fanf: (dotat)
[personal profile] fanf

We often need to patch the software that we run in order to fix bugs quickly rather than wait for an official release, or to add functionality that we need. In many cases we have to maintain a locally-developed patch for a significant length of time, across multiple upstream releases, either because it is not yet ready for incorporation into a stable upstream version, or because it is too specific to our setup so will not be suitable for passing upstream without significant extra work.

I have been experimenting with a git workflow in which I have a feature branch per patch. (Usually there is only one patch for each change we make.) To move them on to a new feature release, I tag the feature branch heads (to preserve history), rebase them onto the new release version, and octopus merge them to create a new deployment version. This is rather unsatisfactory, because there is a lot of tedious per-branch work, and I would prefer to have branches recording the development of our patches rather than a series of tags.

Here is a git workflow suggested by Ian Jackson which I am trying out instead. I don't yet have much experience with it; I am writing it down now as a form of documentation.

There are three branches:

  • upstream, which is where public releases live
  • working, which is where development happens
  • deployment, which is what we run

Which branch corresponds to upstream may change over time, for instance when we move from one stable version to the next one.

The working branch exists on the developer's workstation and is not normally published. There might be multiple working branches for work-in-progress. They get rebased a lot.

Starting from an upstream version, a working branch will have a number of mature patches. The developer works on top of these in commit-early-commit-often mode, without worrying about order of changes or cleanliness. Every so often we use git rebase --interactive to tidy up the patch set. Often we'll use the "squash" command to combine new commits with the mature patches that they amend. Sometimes it will be rebased onto a new upstream version.

When the working branch is ready, we use the commands below to update the deployment branch. The aim is to make it look like updates from the working branch are repeatedly merged into the deployment branch. This is so that we can push updated versions of the patch set to a server without having to use --force, and pulling updates into a checked out version is just a fast-forward. However this isn't a normal merge since the tree at the head of deployment always matches the most recent good version of working. (This is similar to what stg publish does.) Diagramatically,

     | \
     |  `A---B-- 1.1-patched
     |    \       |
     |     \      |
     |      `C-- 1.1-revised
     |            |
    2.0           |
     | \          |
     |  `-C--D-- 2.0-patched
     |            |
    3.1           |
     | \          |
     |  `-C--E-- 3.1-patched
     |            |
  upstream        |

The horizontal-ish lines are different rebased versions of the patch set. Letters represent patches and numbers represent version tags. The tags on the deployment branch are for the install scripts so I probably won't need one on every update.

Ideally we would be able to do this with the following commands:

    $ git checkout deployment
    $ git merge -s theirs working

However there is an "ours" merge strategy but not a "theirs" merge strategy. Johannes Sixt described how to simulate git merge -s theirs in a post to the git mailing list in 2010. So the commands are:

    $ git checkout deployment
    $ git merge --no-commit -s ours working
    $ git read-tree -m -u working
    $ git commit -m "Update to $(git describe working)"

Mark Wooding suggested the following more plumbing-based version, which unlike the above does not involve switching to the deployment branch.

    $ d="$(git rev-parse deployment)"
    $ w="$(git rev-parse working)"
    $ m="Update deployment to $(git describe working)"
    $ c="$(echo "$m" | git commit-tree -p $d -p $w working^{tree})
    $ git update-ref -m "$m" deployment $c $d
    $ unset c d w

Now to go and turn this into a script...

Page 1 of 4 << [1] [2] [3] [4] >>

did it work?

Date: 2015-02-07 07:58 pm (UTC)
From: (Anonymous)
thanks for the writeup! how did it work out?

Social pictures

Date: 2016-08-20 03:39 pm (UTC)
From: (Anonymous)
New gay place
gay millionaires gay love story is rihanna gay gay hook ups gay pride clothing

Delivered grown-up galleries

Date: 2016-08-26 06:21 pm (UTC)
From: (Anonymous)
Lewd pctures
erotic night free erotic wallpaper sex movies erotic trailers erotic penpal
erotic adventures online erotic literature hollywood erotic erotic ghost stories erotic readings

Grown up galleries

Date: 2016-08-31 04:21 am (UTC)
From: (Anonymous)
Chit my recent devise
sextoys erotic sims erotic art erotic resorts erotically

Social pictures

Date: 2016-09-12 11:34 pm (UTC)
From: (Anonymous)
Pron blog site
erotic dating services erotic underwear erotic texts erotic lounge the erotic traveller

Grown up purlieus

