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

Re: [BUG] in rev-parse

From
Jeff King <peff@peff.net>
Date
Dec 17, 2011, 12:02 UTC
Message-ID
<20111217120210.GB31152@sigill.intra.peff.net>
In-Reply-To
<4EEA7A7E.4070109@alum.mit.edu>
On Thu, Dec 15, 2011 at 11:53:50PM +0100, Michael Haggerty wrote:
Show 6 quoted lines
> I believe that the OP was more inconvenienced that "git rev-parse
> --short" chokes on multiple objects than by the fact that it insists
> that the objects exist.  (And shortening the SHA1s of non-existent
> objects doesn't sound very useful anyway.)  So I think that a useful
> compromise would be for "git rev-parse --short" to accept multiple args
> but continue to insist that each of the args is a valid object.

Part of the guarantee of "--verify" is that it returns a single object. I don't know how many callers rely on "--short" implying "--verify" implying a single object.

I agree in practice it would probably be an OK change, and it's very easy to do. I just don't think it's an important enough problem to worry about, given the available workaround. But if you want to write the patch, be my guest. :)

-Peff
Previous: Michael Haggerty
Message 7 of 7 in “[BUG] in rev-parse”
  1. nathan.panike@gmail.comDec 14, 2011
  2. Jeff KingDec 14, 2011
  3. Junio C HamanoDec 15, 2011
  4. Jeff KingDec 15, 2011
  5. Junio C HamanoDec 15, 2011
  6. Michael HaggertyDec 15, 2011
  7. Jeff KingDec 17, 2011

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.