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

Re: Request: git add --interactive: split hunk: When can't split further, split on empty lines

From
Philip Oakley <philipoakley@iee.org>
Date
May 30, 2019, 20:30 UTC
Message-ID
<fb5fd48d-c5fe-57dc-c307-c959ad132da6@iee.org>
In-Reply-To
<nycvar.QRO.7.76.6.1905302136400.44@tvgsbejvaqbjf.bet>

Thanks for the clarification. Funny that we are "staging" the patch preparation to avoid real staging;-)

On 30/05/2019 20:43, Johannes Schindelin wrote:
Show 38 quoted lines
> Hi Philip,
>
> On Thu, 30 May 2019, Philip Oakley wrote:
>
>> On 30/05/2019 15:53, Johannes Schindelin wrote:
>>> Having said that, there was a patch series recently to add the ability to
>>> stage individual lines,
>> I believe that the git-gui (in tk/tcl, but using git commands) was
>> already able to stage individual/selected lines, so there may be some
>> ideas from there.
> Sadly, no.
>
> There is one very big difference between Git GUI and `git add -p`: when
> you stage a line in Git GUI, it is staged *immediately*.
>
> When you stage a single line in the Git GUI, the diff you see in the
> window is reloaded. That is quite slow in the long run, and no fun.
>
> In contrast, `git add -p` does not stage *anything* until you're done
> selecting what you want to stage.
>
> Therefore, `git add -p` does have to do things quite a bit differently, as
> it will have to eventually build a single diff that is applied in one fell
> swoop, no matter how many lines you select individually.
>
> And naturally, there is also the difference between the user interfaces:
> while you can ask the user to select (part of) the line to stage in Git
> GUI via the mouse, that is not at all an option in `git add -p`.
>
> Likewise, the very convenient option to navigate via regular expressions
> in `git add -p` is not available in Git GUI at all.
>
> In short: I think that it makes more sense to come up with a design
> specific to `git add -p` and not get distracted by Tcl code that works
> quite differently.
>
> Ciao,
> Dscho
Previous: Johannes Schindelin
Message 5 of 5 in “Request: git add --interactive: split hunk: When can't split further, split on empty lines”
  1. James HarveyMay 30, 2019
  2. Johannes SchindelinMay 30, 2019
  3. Philip OakleyMay 30, 2019
  4. Johannes SchindelinMay 30, 2019
  5. Philip OakleyMay 30, 2019

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.