author | Andy Parkins <andyparkins@gmail.com> | |
Wed, 14 Mar 2007 14:25:52 +0000 (14:25 +0000) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Mar 2007 16:14:51 +0000 (09:14 -0700) | ||
commit | c47e6a43d30c8a1fd4b8e9234883f01fe3bac805 | |
tree | 66ee8e434260ae578fefce4f2ce566e02e767a11 | tree | snapshot |
parent | c49b260e99d3e0fdd5d84615091ebb969adef5b2 | commit | diff |
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>
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>
templates/hooks--update | diff | blob | history |