Murmele / Gittyup

Understand your Git history!
https://murmele.github.io/Gittyup
MIT License
1.55k stars 114 forks source link

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

Closed ysalmon closed 1 year ago

ysalmon commented 1 year ago

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 commented 1 year ago

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

ysalmon commented 1 year ago

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.

Murmele commented 1 year ago

Thanks for the MR. If you have

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

ysalmon commented 1 year ago

I stage in both repositories, and not always the same files. Those are latex files, so we need them to be in the same place in order for my colleagues to configure their texmf without too much trouble, but I publish only those that I authored personally.

Cordialement,

Yann Salmon

Depuis mon téléphone ; excusez la brièveté.

Murmele commented 1 year ago

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