1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-15 21:53:44 +01:00
git/templates
Andy Parkins c47e6a43d3 update-hook: fix incorrect use of git-describe and sed for finding previous tag
Previously git-describe would output lines of the form
 v1.1.1-gf509d56
The update hook found the dash and stripped it off using
 sed 's/-g.*//'
The remainder was then used as the previous tag name.

However, git-describe has changed format.  The output is now of the form
 v1.1.1-23-gf509d56
The above sed fragment doesn't strip the middle "-23", and so the
previous tag name used would be "v1.1.1-23".  This is incorrect.

Since the hook script was written, git-describe now gained support for
"--abbrev=0", which it uses as a special flag to tell it not to output
anything other than the nearest tag name.  This patch fixes the problem,
and prevents any future recurrence by using this new flag rather than
sed to find the previous tag.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-14 09:14:51 -07:00
..
.gitignore
branches--
hooks--applypatch-msg
hooks--commit-msg hooks/commit-msg: add example to add Signed-off-by line to message 2006-12-26 12:25:34 -08:00
hooks--post-commit
hooks--post-update
hooks--pre-applypatch
hooks--pre-commit
hooks--pre-rebase
hooks--update update-hook: fix incorrect use of git-describe and sed for finding previous tag 2007-03-14 09:14:51 -07:00
info--exclude
Makefile Make 'make' quiet by default 2007-03-06 00:48:13 -08:00
this--description