Re: Moving .git around

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

 



On Thu, Jul 24, 2008 at 12:06:28 +0930, Geoff Russell wrote:
> On Thu, Jul 24, 2008 at 11:42 AM, Nguyen Thai Ngoc Duy
> <pclouds@xxxxxxxxx> wrote:
> > On 7/24/08, Geoff Russell <geoffrey.russell@xxxxxxxxx> wrote:
> >> For reasons which would take a while to explain, I'm building a repository
> >>  in a directory  using "--git-dir=xxxx/.git --work-tree=." and
> >>  then doing an "mv  xxxx/.git ./.git"  and then trying to work with
> >>  that repository  --- but can't
> >>
> >>  Below is a sample script. The last line (git add) fails with
> >>
> >>  fatal: unable to create
> >>  '/usr/local/AusTop/AuPrograms/AuServer/testgit/aaa/bbb/.git/index.lock':
> >>  No such file or directory
> >>
> >>  git doesn't seem to realise that there is a .git back up the tree.
> >
> > It's because when you did git --work-tree=. init, worktree is stored
> > in .git/config. The code that chdir() in setup_git_directory()
> > probably forgot to chdir() back to toplevel worktree. Workaround could
> > be just remove core.worktree in .git/config.
> 
> Many thanks, the work-around works. I'm not sure if this is a bug or
> a feature, but I'm happy either way.

That depends on what the value of core.worktree is:
 - If it is '.', than I think it should be considered a bug in git init,
   because that value is just plain nonsense.
 - If it is '..', than it's a user error and the right thing is to just
   remove it when you relocate the .git directory.
 - If it was '/usr/local/AusTop/AuPrograms/AuServer/testgit/' than it would
   have worked, so it's not that.

Best regards,
Jan

-- 
						 Jan 'Bulb' Hudec <bulb@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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