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