git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kannan Goundan <kannan@cakoose.com>
To: git@vger.kernel.org
Subject: Make "git checkout" automatically update submodules?
Date: Thu, 15 Oct 2015 22:50:05 +0000 (UTC)	[thread overview]
Message-ID: <loom.20151016T001449-848@post.gmane.org> (raw)

Git submodules seem to be a great fit for one of our repos.  The biggest
pain point is that it's too easy to forget to update submodules.

1. I often forget since most repos don't need it.
2. Infrequent users of our repo almost never know to update submodules and
end up coming to us with strange build errors.
3. Existing scripts that work with Git repos are usually not built to handle
submodules.

In the common case of the submodule content having no local edits, it would
be nice if "git checkout" automatically updated submodules [1].  If there
are local edits, it could error out (maybe override with
"--ignore-modified-submodules" or something).

I'm not a Git expert, though.  Is there a reason something like this isn't
already implemented?  Maybe there's an existing write-up or mailing list
thread I can read to get some background information?

Thanks!

[1] Our post-checkout procedure is:

    git submodule sync
    git submodule update --init
    git submodule foreach --recursive \
      'git submodule sync ; git submodule update --init'

(Not sure if this is correct.  Different articles/blogs suggest a slightly
different set of commands.)

             reply	other threads:[~2015-10-15 22:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 22:50 Kannan Goundan [this message]
2015-10-15 23:21 ` Make "git checkout" automatically update submodules? Junio C Hamano
2015-10-22 23:46   ` Make Kannan Goundan
2015-10-23  2:05     ` Make Junio C Hamano
2015-10-23  3:46       ` Make "git checkout" automatically update submodules? Kannan Goundan
2015-10-23  6:19         ` Christian Couder
2015-10-23 17:15         ` Junio C Hamano
2015-10-23 17:20 ` Stefan Beller
2015-10-23 19:11   ` Junio C Hamano
2015-10-23 22:51   ` Kannan Goundan

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=loom.20151016T001449-848@post.gmane.org \
    --to=kannan@cakoose.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.
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).