Subject: [RFC PATCH 0/2] Teach fetch and pull to recursively fetch submodules too

From: Jens Lehmann <[email-masked]>
Date: Sun, 29 Aug 2010 17:49:47 +0200

Before we can take advantage of a recursive checkout for
submodules, we have to make sure that new commits are
present in the submodules. And even now after a fetch in the
superproject one sees "(commits not present)" output from
"git diff --submodule" (and thus in "git gui" and "gitk")
when the superproject recorded new submodule commits that
are not yet fetched there. Currently the time they do get
fetched is when the user does a "git submodule update". But
that makes it really hard to see beforehand what changes in
the submodule you will get by running that command, you have
to do something like "git submodule foreach git fetch" to
achieve that.

So I extended the fetch command to fetch populated submodules
too. I also added a command line option to fetch and pull and
the second patch introduces a per submodule config option to
give users the chance to control that behavior.

And maybe we need a config option to customize that behavior
for all submodules or all repos too?

Opinions?

Jens Lehmann (2):
  fetch/pull: Recursively fetch populated submodules
  Submodules: Add the new "fetch" config option for fetch and pull

 Documentation/config.txt        |    6 ++
 Documentation/fetch-options.txt |    6 ++
 Documentation/gitmodules.txt    |    8 +++
 builtin/fetch.c                 |   17 ++++++-
 git-pull.sh                     |   10 +++-
 submodule.c                     |   60 ++++++++++++++++++++++-
 submodule.h                     |    2 +
 t/t5526-fetch-submodules.sh     |  104 +++++++++++++++++++++++++++++++++++++++
 t/t7403-submodule-sync.sh       |    2 +-
 9 files changed, 210 insertions(+), 5 deletions(-)
 create mode 100755 t/t5526-fetch-submodules.sh

-- 
1.7.2.2.527.gdf3084