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

Better handling of local changes in 'gitk'?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 12, 2007, 19:20 UTC
Message-ID
<alpine.LFD.0.999.0707121214420.20061@woody.linux-foundation.org>

I like how gitk shows the local changes as an unnamed commit at the top, but what I *don't* like is how it just ignored the difference between stuff that has been added to the index, and stuff that hasn't..

It would be very nice to have *two* such commits (either or both of which just disappear), where the top-most is the diff to the index, and the second is the diff from the index to HEAD.

That would not only be useful in general, it would be a wonderful way to visually introduce people to the notion of what the staging area is all about.

I think "gitk" was a great way early in git history to show how the git commit history works and that it made a lot of people understand a lot more how everything tied together (in a way that would have been much nastier to visualize with just the SHA1's in "git log"), and I think it could do the same thing for the staging area, which still seems to occasionally come up as an issue that confuses some people.

But my inability with tcl/tk precludes me from actually changing the logic that does

	git diff-index HEAD
into two different things that do the two operations
	git diff-index --cached HEAD
	git diff-files
respectively and ties them together as the two fake commits...
Paul?
			Linus
Next: Junio C Hamano
Message 1 of 9 in “Better handling of local changes in 'gitk'?”
  1. Linus TorvaldsJul 12, 2007
  2. Junio C HamanoJul 12, 2007
  3. Junio C HamanoJul 12, 2007
  4. Linus TorvaldsJul 12, 2007
  5. Paul MackerrasJul 13, 2007
  6. Paul MackerrasJul 13, 2007
  7. Linus TorvaldsJul 13, 2007
  8. Johannes SixtJul 13, 2007
  9. Linus TorvaldsJul 13, 2007

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.