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

#612 happening again in different form despite PR #614 #731

Closed
ysalmon opened this issue Apr 1, 2024 · 1 comment · Fixed by #732
Closed

#612 happening again in different form despite PR #614 #731

ysalmon opened this issue Apr 1, 2024 · 1 comment · Fixed by #732

Comments

@ysalmon
Copy link
Contributor

ysalmon commented Apr 1, 2024

My previous issue #612 was about repos not being properly managed when the work tree is out of the git dir.

I submitted a PR #614 to address this, which was merged, albeit with some modifications, eg. 0fd2d55, which changes the logic I proposed to determine the name of a repo to avoid infinite loops (which I did not experience, but I admit I did not test extensively).

However, this seems to lead to a resurgence of the initial problem.

With the situation of #612, namely

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

opening a in Gittyup gives a title of tmp (in #612 that was b). It actually gets registered as /tmp in Gittyup.conf.

Moreover, in my actual use case of a git repo in $HOME/Documents/Enseignement/publication-tex.git/ having a config set to worktree = $HOME/Documents/Enseignement/somewhere/Chato-Info/etc/chato, I stumble back on the unwanted behaviour that opening that repo (from its git repo dir) works but lists the repo as Enseignement and writes an inconsistent state in Gittyup.conf, with lastpath being, correctly, $HOME/Documents/Enseignement/publication-tex.git, but the repo appearing as $HOME/Documents/Enseignement in the recent list. Therefore, the repo also gets listed as Enseignement in the recent list of the GUI, and trying to open the repo from that list leads to an error.

@ysalmon
Copy link
Contributor Author

ysalmon commented Apr 1, 2024

I think the culprit is around here https://github.com/Murmele/Gittyup/blame/ec9980f6991795545bec149bd773ae2206133b51/src/git/Repository.cpp#L155 : I do not really understand why there are assert here ; it is not an error for a gitdir to be not be named .git, however if that is not the case, we do not want to remove the last part of the path (if that is what dir.cdUp() does).

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

Successfully merging a pull request may close this issue.

1 participant