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

Re: [PATCH] Teach git-gui to split hunks

From
David Kastrup <dak@gnu.org>
Date
Jul 26, 2007, 05:48 UTC
Message-ID
<85ir8790lj.fsf@lola.goethe.zz>
In-Reply-To
<Pine.LNX.4.64.0707260630570.14781@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 6 quoted lines
> When you select the context menu item "Split Hunk" in the diff area,
> git-gui will now split the current hunk so that a new hunk starts at
> the current position.
>
> For this to work, apply has to be called with --unidiff-zero, since
> the new hunks can start or stop with a "-" or "+" line.

Unless one splits right at the beginning or end of an existing hunk, wouldn't there be context which one could use? Or does it confuse patch when adjacent hunks have overlapping contexts? At least if the first hunk patches what is to be used as context in the second hunk, I could imagine this. And there is really no danger of losing synch in this situation, anyhow. So it would be more of a convenience thing than anything else to be able to omit --unidiff-zero.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Johannes SchindelinNext: Shawn O. Pearce
Message 2 of 6 in “Teach git-gui to split hunks”
  1. Teach git-gui to split hunksJohannes Schindelin, Jul 26, 2007
  2. David KastrupJul 26, 2007
  3. Shawn O. PearceJul 26, 2007
  4. Johannes SchindelinJul 26, 2007
  5. Johannes SixtJul 26, 2007
  6. Johannes SchindelinJul 26, 2007

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.