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

Re: [PATCH v3 1/2] refs: add a new function set_worktree_head_symref

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 8, 2016, 06:42 UTC
Message-ID
<CAPig+cQYktE08zy3nSqxm924P0foW91RtHcapmRBy_Fwh9S_Ug@mail.gmail.com>
In-Reply-To
<20160408063713.GA17696@chikuwa.rhe.jp>
On Fri, Apr 8, 2016 at 2:37 AM, Kazuki Yamaguchi <k@rhe.jp> wrote:
Show 20 quoted lines
> On Thu, Apr 07, 2016 at 05:20:10PM -0400, Eric Sunshine wrote:
>> On Sun, Mar 27, 2016 at 10:37 AM, Kazuki Yamaguchi <k@rhe.jp> wrote:
>> > +int set_worktree_head_symref(const char *gitdir, const char *target)
>> > +{
>> > +       static struct lock_file head_lock;
>> > +       struct ref_lock *lock;
>> > +       struct strbuf err = STRBUF_INIT;
>> > +       struct strbuf head_path = STRBUF_INIT;
>> > +       const char *head_rel;
>> > +       int ret;
>> > +
>> > +       strbuf_addf(&head_path, "%s/HEAD", absolute_path(gitdir));
>> > +       if (hold_lock_file_for_update(&head_lock, head_path.buf,
>> > +                                     LOCK_NO_DEREF) < 0) {
>> > +               error("%s", err.buf);
>>
>> 'err' has not been populated at this point, so I suspect that this
>> error message is likely to be rather uninformative.
>
> Yes, unable_to_lock_message() is missing. Thank you for pointing it out.

You're welcome. As this patch is already in Junio's "next" branch, if you post a fix, it should be incremental atop "ky/branch-m-worktree", rather than as a re-roll of this series.

Previous: Kazuki YamaguchiNext: Kazuki Yamaguchi
Message 7 of 8 in “update all per-worktree HEADs when renaming a branch”
  1. 0/2 update all per-worktree HEADs when renaming a branchKazuki Yamaguchi, Mar 27, 2016
  2. 1/2 refs: add a new function set_worktree_head_symrefKazuki Yamaguchi, Mar 27, 2016
  3. Junio C HamanoMar 28, 2016
  4. David TurnerMar 29, 2016
  5. Eric SunshineApr 7, 2016
  6. Kazuki YamaguchiApr 8, 2016
  7. Eric SunshineApr 8, 2016
  8. 2/2 branch -m: update all per-worktree HEADsKazuki Yamaguchi, Mar 27, 2016

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.