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

Re: PATCH: Allow tree-id to return the ID of a tree object

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 27, 2005, 23:22 UTC
Message-ID
<20050427232223.GM22956@pasky.ji.cz>
In-Reply-To
<426FBBE7.1090806@mindspring.com>

Dear diary, on Wed, Apr 27, 2005 at 06:20:55PM CEST, I got a letter where Philip Pokorny <ppokorny@mindspring.com> told me that...

Show 28 quoted lines
> While playing with cg-ls, I tried:
> 
> % cg-ls
> ... snip ...
> 100644  blob    bc607fd55f6ce4e56ce87766369b5d4d55ec79af        object.h
> 100755  blob    f35877a6aa5b68d2fb4a388dcfa9b3e64262604e        parent-id
> 040000  tree    bfb75011c32589b282dd9c86621dadb0f0bb3866        ppc
> 100644  blob    d922305ee0f5583bdfcb629f6d4061e11e0fa859        read-cache.c
> 100644  blob    1ad7ffc555b635fe57fa7834b12d71ff576be065        read-tree.c
> ... snip ...
> % cg-ls bfb75011c32589b282dd9c86621dadb0f0bb3866       <-- the ppc tree ID
> Invalid id: bfb75011c32589b282dd9c86621dadb0f0bb3866
> usage: cat-file [-t | tagname] <sha1>
> usage: cat-file [-t | tagname] <sha1>
> Invalid id:
> 
> 
> Shouldn't cg-ls give a listing of a sub-tree?  The cg-help says it takes
> a TREE-ID?
> 
> The problem seems to be that tree-id really only accepts a commit-id and
> returns the TREE-ID of that commit.
> 
> So I modified commit-id, tree-id and parent-id to make them more similar
> in coding style, force "short-id" names to be at least 4 lower case
> letters, and have tree-id accept short, unambiguous ID's and bare SHA1-ID's.
> 
> Patch attached.
Could you please functionally split and sign off your patch?

Also, I'd prefer not to have the sha1 completion logic duplicated; what about just having commit-id take a parameter not to validate its id? Actually, that's ugly too. I think the cleanest solution would be to reintroduce the cg-Xnormid, now to only really do the _common_ stuff - basically everything up to the typecheck (exclusively) in commit-id.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Philip PokornyNext: Philip Pokorny
Message 2 of 8 in “PATCH: Allow tree-id to return the ID of a tree object”
  1. Philip PokornyApr 27, 2005
  2. Petr BaudisApr 27, 2005
  3. Philip PokornyApr 28, 2005
  4. Philip PokornyApr 28, 2005
  5. Philip PokornyApr 28, 2005
  6. Philip PokornyMay 2, 2005
  7. Philip PokornyApr 28, 2005
  8. Philip PokornyApr 28, 2005

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.