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

Re: [RFC PATCH] wt-status: show amended content when verbose

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2019, 01:04 UTC
Message-ID
<xmqqv9rfe4th.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20191119145632.xi6zebglzu4lbgcq@yadavpratyush.com>
Pratyush Yadav <me@yadavpratyush.com> writes:
> I'm afraid I don't follow what exactly this would do, and how it would 
> help differentiate between the "what the amend does" and "what the 
> amended commit does".
The resulting history would be
	O---A
         \
          B
where
	O = HEAD^ = HEAD@{1}^
	A = HEAD@{1}		- HEAD before the amend
	B = HEAD		- result of the amend
I wonder if
    git diff -c B O A

(with possibly different permutations of three revisions) is a reasonable way to show what the final state is and where it differs from the previous one (i.e. HEAD@{1}) and the original one (i.e. HEAD^) in the combined diff format.

Show 6 quoted lines
>>  2. would it make sense to show the differences between
>>     HEAD^..HEAD@{1} and between HEAD^..HEAD using the range-diff
>>     machinery.
>
> I considered using range-diff, but didn't go with it because of my 
> personal dislike for range-diff.

For a single-commit amend, the normal diff between HEAD@{1} and HEAD would be far easier to read than such a range-diff, I would think.

Previous: Aaron Schrab
Message 6 of 6 in “wt-status: show amended content when verbose”
  1. wt-status: show amended content when verbosePratyush Yadav, Nov 16, 2019
  2. Junio C HamanoNov 18, 2019
  3. Junio C HamanoNov 18, 2019
  4. Pratyush YadavNov 19, 2019
  5. Aaron SchrabNov 20, 2019
  6. Junio C HamanoNov 20, 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.