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

Gittyup gets confused with work-tree out of git-dir #612

Closed
ysalmon opened this issue Aug 6, 2023 · 5 comments · Fixed by #614
Closed

Gittyup gets confused with work-tree out of git-dir #612

ysalmon opened this issue Aug 6, 2023 · 5 comments · Fixed by #614
Labels
enhancement New feature or request

Comments

@ysalmon
Copy link
Contributor

ysalmon commented Aug 6, 2023

Gittyup records repos by their worktree in the Recent list, which relies on the assumption that the git-dir and the work-tree are in the same path. This is not always the case.

cd /tmp
mkdir a b
git --git-dir a --work-tree b init
touch b/test

Opening /tmp/a in Gittyup does display the adequate work-tree, with test as an untracked file.

However, this gets recorded as b, not a, in the Recent list. Moreover, opening the repo from that entry in the Recent list gives an error "/tmp/b does not contain a valid git repository", which is true, but irrelevant.

@Murmele
Copy link
Owner

Murmele commented Aug 7, 2023

Hi, did you have a look into git submodules? I think this is better than having nested git repositories

@ysalmon
Copy link
Contributor Author

ysalmon commented Aug 7, 2023

Yes I do, but in this case they are not practical. Anyway, the problem is really about the work-tree not being a subfolder of the git repo. I will update the initial post to give a better MWE.

@ysalmon ysalmon changed the title Gittyup gets confused with multiple git repos sharing a worktree Gittyup gets confused with work-tree out of git-dir Aug 7, 2023
@Murmele
Copy link
Owner

Murmele commented Aug 8, 2023

Thanks for the MR.
If you have

  • a
    • repository A
  • b
    • repository B
    • subfolder
      • workdir repoA

Do you ignore the subfolder subfolder then, otherwise you have to stage in both repositories?

@ysalmon
Copy link
Contributor Author

ysalmon commented Aug 8, 2023 via email

@Murmele
Copy link
Owner

Murmele commented Aug 8, 2023

Ah ok I understand thanks for the clarification. I will check out your MR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants