From db8954659180bcf524012107256bd2e2af0da2de Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 24 Oct 2018 20:35:28 -0700 Subject: [PATCH] Use a fixed abbreviation size in `git describe` output Currently, this setting depends on whatever the user of `godep` has in their `git config --get core.abbrev`, if it is set. Even when it is not set, the number of characters used in the shortened git commit will depend on whether there are collisions for that prefix on the local repository (which in large part depends on how much activity exists there.) As a result, when multiple users are maintaining Godeps/ for a single project, many spurious changes to Godeps/Godeps.json are generated due to the lack of stability in the length of the abbreviated commit in output of `git describe`. Let's fix this by enforcing a reasonable abbreviation length in godep's use of `git describe`. 14 characters is very unlikely to result in collisions for prefixes. --- third_party/forked/godep/vcs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/forked/godep/vcs.go b/third_party/forked/godep/vcs.go index 4d69b1a29ee44..83034f2761737 100644 --- a/third_party/forked/godep/vcs.go +++ b/third_party/forked/godep/vcs.go @@ -40,7 +40,7 @@ var vcsGit = &VCS{ vcs: vcs.ByCmd("git"), IdentifyCmd: "rev-parse HEAD", - DescribeCmd: "describe --tags", + DescribeCmd: "describe --tags --abbrev=14", DiffCmd: "diff {rev}", ListCmd: "ls-files --full-name", RootCmd: "rev-parse --show-cdup",