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

Re: gitk (was Re: Linux v2.6.12-rc6)

From
Paul Mackerras <paulus@samba.org>
Date
Jun 10, 2005, 10:57 UTC
Message-ID
<17065.29225.943521.738481@cargo.ozlabs.ibm.com>
In-Reply-To
<Pine.LNX.4.58.0506081608450.2286@ppc970.osdl.org>
Linus Torvalds writes:
> and it would be cool if the "filename list" panel on the right side 
> colorized the names by these things (only three cases - leave the "not 
> touched" files off entirely, of course).

Hmmm. How about this: each parent is given a color, and the file names are colored according to which parent they differ in. If a file differs in more than one parent it gets listed more than once in the colors for the parents in which it differs, with those entries being consecutive in the list.

If instead I list the file once in yet another color, I don't see how to make it intuitively obvious that that's what the color means, and I get a combinatorial explosion in the number of colors required as the number of parents grows (I would potentially need 2^n - 1 colors for n parents).

Show 6 quoted lines
> Also, it should actually possible to do a diff for these things with just
> doing a "diff3" on the two parents and on the merge result (diff3 normally
> expects the "original", but hey, the "original" might as well be the
> result), and thus color a merge file by whether the lines came from one
> side or the other or both (or neither, which would be a manual merge
> fixup).

I already have code in dirdiff to display n-way diffs in a single window, so it's certainly doable. I think I will do it a little differently in this case, though, because the final result has a special status. If I color lines according to which parent(s) they are present in and then have some other way to show which version was chosen (maybe a black box around those lines? or a little tick (check mark) or cross icon at the left hand edge of the line?) I think that should be pretty clear. (I'll need another color for the cases where the result is different to all of the parents, of course.)

Sounds interesting.  I'll have a look at it.
Paul.
Previous: Linus Torvalds
Message 2 of 2 in “gitk (was Re: Linux v2.6.12-rc6)”
  1. Linus TorvaldsJun 8, 2005
  2. Paul MackerrasJun 10, 2005

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.