Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

core.worktree #270

Closed
Keepun opened this issue Oct 25, 2014 · 8 comments
Closed

core.worktree #270

Keepun opened this issue Oct 25, 2014 · 8 comments

Comments

@Keepun
Copy link

Keepun commented Oct 25, 2014

core.worktree sets the path to the --git-dir :(

In 1.9.2-preview20140411 setting works, but the files will not open.

@Keepun
Copy link
Author

Keepun commented Oct 29, 2014

git gui:

couldn't open ".git/HEAD": no such file or directory
couldn't open ".git/HEAD": no such file or directory
    while executing
"open [gitdir HEAD] r"
    (procedure "load_current_branch" line 4)
    invoked from within
"load_current_branch"
    (procedure "repository_state" line 7)
    invoked from within
"repository_state newType newHEAD newMERGE_HEAD"
    (procedure "rescan" line 9)
    invoked from within
"rescan ui_ready"
    (procedure "do_rescan" line 2)
    invoked from within
"do_rescan"
    ("after" script)

@dscho
Copy link
Member

dscho commented Oct 29, 2014

It does not seem like this is a Window-specific problem, or is it, @Keepun?

@Keepun
Copy link
Author

Keepun commented Oct 31, 2014

Window-specific

@Keepun
Copy link
Author

Keepun commented Oct 31, 2014

But the problem is probably in "git gui".
"git status" shows a list of files.

@dscho
Copy link
Member

dscho commented Oct 31, 2014

Thanks-clarify

@Keepun
Copy link
Author

Keepun commented Nov 23, 2014

Bug in Git\libexec\git-core\git-gui.tcl:

1266: set _gitdir [git rev-parse --git-dir]
_gitdir = .git
1335: if {[catch {cd $_gitworktree} err]} {
Change PWD. But _gitdir is not an absolute path, and it depends on the PWD.

And bug in:

1278: if {$_gitdir eq "."} {
1279:   set _gitdir [pwd]
1280: }
GIT_DIR=. git gui

Atlassian SourceTree and GitExtensions can not work with core.worktree

Temporary fix for Git GUI:

git config --global alias.ngui '!git --git-dir=`pwd`/.git gui'
git ngui

@dscho
Copy link
Member

dscho commented Nov 24, 2014

EEXPLANTOOSHORT

;-)

@dscho
Copy link
Member

dscho commented Aug 25, 2015

@Keepun I missed that you updated your very terse explanation. So now it looks as if your problem might be solved by extending

if {$_gitdir eq "."} {
   set _gitdir [pwd]
}

to

if {$_gitdir eq "."} {
   set _gitdir [pwd]
} elseif ($_gitdir eq .git) {
   set _gitdir [pwd]/.git
}

If that fixes your problem, please report back and I will integrate the patch into Git for Windows 2.x.

@dscho dscho closed this as completed Aug 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@dscho @Keepun and others