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

Re: Complete http-pull; where should it go?

From
Daniel Barkalow <barkalow@iabervon.org>
Date
May 1, 2005, 23:46 UTC
Message-ID
<Pine.LNX.4.21.0505011923110.30848-100000@iabervon.org>
In-Reply-To
<Pine.LNX.4.58.0505011616230.22864@ppc970.osdl.org>
On Sun, 1 May 2005, Linus Torvalds wrote:
Show 14 quoted lines
> On Sun, 1 May 2005, Daniel Barkalow wrote:
> > 
> > I added a get_ref_sha1() that just does the .git/refs/ case; I think that
> > most things that want to accept various forms will also want to know what
> > form they got and do something with it, so get_sha1() isn't a big win.
> 
> I really really disagree.
> 
> For example, take something like "git-diff-cache". I think it's a big
> bonus if you can just write
> 
> 	git-diff-cache HEAD
> 
> and it will pick up the sha1 ID from .git/HEAD. 
True, but with -p, you'd probably want to give lines like

--- HEAD/Makefile +++ (cache)/Makefile

when it's not just hex (and "linus/Makefile" for heads/linus, not "heads/linus/Makefile", which would break things). I think it's generally best to call each of the things in the list to try and not only use the first one that understands, but also do program-specific special things depending on which one that was.

Show 10 quoted lines
> In general, I think a "get_sha1()" that tries as many user-friendly things 
> as possible is good for the command line. Within reason. I really don't 
> like the "try to autocomplete a partial sha1" thing, but I wouldn't at all 
> mind having various helpers like
> 
> 	git-diff-tree HEAD.p1 HEAD
> 
> where the ".p1" would just make it look up the first parent of the thing 
> in HEAD (which in turn would mean "look up the sha1 from the .git/HEAD 
> file".
Maybe :p1, to use characters that aren't frequently in filenames?
> Many of these are really easy to do, and I think most people would tend to 
> prefer having the choice.

I agree with that, but I'm not sure how useful having one function that just looks up the sha1 without further reporting is. In any case, it's an easy addition, and it's plausible that similar functions would work for any similar information needed.

	-Daniel
*This .sig left intentionally blank*
Previous: Linus TorvaldsNext: Linus Torvalds
Message 7 of 14 in “Complete http-pull; where should it go?”
  1. Daniel BarkalowMay 1, 2005
  2. Linus TorvaldsMay 1, 2005
  3. Daniel BarkalowMay 1, 2005
  4. Linus TorvaldsMay 1, 2005
  5. Daniel BarkalowMay 1, 2005
  6. Linus TorvaldsMay 1, 2005
  7. Daniel BarkalowMay 1, 2005
  8. Linus TorvaldsMay 1, 2005
  9. Junio C HamanoMay 2, 2005
  10. Linus TorvaldsMay 2, 2005
  11. Junio C HamanoMay 2, 2005
  12. Linus TorvaldsMay 2, 2005
  13. Daniel BarkalowMay 2, 2005
  14. Junio C HamanoMay 1, 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.