git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git pull" throws away dirty state
@ 2008-03-16 18:08 Linus Torvalds
  2008-03-16 18:24 ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: Linus Torvalds @ 2008-03-16 18:08 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano


Ok, this is distressing, and I suspect it's another bug of mine due to 
unpack-trees changes, but before I delve into it deeper I thought I'd 
report it here and see if others see it too, and maybe it's due to 
something else..

I'm used to having dirty state in my tree, and still being able to do a 
lot of my normal work, very much including doing pulls from others. I 
expect that if the dirty state isn't relevant to the merge, it wil just 
remain, with a message like

	xyzzy: needs update
	Merge made by recursive.

and then after the merge my changes to xyzzy are still there.

That doesn't seem to work any more. The merge is successful, but it also 
updated the working tree, overwriting my dirty state!

Appended is a test-script for this behaviour, and I get:

	Before merge:
	diff --git a/a b/a
	index e965047..eacb93d 100644
	--- a/a
	+++ b/a
	@@ -1 +1,2 @@
	 Hello
	+Hi there
	a: needs update
	Merge made by recursive.
	 b |    1 +
	 1 files changed, 1 insertions(+), 0 deletions(-)
	After merge:

with the afte-merge diff being empty.

		Linus

---
#!/bin/sh

rm -rf test-repo
mkdir test-repo
cd test-repo

git init
echo Hello > a
echo Hi > b
git add a b
git commit -m "Initial commit"

git checkout -b newbranch
echo Hullo >> b
git commit -m "Change b in 'newbranch'" b

git checkout master
echo New file > c
git add c
git commit -m "Add new file"

echo Hi there >> a
echo Before merge:
git diff
git pull . newbranch
echo After merge:
git diff

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-03-16 21:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-16 18:08 "git pull" throws away dirty state Linus Torvalds
2008-03-16 18:24 ` Linus Torvalds
2008-03-16 18:37   ` Nicolas Pitre
2008-03-16 20:50     ` Junio C Hamano
2008-03-16 21:13       ` Junio C Hamano
2008-03-16 18:42   ` [PATCH] Don't update unchanged merge entries Linus Torvalds
2008-03-16 20:00     ` Daniel Barkalow
2008-03-16 20:40       ` Linus Torvalds
2008-03-16 21:10         ` Daniel Barkalow
2008-03-16 21:15           ` Linus Torvalds
2008-03-16 21:25             ` Junio C Hamano

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 NNTP newsgroup(s).