Skip to content

Add include/exclude config options & params to fetch - #573

Merged
technoweenie merged 5 commits into
git-lfs:masterfrom
sinbad:fetch-include-exclude
Aug 17, 2015
Merged

technoweenie merged 5 commits into
git-lfs:masterfrom
sinbad:fetch-include-exclude

Conversation

@sinbad

@sinbad sinbad commented Aug 10, 2015

Copy link
Copy Markdown
Contributor

Note: don't merge until we've resolved #564.

Added lfs.fetchinclude and lfs.fetchexclude config options and --include and --exclude command line args to fetch. These cause certain paths to either be included or excluded when fetching binaries so that people who work in specific subfolders and don't want to waste time or disk space fetching irrelevant things can do so. This is most common in teams using a single shared repo for all assets but where not everyone needs all of them, e.g. only texture artists might need the original .psd files vs exported runtime equivalents, only modellers/animators might need the original .max files etc. Some teams have a more complex pipeline which avoids this but for those that don't wanting to download by subfolder is quite common. I expect the config option variants to be most used, --include/--exclude args to fetch are there for special occasions.

This affects the behaviour of fetch, pull and smudge since in all cases the download argument to PointerSmudge is set based on whether it matches include/exclude filters.

There is a later knock-on effect on push though because it means a user won't have all oids for a given commit. Right now that will cause push to fail later if the commits in question get included in the scan for pushing a new branch. This is another case of #564, which needs to be addressed before this can be merged.

sinbad added 4 commits August 10, 2015 17:00
These include or exclude lists of paths (matching as per gitignore) in
the fetch to optimise downloading.
…n arg

If we close down the update-index process without having given it any
args in stdin, then it applies to the whole working copy and has unwanted
side effects e.g. calling clean/smudge filters.
@sinbad

sinbad commented Aug 12, 2015

Copy link
Copy Markdown
Contributor Author

This PR is safe to merge after #581

Comment thread commands/commands.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it make sense to initialize the array with a capacity based on the number of commas in the strings? Not sure this matters much though. Probably best to keep the code simpler :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I figured the likelihood of having enough separate entries to warrant this was quite small.

@technoweenie

Copy link
Copy Markdown
Contributor

I think this PR looks good 👍 A couple things come to mind that won't necessarily block this PR:

As a user, I don't think this documentation is sufficient to show me how this works. What kinds of file paths can I use? Well, I know based on these tests. How should the docs describe this? A man page? Or a link to something in ./docs from the man pages?

Related to that, is there a way to get some visibility into what this is doing? If I have some include/exclude properties set without knowing it, the fetch/pull commands may behave unexpectedly. Any thoughts on how we could show what files, if any, are skipped to lfs users?

@rubyist

rubyist commented Aug 17, 2015

Copy link
Copy Markdown
Contributor

👍, agree on some more documentation

technoweenie added a commit that referenced this pull request Aug 17, 2015
Add include/exclude config options & params to fetch
@technoweenie
technoweenie merged commit 0f63d9b into git-lfs:master Aug 17, 2015
@sinbad

sinbad commented Aug 18, 2015

Copy link
Copy Markdown
Contributor Author

The matching/wildcard rules are the same as gitignore (deliberately so); I'm updating the docs for my next PR anyway so I've included some explicit examples: sinbad@e7e150c

@sinbad
sinbad deleted the fetch-include-exclude branch August 18, 2015 09:26
@technoweenie

Copy link
Copy Markdown
Contributor

@sinbad: That's perfect 👍

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.

File Cannot Be Found error

3 participants