Re: FIX/COMMENT: git remote manual page

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

 



On Sat, Dec 25, 2010 at 6:41 PM, Michel Briand <michelbriand@xxxxxxx> wrote:
> 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.

> ~/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
--
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]