]> git.ipfire.org Git - thirdparty/git.git/commit - GIT-VERSION-GEN
GIT-VERSION-GEN: do not force abbreviation length used by 'describe'
authorRamsay Jones <ramsay@ramsayjones.plus.com>
Sun, 4 Dec 2016 20:45:59 +0000 (20:45 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Dec 2016 18:08:31 +0000 (10:08 -0800)
commita7659747c2eeb0c601ced321446da92149310cd0
tree5e2a4fee0783b03ba6a728c91f5c77af6e6b56fa
parent8d7a455ed52e2a96debc080dfc011b6bb00db5d2
GIT-VERSION-GEN: do not force abbreviation length used by 'describe'

The default version name for a Git binary is computed by running
"git describe" on the commit the binary is made out of, basing on a
tag whose name matches "v[0-9]*", e.g. v2.11.0-rc2-2-g7f1dc9.

In the very early days, with 9b88fcef7d ("Makefile: use git-describe
to mark the git version.", 2005-12-27), we used "--abbrev=4" to get
absolute minimum number of abbreviated commit object name.  This was
later changed to match the default minimum of 7 with bf505158d0
("Git 1.7.10.1", 2012-05-01).

These days, the "default minimum" scales automatically depending on
the size of the repository, and there is no point in specifying a
particular abbreviation length; all we wanted since Git 1.7.10.1
days was to get "something reasonable we would use by default".

Just drop "--abbrev=<number>" from the invocation of "git describe"
and let the command pick what it thinks is appropriate, taking the
end user's configuration and the repository contents into account.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
GIT-VERSION-GEN