coreutils
[Top][All Lists]
Advanced

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

Re: [coreutils] Re: new branch in gnulib: coreutils-8.9


From: Eric Blake
Subject: Re: [coreutils] Re: new branch in gnulib: coreutils-8.9
Date: Tue, 04 Jan 2011 15:01:25 -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/04/2011 02:29 PM, Eric Blake wrote:
>> +# Just before tagging a release, ensure that the gnulib submodule
>> +# commit we're using is public.
>> +alpha beta stable: gnulib-commit-check
>> +.PHONY: gnulib-commit-check
>> +gnulib-commit-check:
>> +    submod=gnulib; \
>> +    st=$$(git submodule status $$submod) || exit 1; \
>> +    commit=$$(echo $$st | awk '{ print $$1 }') || exit 1; \
>> +    wget -q -O /dev/null \
>> +      "http://git.savannah.gnu.org/gitweb/?p=$$submod.git;a=tree;h=$$commit";
> 
> I'm trying to come up with some
> git submodule foreach 'command $sha1'
> formula that will allow you to make the same check without having to
> resort to wget or even to hardcoding the URL of each upstream repository.

Found one, and it even works on libvirt (where the gnulib submodule is
named .gnulib instead of gnulib).  It should also work on a repository
with multiple submodules, although I have not yet tested it on bison.git.

gnulib-commit-check:
        git submodule foreach test '$$(git merge-base --independent \
          origin $$sha1 | wc -w)' = 1

This effectively runs the shell command:

git merge-base --independent origin $sha1

with $sha1 set to the value recorded in the superproject (identical to
your computation of $commit), and outputs the minimal set of revisions
not reachable from any other in the set of arguments.  If origin
contains $sha1, the output is a single hash (it happens to be that of
origin); if $sha1 is a local-only revision, the output is two hashes, so
the test fails, which in turn lets 'make alpha' fail.

No need for wget, awk, or a hardcoded URL :)

-- 
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]