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

ls-files: add support for reference range #3764

Merged
merged 1 commit into from
Aug 9, 2019

Conversation

dvdveer
Copy link
Contributor

@dvdveer dvdveer commented Aug 9, 2019

Add an option to the ls-files command where the user can specify a commit range. This will return all the lfs files which changed between those two commits.

This change is based on the aborted pull request #3151 by @larsxschneider. I finished implementation and added unit tests and documentation.

As background information, the reason for this option is that I have a script that creates a git bundle. To workaround the missing bundle support in lfs (see #1755), I want to know which lfs objects were changed/created in the commit range of the bundle. Currently, in the script, I walk over all commits in the range and do a compare of the ls-files output. This is very slow however, so if ls-files has support for a commit range that would help me a lot.

Copy link
Member

@bk2204 bk2204 left a comment

Choose a reason for hiding this comment

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

Welcome to Git LFS! This looks good overall. I had just one suggestion for the documentation so that it's a bit clearer what the behavior is with deletions.


## DESCRIPTION

Display paths of Git LFS files that are found in the tree at the given
reference. If no reference is given, scan the currently checked-out branch.
If two references are given, the LFS files that are modified between the two
references are shown.
Copy link
Member

Choose a reason for hiding this comment

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

It looks like your test checks that we don't print deletions. That's fine, but we probably want to mention it here, since Git considers a deletion to be a modification. Maybe add a semicolon and “deletions are not listed”?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! What do you prefer, that I create a new commit or amend the original commit?

Copy link
Member

Choose a reason for hiding this comment

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

If you could amend the original commit, that would be great.

Teach the ls-files command to show the modified LFS files in
a specified commit range.
Copy link
Member

@bk2204 bk2204 left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks!

@bk2204 bk2204 merged commit aa83314 into git-lfs:master Aug 9, 2019
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