fedora-git-commit-mail-hook: Fix command for finding previous tag

Todd Zullinger tmz at pobox.com
Mon Jun 22 15:25:54 UTC 2009


I wrote:
>  configs/system/fedora-git-commit-mail-hook |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> New commits:
> commit 226e06441f2fab7c7c52609834e86c236910e963
> Author: Todd Zullinger <tmz at pobox.com>
> Date:   Sun Jun 21 03:34:20 2009 +0000
>
>     fedora-git-commit-mail-hook: Fix command for finding previous tag
>
>     The spacewalk maintainers reported problems when pushing tags[1].  The
>     root of the problem appears to be in determining the previous tag,
>     which used 'git describe' piped to sed.  The sed call is better
>     replaced with the --abbrev=0 option to 'git describe' and should
>     correct the problems noted by the spacewalk maintainers.
>
>     This fix was made to the upstream update hook in c47e6a4[2], and was
>     required because the format of git describe changed.
>
>     It is worth noting that the upstream update hook has been completely
>     re-worked.  Email notification has been removed from the update
>     hook[3] and implemented in the post-receive hook[4].

I think we may want to look at converting from our use of the update
hook to the post-receive hook for sending commit notifications.
Upstream moved the mail notification bits from the update hook to a
new post-receive hook only a few weeks after Jeremy added the initial
fedora-git-commit-mail-hook.  So what we're running now isn't
something which will receive any attention or bug fixes from upstream,
unfortunately.  The reasoning for upstream moving mail notification is
stated in the the commit message for 46d409d:

     The update hook's only job is to decide is a particular update
     is allowed or not.  It was not the right place to send out
     update notification e-mails from to begin with, as the final
     stage of updating refs can fail after this hook runs.

>     [1] https://fedorahosted.org/fedora-infrastructure/ticket/1362
>     [2] http://git.kernel.org/?p=git/git.git;a=commitdiff;h=c47e6a4
>     [3] http://git.kernel.org/?p=git/git.git;a=commitdiff;h=46d409d
>     [4] http://git.kernel.org/?p=git/git.git;a=commitdiff;h=4557e0d
>
> diff --git a/configs/system/fedora-git-commit-mail-hook b/configs/system/fedora-git-commit-mail-hook
> index 85359ca..e80a461 100644
> --- a/configs/system/fedora-git-commit-mail-hook
> +++ b/configs/system/fedora-git-commit-mail-hook
> @@ -82,7 +82,7 @@ then
>  			git cat-file tag $3 | sed -n '5,$p'
>  			echo
>  		fi
> -		prev=$(git describe "$3^" | sed 's/-g.*//')
> +		prev=$(git describe --abbrev=0 "$3^")
>  		# the first tag in a repo will yield no $prev
>  		if [ -z "$prev" ]; then
>  			echo "Changes since the dawn of time:"

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The man who is a pessimist before forty-eight knows too much; the man
who is an optimist after forty-eight knows too little.
    -- Mark Twain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-infrastructure-list/attachments/20090622/4bf3c0e3/attachment.sig>


More information about the Fedora-infrastructure-list mailing list