-
Notifications
You must be signed in to change notification settings - Fork 386
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
Ignore Git LFS files #5480
base: main
Are you sure you want to change the base?
Ignore Git LFS files #5480
Conversation
* Check for `.gitattributes` files in subdirectories and also use them * Do not depend on running commands in the repo root anymore
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
||
```tom | ||
[git] | ||
ignore-lfs-files = -rue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore-lfs-files = -rue | |
ignore-lfs-files = true |
changes in these files, even if they are unchanged. You can configure `jj` to ignore these | ||
files by instructing it to parse the relevant `.gitattributes` files | ||
|
||
```tom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```tom | |
```toml |
InvalidPattern(String), | ||
} | ||
|
||
fn parse_gitattributes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a gix-attributes crate, probably it's better to use it?
Please adhere to the commit style guidelines outlined here: https://github.com/jj-vcs/jj/blob/main/docs/contributing.md#code-reviews |
I'm sorry, but it's unclear for me to which part of the guide lines you exactly refer and also how that interacts with this kind on commit structure with commits from several authors. For example I fear it's not possible to just squash contributions from other persons into my commits. |
I don't think matching the
For squashing others commits you can manually add the |
100%, please do! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial minor nits, also cc @yuja as he knows the matcher internals better and should give the final approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
@@ -1277,6 +1277,32 @@ to the current parents may contain changes from multiple commits. | |||
self.path_converter().parse_file_path(input) | |||
} | |||
|
|||
/// Parses the given strings as file patterns, convert it to a matcher and | |||
/// apply GIT LFS exclusions if requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Its Git LFS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: squash this into the first commit which successfully implements this.
Are you able to sign the CLA? |
I haven't reviewed the code, but I wonder if gitattributes could really be abstracted as a If the attributes patterns can be converted to a |
This PR adds support for ignoring files handled by git lfs.
jj
previously detected these files as changed as it expected the original file content before thegit lfs
checkout to be present. With this change it's possible to opt in (via thegit.ignore-lfs-files
setting) into just ignoring this files fromjj
. They then need to be manually handled via e.g. git if they are changed.From a technical point of view this change parses all
.gitattributes
files in the current repository and constructs a ignore list from that. This ignore list is then applied through all subcommands.This is still missing tests, as I'm really unsure what to test about and how to write these tests. I likely won't have the capacity to figure that out on my own, so I would appreciate if someone could point to the correct places.
Somewhat addresses #80
Checklist
If applicable:
CHANGELOG.md