Re: FIX/COMMENT: git remote manual page
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 25, 2010, 13:00 UTC
- Message-ID
- <AANLkTik_x+FcdRs7ac1X45OE7_9E8W-y44HJU=XUuRog@mail.gmail.com>
- In-Reply-To
- <20101225124104.06a4f83c@eana.kheb.homelinux.org>
On Sat, Dec 25, 2010 at 6:41 PM, Michel Briand <michelbriand@free.fr> wrote:
Show 8 quoted lines
> Hi, > > I'm running Debian squeeze. Git is version 1.7.2.3. > > Here is the complete command sequence I used: > > ~/tmp/git $ mkdir toto toto_wk > ~/tmp/git $ GIT_DIR=toto GIT_WORK_TREE=toto_wk git init
Note that this also sets core.worktree=`cwd`/toto_wk so you only need to set GIT_DIR in the following commands. But I wouldn't recommend it, just set GIT_WORK_TREE the way you are doing, until maybe 1.7.4. core.worktree is buggy.
> ~/tmp/git $ GIT_DIR=toto GIT_WORK_TREE=toto_wk git merge TOTO > fatal: This operation must be run in a work tree > fatal: read-tree failed
Thanks for the instructions. We've got a problem with $GIT_WORK_TREE vs cwd here. I'll send a patch later.
Show 9 quoted lines
> ~/tmp/git $ ls toto_wk/ > <NOTHING> > > I re-issue the latest command : > > ~/tmp/git $ GIT_DIR=toto GIT_WORK_TREE=toto_wk git merge TOTO > Already up-to-date. > > Strange isn't it ?
Actually no. 'git-merge' is successful and its last step is to call 'git read-tree --reset -u SHA-1' to update worktree. Unfortunately, git's internal cwd has been moved to ~/tmp/git/toto_wk while $GIT_WORK_TREE is still "toto_wk". When git-read-tree is run, it tries to find a worktree at ~/tmp/git/toto_wk/toto_wk.
> But directory is still empty > ~/tmp/git $ ls toto_wk/ > <NOTHING>
Because git-read-tree fails to run.
> Trying to recover : > > ~/tmp/git $ GIT_DIR=toto GIT_WORK_TREE=toto_wk git reset --hard
Or you can try this until new git release:
GIT_DIR=toto GIT_WORK_TREE=$HOME/tmp/toto_wk git merge TOTO
or
GIT_DIR=toto git merge TOTO
In other words, making worktree absolute should work (core.worktree is always set absolute by git-init).
-- Duy