All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Turner <dturner@twopensource.com>
To: Junio C Hamano <gitster@pobox.com>,
	Michael Haggerty <mhagger@alum.mit.edu>
Cc: Kazuki Yamaguchi <k@rhe.jp>,
	git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
	Duy Nguyen <pclouds@gmail.com>
Subject: Re: [PATCH v3 1/2] refs: add a new function set_worktree_head_symref
Date: Mon, 28 Mar 2016 22:23:12 -0400	[thread overview]
Message-ID: <1459218192.2976.4.camel@twopensource.com> (raw)
In-Reply-To: <xmqq4mbqze65.fsf@gitster.mtv.corp.google.com>

On Mon, 2016-03-28 at 10:48 -0700, Junio C Hamano wrote:
> Kazuki Yamaguchi <k@rhe.jp> writes:
> 
> > Add a new function set_worktree_head_symref, to update HEAD symref
> > for
> > the specified worktree.
> > 
> > To update HEAD of a linked working tree,
> > create_symref("worktrees/$work_tree/HEAD", "refs/heads/$branch",
> > msg)
> > could be used. However when it comes to updating HEAD of the main
> > working tree, it is unusable because it uses $GIT_DIR for
> > worktree-specific symrefs (HEAD).
> > 
> > The new function takes git_dir (real directory) as an argument, and
> > updates HEAD of the working tree. This function will be used when
> > renaming a branch.
> > 
> > Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
> > ---
> 
> I suspect that this helper function should be in the common layer
> (refs.c) to be redirected to specific backend(s).
> 
> David & Michael, what do you think?

HEAD is a per-worktree ref, so it's always handled by the files
backend.  So this looks fine to me.

> > +/*
> > + * Update HEAD of the specified gitdir.
> > + * Similar to create_symref("relative-git-dir/HEAD", target,
> > NULL), but this is
> > + * able to update the main working tree's HEAD wherever $GIT_DIR
> > points to.


nit: "able to update the main working tree's HEAD regardless of where
GIT_DIR points to" would be clearer.

  reply	other threads:[~2016-03-29  2:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21  9:50 [PATCH] branch: update all per-worktree HEADs when renaming a branch Kazuki Yamaguchi
2016-03-21 17:41 ` Eric Sunshine
2016-03-22  0:49   ` Duy Nguyen
2016-03-25 11:56     ` Kazuki Yamaguchi
2016-03-25 11:33   ` Kazuki Yamaguchi
2016-03-25 18:28 ` [PATCH v2 0/5] branch: fix branch operations with multiple working trees Kazuki Yamaguchi
2016-03-25 18:28   ` [PATCH v2 1/5] refs: add new flag RESOLVE_REF_COMMON_DIR to resolve_ref_unsafe Kazuki Yamaguchi
2016-03-25 18:28   ` [PATCH v2 2/5] refs: add REF_COMMON_DIR flag Kazuki Yamaguchi
2016-03-25 18:28   ` [PATCH v2 3/5] refs: add create_symref_common_dir as a variation of create_symref Kazuki Yamaguchi
2016-03-25 18:28   ` [PATCH v2 4/5] branch -m: update all per-worktree HEADs Kazuki Yamaguchi
2016-03-25 18:28   ` [PATCH v2 5/5] branch -d: refuse deleting a branch which is currently checked out Kazuki Yamaguchi
2016-03-25 21:00     ` Junio C Hamano
2016-03-27 17:52     ` Eric Sunshine
2016-03-28  7:16       ` Kazuki Yamaguchi
2016-03-28  7:22     ` [PATCH v2] " Kazuki Yamaguchi
2016-03-28 16:51       ` Eric Sunshine
2016-03-29  9:28         ` Kazuki Yamaguchi
2016-03-29 18:47           ` Eric Sunshine
2016-03-29  9:38     ` [PATCH v3] " Kazuki Yamaguchi
2016-03-29 18:57       ` Eric Sunshine
2016-03-25 21:13   ` [PATCH v2 0/5] branch: fix branch operations with multiple working trees Junio C Hamano
2016-03-27  7:29     ` Kazuki Yamaguchi
2016-03-27 14:37 ` [PATCH v3 0/2] update all per-worktree HEADs when renaming a branch Kazuki Yamaguchi
2016-03-27 14:37   ` [PATCH v3 1/2] refs: add a new function set_worktree_head_symref Kazuki Yamaguchi
2016-03-28 17:48     ` Junio C Hamano
2016-03-29  2:23       ` David Turner [this message]
2016-04-07 21:20     ` Eric Sunshine
2016-04-08  6:37       ` Kazuki Yamaguchi
2016-04-08  6:42         ` Eric Sunshine
2016-03-27 14:37   ` [PATCH v3 2/2] branch -m: update all per-worktree HEADs Kazuki Yamaguchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459218192.2976.4.camel@twopensource.com \
    --to=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=k@rhe.jp \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.