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

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

 



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.

johannes

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