git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Lortie <desrt@desrt.ca>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Chris Packham <judge.packham@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: git submodule: update=!command
Date: Tue, 17 Mar 2015 16:48:22 -0400	[thread overview]
Message-ID: <1426625302.1806008.241713717.52A37086@webmail.messagingengine.com> (raw)
In-Reply-To: <20150317195030.GA18725@peff.net>

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

On Tue, Mar 17, 2015, at 15:50, Jeff King wrote:
> Yeah, spelling out the security model more explicitly would be good.

Please see the attached patch.

Cheers

[-- Attachment #2: 0001-docs-clarify-command-submodule-update-policy.patch --]
[-- Type: application/octet-stream, Size: 2625 bytes --]

From a6d70056f21f039db8676f72a1deca00c39121bd Mon Sep 17 00:00:00 2001
From: Ryan Lortie <desrt@desrt.ca>
Date: Tue, 17 Mar 2015 16:29:51 -0400
Subject: [PATCH] docs: clarify !command submodule update policy

Clarify that the !command submodule update policy is not available from
.gitmodules files.

This should help calm any fears people have about the security
implications of this otherwise scary-looking feature.

Signed-off-by: Ryan Lortie <desrt@desrt.ca>
---
 Documentation/git-submodule.txt | 10 +++++++---
 Documentation/gitmodules.txt    | 11 ++++++++---
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 8e6af65..a033e26 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -159,9 +159,13 @@ update::
 	This will make the submodules HEAD be detached unless `--rebase` or
 	`--merge` is specified or the key `submodule.$name.update` is set to
 	`rebase`, `merge` or `none`. `none` can be overridden by specifying
-	`--checkout`. Setting the key `submodule.$name.update` to `!command`
-	will cause `command` to be run. `command` can be any arbitrary shell
-	command that takes a single argument, namely the sha1 to update to.
+	`--checkout`.
++
+Setting the key `submodule.$name.update` in `.git/config` to
+`!command` will cause `command` to be run. `command` can be any
+arbitrary shell command that takes a single argument, namely the sha1
+to update to.  For security reasons, this feature is not supported
+from the `.gitmodules` file.
 +
 If the submodule is not yet initialized, and you just want to use the
 setting as stored in .gitmodules, you can automatically initialize the
diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt
index f6c0dfd..f11e872 100644
--- a/Documentation/gitmodules.txt
+++ b/Documentation/gitmodules.txt
@@ -47,9 +47,14 @@ submodule.<name>.update::
 	in the submodule.
 	If 'none', the submodule with name `$name` will not be updated
 	by default.
-
-	This config option is overridden if 'git submodule update' is given
-	the '--merge', '--rebase' or '--checkout' options.
++
+This config option is overridden if 'git submodule update' is given
+the '--merge', '--rebase' or '--checkout' options.
++
+Only the values 'checkout', 'rebase', 'merge' and 'none' are
+recognized when this key appears in the `.gitmodules` file.  In
+particular, '!command' is not recognised, and will be rewritten to
+'none' by "git submodule init".
 
 submodule.<name>.branch::
 	A remote branch name for tracking updates in the upstream submodule.
-- 
2.1.4


  reply	other threads:[~2015-03-17 20:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 19:28 git submodule: update=!command Ryan Lortie
2015-03-17 19:50 ` Jeff King
2015-03-17 20:48   ` Ryan Lortie [this message]
2015-03-18  7:38   ` Chris Packham
2015-03-17 20:49 ` Junio C Hamano
2015-03-17 20:59   ` Ryan Lortie
2015-03-17 21:05     ` Junio C Hamano
2015-03-17 21:11       ` Ryan Lortie
2015-03-18  7:43       ` Chris Packham
2015-03-18  7:45         ` Chris Packham

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=1426625302.1806008.241713717.52A37086@webmail.messagingengine.com \
    --to=desrt@desrt.ca \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=judge.packham@gmail.com \
    --cc=peff@peff.net \
    /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).