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

gitignore: fix prefix handling when chaining .gitignore in sub directory #3131

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Feb 24, 2024

#3126

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

yuja added 3 commits February 24, 2024 14:57
…erns

With the current implementation, the file3 pattern is set to the prefix
"foo/foo/bar". I don't know if (unrooted) "baz" prefixed with "foo/foo/bar"
should match "foo/bar/baz", but apparently it is. Anyway, that wouldn't be
the case in practice because adjacent .gitignore files shouldn't be loaded.
The prefix is relative to the root, not to the parent .gitignore file.

Fixes jj-vcs#3126
This partially reverts changes in a9f489c "Switch to ignore crate for
gitignore handling." Since child ignore object no longer needs to access the
root to resolve the prefix path, it's simpler to store a matcher per node.
@yuja yuja force-pushed the push-wxxxqnsulyun branch from de1c462 to ca29791 Compare February 24, 2024 06:47
Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@yuja yuja enabled auto-merge (rebase) February 24, 2024 06:54
@yuja yuja merged commit a67aa08 into jj-vcs:main Feb 24, 2024
15 checks passed
@yuja yuja deleted the push-wxxxqnsulyun branch February 24, 2024 06:55
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 this pull request may close these issues.

2 participants