Re: [StGIT PATCH 2/4] Implement a new patch identification scheme and id command

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

 



On 2008-06-19 22:42:10 +0100, Catalin Marinas wrote:

> The new scheme allows '[<branch>:]<patch>' and '[<branch>:]{base}'
> (the latter showing the base of a stack). The former format allows
> symbols like ^ and ^{...}.

Hmm. Why only the former? Supporting it for the latter should be easy.
(Though it would take some extra work, I guess.)

Other than that, it looks good to me.

> +def git_commit(name, repository, branch = None):
> +    """Return the a Commit object if 'name' is a patch name or Git commit.
> +    The patch names allowed are in the form '<branch>:<patch>' and can be
> +    followed by standard symbols used by git-rev-parse. If <patch> is '{base}',

Long line.

> +    # The stack base
> +    if patch == '{base}':
> +        return repository.get_stack(branch).base

Should be a simple matter of

  if patch.startswith('{base}'):
      foo = repository.get_stack(branch).base + drop_prefix(patch, '{base}')
      return repository.rev_parse(foo)

or something.

-- 
Karl Hasselström, kha@xxxxxxxxxxx
      www.treskal.com/kalle
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux