Re: $ git checkout and symlinks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 04, 2007 at 11:05:59PM +0200, Pierre Habouzit wrote:
> On Wed, Jul 04, 2007 at 01:52:32PM -0700, Junio C Hamano wrote:
> > Pierre Habouzit <madcoder@xxxxxxxxxx> writes:
> > 
> > >   if in a branch $ you track the file: dir1/file1.c
> > > and in the branch $ you track elsewhere/file1.c and dir1 be
> > > symlink on elsewhere, then it's not possible to checkout the branch
> > > $. You have to manually
> > > remove the symlink `dir1` else git complains that checkouting branch1
> > > would overwrite dir1/file1.c.
> > >
> > >   I'm not sure how to fix this, and it's quite painful actually :)
> > 
> > Yeah, I think our handling of symlinks in both read-tree and
> > merge-recursive codepath are Ok for symlinks at the leaf level
> > but not for intermediate levels.  I think we have some patches
> > in the recent git (post 1.5.1) to fix (perhaps some of) the
> > issues, though.
> 
>   that was with the git in debian unstable, 1.5.2.3 actually.  I'll try
> again with HEAD to see if that's fixed.

  HEADS does not fixes it either.
  Here is how to reproduce the problem step by step:

$ git init-db 				# init a repo

$ mkdir dir
$ echo wibble > dir/a
$ git add a
$ git commit -a -m'add a' 		# have dir/a live in master

$ git checkout -b break
$ git mv dir new 			# rename dir into new
$ ln -s new dir 			# symlink dir to new
$ git add dir 				# add the symlink
$ git commit -a -m 'break things' 	# commit

$ git checkout master
fatal: Untracked working tree file 'dir/a' would be overwritten by merge.


  The same is true for current git.git HEAD, or git 1.5.2.x

Cheers,
-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpy13fqZUBWp.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux