Open MartinL0815 opened 5 years ago
I was surprised to see, that seemly one specific solution does not allow "global" (solution-wide" git commands, but document-only commands! What prevents in a specific solution, the global commands and allow document commands?
It tries to find the .git folder in the solution folder. It caches if it was able to find the folder for 30 seconds. So that might cause a problem while switching solutions.
I know now the difference between the "old" and this "new" branch. It is created as worktree, has no ".git" folder, but a ".git" file.
Eventually … https://stackoverflow.com/questions/53796823/git-directory-in-git-worktree-not-a-directory … tells the needed things to enable the TGit commands in the worktree branch (not cloned).
The "correct" .git folder is for this worktree branch in "..\master.git\worktrees\PS-15.1"
And the .git file points with its content to it:
gitdir: C:/Development/git/…/Master/.git/worktrees/PS-15.1
Thanks for the info! Very helpful. Should be ready to parse the .git file and use that info in the extension.
Will look into adding that in the next version :)
Documentation: Git Repository Layout
Note: Also you can have a plain text file .git at the root of your working tree, containing gitdir:
to point at the real directory that has the repository.
Do you have a plan, when to publish a next version, fixing this issue, which you categorized as enhancement? Thanks!
Sorry no plan yet. Really busy with personal live at the moment (my daughter was born ❤️), so hard to find time to work on the extension :(
So for now the best I can promise: It is on my todo list and will not forget about it!
Found some spare time at work, try the new release 🚀 !
Oh wow, you found some spare time to get this issue resolved 👍 and I was from Dec. 16th out of office and unable to check this release. :( Sadly the issue is not resolved, since the path to the repository gets build in a wrong way:
In the path of the .git
file points to a directory, where the gitdir
file is in, which itself contains the path to the original repository I work with.
So the needed steps are:
.git
exists instead of a directory.git
file to get the path to gitdir
filegitdir
file in the directory read in step 2I'm really sorry, that I wasn't able to validate your quickly provided fix, created in the really seldom spare time as young father!
I hope, that you and your family had a good end of 2019 and a good start into 2020! All the best!
Try the new release: https://github.com/sboulema/TGit/releases/tag/v4.15.72 🚀
Could you send me your gitdir file, can't find much about the format of the file content? You can reach me at vsix@sboulema.nl
I tried the next version and it seems to work after an error message after opening initially the TGIT menu:
The gitdir
is very simple, only containing the path in the first line and an empty new line:
C:/Development/git/…/PS-15.1/.git
(gitdir.txt)
Thanks for your work to solve this issue!!! 👍
I think the solution is even simpler, you can just check for the .git file as you do it for the .git directory, see #77
I dont' have much experience with git (we just switched to it), but with the fix from above my TortoiseGit works well for worktrees. I tested it with TortoiseGit 2.13.0.1 and git version 2.37.1.windows.1.
Thanks for the PR!
If I open another solution from the VS2019 file menu TGIT disables all functions. If I re-open the previous loaded solution, TGIT returns from completely disabled to enabled.