Maintaining patch series with Stacked GIT: a walk-through
Fetching the Drupal repository from a CVS mirror
$ stg clone git://git.drupalfr.org/git/core/main.git drupal-devThis actually fetches the whole Drupal history, including all branches and tags, not only a copy of HEAD. So you can disconnect, and do all your work offline.
Creating a patch
You are now ready to manage your patch series. By convention, use this naming pattern: [nid]-[brief-description].
The generic procedure is:
// Tell Stacked Git you want to create a new patch.
$ stg new <your patch name>
// Make your modifications in the tree. `stg show` will show your diff
// ...
// Tell Stacked Git to refresh the patch (ie. to commit the modifications you made in the patch).
$ stg refreshManaging patch series
stg seriesShow the full patch series.
stg push [<patch name>]Apply one patch from your series in your working copy.
stg pop [<patch name>]Unapply one patch from your working copy.
stg sink [<patch name>]Sink a patch (move it down in the series).
stg float [<patch name>]Float a patch (move it up in the series).
Updating your patches from upstream
stg pullWill update your repository and all the patches in your series. Some modifications may conflict, and you will have to resolve those yourself (stacked git is great, but can't read your mind).
Exporting patches for Drupal
stg export -p -O --no-prefixWill create a patches-<branch name> directory with all your patches, and a nice series file.
