From: Jonathan Nieder Date: Tue, 11 May 2010 23:05:42 GMT Subject: Re: [RFC PATCH] GIT-VERSION-GEN: restrict tags used Message-ID: <20100511230542.GC31163@progeny.tock> In-Reply-To: <20100511230100.GB31163@progeny.tock> Jonathan Nieder wrote: > Tay Ray Chuan wrote: >> since git's tags for git-core (ie. excluding git-gui) >> are all of the form "vX.Y...". > > git gui’s too, now. Aggh --- sent early, there. Here is what I meant to say. Shawn, this helps avoid any stray (annotated) tags the user may have made, following Tay’s example. Signed-off-by: Jonathan Nieder --- diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index b3f937e..d6a6601 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -13,7 +13,7 @@ tree_search () for p in $(git rev-list --parents --max-count=1 $head 2>/dev/null) do test $tree = $(git rev-parse $p^{tree} 2>/dev/null) && - vn=$(git describe --abbrev=4 $p 2>/dev/null) && + vn=$(git describe --match=gitgui-[0-9]* --abbrev=4 $p 2>/dev/null) && case "$vn" in gitgui-[0-9]*) echo $vn; break;; esac --