{"thread":{"id":"11768","subject":"How to split a patch","startedAt":"2008-01-28T09:05:31Z","lastAt":"2008-01-28T12:47:32Z","messageCount":11,"participants":["Paolo Ciarrocchi","Junio C Hamano","Matthieu Moy","Wincent Colaiuta","Boaz Harrosh","Mike Hommey","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66723","messageId":"4d8e3fd30801280105g2876cedfjbe1ba323ede57e0a@mail.gmail.com","threadId":"11768","inReplyTo":null,"subject":"How to split a patch","fromName":"Paolo Ciarrocchi","fromEmail":"paolo.ciarrocchi@gmail.com","sentAt":"2008-01-28T09:05:31Z","receivedAt":"2008-01-28T09:05:31Z","isPatch":false,"sender":{"key":"paolo.ciarrocchi@gmail.com","avatar":null},"body":"Hi all,\nI have a big patch that affects a single file that needs to be split in\na few logical patches.\n\nI know ho to do the opposite process, rebase -i and squash is something\nI'm really used to do but this time that trick is not going to help me.\n\nWhat is the preferred way to split a big patch in a series of smaller patches?\n\nThanks.\n\nCiao,\n-- \nPaolo\nhttp://paolo.ciarrocchi.googlepages.com/\n"},{"id":"66726","messageId":"7vhcgyuwsx.fsf@gitster.siamese.dyndns.org","threadId":"11768","inReplyTo":"4d8e3fd30801280105g2876cedfjbe1ba323ede57e0a@mail.gmail.com","subject":"Re: How to split a patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-28T09:25:02Z","receivedAt":"2008-01-28T09:25:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n\n> I know ho to do the opposite process, rebase -i and squash is something\n> I'm really used to do but this time that trick is not going to help me.\n>\n> What is the preferred way to split a big patch in a series of\n> smaller patches?\n\n\nI personally found the procedure described there a bit on the\nsketchy side, but does \"SPLITTING COMMITS\" section of git-rebase\nmanual help?\n"},{"id":"66727","messageId":"4d8e3fd30801280132k59676921h272addab6cac6899@mail.gmail.com","threadId":"11768","inReplyTo":"7vhcgyuwsx.fsf@gitster.siamese.dyndns.org","subject":"Re: How to split a patch","fromName":"Paolo Ciarrocchi","fromEmail":"paolo.ciarrocchi@gmail.com","sentAt":"2008-01-28T09:32:54Z","receivedAt":"2008-01-28T09:32:54Z","isPatch":false,"sender":{"key":"paolo.ciarrocchi@gmail.com","avatar":null},"body":"On Jan 28, 2008 10:25 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n>\n> > I know ho to do the opposite process, rebase -i and squash is something\n> > I'm really used to do but this time that trick is not going to help me.\n> >\n> > What is the preferred way to split a big patch in a series of\n> > smaller patches?\n>\n>\n> I personally found the procedure described there a bit on the\n> sketchy side, but does \"SPLITTING COMMITS\" section of git-rebase\n> manual help?\n\nYes it helps but I still wonder whether thereis a \"simpler\" way to achive that.\nIs it possible to split a patch selecting the hunk in git gui or any\nother graphical\ntool?\n\nThat would be a good starting point for a newbie (like me).\n\nThanks!\n\nCiao,\n-- \nPaolo\nhttp://paolo.ciarrocchi.googlepages.com/\n"},{"id":"66728","messageId":"vpqfxwi5ljf.fsf@bauges.imag.fr","threadId":"11768","inReplyTo":"4d8e3fd30801280132k59676921h272addab6cac6899@mail.gmail.com","subject":"Re: How to split a patch","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-01-28T09:47:32Z","receivedAt":"2008-01-28T09:47:32Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n\n> Yes it helps but I still wonder whether thereis a \"simpler\" way to achive that.\n> Is it possible to split a patch selecting the hunk in git gui or any\n> other graphical\n> tool?\n\nYou can apply the patch without commiting it, and them make several\npartial commits, by right-click \"stage hunk for commit\" in git-gui.\n\n-- \nMatthieu\n"},{"id":"66730","messageId":"7vy7aatfck.fsf@gitster.siamese.dyndns.org","threadId":"11768","inReplyTo":"vpqfxwi5ljf.fsf@bauges.imag.fr","subject":"Re: How to split a patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-28T10:27:23Z","receivedAt":"2008-01-28T10:27:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n>\n>> Yes it helps but I still wonder whether thereis a \"simpler\" way to achive that.\n>> Is it possible to split a patch selecting the hunk in git gui or any\n>> other graphical\n>> tool?\n>\n> You can apply the patch without commiting it, and them make several\n> partial commits, by right-click \"stage hunk for commit\" in git-gui.\n\nYes, and you can do the same with \"git add -i\".  These tools are\nnot quite nice, as they encourage a wrong workflow of committing\nwhat you haven't had as a whole in the work tree.  By\ndefinition, you are making untested commits between your base\ncommit (that presumably was tested well) and your final commit\n(that would also be tested well).\n\nIdeally, once you have a perfect state (i.e. the shape of the\ntree recorded by the last commit in your \"split\" series), you\nshould be able to make a commit, and walk backwards, removing\nthe fanciest \"finishing touches\" changes from the work tree\nfiles, test it, and record it as a new commit between where you\nare and one commit before it.  A possible workflow could be:\n\n\t$ work work work, now it is perfect.\n\t$ git commit -a -m 'Now it is perfect'\n        $ edit away the fanciest bits\n        $ test test, the basics still work.\n        $ git commit --splice -a -m 'Almost there'\n\nAnd the last \"git commit --splice\" would record the tree object\nas a commit, whose parent is the parent of the current HEAD, and\nrecord the tree of the current HEAD as a (rewritten) commit that\nis a child of that commit.\n\nGraphically, you would start from (X is \"the perfect commit\"):\n\n\t---o-------X\n\nthen \"--splice\" would create a new commit \"W\" and record the\nsame tree as X as a new commit X' that is a child of W:\n\n             .--W---X'\n            /\n\t---o-------X\n\nThere is no such tool yet, though.\n\nThe splitting you can do with \"rebase -i\" instead walks\nforwards.  That also lets you test before you make commits in\neach step.\n"},{"id":"66731","messageId":"5382B5D2-35B5-4FCA-BA7B-95B4CC1A099B@wincent.com","threadId":"11768","inReplyTo":"vpqfxwi5ljf.fsf@bauges.imag.fr","subject":"Re: How to split a patch","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2008-01-28T10:27:28Z","receivedAt":"2008-01-28T10:27:28Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 28/1/2008, a las 10:47, Matthieu Moy escribió:\n\n> \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n>\n>> Yes it helps but I still wonder whether thereis a \"simpler\" way to  \n>> achive that.\n>> Is it possible to split a patch selecting the hunk in git gui or any\n>> other graphical\n>> tool?\n>\n> You can apply the patch without commiting it, and them make several\n> partial commits, by right-click \"stage hunk for commit\" in git-gui.\n\nOr \"git add --interactive\", which isn't GUI but is a similar idea in  \ncommand line form.\n\nAnd in case you've already applied the patch you can do a \"git reset  \nHEAD^\"; this moves your HEAD back by one commit, puts the index back  \nthe way it was, but leaves the changes in your working tree. Then you  \nstage your hunks and commit them like Matthieu says.\n\nCheers,\nWincent\n"},{"id":"66732","messageId":"479DB087.30405@panasas.com","threadId":"11768","inReplyTo":"4d8e3fd30801280132k59676921h272addab6cac6899@mail.gmail.com","subject":"Re: How to split a patch","fromName":"Boaz Harrosh","fromEmail":"bharrosh@panasas.com","sentAt":"2008-01-28T10:37:59Z","receivedAt":"2008-01-28T10:37:59Z","isPatch":false,"sender":{"key":"bharrosh@panasas.com","avatar":"https://gravatar.com/avatar/347e426f8ca0409f6891ceeefd4c3c2d8769608382323057efeaa362b4c3dbf3?d=mp&s=160"},"body":"On Mon, Jan 28 2008 at 11:32 +0200, \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> wrote:\n> On Jan 28, 2008 10:25 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n>>\n>>> I know ho to do the opposite process, rebase -i and squash is something\n>>> I'm really used to do but this time that trick is not going to help me.\n>>>\n>>> What is the preferred way to split a big patch in a series of\n>>> smaller patches?\n>>\n>> I personally found the procedure described there a bit on the\n>> sketchy side, but does \"SPLITTING COMMITS\" section of git-rebase\n>> manual help?\n> \n> Yes it helps but I still wonder whether thereis a \"simpler\" way to achive that.\n> Is it possible to split a patch selecting the hunk in git gui or any\n> other graphical\n> tool?\n> \n> That would be a good starting point for a newbie (like me).\n> \n> Thanks!\n> \n> Ciao,\nWhat I do is edit the patch, let me explain.\n- I create a new branch based at the base of the big patch. Now\n  I have the original branch for reference. Lets say the original\n  branch is called ALL, and this new branch SPLIT. and BASE is the base.\n- # git-checkout -b SPLIT BASE\n- # git-diff -R ALL >edit-the-patch-001.patch\n- now I open the patch file with an editor. I use kwrite because of\n  the good color highlighting.\n- I remove all the hunks that I don't need, and am left with only the\n  parts that I want to be in the first patch.\n- I save the patch.\n- If at the edit stage I have changed a big hunk and only used part\n  of it I need to run fixpatch script attached below. If I only removed\n  complete hunks then I'm good to go.\n- I now use:\n  # patch -p 1 < edit-the-patch-001.patch\n- # git-commit -a\n- and git-commit --amend until the first patch is good\n- now do the \n  # git-diff -R ALL >edit-the-patch-002.patch\n  and so on until there is nothing left. It is nice how\n  every time it gets smaller and smaller.\n\n[fixpatch command line]\nusage: fixpatch inputfile outputfile\nwhat I do is just\n# fixpatch edit-the-patch-001.patch{,}\n\nBoaz\n\n\n\n#!/bin/sh\n\nsrc=\"$1\"\ndest=\"$2\"\ntmp=/tmp/`basename $0`.tmp.$$\n\nif [ -z \"$dest\" ]; then\n\tdest=\"/dev/fd/1\"\nelif [ \"$src\" == \"$dest\" ]; then\n\tcp \"$src\" \"$src.orig\" || exit 1\nfi\n\nawk '\nfunction dump_hunk()\n{\n\tif (!hunk) {\n\t\treturn;\n\t}\n\n\tif (!hsrc_line)\n\t\tfoffset = 1;\n\n#\tif (hsuffix !~ /\\n$/) {\n#\t\thsuffix = hsuffix \"\\n\";\n#\t}\n\tprintf(\"@@ -%d,%d +%d,%d %s\\n\", -hsrc_line, hsrc_count,\n\t\t-hsrc_line + foffset, hdest_count, hsuffix);\n\n\tif (hunchanged + hdel + hadd != hlines) {\n\t\tfflush();\n\t\tprintf(\"%s %d: Warning: Unchanged %d deleted %d added %d != lines %d\\n\",\n\t\t\tFILENAME, FNR, hunchanged, hdel, hadd, hlines) > \"/dev/stderr\";\n\t}\n\n\tif (hunchanged + hdel != hsrc_count) {\n\t\tfflush();\n\t\tprintf(\"%s %d: Warning: Unchanged %d deleted %d != hsrc_count %d\\n\",\n\t\t\tFILENAME, FNR, hunchanged, hdel, hsrc_count) > \"/dev/stderr\";\n\t}\n\n\tif (hunchanged + hadd != hdest_count) {\n\t\tfflush();\n\t\tprintf(\"%s %d: Warning: Unchanged %d added %d != hdest_count %d\\n\",\n\t\t\tFILENAME, FNR, hunchanged, hadd, hdest_count) > \"/dev/stderr\";\n\t}\n\n\tfor (i = 0; i < hlines; i++) {\n\t\tprint hline[i];\n\t\tdelete hline[i];\n\t}\n\n\tfoffset += hdest_count - hsrc_count;\n\thsrc_line = 0;\n\thsrc_count = 0;\n\thdest_line = 0;\n\thdest_count = 0;\n\thsuffix = \"\";\n\n\thunchanged = hadd = hdel = 0;\n\thlines = 0;\n\thunk = 0;\n}\n\n/^(diff|====)/ {\n\tdump_hunk();\n\tprint;\n\tfoffset = 0;\n\tnext;\n}\n\n/^@@/ {\n\tdump_hunk();\n\tn = split($2, a, /,/);\n\thsrc_line = a[1]+0;\n\thsrc_oldcount = a[2]+0;\n\thsrc_count = 0;\n\tif (n != 2 || hsrc_line > 0 || hsrc_oldcount < 0) {\n\t\tfflush();\n\t\tprintf(\"%s %d: Error: Corrupt hunk header (n %d hsrc_line %d hsrc_oldcount %d)\\n\",\n\t\t\tFILENAME, FNR, n, hsrc_line, hsrc_count) > \"/dev/stderr\";\n\t}\n\n\tn = split($3, a, /,/);\n\thdest_line = a[1]+0;\n\thdest_oldcount = a[2]+0;\n\thdest_count = 0;\n\tif (n != 2 || hdest_line < 0 || hdest_oldcount < 0) {\n\t\tfflush();\n\t\tprintf(\"%s %d: Error: Corrupt hunk header (hdest_line %d hdest_oldcount %d)\\n\",\n\t\t\tFILENAME, FNR, hdest_line, hdest_oldcount) > \"/dev/stderr\";\n\t}\n\n\thsuffix = $0;\n\tsub(/^@@.*@@/, \"@@\", hsuffix);\n\n\thlines = 0;\n\thunk = 1;\n\tnext;\n}\n\n(!hunk) || /^#/ {\n\tprint;\n\tnext;\n}\n\n/^-/ {\n\thdel++;\n\thsrc_count++;\n}\n\n/^+/ {\n\thadd++;\n\thdest_count++;\n}\n\n/^ / {\n\thunchanged++;\n\thsrc_count++;\n\thdest_count++;\n}\n\n/^$/ || /^[^-+ ]/ {\n\tfflush();\n\tprintf(\"%s %d: Warning: badly formatted line\\n\",\n\t\tFILENAME, FNR) > \"/dev/stderr\";\n\texit(255);\n##\thadd++;\n##\thdest_count++;\n#\tnext;\n}\n\n{\n\thline[hlines++] = $0;\n}\n\nEND {\n\tdump_hunk()\n}\n' \"$src\" > \"$tmp\" && mv \"$tmp\" \"$dest\"\n"},{"id":"66733","messageId":"7vr6g2teqh.fsf@gitster.siamese.dyndns.org","threadId":"11768","inReplyTo":"7vy7aatfck.fsf@gitster.siamese.dyndns.org","subject":"Re: How to split a patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-28T10:40:38Z","receivedAt":"2008-01-28T10:40:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Yes, and you can do the same with \"git add -i\".  These tools are\n> not quite nice, as they encourage a wrong workflow of committing\n> what you haven't had as a whole in the work tree.  By\n> definition, you are making untested commits between your base\n> commit (that presumably was tested well) and your final commit\n> (that would also be tested well).\n> ...\n> There is no such tool yet, though.\n> \n> The splitting you can do with \"rebase -i\" instead walks\n> forwards.  That also lets you test before you make commits in\n> each step.\n\nHaving said all that, what I tend to do in practice is something\nlike this:\n\n (1) Prepare a perfect state (i.e. what to become the final\n     commit in the series) in work tree.  Make a commit.  Let's\n     say I was working on 'master' branch.\n\n (2) Checkout the state before the series.  If I currently have\n     a three commit series that I want to split further, that\n     would be HEAD~3.  If I just made a huge change without\n     making intermediate commits, that would be HEAD~1:\n\n     $ git checkout HEAD~3\n\n (3) Get the final state in the work tree, to decide what to put\n     in and what to omit from the first in the series:\n\n     $ git diff -R master | git apply --index\n\n (4) Use \"git-add -i\" to prepare what I want in the first\n     commit.\n\n     $ git add -i\n\n (5) When the index is in a good shape, drop all other changes\n     from the work tree.  This is what I thought would be a good\n     first commit:\n\n     $ git diff -R | git apply\n\n (6) Test it.  Make corrections.  Perfect it.  Then commit.\n\n     $ git commit\n\n (7) Go back to step (3), until the commit that I make in step\n     (6) matches 'master'.\n\n (8) Reset 'master' with HEAD:\n\n    $ git branch -f master HEAD\n    $ git checkout master\n"},{"id":"66734","messageId":"E8308544-2613-463D-8277-5C1B40709A7B@wincent.com","threadId":"11768","inReplyTo":"7vy7aatfck.fsf@gitster.siamese.dyndns.org","subject":"Re: How to split a patch","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2008-01-28T10:44:28Z","receivedAt":"2008-01-28T10:44:28Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 28/1/2008, a las 11:27, Junio C Hamano escribió:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n>>\n>>> Yes it helps but I still wonder whether thereis a \"simpler\" way to  \n>>> achive that.\n>>> Is it possible to split a patch selecting the hunk in git gui or any\n>>> other graphical\n>>> tool?\n>>\n>> You can apply the patch without commiting it, and them make several\n>> partial commits, by right-click \"stage hunk for commit\" in git-gui.\n>\n> Yes, and you can do the same with \"git add -i\".  These tools are\n> not quite nice, as they encourage a wrong workflow of committing\n> what you haven't had as a whole in the work tree.  By\n> definition, you are making untested commits between your base\n> commit (that presumably was tested well) and your final commit\n> (that would also be tested well).\n\nAnd as another alternative, seeing as Git is so easy to script, it is  \ntrivial to make a script that checks out all the commits in a series  \nand runs the test suite against them. This of course assumes that you  \nhave a test suite!\n\nFor example, this is the script that I use on a topic branch before  \nsubmitting the corresponding patch series. It's one of the first  \nscripts for Git that I wrote, so it is probably a bit naïve, but it  \nworks in the basic case. Basically bails if \"make clean && make test\"  \ndoesn't work for any commit in the series.\n\nI've used this on the series that I've sent to the Git mailing list,  \nbut you can use it internally on your local projects too before  \nmerging topic branches.\n\nCheers,\nWincent\n\n#!/bin/sh -e\n#\n# check-series.sh\n# Check all commits in a topic branch before submission\n#\n# Created by Wincent Colaiuta on 23 November 2007.\n# Copyright 2007 Wincent Colaiuta.\n\n#\n# Functions\n#\n\ndie () {\n   echo \"$1\"\n   exit 1\n}\n\n#\n# Main\n#\n\ngit diff --quiet || die \"Unstaged changes; won't start\"\ngit diff --cached --quiet || die \"Staged changes; won't start\"\n\n# parse HEAD (something like \"ref: refs/heads/my_local_branch\") to get  \nremote and merge\nGIT_DIR=$(git rev-parse --git-dir)\nTOPIC=\"$GIT_DIR/HEAD\"\ntest -f \"$TOPIC\" || die \"No HEAD found at '$TOPIC'\"\nBRANCH_REF=$(< \"$TOPIC\")\nif [ \"${BRANCH_REF%%: */*}\" != \"ref\" ]; then\n   die \"expected HEAD '$BRANCH_REF' to be of the form 'ref: .../...'\"\nfi\nBRANCH=${BRANCH_REF##*/}\nREMOTE=$(git config branch.$BRANCH.remote) || die \"failed to get  \nbranch.$BRANCH.remote\"\nMERGE=$(git config branch.$BRANCH.merge) || die \"failed to get branch. \n$BRANCH.merge\"\nMERGE=${MERGE##*/}\n\n# remember which branch we were on prior to starting\ntrap 'git checkout $BRANCH' exit\n\n# will check all commits in topic branch not present in origin\necho \"On branch $BRANCH\"\necho \"Commits to be checked:\"\ngit rev-list --pretty=oneline HEAD ^$REMOTE/$MERGE\nfor COMMIT in $(git rev-list HEAD ^$REMOTE/$MERGE); do\n   echo \"Checking $COMMIT\"\n   git checkout $COMMIT\n   make clean\n   make test || die \"Commit $COMMIT is bad\"\ndone\n\necho \"All revisions passed!\"\n"},{"id":"66736","messageId":"20080128104932.GA20586@glandium.org","threadId":"11768","inReplyTo":"7vr6g2teqh.fsf@gitster.siamese.dyndns.org","subject":"Re: How to split a patch","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-01-28T10:49:33Z","receivedAt":"2008-01-28T10:49:33Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Mon, Jan 28, 2008 at 02:40:38AM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Yes, and you can do the same with \"git add -i\".  These tools are\n> > not quite nice, as they encourage a wrong workflow of committing\n> > what you haven't had as a whole in the work tree.  By\n> > definition, you are making untested commits between your base\n> > commit (that presumably was tested well) and your final commit\n> > (that would also be tested well).\n> > ...\n> > There is no such tool yet, though.\n> > \n> > The splitting you can do with \"rebase -i\" instead walks\n> > forwards.  That also lets you test before you make commits in\n> > each step.\n> \n> Having said all that, what I tend to do in practice is something\n> like this:\n(...)\n\nI just git commit the hunks, then git stash the rest of the changes, and\nif I need some more changes to make the hunks only work, I commit --amend.\n\nOnce the commit is stable, I stash apply, resolving conflicts if any arose.\n\nMike\n"},{"id":"66743","messageId":"alpine.LSU.1.00.0801281246180.23907@racer.site","threadId":"11768","inReplyTo":"7vy7aatfck.fsf@gitster.siamese.dyndns.org","subject":"Re: How to split a patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-28T12:47:32Z","receivedAt":"2008-01-28T12:47:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 28 Jan 2008, Junio C Hamano wrote:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n> \n> > \"Paolo Ciarrocchi\" <paolo.ciarrocchi@gmail.com> writes:\n> >\n> >> Yes it helps but I still wonder whether thereis a \"simpler\" way to \n> >> achive that. Is it possible to split a patch selecting the hunk in \n> >> git gui or any other graphical tool?\n> >\n> > You can apply the patch without commiting it, and them make several \n> > partial commits, by right-click \"stage hunk for commit\" in git-gui.\n> \n> Yes, and you can do the same with \"git add -i\".  These tools are\n> not quite nice, as they encourage a wrong workflow of committing\n> what you haven't had as a whole in the work tree.\n\nFWIW I have a preliminary patch for \"git stash apply -i\" in my personal \nnext branch.  It does not quite work yet, and it is stalled, of course, \nsince I am working on master until 1.5.4 is released.\n\nCiao,\nDscho\n"}]}