git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikhail Glushenkov <the.dead.shall.rise@gmail.com>
To: git@vger.kernel.org
Cc: Mikhail Glushenkov <the.dead.shall.rise@gmail.com>
Subject: [PATCH] Make 'submodule update' honor the 'update' setting in .gitmodules.
Date: Thu,  6 Aug 2009 05:36:09 +0200	[thread overview]
Message-ID: <1249529769-15720-1-git-send-email-the.dead.shall.rise@gmail.com> (raw)

Make the 'submodule update' command use the 'submodule.$path.update' setting in
.gitmodules unless this setting is overridden in '.git/config' or with
--rebase/--merge options.

Signed-off-by: Mikhail Glushenkov <the.dead.shall.rise@gmail.com>
---
 git-submodule.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index ebed711..636023a 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -372,6 +372,15 @@ cmd_update()
 		name=$(module_name "$path") || exit
 		url=$(git config submodule."$name".url)
 		update_module=$(git config submodule."$name".update)
+
+		if test -z "$update_module"
+		then
+		    update_module="$(git config -f .gitmodules submodule."$name".update)"
+		    test -z "$update_module" ||
+		    git config submodule."$name".update "$update_module" ||
+		    die "Failed to register update mode for submodule path '$path'"
+		fi
+
 		if test -z "$url"
 		then
 			# Only mention uninitialized submodules when its
-- 
1.6.4

             reply	other threads:[~2009-08-06  4:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06  3:36 Mikhail Glushenkov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-08-06  3:56 [PATCH] Make 'submodule update' honor the 'update' setting in .gitmodules Mikhail Glushenkov
2009-08-07 21:54 ` 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

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

  git send-email \
    --in-reply-to=1249529769-15720-1-git-send-email-the.dead.shall.rise@gmail.com \
    --to=the.dead.shall.rise@gmail.com \
    --cc=git@vger.kernel.org \
    /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).