fix(discover): honor .git/info/exclude and core.excludesFile in linked worktrees#695
Open
lg320531124 wants to merge 1 commit into
Open
fix(discover): honor .git/info/exclude and core.excludesFile in linked worktrees#695lg320531124 wants to merge 1 commit into
lg320531124 wants to merge 1 commit into
Conversation
f5140e8 to
1702afa
Compare
Owner
|
Huge thanks for opening this PR and for the work you put into it. The maintainer shop is currently full, so this may sit for a bit before it gets a proper review. We will come back to this as soon as possible with real feedback; I wanted to make sure it did not sit unacknowledged in the meantime. |
1702afa to
2333563
Compare
Owner
|
Thanks, this looks focused. Before merge, please rewrite the commit metadata to remove generated/co-author/session attribution. DCO otherwise appears to be present on the non-merge commit. |
…d worktrees Linked git worktrees have a .git *file* (not directory) containing 'gitdir: <path>' pointing to the worktree-specific git directory. The previous code checked S_ISDIR on .git, which returned false for worktrees, skipping all exclude/config resolution. Add resolve_git_dir_from_dotgit_file() to parse the gitdir: pointer and resolve the actual git directory. Use the resolved path for info/exclude and config lookups, making worktree exclude rules work identically to regular repos. Fixes DeusData#689 Signed-off-by: lg320531124 <lg320531124@users.noreply.github.com>
2333563 to
5d7315a
Compare
Author
|
Done — rewrote the commit metadata to drop the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Linked git worktrees have a
.gitfile (not directory) containinggitdir: <path>pointing to the worktree-specific git directory under the main repo's.git/worktrees/<name>/. The discover module checkedS_ISDIRon.git, which returnedfalsefor worktrees, causing two issues:.git/info/excludenot honored — per-repo local exclude rules were skippedcore.excludesFilenot evaluated — git config check also used wrong pathWhy This Change Was Made
Added
resolve_git_dir_from_dotgit_file()to parse thegitdir:pointer and resolve the actual git directory. Bothinfo/excludeandconfiglookups now use the resolved path.Evidence
local_only.txt(ininfo/exclude) was indexedmain.cindexedFixes #689