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

Re: [PATCH v3 1/2] worktrees: add die_if_shared_symref

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 31, 2015, 19:35 UTC
Message-ID
<CAPig+cTX0Wav2QSFi734uLVpjdmwFKzcesgkpmVKCPomMB_HyA@mail.gmail.com>
In-Reply-To
<1438369297-4838-1-git-send-email-dturner@twopensource.com>
On Fri, Jul 31, 2015 at 3:01 PM, David Turner <dturner@twopensource.com> wrote:
Show 6 quoted lines
> Add a new function, die_if_shared_symref, which works like
> die_if_checked_out, but for all references.  Refactor
> die_if_checked_out to work in terms of die_if_shared_symref.
>
> Soon, we will use die_if_shared_symref to protect notes merges in
> worktrees.
I wonder if the diagnostic:
    'blorp' is already checked out at '/path/name/'

emitted by check_linked_checkout() needs to be adjusted for this change. It still makes sense for die_if_checked_out(), but sounds odd for die_if_shared_symref().

Show 14 quoted lines
> Signed-off-by: David Turner <dturner@twopensource.com>
> ---
> diff --git a/branch.h b/branch.h
> index 58aa45f..b2fca30 100644
> --- a/branch.h
> +++ b/branch.h
> @@ -59,4 +59,11 @@ extern int read_branch_desc(struct strbuf *, const char *branch_name);
>   */
>  extern void die_if_checked_out(const char *branch);
>
> +/*
> + * Check if a symref points to a branch in the main worktree or any linked
> + * worktree and die (with a message describing its checkout location) if
> + * it is.

Ditto here. This is still talking about "branch" and "checkout", whereas it's actually checking if a symref in some worktree already references the given referent.

> + */
> +extern void die_if_shared_symref(const char *symref, const char *branch);
s/branch/referent/ or something?
Previous: David TurnerNext: Junio C Hamano
Message 3 of 7 in “worktrees: add die_if_shared_symref”
  1. 1/2 worktrees: add die_if_shared_symrefDavid Turner, Jul 31, 2015
  2. 2/2 notes: handle multiple worktreesDavid Turner, Jul 31, 2015
  3. Eric SunshineJul 31, 2015
  4. Junio C HamanoJul 31, 2015
  5. David TurnerJul 31, 2015
  6. Eric SunshineJul 31, 2015
  7. David TurnerJul 31, 2015

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.