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

Re: Re: Extended splitting for "git add --interactive"

From
Johan Herland <johan@herland.net>
Date
Nov 27, 2014, 10:14 UTC
Message-ID
<CALKQrgcHvjuynbmRZWAKWu-Ld1-h7eqEZEBqorPTHW9m8onDGg@mail.gmail.com>
In-Reply-To
<5476F4FA020000A100018078@gwsmtp1.uni-regensburg.de>

On Thu, Nov 27, 2014 at 9:55 AM, Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> wrote:

Show 8 quoted lines
> I probably forgot to mention the obvious: My enhancement request was
> for cases where git would reject so split a hunk. I don't want to
> change the default split (if it finds a point to split).
> So maybe call it a "2nd-level-split". Only if split refuses to split,
> you could avoid using "edit" to manually split.
> I know that in general such things can't be right, but you can
> either reject the new hunks or use "edit". I just guessed the feature
> could save some time on the average.

FWIW, I would very much like a "2nd-level split" where it simply splits into individual lines. I think it's not worth trying to be extra clever about it. For your example, I'd simply want the following behavior:

  -AAA
  -BBB
  +CCC
  +DDD
  Stage this hunk? SPLIT
  -AAA
  Stage this hunk? YES
  -BBB
  Stage this hunk? NO
  +CCC
  Stage this hunk? YES
  +DDD
  Stage this hunk? NO
This would allow me to stage the following:
  -AAA
  +CCC
and leave the following unstaged:
  -BBB
  +DDD
but would also allow any other combination.
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Ulrich WindlNext: Brandon McCaig
Message 5 of 6 in “Extended splitting for "git add --interactive"”
  1. Ulrich WindlNov 26, 2014
  2. Junio C HamanoNov 26, 2014
  3. Junio C HamanoNov 26, 2014
  4. Antw: Re: Extended splitting for "git add --interactive"Ulrich Windl, Nov 27, 2014
  5. Johan HerlandNov 27, 2014
  6. Brandon McCaigNov 27, 2014

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.