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

Add support for checking if a path would be ignored #204

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Add support for checking if a path would be ignored #204

merged 1 commit into from
Jul 20, 2023

Conversation

richfitz
Copy link
Contributor

This PR adds support for libgit2's ignore parsing functions (https://libgit2.org/libgit2/#HEAD/group/ignore/git_ignore_path_is_ignored), to test if for a given repo a path would be ignored. This felt simple enough to implement before checking whether or not you'd be happy to support it - don't feel obliged to accept.

I've just reflected the C lib name here, as I think that's what you're mostly doing. This one does not really have a cli equivalent (you can get there with some options), so it might be worth renaming. Something like git_path_is_ignored would be snappier and avoid the unfortunate spacing issues in init.c.

My use case, in case you're curious, is that people use .gitignore files to indicate "generated" files quite often, so if we have access to files that are marked this way we can clean them out of source trees more easily within our workflow tooling.

@jeroen jeroen merged commit 0e805a9 into r-lib:main Jul 20, 2023
7 checks passed
@jeroen
Copy link
Member

jeroen commented Jul 20, 2023

Thanks!

@jeroen
Copy link
Member

jeroen commented Jul 20, 2023

I'm not sure we can do a CRAN update very soon-ish, but binaries are available from https://ropensci.r-universe.dev/gert

@richfitz
Copy link
Contributor Author

No rush on my side, thanks for this. One potential issue though is that your version number 1.9000 is ahead of both cran and the likely next cran release - did you miss a minor version number in between?

@jeroen
Copy link
Member

jeroen commented Jul 20, 2023

I anticipate that the next release will be 2.0 because of some breaking changes at least on Windows, caused by the upgrade of libgit2 (see the NEWS file).

@richfitz
Copy link
Contributor Author

Ah, that makes total sense. I'll use >= 1.9000 then and all should work well

@jeroen
Copy link
Member

jeroen commented Aug 7, 2023

I did a patch release for CRAN and included this commit in gert 1.9.3.

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