All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Seth Falcon <sethfalcon@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git-svn failure when symlink added in svn
Date: Sat, 14 Apr 2007 13:10:03 -0700	[thread overview]
Message-ID: <20070414201003.GA28389@muzzle> (raw)
In-Reply-To: <m2647zh2zc.fsf@gmail.com>

Seth Falcon <sethfalcon@gmail.com> wrote:
> 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

  reply	other threads:[~2007-04-14 20:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-14  6:41 git-svn failure when symlink added in svn Seth Falcon
2007-04-14 20:10 ` Eric Wong [this message]
2007-04-16  3:13   ` Seth Falcon
2007-04-26 23:07     ` Alexander Klink
2007-04-27 18:03       ` Linus Torvalds
2007-04-28 13:02         ` Alexander Klink
2007-04-28 16:54           ` Seth Falcon
2007-04-28 17:31           ` Junio C Hamano
2007-04-28 18:13             ` Seth Falcon
2007-04-28 18:34               ` Junio C Hamano
2007-04-28 21:15                 ` Seth Falcon
2007-04-28 22:43                   ` Junio C Hamano
     [not found]                     ` <m2irbfqlze.fsf@ziti.local>
2007-04-29 18:26                       ` Eric Wong
2007-04-30 14:43                         ` Seth Falcon
2007-04-30 15:43                           ` Eric Wong
2007-05-01 17:49                             ` Seth Falcon
2007-04-29 18:31                     ` Eric Wong
2007-04-29 21:01                       ` Junio C Hamano
2007-04-29 22:21                         ` Eric Wong
2007-04-30  0:24                           ` Alexander Klink
2007-04-30  5:08                           ` Junio C Hamano
2007-04-30  6:31                             ` Eric Wong
2007-04-30 14:33                               ` Seth Falcon
2007-05-01 20:53                             ` Alexander Klink

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=20070414201003.GA28389@muzzle \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=sethfalcon@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.