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

Re: git-svn failure when symlink added in svn

From
Seth Falcon <sethfalcon@gmail.com>
Date
Apr 16, 2007, 03:13 UTC
Message-ID
<m2slb1c8ps.fsf@fhcrc.org>
In-Reply-To
<20070414201003.GA28389@muzzle>
Eric Wong <normalperson@yhbt.net> writes:
> 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?

Thanks for sending the test case. It doesn't properly fail for me on OSX, but if I run it with -v then I do see the error (so it is failing on OSX and, as you found, not on Linux).

I added a silly print statement to see the symlink args:
diff --git a/entry.c b/entry.c
index d72f811..70f6402 100644
--- a/entry.c
+++ b/entry.c
@@ -129,6 +129,7 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat
                                return error("git-checkout-index: unable to write file %s",
                                        path);
                } else {
+                        fprintf(stderr, "symlink: '%s' => '%s'\n", path, new);
                        wrote = symlink(new, path);
                        free(new);
                        if (wrote)

And so then on Linux with -v I get (after snipping most of the
output):

   * expecting success: 
           cd git &&
                   git svn rebase
                   cd ..
   
           A       bar.txt
   r2 = 31e734669e3fe4dbbd375e5a9f5af828a5b7ba92 (git-svn)
           D       foo.txt
   r3 = bd3b318730e8efc77235976abb18d04bc927bf9e (git-svn)
           A       foo.txt
   r4 = 2376eedcfec1de7cbe69b2bbad1c5de231a0ed0d (git-svn)
   First, rewinding head to replay your work on top of it...
   symlink: 'foo.txt' => 'bar.txt'
   HEAD is now at 2376eed... add foo as symlink
   Fast-forwarded master to refs/remotes/git-svn.
   *   ok 4: rebase in git-svn
   
   * passed all 4 test(s)

On my OSX laptop I get:

   * expecting success: 
           cd git &&
                   git svn rebase
                   cd ..
   
           A       bar.txt
   r2 = 4964f302b94ede0301b33faf5f4242c4bab3108b (git-svn)
           D       foo.txt
   r3 = 178a9ff3c7013d4ad8ec7defa93b91a1080c1e53 (git-svn)
           A       foo.txt
   r4 = 9f0bc38df8113fe1e11e47b708589d82bfa035a0 (git-svn)
   First, rewinding head to replay your work on top of it...
   symlink: 'foo.txt' => ''
   error: git-checkout-index: unable to create symlink foo.txt (Invalid argument)
   HEAD is now at 9f0bc38... add foo as symlink
   Fast-forwarded master to refs/remotes/git-svn.
   *   ok 4: rebase in git-svn
   
   * passed all 4 test(s)

If you're still with me, the curious part is what the symlink call is
trying to do.

  Linux:    symlink: 'foo.txt' => 'bar.txt'
    OSX:    symlink: 'foo.txt' => ''

So it looks like the problem is some sort of off-by-one that happens
well before the symlink call.  Perhaps this is enough for someone more
knowledgable than me to have a clue where to look next?

+ seth
Previous: Eric WongNext: Alexander Klink
Message 3 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.