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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to