git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: git@vger.kernel.org
Subject: untracked symlinks are less precious than untracked files?
Date: Wed, 2 Feb 2011 20:25:05 +0100	[thread overview]
Message-ID: <201102022025.06140.j6t@kdbg.org> (raw)

While I was poking around in t6035-merge-dir-to-symlink.sh, I noticed this:

diff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6035-merge-dir-to-symlink.sh
index 92e02d5..46b401b 100755
--- a/t/t6035-merge-dir-to-symlink.sh
+++ b/t/t6035-merge-dir-to-symlink.sh
@@ -5,21 +5,22 @@ test_description='merging when a directory was replaced with 
a symlink'
 
 test_expect_success SYMLINKS 'create a commit where dir a/b changed to 
symlink' '
 	mkdir -p a/b/c a/b-2/c &&
 	> a/b/c/d &&
 	> a/b-2/c/d &&
 	> a/x &&
 	git add -A &&
 	git commit -m base &&
 	git tag start &&
 	rm -rf a/b &&
-	ln -s b-2 a/b &&
+	# ln -s b-2 a/b &&
+	>a/b &&
 	git add -A &&
 	git commit -m "dir to symlink"
 '
 
 test_expect_success SYMLINKS 'keep a/b-2/c/d across checkout' '
 	git checkout HEAD^0 &&
 	git reset --hard master &&
 	git rm --cached a/b &&
 	git commit -m "untracked symlink remains" &&
 	 git checkout start^0 &&

With this change, where a symlink is replaced by a regular file, the 'git 
checkout start^0' fails. At this time, a/b is untracked. When it is a 
symlink, it is replaced by a directory. When it is a file, the test fails:

error: The following untracked working tree files would be overwritten by 
checkout:
        a/b

Is it by design that symlinks are less precious than files, or is it an 
oversight?

-- Hannes

             reply	other threads:[~2011-02-02 19:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 19:25 Johannes Sixt [this message]
2011-02-02 20:03 ` untracked symlinks are less precious than untracked files? Junio C Hamano
2011-02-02 22:24   ` Johannes Sixt
2011-02-05 18:18     ` [PATCH] Demonstrate breakage: checkout overwrites untracked symlink with directory Johannes Sixt
2011-02-05 18:33       ` Clemens Buchacher
2011-02-09 23:48         ` Junio C Hamano
2011-02-10 21:49           ` Clemens Buchacher
2011-02-20 12:13         ` [PATCH] do not overwrite untracked symlinks Clemens Buchacher
2011-02-21  7:15           ` Junio C Hamano
2011-02-21 19:46             ` Clemens Buchacher
2011-02-22  6:54               ` Junio C Hamano
2011-02-22 19:26                 ` Clemens Buchacher
2011-02-22 20:01                   ` Junio C Hamano
2011-02-15  7:24       ` [PATCH] Demonstrate breakage: checkout overwrites untracked symlink with directory Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102022025.06140.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).