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

check the git version is ok in some key commands #1461

Merged
merged 4 commits into from Aug 18, 2016

Conversation

technoweenie
Copy link
Contributor

/cc #1212

@@ -334,6 +334,18 @@ func isCommandEnabled(cfg *config.Configuration, cmd string) bool {
return cfg.Os.Bool(fmt.Sprintf("GITLFS%sENABLED", strings.ToUpper(cmd)), false)
}

func requireGitVersion() {
minimumGit := "1.8.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be worth elevating this to a method argument, and having a const in the commands package.

This would allow us to easily require different versions of Git for different commands, but I'm not sure that's behavior we need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the absolute minimum requirement for Git LFS to run safely. We can add a const if something else needs this specific value, but nothing does right now. Other bits in the codebase that check the git version already use IsGitVersionAtLeast():

$ ack IsGitVersionAtLeast
commands/command_clone.go
89:     if !git.Config.IsGitVersionAtLeast("2.9.0") {

git/git.go
406:func (c *gitConfig) IsGitVersionAtLeast(ver string) bool {
790:    if !Config.IsGitVersionAtLeast("2.8.0") {

git/git_test.go
205:    if !Config.IsGitVersionAtLeast("2.5.0") {

lfs/hook.go
41:     customHooksSupported := git.Config.IsGitVersionAtLeast("2.9.0")

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, this makes sense as an absolute min.

@ttaylorr
Copy link
Contributor

Aside from my one comment, 👍

@ttaylorr
Copy link
Contributor

ttaylorr commented Aug 18, 2016

🚢

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.

None yet

2 participants