bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fatal: ambiguous message


From: Eric Blake
Subject: Re: fatal: ambiguous message
Date: Mon, 03 Jan 2011 11:58:07 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 01/03/2011 11:37 AM, Jim Meyering wrote:
>> I'll probably end up writing yet a third approach, which collects git
>> rev-list output into a temporary variable in order to correctly detect
>> failures, without refactoring into a helper function.
> 
> Thanks for forwarding that here.
> Here's a lightly tested patch to do what you suggest.
> I tried to keep it minimal, since what we're doing here
> is solely to accommodate very old versions of git.

You beat me to it, but your approach matches my thoughts.

> @@ -122,8 +122,12 @@ then
>           # result is the same as if we were using the newer version
>           # of git describe.
>           vtag=`echo "$v" | sed 's/-.*//'`
> -         numcommits=`git rev-list "$vtag"..HEAD | wc -l`
> +         commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
> +             || { commit_list=failed;
> +                  echo "$0: WARNING: git rev-list failed" 1>&2; }
> +         numcommits=`echo "$commit_list" | wc -l`
>           v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
> +         test "$commit_list" = failed && v=UNKNOWN

I like it.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]