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

Re: Understanding the diff output in gitk when comparing a commit with working tree

From
Johannes Sixt <j6t@kdbg.org>
Date
Nov 29, 2024, 07:38 UTC
Message-ID
<d88a5f98-55e3-45dc-8f59-b7089096ba1f@kdbg.org>
In-Reply-To
<AS2PR08MB82880324292BB445428393B7E1292@AS2PR08MB8288.eurprd08.prod.outlook.com>
Am 28.11.24 um 09:27 schrieb tobias.boesch@miele.com:
Show 7 quoted lines
> I found that when comparing a commit with those changes made in the
> working tree, I don’t understand the following observations I made
> in the diff output for _some_ files:
> 
> - the diff output is not colored in red and green for additions and
> removals, but in red and bold black (still preceded with “++”, “+-“,
> “--“ and so on)

I will assume that there is no merge conflict. Then you see a combined diff where the "first parent" is the index and the "second parent" is the commit that you selected.

Without having looked at the code and its history, I guess that this is an accident that nobody has bothered to fix, because it is not a very useful way to show differences between the worktree and a selected commit.

-- Hannes
Previous: tobias.boesch@miele.com
Message 2 of 2 in “Understanding the diff output in gitk when comparing a commit with working tree”
  1. tobias.boesch@miele.comNov 28, 2024
  2. Johannes SixtNov 29, 2024

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.