KEMBAR78
Add `--skip-repo` option to `git lfs install` & use in tests by sinbad · Pull Request #1868 · git-lfs/git-lfs · GitHub
Skip to content

Conversation

sinbad
Copy link
Contributor

@sinbad sinbad commented Jan 16, 2017

It's bugged me for a while that the integration tests keep creating the pre-push hook in my local git-lfs working copy repo whenever I run them; it gets much worse when you factor in the new hooks we're starting to add. This happens even if you use GIT_LFS_TEST_DIR, if you run the tests from within the working copy.

Seems useful to have a --skip-repo option in git lfs install which skips the local repo changes, for when you just want to install filters. This is how our tests need to use it.

I could have just made the tests cd to a non-repo folder instead but being explicit seems better.

Useful for avoiding unintended side effects when just wanting to install
filters
Previously running any tests inside the `git-lfs` repo would create
hooks which was undesirable (regardless of whether you use
GIT_LFS_TEST_DIR or not). Gets worse the more hooks we add.
Copy link
Contributor

@ttaylorr ttaylorr left a comment

Choose a reason for hiding this comment

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

The code looks good, and this is definitely a useful thing to have 👍

Before merging, I think we should talk about the name --skip-repo. It's awesome that it's documented in the manpage entry, but without consulting that first, I'm not immediately sure on what that flag means. What do you think about keeping a similar convention with the --skip-smudge flag and naming this new flag: --skip-all?

@sinbad
Copy link
Contributor Author

sinbad commented Jan 18, 2017

Names are hard 😄

I don't really like --skip-all because that sounds like it would do nothing, when we're still installing the filters. I had considered options like --filters-only but wanted to use --skip-something since that was already an established convention. I thought about --skip-local but that overlaps too much with the --local option. My other primary option was --skip-hooks, but I considered that what you really wanted was to leave the repo alone entirely, which includes not creating any new folders in .git/lfs etc. Hence --skip-repo was the best I could come up with :/

Copy link
Contributor

@ttaylorr ttaylorr left a comment

Choose a reason for hiding this comment

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

Works for me, thanks for the detailed explanation 👍

@sinbad sinbad merged commit 05f7617 into master Jan 19, 2017
@sinbad sinbad deleted the install-skip-repo branch January 19, 2017 11:41
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