git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Casey Fitzpatrick <kcghost@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] submodule: Add --dissociate option to add/update commands
Date: Tue, 1 May 2018 16:25:25 -0400	[thread overview]
Message-ID: <CAPig+cSbOsdibX588ObTG5_O=Mmp1+pbxiaUFMx-P0jFLLUuHQ@mail.gmail.com> (raw)
In-Reply-To: <20180501180908.17443-3-kcghost@gmail.com>

On Tue, May 1, 2018 at 2:09 PM, Casey Fitzpatrick <kcghost@gmail.com> wrote:
> submodule: Add --dissociate option to add/update commands

s/Add/add/

> Add --dissociate option to add and update commands, both clone helper commands
> that already have the --reference option --dissociate pairs with.
> Add documentation.
> Add tests.
>
> Signed-off-by: Casey Fitzpatrick <kcghost@gmail.com>
> ---
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> @@ -1075,6 +1075,9 @@ static int clone_submodule(const char *path, const char *gitdir, const char *url
> +       if (dissociate) {
> +               argv_array_push(&cp.args, "--dissociate");
> +       }

Style: drop unnecessary braces

> @@ -1208,6 +1212,8 @@ static int module_clone(int argc, const char **argv, const char *prefix)
> +               OPT_BOOL(0, "dissociate", &dissociate,
> +                          N_("use --reference only while cloning")),

s/reference/dissociate/

> @@ -1575,6 +1584,8 @@ static int update_clone(int argc, const char **argv, const char *prefix)
> +               OPT_BOOL(0, "dissociate", &suc.dissociate,
> +                          N_("use --reference only while cloning")),

s/reference/dissociate/

> diff --git a/git-submodule.sh b/git-submodule.sh
> +               --dissociate)
> +                       dissociate="--dissociate"
> @@ -258,7 +262,7 @@ or you are unsure what this means choose another name with the '--name' option."
> -               git submodule--helper clone ${GIT_QUIET:+--quiet} ${progress:+"$progress"} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${depth:+"$depth"} || exit
> +               git submodule--helper clone ${GIT_QUIET:+--quiet} ${progress:+"$progress"} --prefix "$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo" ${reference:+"$reference"} ${dissociate:+"$dissociate"} ${depth:+"$depth"} || exit

I realize that you're just following existing practice in this script,
but it's a bit off-putting to see expansions for the new --progress
and --dissociate options being done via unnecessarily complex
${foobar:+"$foobar"} when the simpler $foobar would work just as well.

Just a comment; not necessarily a request for change. (A separate
preparatory cleanup patch which simplifies the existing complex
expansion expressions would be welcome but could also be considered
outside the scope of this patch series.)

> @@ -493,6 +497,9 @@ cmd_update()
> +               --dissociate)
> +                       dissociate="--dissociate"
> +                       ;;
> @@ -550,6 +557,7 @@ cmd_update()
>                 ${reference:+"$reference"} \
> +               ${dissociate:+"$dissociate"} \
>                 ${depth:+--depth "$depth"} \

  parent reply	other threads:[~2018-05-01 20:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30  8:29 git-submodule is missing --dissociate option Casey Fitzpatrick
2018-04-30 11:30 ` Casey Fitzpatrick
2018-04-30 13:16   ` Ævar Arnfjörð Bjarmason
2018-05-02  4:32     ` Junio C Hamano
2018-04-30 18:19 ` Stefan Beller
2018-04-30 21:39   ` Casey Fitzpatrick
2018-05-01 18:09     ` [PATCH 0/2] Add --progress and --dissociate to git submodule Casey Fitzpatrick
2018-05-01 18:09       ` [PATCH 1/2] submodule: Add --progress option to add command Casey Fitzpatrick
2018-05-01 18:41         ` Stefan Beller
2018-05-01 20:48           ` Casey Fitzpatrick
2018-05-01 18:09       ` [PATCH 2/2] submodule: Add --dissociate option to add/update commands Casey Fitzpatrick
2018-05-01 20:23         ` Stefan Beller
2018-05-01 20:25         ` Eric Sunshine [this message]
2018-05-01 21:21           ` Casey Fitzpatrick
2018-05-01 18:20       ` [PATCH 0/2] Add --progress and --dissociate to git submodule Stefan Beller
2018-05-02  0:27     ` [PATCH 0/3] " Casey Fitzpatrick
2018-05-02  0:27       ` [PATCH 1/3] submodule: clean up subsititions in script Casey Fitzpatrick
2018-05-02  0:27       ` [PATCH 2/3] submodule: add --progress option to add command Casey Fitzpatrick
2018-05-02  0:27       ` [PATCH 3/3] submodule: add --dissociate option to add/update commands Casey Fitzpatrick
2018-05-02  0:40         ` Casey Fitzpatrick
2018-05-02  0:55     ` [PATCH 0/3] Add --progress and --dissociate to git submodule Casey Fitzpatrick
2018-05-02  0:55       ` [PATCH 1/3] submodule: clean up subsititions in script Casey Fitzpatrick
2018-05-02  5:59         ` Junio C Hamano
2018-05-03 10:46           ` Casey Fitzpatrick
2018-05-02  0:55       ` [PATCH 2/3] submodule: add --progress option to add command Casey Fitzpatrick
2018-05-02  0:55       ` [PATCH 3/3] submodule: add --dissociate option to add/update commands Casey Fitzpatrick
2018-05-02  4:37       ` [PATCH 0/3] Add --progress and --dissociate to git submodule Junio C Hamano
2018-05-02  8:54         ` Casey Fitzpatrick
2018-05-02  4:34   ` git-submodule is missing --dissociate option 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+cSbOsdibX588ObTG5_O=Mmp1+pbxiaUFMx-P0jFLLUuHQ@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=kcghost@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).