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

Re: [PATCH 1/3] for-each-ref: utilize core.warnambiguousrefs for strict refname:short format

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Sep 22, 2008, 18:00 UTC
Message-ID
<36ca99e90809221100q4db71514re448f5fa36a19ffc@mail.gmail.com>
In-Reply-To
<7vk5d4xi1m.fsf@gitster.siamese.dyndns.org>
On Mon, Sep 22, 2008 at 18:27, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>> diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
>> index 9b44092..e7b7712 100644
>> --- a/builtin-for-each-ref.c
>> +++ b/builtin-for-each-ref.c
>> @@ -571,7 +571,7 @@ static void gen_scanf_fmt(char *scanf_fmt, const char *rule)
>>  /*
>>   * Shorten the refname to an non-ambiguous form
>>   */
>> -static char *get_short_ref(struct refinfo *ref)
>> +static void get_short_ref(struct refinfo *ref, int strict, char **short_ref)
>>  {
>>       int i;
>>       static char **scanf_fmts;
>
> As far as I can tell this changing of function signature does not help its
> existing caller nor the function's implementation.
>
> Why?  And especially why do this in a patch that does something else?

Good point. I think it had something to do that I first want a reverse of dwim_ref(). And this has this 'char **' argument. Than I changed it back to the old signature which makes this line:

-                                       refname = get_short_ref(ref);
+                                       refname = get_short_ref(ref,
warn_ambiguous_refs);

unbreakable or screams for an out factoring of all inside the 'if (!prefixcmp(name, "refname")) {'

I would prefer the out factory.
Bert
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 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.