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
Conversation
@@ -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" |
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.
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.
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.
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")
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.
Ah, this makes sense as an absolute min.
Aside from my one comment, 👍 |
🚢 |
/cc #1212