stash view in gitk

615 views
Skip to first unread message

gauthier

unread,
Sep 23, 2008, 4:20:50 AM9/23/08
to msysGit
Hi all!

I'm not sure this is the right place to ask that kind of question.
Sorry if it's not.
See my current gitk tree view:
http://msysgit.googlegroups.com/web/stash-tree.GIF?gsc=vUkbTQsAAAA99mawl8LynRuwZ5PdqzWV

My version is git 1.5.6.1

I was working on "I2S out from radio is working", and detected a bug.
So I stashed my current work and reverted to previous version to track
the bug. First i got confused by the way the stash looked like in gitk
(the triangle with "stash" and "index on...", but chose not to bother.

When i understood that the bug was not related to software (darn!) I
checked out "I2S out from radio is working" again. But then I chose
NOT to stash-apply, but to do that stashed work again by hand.
I did a bit of that, and committed.

The strange thing is - as you can see on the linked gif - that the
HEAD seems to come from the previous commit ("Began the TLI / HWL
struct...") instead of "I2S out from radio".
When diffing, I can see that the changes that came in the commit "I2S
out from radio" are included in my HEAD. But from the tree view, it
doesn't seem so.

Is there something strange here?


As a side question, I'd like to get rid of that stash work, and I
still don't get why gitk shows a middle "index on radio01_dev"...


Anyone?

Gauthier Fleutot

unread,
Sep 23, 2008, 4:26:42 AM9/23/08
to msysGit
Mmm, this may have to do with a
git reset --soft HEAD^

But i thought reset --soft just "Does not touch the index file nor the working tree at all" (from kernel.org)

Gauthier

Junio C Hamano

unread,
Sep 23, 2008, 5:44:38 AM9/23/08
to gauthier...@gmail.com, msysGit
"Gauthier Fleutot" <gauthier...@gmail.com> writes:

> Mmm, this may have to do with a
> git reset --soft HEAD^
>
> But i thought reset --soft just "Does not touch the index file nor the
> working tree at all" (from kernel.org)

I do not see anything surprising, and the above quoted specification
explains what you are seeing perfectly well.

You had this ancestry (B = "I2S out from")

B HEAD
/
---o---A

And then you made some changes and stashed:

C
/ \
HEAD B---D stash
/
---o---o---A

and you rewound with "reset --soft HEAD^" to A (= "Began the TLI/HWL"):

C
/ \
B---D stash
/
---o---o---A HEAD

At this point after "reset --soft", your HEAD pointer points at A, but
your tree is still at the state of B exactly because you told "reset" not
to modify your index and the work tree.

Then you built something on top, *starting from the state "reset --soft"
left you*.

C
/ \
B---D stash
/
---o---o---A---X HEAD

You may have edited the files with your editor, adding and deleting lines,
recreating what you thought you did between B and D, but you started that
change from the state of B, and committed the result as X.

Of course diff between A and X will contain what you kept when you did
"reset --soft HEAD^", i.e. the diff between A and B, as well as the change
you did by hand, reproducing the change between B and D.

By the way, don't top post.

Reply all
Reply to author
Forward
0 new messages