git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Karl Hasselström <kha@treskal.com>
Date
Jul 14, 2008, 06:58 UTC
Message-ID
<20080714065814.GF20751@diana.vm.bytemark.co.uk>
In-Reply-To
<20080713114035.18845.45056.stgit@localhost.localdomain>
On 2008-07-13 12:40:35 +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 ^{...}.

You changed it, so s/The former format allows/You may append/ or something.

> +    # The stack base
> +    if patch.startswith('{base}'):
> +        base_id = repository.get_stack(branch).base.sha1
> +        return repository.rev_parse(base_id + patch[6:])

We have a strip_prefix() function precisely so that we can avoid error-prone and not-so-easy-to-read constants like that "6" ...

Hmm. I see that I feel strongly enough about this that I've defined no less than two identical functions in utils.py to do this job: strip_prefix() and strip_leading(). :-)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Catalin Marinas
Message 7 of 17 in “Proposed patches”
  1. 0/4 Proposed patchesCatalin Marinas, Jul 13, 2008
  2. 1/4 Allow e-mails to be sent with the Unix sendmail toolCatalin Marinas, Jul 13, 2008
  3. Mark BrownJul 15, 2008
  4. Karl HasselströmJul 15, 2008
  5. Catalin MarinasJul 15, 2008
  6. 2/4 Implement a new patch identification scheme and id commandCatalin Marinas, Jul 13, 2008
  7. Karl HasselströmJul 14, 2008
  8. 3/4 Convert git_id() to the new id formatCatalin Marinas, Jul 13, 2008
  9. Karl HasselströmJul 14, 2008
  10. Catalin MarinasAug 21, 2008
  11. Fix some remaining old-style stg id callsKarl Hasselström, Jul 25, 2008
  12. Catalin MarinasJul 27, 2008
  13. 4/4 Remove the applied/unapplied commandsCatalin Marinas, Jul 13, 2008
  14. Catalin MarinasJul 13, 2008
  15. Lukas SandströmJul 13, 2008
  16. Catalin MarinasJul 13, 2008
  17. Karl HasselströmJul 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.