git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-svn failure when symlink added in svn

From
EWEric Wong <normalperson@yhbt.net>
Date
Apr 14, 2007, 20:10 UTC
Message-ID
<20070414201003.GA28389@muzzle>
In-Reply-To
<m2647zh2zc.fsf@gmail.com>
Seth Falcon <sethfalcon@gmail.com> wrote:
Show 9 quoted lines
> A few weeks ago I reported a symlink related error with git-svn and
> I've now had a chance to track down a few more details.  The trigger
> seems to be if a file is removed from svn and then later added as a
> symlink.  The error I get is:
> 
>   error: git-checkout-index: unable to create symlink foo.txt (Invalid argument)
> 
> This is from the call to symlink(new, path) in entry.c and it seems
> that new is ''.

I can't reproduce it on Linux with ext3. I translated your recipe into a test script in the patch below. Anybody familiar with OSX and/or HFS know if there's a workaround or fix for this?

From: Eric Wong <normalperson@yhbt.net>
Date: Sat, 14 Apr 2007 13:03:24 -0700
Subject: [PATCH] git-svn: add test to handle conversion from file to symlink

This does not trigger any failures on my Linux machine with ext3, but it may fail on OSX and/or HFS.

This test is based on a bug report by Seth Falcon:
  http://permalink.gmane.org/gmane.comp.version-control.git/44445
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 t/t9112-git-svn-file-to-symlink.sh |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100755 t/t9112-git-svn-file-to-symlink.sh
diff --git a/t/t9112-git-svn-file-to-symlink.sh b/t/t9112-git-svn-file-to-symlink.sh
new file mode 100755
index 0000000..f94310f
--- /dev/null
+++ b/t/t9112-git-svn-file-to-symlink.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Copyright (c) 2007 Eric Wong
+test_description='git-svn file to symlink'
+. ./lib-git-svn.sh
+
+test_expect_success 'create file in svn repository' "
+	svn co '$svnrepo' svn &&
+	cd svn &&
+		echo 123 > foo.txt &&
+		svn add foo.txt &&
+		svn commit -m 'add a file'
+		cd ..
+	"
+
+test_expect_success 'clone with git-svn' "pwd && git svn clone '$svnrepo' git"
+
+test_expect_success 'remove and add file as symlink in svn' "
+	cd svn &&
+		echo 123 > bar.txt &&
+		svn add bar.txt &&
+		svn commit -m 'add bar' &&
+		svn rm foo.txt &&
+		svn commit -m 'remove foo' &&
+		ln -s bar.txt foo.txt &&
+		svn add foo.txt &&
+		svn ci -m 'add foo as symlink'
+		cd ..
+	"
+
+test_expect_success 'rebase in git-svn' "
+	cd git &&
+		git svn rebase
+		cd ..
+	"
+
+test_done
-- 
Eric Wong
Previous: Seth FalconNext: Seth Falcon
Message 2 of 24 in “git-svn failure when symlink added in svn”
  1. Seth FalconApr 14, 2007
  2. Eric WongApr 14, 2007
  3. Seth FalconApr 16, 2007
  4. Alexander KlinkApr 26, 2007
  5. Linus TorvaldsApr 27, 2007
  6. Alexander KlinkApr 28, 2007
  7. Seth FalconApr 28, 2007
  8. Junio C HamanoApr 28, 2007
  9. Seth FalconApr 28, 2007
  10. Junio C HamanoApr 28, 2007
  11. Seth FalconApr 28, 2007
  12. Junio C HamanoApr 28, 2007
  13. Eric WongApr 29, 2007
  14. Junio C HamanoApr 29, 2007
  15. Eric WongApr 29, 2007
  16. Alexander KlinkApr 30, 2007
  17. Junio C HamanoApr 30, 2007
  18. Eric WongApr 30, 2007
  19. Seth FalconApr 30, 2007
  20. Alexander KlinkMay 1, 2007
  21. Eric WongApr 29, 2007
  22. Seth FalconApr 30, 2007
  23. Eric WongApr 30, 2007
  24. Seth FalconMay 1, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.