git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: "Git List" <git@vger.kernel.org>, "Taylor Blau" <me@ttaylorr.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH v2 2/2] worktree: add per-worktree config files
Date: Sun, 30 Sep 2018 03:24:15 -0400	[thread overview]
Message-ID: <CAPig+cTJKuEkb5AVi=xyztfEo84NzaduNnX3mhec3xrYf4PGUg@mail.gmail.com> (raw)
In-Reply-To: <CACsJy8AVowvXDkOh_fjdRpNtcXWchxFULbE8m9ZPQN9BsJx5ag@mail.gmail.com>

On Sun, Sep 30, 2018 at 3:16 AM Duy Nguyen <pclouds@gmail.com> wrote:
> On Sun, Sep 30, 2018 at 6:33 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > > diff --git a/builtin/config.c b/builtin/config.c
> > > @@ -645,7 +649,20 @@ int cmd_config(int argc, const char **argv, const char *prefix)
> > > +       else if (use_worktree_config) {
> > > +               struct worktree **worktrees = get_worktrees(0);
> > > +               if (repository_format_worktree_config)
> > > +                       given_config_source.file = git_pathdup("config.worktree");
> > > +               else if (worktrees[0] && worktrees[1])
> > > +                       die(_("--worktree cannot be used with multiple "
> > > +                             "working trees unless the config\n"
> > > +                             "extension worktreeConfig is enabled. "
> > > +                             "Please read \"CONFIGURATION FILE\"\n"
> > > +                             "section in \"git help worktree\" for details"));
> > > +               else
> > > +                       given_config_source.file = git_pathdup("config");
> >
> > I'm not sure I understand the purpose of allowing --worktree when only
> > a single worktree is present and extensions.worktreeConfig is not set.
> > Can you talk about it a bit more?
>
> Unified API. If I write a script to do stuff and want it to work in
> multiple worktrees as well, I should not need to do "if single
> worktree, use "git config --local", if multiple use "git config
> --worktree"". By using "git config --worktree" I tell git "this config
> is per-worktree" and git should do the right thing, single worktree or
> not.

That's what I thought, but I still don't understand how that unified
API is going to help if the script writer happens to have multiple
worktrees but doesn't have extensions.worktreeConfig set, in which
case the command will error out. I don't see how that simplifies
things, but perhaps I'm missing something obvious.

  reply	other threads:[~2018-09-30  7:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-23 17:04 [PATCH] worktree: add per-worktree config files Nguyễn Thái Ngọc Duy
2018-09-23 20:47 ` Eric Sunshine
2018-09-24 14:21 ` Taylor Blau
2018-09-25 15:57   ` Duy Nguyen
2018-09-29 13:53   ` Duy Nguyen
2018-09-25 21:26 ` Junio C Hamano
2018-09-26 15:48   ` Duy Nguyen
2018-09-26 17:40     ` Junio C Hamano
2018-09-27 15:24     ` Wherefor worktrees? Marc Branchaud
2018-09-27 16:36       ` Duy Nguyen
2018-09-26 18:25 ` [PATCH] worktree: add per-worktree config files Ævar Arnfjörð Bjarmason
2018-09-27 17:24   ` Duy Nguyen
2018-09-27 18:34     ` Ævar Arnfjörð Bjarmason
2018-09-27 18:49       ` Duy Nguyen
2018-09-29  6:36       ` Duy Nguyen
2018-09-29 15:30 ` [PATCH v2 0/2] Per-worktree " Nguyễn Thái Ngọc Duy
2018-09-29 15:30   ` [PATCH v2 1/2] t1300: extract and use test_cmp_config() Nguyễn Thái Ngọc Duy
2018-09-30  4:05     ` Eric Sunshine
2018-09-30 12:31     ` SZEDER Gábor
2018-09-29 15:30   ` [PATCH v2 2/2] worktree: add per-worktree config files Nguyễn Thái Ngọc Duy
2018-09-30  4:32     ` Eric Sunshine
2018-09-30  7:15       ` Duy Nguyen
2018-09-30  7:24         ` Eric Sunshine [this message]
2018-09-30  7:36           ` Duy Nguyen
2018-10-02 16:06   ` [PATCH v3 0/2] Per-worktree " Nguyễn Thái Ngọc Duy
2018-10-02 16:06     ` [PATCH v3 1/2] t1300: extract and use test_cmp_config() Nguyễn Thái Ngọc Duy
2018-10-03  7:46       ` Eric Sunshine
2018-10-02 16:06     ` [PATCH v3 2/2] worktree: add per-worktree config files Nguyễn Thái Ngọc Duy
2018-10-21 14:02     ` [PATCH v4 0/2] Per-worktree " Nguyễn Thái Ngọc Duy
2018-10-21 14:02       ` [PATCH v4 1/2] t1300: extract and use test_cmp_config() Nguyễn Thái Ngọc Duy
2018-10-21 14:02       ` [PATCH v4 2/2] worktree: add per-worktree config files Nguyễn Thái Ngọc Duy
2018-10-22  4:54         ` Junio C Hamano
2018-10-22 14:32           ` Duy Nguyen
2018-10-25  9:16             ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAPig+cTJKuEkb5AVi=xyztfEo84NzaduNnX3mhec3xrYf4PGUg@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=pclouds@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).