On Mon, Jan 28 2008 at 11:32 +0200, "Paolo Ciarrocchi" wrote: > On Jan 28, 2008 10:25 AM, Junio C Hamano wrote: >> "Paolo Ciarrocchi" writes: >> >>> I know ho to do the opposite process, rebase -i and squash is something >>> I'm really used to do but this time that trick is not going to help me. >>> >>> What is the preferred way to split a big patch in a series of >>> smaller patches? >> >> I personally found the procedure described there a bit on the >> sketchy side, but does "SPLITTING COMMITS" section of git-rebase >> manual help? > > Yes it helps but I still wonder whether thereis a "simpler" way to achive that. > Is it possible to split a patch selecting the hunk in git gui or any > other graphical > tool? > > That would be a good starting point for a newbie (like me). > > Thanks! > > Ciao, What I do is edit the patch, let me explain. - I create a new branch based at the base of the big patch. Now I have the original branch for reference. Lets say the original branch is called ALL, and this new branch SPLIT. and BASE is the base. - # git-checkout -b SPLIT BASE - # git-diff -R ALL >edit-the-patch-001.patch - now I open the patch file with an editor. I use kwrite because of the good color highlighting. - I remove all the hunks that I don't need, and am left with only the parts that I want to be in the first patch. - I save the patch. - If at the edit stage I have changed a big hunk and only used part of it I need to run fixpatch script attached below. If I only removed complete hunks then I'm good to go. - I now use: # patch -p 1 < edit-the-patch-001.patch - # git-commit -a - and git-commit --amend until the first patch is good - now do the # git-diff -R ALL >edit-the-patch-002.patch and so on until there is nothing left. It is nice how every time it gets smaller and smaller. [fixpatch command line] usage: fixpatch inputfile outputfile what I do is just # fixpatch edit-the-patch-001.patch{,} Boaz