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

Excluding a file in a worktree does not work #3489

Open
bradphelan opened this issue Apr 10, 2024 · 3 comments
Open

Excluding a file in a worktree does not work #3489

bradphelan opened this issue Apr 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bradphelan
Copy link

Describe the bug

The folder is a worktree d:\checkouts\foo\worktrees\wt2 and the main repo is :\checkouts\foo

I move the cursor to a file I wish to exclude. I press i then I press e. An error appears

image

there is no d:\checkouts\moduleworks\worktrees\wt2\.git folder but there is a d:\checkouts\moduleworks\.git\worktrees\wt2 where an exclude file for worktrees should live. I think the exclude command is just not worktree aware

@bradphelan bradphelan added the bug Something isn't working label Apr 10, 2024
@mark2185
Copy link
Collaborator

It was fixed by #3432, if you need it before the next release please try building from source.

@bradphelan
Copy link
Author

Did you really get it to work with exclude? I'm actually surprised because in the last 5 min I've just tried doing it by manually editing d:\checkouts\foo\worktrees\wt2\.git\worktrees\wt2\info\exclude and it doesn't work. If I append the same line to the global d:\checkouts\foo\worktrees\wt2\.git\info\exclude then it does work.

@mark2185
Copy link
Collaborator

If I append the same line to the global d:\checkouts\foo\worktrees\wt2.git\info\exclude then it does work.

Judging by the code diff that's what exactly what we're doing, which I see now might not be entirely aligned with "worktree exclude".

There's this SO answer that mentions there isn't a info/exclude in the ./git/worktrees, and judging by your experiment, it could be that it's not supported by git itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants