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

[PATCH 0/5] Custom extended SHA-1 syntax

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Dec 24, 2010, 14:07 UTC
Message-ID
<1293199669-19016-1-git-send-email-pclouds@gmail.com>
Merry Christmas!

This series introduces two new syntax: @{~foo} and ^{~foo}. Both syntax allow an external program to run and return the result. So users can extend the ref/sha1 syntax as they want. External commands are defined similar to aliases in config.

The former does ref->ref mapping. The latter does SHA-1->SHA-1 mapping. Both allow @{} and ^{} in the result respectively, so you can make a chain of mapping (*). This should allow Kevin to add "search the n-th commit that matches 'foo'" syntax.

I think this is something nice to have. For one thing, commonly used mappings can be collected in config file and distributed. Shell requirements can be loosened because you don't need shell backquotes (OK I'm always on a shell so this is moot, but an IDE, maybe).

OK time for movies..

(*) They can also make infinite chain. I don't think I can stop them from doing that.

Nguyễn Thái Ngọc Duy (5):
  alias: add functions to do param substitution and alias running
  get_sha1: allow custom SHA-1 mapping with $SHA1^{~alias} syntax
  sha1_name: move interpret_nth_prior_checkout closer to
    interpret_branch_name
  interpret_branch_name: takes @{u} code out and reorder the function
  get_sha1: allow custom ref mapping with $ref@{~alias} syntax
 Documentation/config.txt    |   18 +++
 Documentation/revisions.txt |   12 ++
 alias.c                     |  167 ++++++++++++++++++++++-
 cache.h                     |   13 ++
 sha1_name.c                 |  321 ++++++++++++++++++++++++++++++++----------
 t/t1511-rev-parse-caret.sh  |   45 ++++++
 t/t1512-rev-parse-at.sh     |   63 +++++++++
 7 files changed, 557 insertions(+), 82 deletions(-)
 create mode 100755 t/t1512-rev-parse-at.sh
-- 
1.7.3.3.476.g10a82
Next: Nguyễn Thái Ngọc Duy
Message 1 of 6 in “Custom extended SHA-1 syntax”
  1. 0/5 Custom extended SHA-1 syntaxNguyễn Thái Ngọc Duy, Dec 24, 2010
  2. 1/5 alias: add functions to do param substitution and alias runningNguyễn Thái Ngọc Duy, Dec 24, 2010
  3. 2/5 get_sha1: allow custom SHA-1 mapping with $SHA1^{~alias} syntaxNguyễn Thái Ngọc Duy, Dec 24, 2010
  4. 3/5 sha1_name: move interpret_nth_prior_checkout closer to interpret_branch_nameNguyễn Thái Ngọc Duy, Dec 24, 2010
  5. 4/5 interpret_branch_name: takes @{u} code out and reorder the functionNguyễn Thái Ngọc Duy, Dec 24, 2010
  6. 5/5 get_sha1: allow custom ref mapping with $ref@{~alias} syntaxNguyễn Thái Ngọc Duy, Dec 24, 2010

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.