From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jay Soffian <jaysoffian@gmail.com>, git@vger.kernel.org
Subject: Re: [RFC/PATCH] Add multiple workdir support to branch/checkout
Date: Thu, 6 Oct 2011 09:38:52 +1100 [thread overview]
Message-ID: <CACsJy8D9xgLtYTkgWWkiuQPbonfM7zY49WDxaW9ng=e7x_Pk5g@mail.gmail.com> (raw)
In-Reply-To: <7vpqib8jzk.fsf@alter.siamese.dyndns.org>
On Thu, Oct 6, 2011 at 3:46 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Jay Soffian <jaysoffian@gmail.com> writes:
>
>> On Wed, Oct 5, 2011 at 12:02 AM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>>> Could you please consider a more generic approach? What I have in mind
>>> is a mechanism to "lock" a branch, so that only commands that have the
>>> key can update it.
>>>
>>> So instead of branch.<name>.checkout, I would have something like
>>> branch.<name>.locked = <key>, where <key> is just a string. Only
>>> commands that provide the matching <key> are allowed to update the
>>> branch. In checkout case, <key> could be "checkout: worktree".
>>
>> In this case, each workdir needs its own key, so I'd have to record
>> the key somewhere, unless you meant using a key of "checkout:
>> </path/to/workdir>".
>
> That actually is how I read his message.
That's what I meant.
> I think "switch_branches()" that updates HEAD to point at a local branch
> is one good place to lock the branch, but I do not know if it is a good
> idea to hook the check into the codepaths for deletion of the branch using
> "branch -[dD]" and check-out of the branch using "checkout $branch". I
> wonder if it makes sense to add the "checking" hook into much lower level
> in the callchain, perhaps delete_ref(), rename_ref() and update_ref() to
> catch attempts to update "your" current branch by other people.
I'd aim at low-level ref manipulation because too me it affects more
than just "git checkout".
> For that
> matter, instead of switch_branches(), would it make more sense to add this
> lock/unlock logic to symbolic_ref() that repoints HEAD to other branch?
Couldn't find symbolic_ref() in current code. If you meant
create_symref(), yes that would make sense.
--
Duy
next prev parent reply other threads:[~2011-10-05 22:39 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 3:43 [RFC/PATCH] Add multiple workdir support to branch/checkout Jay Soffian
2011-10-05 3:48 ` Jay Soffian
2011-10-05 4:02 ` Nguyen Thai Ngoc Duy
2011-10-05 13:11 ` Jay Soffian
2011-10-05 16:46 ` Junio C Hamano
2011-10-05 17:17 ` Jay Soffian
2011-10-05 18:19 ` Junio C Hamano
2011-10-05 19:11 ` Jay Soffian
2011-10-05 20:00 ` Andreas Krey
2011-10-05 20:50 ` Jay Soffian
2011-10-05 21:30 ` Jonathan Nieder
2011-10-05 21:52 ` Jay Soffian
2011-10-05 21:57 ` Jonathan Nieder
2011-10-05 21:29 ` Junio C Hamano
2011-10-05 21:49 ` Jay Soffian
2011-10-05 19:14 ` Jay Soffian
2011-10-05 22:47 ` Nguyen Thai Ngoc Duy
2011-10-05 22:56 ` Junio C Hamano
2011-10-05 23:11 ` Nguyen Thai Ngoc Duy
2011-10-05 23:49 ` Junio C Hamano
2011-10-06 0:33 ` Jay Soffian
2011-10-06 0:43 ` Junio C Hamano
2011-10-06 0:57 ` Jay Soffian
2011-10-06 1:15 ` Junio C Hamano
2011-10-06 1:38 ` Jay Soffian
2011-10-06 1:57 ` Junio C Hamano
2011-10-06 4:02 ` Jay Soffian
2011-10-06 2:06 ` Nguyen Thai Ngoc Duy
2011-10-06 11:25 ` Bernhard R. Link
2011-10-06 14:42 ` Jeff King
2011-10-05 22:38 ` Nguyen Thai Ngoc Duy [this message]
2011-10-05 4:07 ` Junio C Hamano
2011-10-05 15:24 ` Jay Soffian
2011-10-05 16:01 ` Jay Soffian
2011-10-08 22:55 ` Julián Landerreche
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='CACsJy8D9xgLtYTkgWWkiuQPbonfM7zY49WDxaW9ng=e7x_Pk5g@mail.gmail.com' \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jaysoffian@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).