* Oops, I screwed it up
[not found] <AANLkTinyZ-dqV5=yaucLZTj14hdxS61v=VT-j82SqN7r@mail.gmail.com>
@ 2010-12-10 18:31 ` Péter András Felvégi
2010-12-10 23:01 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Péter András Felvégi @ 2010-12-10 18:31 UTC (permalink / raw)
To: git
Dear All,
I did some rebasing which ended in an unexpected result.
This is what I did precisely:
- added 3 files to the index, then committed (#1)
- realized that a file was left out (not yet tracked), so added + committed it
- stashed the local changes
- used rebase -i to meld the last commit into the previous one (fixup)
- stash pop
- added more files to the index, committed (#2)
- made some minor changes to a file committed in #1, added, committed
- decided to meld into #1
- there were 3 more locally changed files
- stashed them
- rebase -i, moved the last item one line up, set to fixup, so that it
melds into #1
- stash pop: surprise! the stash was empty
git log --stat showed that the 3 stashed files got melded into commit #1, too.
I didn't expect this. Is this the normal operation?
I was able to undo the effects by rebase -i, edit (as in the git
rebase manpage under SPLITTING COMMITS), committing again w/o the 3
files I didn't need, saving them to a temp dir, revert them via
checkout, rebase --continue, then move the files from temp to have
them locally changed again. This is where I would have been if stash
pop succeeded.
The files in commit #1, #2, and the last 3 locally changed ones where disjunct.
I don't know how those 3 locally changed, stashed files ended up in
the commit. I checked my command line history, I wasn't adding them.
Unfortunately, I wasn't able to reproduce the phenomenon on a test
repo, by 3 files:
- commit a, b, c
- change a, commit
- change b, commit
- change a, commit
- change c
- stash c
- rebase -i to meld the two a's, making b the last commit
- stash pop : it worked
Any ideas?
I'm using git version 1.7.2.3 under Debian Squeeze AMD64.
Please CC me, I'm not on the list. Thanks.
Regards, Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Oops, I screwed it up
2010-12-10 18:31 ` Oops, I screwed it up Péter András Felvégi
@ 2010-12-10 23:01 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-12-10 23:01 UTC (permalink / raw)
To: Péter András Felvégi; +Cc: git
Péter András Felvégi <petschy@gmail.com> writes:
> This is what I did precisely:
> - added 3 files to the index, then committed (#1)
> - realized that a file was left out (not yet tracked), so added + committed it
FWIW, at this point doing "git commit --amend" would have been easier
and avoided the need to stash.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-10 23:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <AANLkTinyZ-dqV5=yaucLZTj14hdxS61v=VT-j82SqN7r@mail.gmail.com>
2010-12-10 18:31 ` Oops, I screwed it up Péter András Felvégi
2010-12-10 23:01 ` Andreas Schwab
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).