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

Re: [PATCH 4/4] worktree add: let worktree_basename() return string copy

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 31, 2026, 18:56 UTC
Message-ID
<xmqqfqzuw23a.fsf@gitster.g>
In-Reply-To
<xmqqjypdj6g4.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
>>> So going back to the confusing part of the log message,
>>> 
>>>     Remind ... to worktree_basename_dup().  Among the three callers
>>>     of worktree_basename(), two immediately make copies of the
>>>     returned string before using and freeing it, which makes for an
>>>     easy conversion.  Convert the other one from resetting ...
>>> 
>>> or something like that, perhaps?
>>
>> Yes.
>
> Thanks.  We do not know if other parts of the series gets more
> serious reviews that necessitates an updated version, so in the
> meantime I'll reword what I have locally.

And nothing happened since then. As the topic was in a good shape except for the confusing part of the log, which we amended in my tree already, let's mark the topic for 'next'.

Previous: Junio C HamanoNext: René Scharfe
Message 6 of 10 in “worktree add: worktree_basename() fixes”
  1. 0/4 worktree add: worktree_basename() fixesRené Scharfe, Aug 25, 2026
  2. 4/4 worktree add: let worktree_basename() return string copyRené Scharfe, Aug 25, 2026
  3. Junio C HamanoAug 25, 2026
  4. René ScharfeAug 26, 2026
  5. Junio C HamanoAug 26, 2026
  6. Junio C HamanoAug 31, 2026
  7. 3/4 worktree add: trim slashes when deriving branch name from pathRené Scharfe, Aug 25, 2026
  8. Junio C HamanoAug 25, 2026
  9. 1/4 worktree add: don't read out of bounds in worktree_basename()René Scharfe, Aug 25, 2026
  10. 2/4 worktree add: reject separator-only pathRené Scharfe, Aug 25, 2026

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.