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

Re: [PATCH 2/2] git-gui: Allow "Stage Line" to stage adjacent changes independently

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jul 16, 2008, 07:15 UTC
Message-ID
<487DA003.3090905@viscovery.net>
In-Reply-To
<7vy742zul7.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 29 quoted lines
> Johannes Sixt <johannes.sixt@telecom.at> writes:
> 
>> Consider this hunk:
>>
>>   @@ -10,4 +10,4 @@
>>    context before
>>   -old 1
>>   -old 2
>>   +new 1
>>   +new 2
>>    context after
>>
>> [Nomenclature: to "stage change 2" means to stage lines "-old 1" and
>> "+new 1", in any order; likewise for "unstage" and "change 2".]
> 
> You lost me.
> 
> Do you mean to say that you always interpret the above hunk as:
> 
>    @@ -10,4 +10,4 @@
>     context before
>    -old 1
>    +new 1
>    -old 2
>    +new 2
>     context after
> 
> and call "replace 'old 1' with 'new 1'" as "change 1", "replace 'old
> 2' with 'new 2'" as "change 2"?

No, it is not that I *always* interpret it this way. There is a problem to fix only if I *want* to interpret it this way. Probably that's what I have to make clear?

Show 14 quoted lines
> If it is what you are doing, it does not make much sense to me.  "new 1"
> may correspond to "old 1" and "old 2" while "new 2" may be an independent
> addition.  E.g.
> 
>    @@ -10,4 +10,4 @@
>     context before
>    -#define add(x,y) \
>    - (x) + (y)
>    +#define add(x,y) ((x)+(y))
>    +#define sub(x,y) ((x)-(y))
>     context after
> 
> I might want to pick bugfix of add() definition without using the new
> definition of sub().

In order to that, there is nothing to fix; you can do that today without this patch.

Show 8 quoted lines
> Please call
> 
> 	"-old 1" - change #1
>         "-old 2" - change #2
>         "+new 1" - change #3
>         "+new 2" - change #4
> 
> and try explaining what you are doing again, pretty please?

No, this sounds like 4 independent changes, and that is not what this fix is about.

I'll try to come up with a better wording.
-- Hannes
Previous: Junio C Hamano
Message 7 of 7 in “git-gui: Fix "Stage/Unstage Line" with one line of context.”
  1. 1/2 git-gui: Fix "Stage/Unstage Line" with one line of context.Johannes Sixt, Jul 15, 2008
  2. 2/2 git-gui: Allow "Stage Line" to stage adjacent changes independentlyJohannes Sixt, Jul 15, 2008
  3. Junio C HamanoJul 15, 2008
  4. Shawn O. PearceJul 16, 2008
  5. 2/2 git-gui: "Stage Line": Treat independent changes in adjacent lines betterJohannes Sixt, Jul 17, 2008
  6. Junio C HamanoJul 18, 2008
  7. Johannes SixtJul 16, 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.