[OE-core] [PATCH] kernel-yocto: Inspect remote branches with git ls-remote

Bruce Ashfield bruce.ashfield at gmail.com
Wed Mar 5 20:06:37 UTC 2014


On Wed, Mar 5, 2014 at 2:53 PM, Chris Larson <clarson at kergoth.com> wrote:
>
> On Wed, Mar 5, 2014 at 10:47 AM, Richard Purdie
> <richard.purdie at linuxfoundation.org> wrote:
>>
>> On Wed, 2014-03-05 at 16:49 +0000, Matt Fleming wrote:
>> > From: Matt Fleming <matt.fleming at intel.com>
>> >
>> > 'git branch' may use ANSI escape codes in its output (to provide colour)
>> > which doesn't play well with commands expecting pure plain text, e.g.
>> >
>> >     fatal: '^[[31mmaster^[[m' is not a valid branch name.
>> >
>> > Furthermore, the output of 'git branch' is subject to change and trying
>> > to parse it could potentially lead to breakage in the future.
>> >
>> > Signed-off-by: Matt Fleming <matt.fleming at intel.com>
>> > ---
>> >  meta/classes/kernel-yocto.bbclass | 10 +++++-----
>> >  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> My worry with this change is that it will cause the system to hit the
>> network. We specifically support builds from archives of the
>> repositories so I'd worry about using ls-remote like this :/.
>
>
> What about git for-each-ref? If we just need a list of refs, that's what
> for-each-ref is ideal for.

Good suggestion, that can definitely work. With the format, it saves the
awkward awking and cutting :

I've used this in the past:

   git for-each-ref --shell --format="%(refname)"  refs/heads/ refs/remotes

The minimum footprint change is still just --no-color, that way we don't change
just for the sake of changing.

Cheers,

Bruce


> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"



More information about the Openembedded-core mailing list