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

Re: [PATCH 0/5] fetch & co: misc output cleanup

From
Junio C Hamano <junkio@cox.net>
Date
Sep 29, 2006, 21:27 UTC
Message-ID
<7v1wpumkhk.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<451D6BDB.50900@gmail.com>
A Large Angry SCM <gitzilla@gmail.com> writes:
Show 12 quoted lines
> Santi Béjar wrote:
>> this patchset includes:
>>
>>       fetch: Reset remote refs list each time fetch_main is called
>>       fetch & co: Use "hash1..hash2" instead of "from hash1 to hash2"
>>       fetch & co: Use short sha1 in the output
>>       fetch: Add output for the not fast forward case
>>       fetch: Clean output
>
> Please do not make short ID output the default. That is, unless you
> can somehow guarantee that the short ID reported today will _always_
> be unambiguous even with future additions to the repository.

I would understand your worries of spitting out only abbreviated object names if they appear in a document to be preserved for a long term. But we are talking about output to stderr to help people see what happened in the operation they initiated a few moments ago, and to help them use the output for cut&paste while it is still in the scrollbuffer of the terminal.

Shortening them would help A..B avoid crossing the line boundaries, which terminal emulators have trouble with cutting sometimes. That benefit may outweigh the longer term ambiguity concerns.

The only real-life situation I can imagine the program output is preserved in any longer term than immediate consumption for cut&paste is to paste it into a piece of e-mail (which is archived), to show exactly what the program said to the user. But then it carries the timestamp and you should be able to figure out what the abbreviation uniquely stood for back then if you really cared. If you are producing a document for longer term storage, the program that produces such a document should be doing its own rev-parse anyway (or maybe pass whatever it is piping through git-name-rev --stdin).

I think it is Ok to always use the abbreviated form in the places Santi's patch touched, as long as people understand these messages are not for long term storage. We might want to use a bit longer abbreviation than the default (7 hexdigits).

Previous: Santi
Message 12 of 12 in “fetch & co: misc output cleanup”
  1. 0/5 fetch & co: misc output cleanupSanti Béjar, Sep 29, 2006
  2. 1/5 fetch: Reset remote refs list each time fetch_main is calledSanti Béjar, Sep 29, 2006
  3. 2/5 fetch & co: Use "hash1..hash2" instead of "from hash1 to hash2"Santi Béjar, Sep 29, 2006
  4. 3/5 fetch & co: Use short sha1 in the outputSanti Béjar, Sep 29, 2006
  5. 4/5 fetch: Add output for the not fast forward caseSanti Béjar, Sep 29, 2006
  6. 5/5 fetch: Clean outputSanti Béjar, Sep 29, 2006
  7. Junio C HamanoSep 30, 2006
  8. SantiSep 30, 2006
  9. Junio C HamanoSep 30, 2006
  10. A Large Angry SCMSep 29, 2006
  11. SantiSep 29, 2006
  12. Junio C HamanoSep 29, 2006

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.