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

Re: [PATCH v2 0/2] object-name: fix resolution of object names containing curly braces

From
Elijah Newren <newren@gmail.com>
Date
Jan 6, 2025, 19:26 UTC
Message-ID
<CABPp-BHyWgu47mCDH_f_MkS4CMGh_OtX4K-YGFsB-fZvvaNJPQ@mail.gmail.com>
In-Reply-To
<xmqqbjwjzw9b.fsf@gitster.g>
On Mon, Jan 6, 2025 at 9:29 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > Maintainer note: these bugs both date back to 2006; neither is a regression
> > in this cycle.
>
> While I was preparing today's -rc2 release, I noticed that this
> change broke some of my release scripts with
>
>     $ git rev-parse --verify v2.48.0-rc2-161-g6c2274cdbc^0
>     fatal: Needed a single revision
>
> which is the construct that has been there almost forever.  Its
> expected output is
>
>     $ git rev-parse --verify v2.48.0-rc2-161-g6c2274cdbc^0
>     6c2274cdbca14b7eb70fb182ffac80bf6950e137
>
> The series seems to need a bit more work.

Gah, I made sure to copy the object name into a string buf, so I could operate on just the relevant part, but then ignored that and operated on the full thing.

This fixes it:
diff --git a/object-name.c b/object-name.c
index 614520954c7..cb96a0e6161 100644
--- a/object-name.c
+++ b/object-name.c
@@ -1318,7 +1318,7 @@ static int ref_and_count_parts_valid(const char
*name, int len)
        len = cp - name;
        strbuf_init(&sb, len);
        strbuf_add(&sb, name, len);
-       ret = !check_refname_format(name, flags);
+       ret = !check_refname_format(sb.buf, flags);
        strbuf_release(&sb);
        return ret;
 }

I'll include it with all my other fixes in a reroll, which I'll
probably send out after 2.48 to avoid distracting from the release.
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 25 in “object-name: fix resolution of object names containing curly braces”
  1. object-name: fix resolution of object names containing curly bracesElijah Newren via GitGitGadget, Jan 1, 2025
  2. Junio C HamanoJan 1, 2025
  3. Elijah NewrenJan 3, 2025
  4. Junio C HamanoJan 4, 2025
  5. Patrick SteinhardtJan 3, 2025
  6. Junio C HamanoJan 3, 2025
  7. Elijah NewrenJan 3, 2025
  8. 0/2 object-name: fix resolution of object names containing curly bracesElijah Newren via GitGitGadget, Jan 4, 2025
  9. 1/2 object-name: fix resolution of object names containing curly bracesElijah Newren via GitGitGadget, Jan 4, 2025
  10. Junio C HamanoJan 4, 2025
  11. Elijah NewrenJan 4, 2025
  12. Junio C HamanoJan 5, 2025
  13. 2/2 object-name: be more strict in parsing describe-like outputElijah Newren via GitGitGadget, Jan 4, 2025
  14. Junio C HamanoJan 4, 2025
  15. Elijah NewrenJan 4, 2025
  16. Junio C HamanoJan 4, 2025
  17. Elijah NewrenJan 4, 2025
  18. Junio C HamanoJan 6, 2025
  19. Elijah NewrenJan 6, 2025
  20. Junio C HamanoJan 6, 2025
  21. 0/2 object-name: fix a pair of object name resolution issuesElijah Newren via GitGitGadget, Jan 13, 2025
  22. 1/2 object-name: fix resolution of object names containing curly bracesElijah Newren via GitGitGadget, Jan 13, 2025
  23. 2/2 object-name: be more strict in parsing describe-like outputElijah Newren via GitGitGadget, Jan 13, 2025
  24. Junio C HamanoJan 13, 2025
  25. Elijah NewrenJan 13, 2025

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.