Re: [PATCH 1/9] lib/bpgit.py: make git describe --long optional

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

 



On Wed, May 22, 2013 at 5:02 AM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> Why not do:
>
>> -def describe(rev='HEAD', tree=None):
>> -    process = subprocess.Popen(['git', 'describe', '--always', '--long', rev],
>> +def describe(rev='HEAD', tree=None, get_long=False):
>> +    cmd = ['git', 'describe', '--always']
>> +
>> +    if (get_long):
>> +        cmd.append('--long')
>> +
>> +    cmd.append(rev)
>
> def describe(rev='HEAD', tree=None, extra_args=[]):
>     cmd = ['git', 'describe', '--always']
>     cmd.extend(extra_args)
>     if rev is not None:
>         cmd.append(rev)
>     process = ...
>
> that way you can do
>
> bpgit.describe(rev=None, extra_args=['--dirty'])
>
> or
>
> bpgit.describe(extra_args=['--long'])
>
>
> and don't need two different patches.

Although probably overkill for git describe given that I don't foresee
us adding more options I can see this being good practice for anything
else we'll add so sure, I'll make these changes.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux