threads / discuss / 16758

Strange untracked file behaviour

Subject: Strange untracked file behaviour

## tl;dr

3 messages between Dec 16, 2008 and Dec 17, 2008.

replies: 2people: 2as markdown or json

Miklos Vajna· Dec 16, 2008, 23:24 UTC · lore
Hi,
Here is a copy of the udev repo I cloned some time ago:
http://frugalware.org/~vmiklos/files/udev.tar.bz2
I did not modify it, so I thought a simple 'git pull' can update it.

$ git pull Updating 661a0be..b6626d0 error: Untracked working tree file 'test/sys/class/misc/rtc/dev' would be removed by merge.

Ok, let's clean the untracked files:
$ git clean -x -d -f
But it does not remove any file.

$ git ls-files|grep test/sys/class/misc/rtc/dev test/sys/class/misc/rtc/dev

So it seems git-clean is right.

$ git pull -s resolve Updating 661a0be..b6626d0 error: Untracked working tree file 'test/sys/class/misc/rtc/dev' would be removed by merge.

So it does not seem to be merge-recursive-related.
Does somebody have an idea what's going on? :)

$ git version git version 1.6.1.rc1.35.gae26e.dirty

('dirty' is due to non-code changes in my working directory.)
Let me know if you need more details.
Thanks.
Johannes Schindelin· Dec 17, 2008, 05:09 UTC · re: Miklos Vajna · lore

Re: Strange untracked file behaviour

Hi,
On Wed, 17 Dec 2008, Miklos Vajna wrote:
Show 10 quoted lines
> Here is a copy of the udev repo I cloned some time ago:
> 
> http://frugalware.org/~vmiklos/files/udev.tar.bz2
> 
> I did not modify it, so I thought a simple 'git pull' can update it.
> 
> $ git pull
> Updating 661a0be..b6626d0
> error: Untracked working tree file 'test/sys/class/misc/rtc/dev' would
> be removed by merge.

I just spent three hours narrowing it down to this test case (but now I have to catch 3 hours of sleep):

-- snipsnap -- [PATCH] Miklos' testcase

Even if we would not handle symlink/directory conflicts gracefully (which we do, though), those conflicts should not affect unchanged files at all, especially not claiming that they are untracked.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t1008-read-tree-sd.sh |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 t/t1008-read-tree-sd.sh
diff --git a/t/t1008-read-tree-sd.sh b/t/t1008-read-tree-sd.sh
new file mode 100644
index 0000000..4d74430
--- /dev/null
+++ b/t/t1008-read-tree-sd.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Copyright (c) 2008 Johannes E. Schindelin
+#
+
+test_description='symlink/directory conflict'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+
+	mkdir -p alpha/beta/gamma &&
+	ln -s delta alpha/beta/gamma/epsilon &&
+	mkdir -p alpha/beta/theta &&
+	ln -s zeta alpha/beta/theta/eta &&
+	mkdir -p iota/kappa/lambda/ &&
+	: > iota/kappa/lambda/mu &&
+	git add . &&
+	test_tick &&
+	git commit -m initial &&
+
+	git rm -r alpha/beta/gamma &&
+	ln -s nu alpha/beta/gamma &&
+	git rm -r alpha/beta/theta &&
+	ln -s xi alpha/beta/theta &&
+	git add . &&
+	test_tick &&
+	git commit -m 2nd
+
+'
+
+test_expect_failure 'read-tree -u -m handles symlinks gracefully' '
+
+	git checkout -b side HEAD^ &&
+	git read-tree -u -m master
+
+'
+
+test_done
-- 
1.6.0.4.1189.g8876f
Miklos Vajna· Dec 17, 2008, 14:38 UTC · re: Johannes Schindelin · lore

Re: Strange untracked file behaviour

On Wed, Dec 17, 2008 at 06:09:16AM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> I just spent three hours narrowing it down to this test case (but now I 
> have to catch 3 hours of sleep):
Thank you very much! :-)

← back to recent threads