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: remove FIXME comment about passing path #5118

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

scott2000
Copy link
Collaborator

I looked through the code for the ignore crate, and this optional path is not used anywhere. The only reason to pass it would be to be able to get the path from the Glob when we call Gitignore::matched or Gitignore::matched_path_or_any_parents, but we ignore the returned Glob completely anyway. Passing the path would require an unnecessary clone of the path for each line in every .gitignore file, so it's better not to pass it since we don't need it.

#5113 (comment)

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

Copy link
Collaborator

@yuja yuja left a comment

Choose a reason for hiding this comment

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

Thanks!

lib/src/gitignore.rs Show resolved Hide resolved
I looked through the code for the `ignore` crate, and this optional path
is not used anywhere. The only reason to pass it would be to be able to
get the path from the `Glob` when we call `Gitignore::matched` or
`Gitignore::matched_path_or_any_parents`, but we ignore the returned
`Glob` completely anyway. Passing the path would require an unnecessary
clone of the path for each line in every .gitignore file, so it's better
not to pass it since we don't need it.
@scott2000 scott2000 force-pushed the remove-gitignore-fixme branch from 17ed544 to 0066441 Compare December 17, 2024 02:35
@scott2000 scott2000 merged commit d75cc94 into jj-vcs:main Dec 17, 2024
18 checks passed
@scott2000 scott2000 deleted the remove-gitignore-fixme branch December 17, 2024 03:02
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