git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to split a patch

From
Wincent Colaiuta <win@wincent.com>
Date
Jan 28, 2008, 10:27 UTC
Message-ID
<5382B5D2-35B5-4FCA-BA7B-95B4CC1A099B@wincent.com>
In-Reply-To
<vpqfxwi5ljf.fsf@bauges.imag.fr>
El 28/1/2008, a las 10:47, Matthieu Moy escribió:
Show 10 quoted lines
> "Paolo Ciarrocchi" <paolo.ciarrocchi@gmail.com> writes:
>
>> 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?
>
> You can apply the patch without commiting it, and them make several
> partial commits, by right-click "stage hunk for commit" in git-gui.

Or "git add --interactive", which isn't GUI but is a similar idea in command line form.

And in case you've already applied the patch you can do a "git reset HEAD^"; this moves your HEAD back by one commit, puts the index back the way it was, but leaves the changes in your working tree. Then you stage your hunks and commit them like Matthieu says.

Cheers, Wincent

Previous: Johannes SchindelinNext: Boaz Harrosh
Message 10 of 11 in “How to split a patch”
  1. Paolo CiarrocchiJan 28, 2008
  2. Junio C HamanoJan 28, 2008
  3. Paolo CiarrocchiJan 28, 2008
  4. Matthieu MoyJan 28, 2008
  5. Junio C HamanoJan 28, 2008
  6. Junio C HamanoJan 28, 2008
  7. Mike HommeyJan 28, 2008
  8. Wincent ColaiutaJan 28, 2008
  9. Johannes SchindelinJan 28, 2008
  10. Wincent ColaiutaJan 28, 2008
  11. Boaz HarroshJan 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.