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,
|
1.1
| \
| `A---B-- 1.1-patched
| \ |
| \ |
| `C-- 1.1-revised
| |
2.0 |
| \ |
| `-C--D-- 2.0-patched
| |
3.1 |
| \ |
| `-C--E-- 3.1-patched
| |
upstream |
deployment
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...
did it work?
Date: 2015-02-07 19:58 (UTC)thanks for the writeup! how did it work out?
Re: did it work?
Date: 2015-02-08 22:34 (UTC)It isn't really simple or robust enough for general use yet.
Social pictures
Date: 2016-08-20 15:39 (UTC)http://gayfiles.xblog.in/?page-dion
gay millionaires gay love story is rihanna gay gay hook ups gay pride clothing
Delivered grown-up galleries
Date: 2016-08-26 18:21 (UTC)erotic night free erotic wallpaper sex movies erotic trailers erotic penpal
http://shemale.erolove.in/?phoebe
erotic adventures online erotic literature hollywood erotic erotic ghost stories erotic readings
Grown up galleries
Date: 2016-08-31 04:21 (UTC)http://amateur.selfies.purplesphere.in/?page.theresa
sextoys erotic sims erotic art erotic resorts erotically
Social pictures
Date: 2016-09-12 23:34 (UTC)http://futanari.porndairy.in/?katharine
erotic dating services erotic underwear erotic texts erotic lounge the erotic traveller
Grown up purlieus
Date: 2016-09-14 08:54 (UTC)http://prostitute.porn.porndairy.in/?post-karley
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 (UTC)http://amateur.selfies.purplesphere.in/?diagram.dana
adult erotic fiction xxx.prono.com erotic events erotic womens erotic modelling
Renewed site
Date: 2016-09-15 18:02 (UTC)http://arab.porn.pornpost.in/?entry.antonia
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 (UTC)history of feminism book talent management agency meet a mistress
http://sissies.purplesphere.in/?page.melody
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 19:31 (UTC)http://arab.aunties.porndairy.in/?post.tiffany
ng conduct kasim themes christmas
Callow Job
Date: 2016-09-21 08:50 (UTC)http://jessica.casual.blogporn.in/?page.alanis
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 (UTC)http://asses.sexblog.pw/?phoebe
erotic literature online download erotic games erotic tv shows pinoy erotic movies most erotic film
Loose galleries
Date: 2016-09-24 07:10 (UTC)http://yaoi.erolove.in/?page.greyson
bottom gay tom selleck gay for gay marriage gay sax aiden grimshaw gay
Mature galleries
Date: 2016-09-25 18:44 (UTC)ios camera android download shazam android channels apps free apps for android mobiles download hey sexy lady
http://sexgames.android.tobuy.in/?profile.emilia
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 17:53 (UTC)http://muslim.clit.pornpost.in/?entry-kayleigh
rorno stripping plus heroes trendy
Grown up purlieus
Date: 2016-10-04 20:01 (UTC)http://latex.xblog.in/?page.deja
erotic fitness erotics erotic hypnosis free erotic baby free video pornography
Latest site
Date: 2016-10-06 19:46 (UTC)http://whipme.yopoint.in/?epoch.deasia
erotic tarot erotic email free adult films erotic photography blog free adult videos
Pictures from collective networks
Date: 2016-10-07 01:59 (UTC)erotic mask sex dolls erotic texts erotic pregnancy erotic entertainment
http://latin.erolove.in/?annabelle
the erotic adultvideo craiglist erotic erotic photographic art erotic desktop wallpaper
Loose galleries
Date: 2016-10-07 12:00 (UTC)http://shemales.blogporn.in/?post-monique
sex videos shemals shaemle video younger tranys shemel sex movis free shemaile sex
Full-grown galleries
Date: 2016-10-08 02:44 (UTC)http://big.boobies.twiclub.in/?post-regina
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 (UTC)http://europe.meet.erolove.top/?profile.jenifer
plus size females no signup dating site jehovah witness nz pictures of herpes virus free muslim
Unshackle galleries
Date: 2016-10-11 02:31 (UTC)http://arab.aunties.porndairy.in/?entry.kelly
towards baltic xxxxx lisa stanford
Pictures from collective networks
Date: 2016-10-11 14:42 (UTC)victorian erotic books erotic drama movies erotic parties erotic horror movie erotic paranormal romance
http://animeshemale.net.erolove.in/?riya
erotic thai massage the erotic networks victorian erotic novels erotic mobile erotic digital art
Mature site
Date: 2016-10-12 21:47 (UTC)http://hotties.pictures.erolove.in/?post-tina
tsunamis in japan emo girl footjob indian springs staet park powderpuff girls names girl sexy flv
My supplementary website
Date: 2016-10-15 18:51 (UTC)http://cat.photos.replyme.pw/?entry.estefani
free teen esbian porn archive most girls porn sveta porn porn download forum top floor porn