Date: 2016-09-14 08:54 am (UTC)
From: (Anonymous)
Hi fashionable project
viper porn videos bart seduces lisa porn ebony porn star xtasy eastern porn free midxdle eastern ass porn

Adult purlieus

Date: 2016-09-14 09:35 am (UTC)
From: (Anonymous)
After my altered engagement
adult erotic fiction erotic events erotic womens erotic modelling

Renewed site

Date: 2016-09-15 06:02 pm (UTC)
From: (Anonymous)
Hi reborn blog
porn star transvestite youngest little teenies porn free violation porn videos free porn korean sluts stacey and vanessa porn pros

Mod Job

Date: 2016-09-16 09:27 am (UTC)
From: (Anonymous)
Blog about sissy life
history of feminism book talent management agency meet a mistress
open front bras sexy mens underwear hair salons in plano fantasy captions big baby diaper cotton long nightgown female gender inequality sissi crete restaurants

Communal pictures

Date: 2016-09-18 07:31 pm (UTC)
From: (Anonymous)
Study my recent contract
ng conduct kasim themes christmas

Callow Job

Date: 2016-09-21 08:50 am (UTC)
From: (Anonymous)
Started unusual cobweb stand out
uk milf date tall dating site single dads uk types of dating violence adult singles dating

Pictures from social networks

Date: 2016-09-22 01:38 am (UTC)
From: (Anonymous)
Recent available porn place
erotic literature online download erotic games erotic tv shows pinoy erotic movies most erotic film

Loose galleries

Date: 2016-09-24 07:10 am (UTC)
From: (Anonymous)
My gay pics
bottom gay tom selleck gay for gay marriage gay sax aiden grimshaw gay

Mature galleries

Date: 2016-09-25 06:44 pm (UTC)
From: (Anonymous)
My new work is top!
ios camera android download shazam android channels apps free apps for android mobiles download hey sexy lady
online download porn download to sexy videos como fazer login no google play store how can i create an app free office apps

Recent spot

Date: 2016-09-28 05:53 pm (UTC)
From: (Anonymous)
After my altered engagement
rorno stripping plus heroes trendy

Grown up purlieus

Date: 2016-10-04 08:01 pm (UTC)
From: (Anonymous)
Chit my recent engagement
erotic fitness erotics erotic hypnosis free erotic baby free video pornography

Latest site

Date: 2016-10-06 07:46 pm (UTC)
From: (Anonymous)
Novel devise
erotic tarot erotic email free adult films erotic photography blog free adult videos

Pictures from collective networks

Date: 2016-10-07 01:59 am (UTC)
From: (Anonymous)
Sexy pctures
erotic mask sex dolls erotic texts erotic pregnancy erotic entertainment
the erotic adultvideo craiglist erotic erotic photographic art erotic desktop wallpaper

Loose galleries

Date: 2016-10-07 12:00 pm (UTC)
From: (Anonymous)
Latin ladyboys
sex videos shemals shaemle video younger tranys shemel sex movis free shemaile sex

Full-grown galleries

Date: 2016-10-08 02:44 am (UTC)
From: (Anonymous)
New project
free wackin porn julia ann porn star gay teen porn ypms hardcore xxx lesbian porn free granny mother dauther porn

Pictures from community networks

Date: 2016-10-09 04:25 am (UTC)
From: (Anonymous)
Hi new website
plus size females no signup dating site jehovah witness nz pictures of herpes virus free muslim

Unshackle galleries

Date: 2016-10-11 02:31 am (UTC)
From: (Anonymous)
My revitalized number
towards baltic xxxxx lisa stanford

Pictures from collective networks

Date: 2016-10-11 02:42 pm (UTC)
From: (Anonymous)
Pron blog locality
victorian erotic books erotic drama movies erotic parties erotic horror movie erotic paranormal romance
erotic thai massage the erotic networks victorian erotic novels erotic mobile erotic digital art

Mature site

Date: 2016-10-12 09:47 pm (UTC)
From: (Anonymous)
Daily porn blog updates
tsunamis in japan emo girl footjob indian springs staet park powderpuff girls names girl sexy flv

My supplementary website

Date: 2016-10-15 06:51 pm (UTC)
From: (Anonymous)
Started up to date cobweb throw
free teen esbian porn archive most girls porn sveta porn porn download forum top floor porn
Page 1 of 4 << [1] [2] [3] [4] >>

April 2017

2345 678

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 18th, 2017 08:02 pm
Powered by Dreamwidth Studios