Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2019 - Switching solutions disables TGIT #59

Open
MartinL0815 opened this issue Sep 11, 2019 · 13 comments
Open

VS2019 - Switching solutions disables TGIT #59

MartinL0815 opened this issue Sep 11, 2019 · 13 comments
Assignees

Comments

@MartinL0815
Copy link

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.

@MartinL0815
Copy link
Author

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?

@sboulema sboulema self-assigned this Sep 16, 2019
@sboulema
Copy link
Owner

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.

@MartinL0815
Copy link
Author

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).

@MartinL0815
Copy link
Author

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

@sboulema
Copy link
Owner

sboulema commented Sep 23, 2019

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.

@MartinL0815
Copy link
Author

Do you have a plan, when to publish a next version, fixing this issue, which you categorized as enhancement?
Thanks!

@sboulema
Copy link
Owner

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!

@sboulema
Copy link
Owner

Found some spare time at work, try the new release 🚀 !

https://github.com/sboulema/TGit/releases/tag/v4.15.69

@MartinL0815
Copy link
Author

MartinL0815 commented Jan 6, 2020

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:

path error message

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:

  1. detect if the file .git exists instead of a directory
  2. read .git file to get the path to gitdir file
  3. read gitdir file in the directory read in step 2

I'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!

@sboulema
Copy link
Owner

sboulema commented Jan 9, 2020

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

@MartinL0815
Copy link
Author

I tried the next version and it seems to work after an error message after opening initially the TGIT menu:

Error on initial opening of 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!!! 👍

@Dschaehn
Copy link

Dschaehn commented Aug 3, 2022

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.

@sboulema
Copy link
Owner

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants