Re: Better handling of local changes in 'gitk'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> 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.

Interesting, as I was thinking about something similar when I
typed "git show stash" by mistake. I meant to say "git stash
show", but "git show stash" output actually was even closer to
what I wanted to see.

"git stash" internally creates two commits, based on your HEAD:

         .----W
        /    / 
    ---H----I

Here, W keeps the state of the working tree, I is the index
state and H is the HEAD.  Commit I is direct child of H, Commit
W is an evil merge between H and I, and that is what is kept as
refs/stash, so "git show stash" would end up showing that merge
in --cc format.



-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux