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

Re: [PATCH&RFC] get_short_ref(): add strict mode

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Apr 11, 2009, 19:50 UTC
Message-ID
<36ca99e90904111250t7f4563e6x495937d8f3f45d40@mail.gmail.com>
In-Reply-To
<7vr5zzdmg8.fsf@gitster.siamese.dyndns.org>
On Sat, Apr 11, 2009 at 21:23, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>> I think of 3 alternatives to use this mode for the "refname" format (and
>> probably others):
>>
>>   a) Use core.warnAmbiguousRefs to control strict mode.
>>      This would change the current default behaviour, because this is true
>>      by default.
>>
>>   b) Introduce a new core config variable to control this, either for
>>      for-each-ref alone ore globally.
>>
>>   c) Introduce a "refname:short-strict" format to get the strict abbreviation.
>>
>> I'm currently slighty in favour for option b).
>
> Your earlier http://thread.gmane.org/gmane.comp.version-control.git/96464
> made a lot of sense to me.  The request "refname:short" cannot be for use
> by scripts (well, scripts may pass it to for-each-ref but that has to be
> for final consumption by humans wanting to view the names in a format not
> overly long, as opposed to scripts using for-each-ref to extract
> unambiguous names to be used for further processing, in which case they
> would be using "refname" without ":short"), so I do not see "change the
> current default behaviour" is a bad thing at all.  If anything, it is an
> improvement, isn't it?

Sure it is. So you're still with option a) and I'm ok with this. I prepare a patch.

Bert
Previous: Junio C HamanoNext: Bert Wesarg
Message 15 of 16 in “for-each-ref: utilize core.warnambiguousrefs for strict refname:short format”
  1. 1/3 for-each-ref: utilize core.warnambiguousrefs for strict refname:short formatBert Wesarg, Sep 22, 2008
  2. 2/3 for-each-ref: factor out get_short_ref() into refs.c:abbreviate_refname()Bert Wesarg, Sep 22, 2008
  3. 3/3 git abbref-ref: new porcelain for abbreviate_ref()Bert Wesarg, Sep 22, 2008
  4. Shawn O. PearceSep 22, 2008
  5. Junio C HamanoSep 22, 2008
  6. Bert WesargSep 22, 2008
  7. Bert WesargSep 22, 2008
  8. Junio C HamanoSep 22, 2008
  9. Bert WesargSep 22, 2008
  10. Junio C HamanoOct 17, 2008
  11. Shawn O. PearceOct 18, 2008
  12. Bert WesargOct 18, 2008
  13. get_short_ref(): add strict modeBert Wesarg, Apr 11, 2009
  14. Junio C HamanoApr 11, 2009
  15. Bert WesargApr 11, 2009
  16. for-each-ref: refname:short utilize core.warnAmbiguousRefsBert Wesarg, Apr 11, 2009

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.