Suvayu Ali writes: > On Mon, May 12, 2014 at 10:33:48AM +0200, Rainer M Krug wrote: >> Eric Schulte writes: >> >> > Rainer M Krug writes: >> > >> >> Bastien writes: >> >> >> >>> Hi Rainer, >> >>> >> >>> Rainer M Krug writes: >> >>> >> >>>> I'll look at it again tomorrow and let you know as I made some changes >> >>>> since then. Do you prefer one patch to several? >> >>> >> >>> Up to Eric's taste -- but in general I think a series of patches >> >>> is better, it allows you to isolate and fix conflicts more easily. >> >> >> > >> > I agree, multiple patches make future maintenance easier. >> > >> >> OK - I'll do so. >> >> A little bit off-topic, is there a "git way" of splitting one patch into >> several patches, if it was a single commit? > > Do an interactive rebase, and amend. > > Say this is the commit graph: > > A---B---C---D > > You want to split B. Then you do: > > $ git rebase -i B~ > > In the editor that pops out, you choose `edit' for B, leave the others > unchanged. Then git will checkout A for you, and wait for you to edit. > Now you can apply patch B in parts (by hand). > > $ git show B > patch > $ # apply part1 of patch (assuming you are breaking it into 2 parts) > $ git commit -a -m "Message for part1" # lets say this is B1 > $ # apply rest of the patch > $ git commit -a -m "Message for the rest" # and this is B2 > $ git rebase --continue > > Now your commit graph should be like this: > > A---B1---B2---C---D > > Hope this helps, Definitely. Sounds perfect. I will look at it a little bit later and come back if I have any problems. Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982