git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kevin Ballard <kevin@sb.org>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Johannes Sixt <j.sixt@viscovery.net>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 0/2] fix problems with recursive submodule fetching
Date: Sun, 19 Sep 2010 23:40:39 -0700	[thread overview]
Message-ID: <28BC3A45-D3CF-4A8C-A818-B92A9827C8FB@sb.org> (raw)
In-Reply-To: <4C963D00.9050207@web.de>

On Sep 19, 2010, at 9:40 AM, Jens Lehmann wrote:

> Am 19.09.2010 05:54, schrieb Kevin Ballard:
>> Here's the submodule layout:
>> 
>> .--Root-.
>> / / /|\ \ \  
>> A B C D E F G
>>    |
>>    H
>>   /|\
>>  I J K
>>   /|\
>>  L M N
>>   /|\
>>  O P Q
>> 
>> I control the root, and I control most of the first-level of submodules. I would also not mind seeing updates to other submodules at that level, though that doesn't generally concern me. However, I don't control submodule H, and I have absolutely no desire whatsoever to see updates to I-Q unless needed by submodule H. In this layout, regularly running `git submodule update --init --recursive` works perfectly. Having `git fetch` fetch submodules I-Q on every invocation is a complete waste of my time.
> 
> Sounds like adding  the "fetch=no" option to the .gitmodules entry
> for submodule H would help you. That would tell "git fetch" to not
> recurse into H and deeper.

The problem is that while I want to get updates from H, I don't control H so I can't add anything to its .gitmodules. I can go in and edit H's .git/config to handle this, but then everybody else that clones this project will have the exact same problem.

> But as you seem to be fine with running "git submodule update --init
> --recursive" when needed you might be even better off by setting the
> upcoming global config option to control recursive fetching to false.

Perhaps, but that negates any benefit from this patchset whatsoever. You're optimizing for the case where you control the project and every level of submodules beneath it, and you want to be notified the moment there's a commit available on any of them to pull into the parent. My argument is that two extremely common cases are you don't control all the submodules beneath yourself, and your submodules are pegged to versioned tags. In both these cases, you don't want to recursively fetch for changes every time. I think fetching everything every time has merit, but I don't think it's a worthwhile default. A far better default would be to only fetch submodules if a gitlink entry is updated in the parent repository. Given that this may be complicated, a reasonable compromise might be to update 
 submodules only if the parent repository had changes, and then this can be overridden to either always update or never update submodules.

I should also like to point out that, although the original motivation for this fetching (judging from the commit messages) seems to be to prevent you from having problems diffing the current submodule with the value stored in the gitlink, this doesn't actually do anything to help the fact that, if you have a clean tree with no changes and all submodules are up-to-date, you can run `git pull` and end up with a dirty tree as submodules are not automatically updated when their gitlink changes. I hope someone is considering modifying pull/merge behavior to update submodules automatically if their gitlink changes and they were already in a clean state with a detached HEAD pointing at the old value of the gitlink (e.g. if you checkout master, or if you make changes, don't update it).

> But IMHO it makes more sense to let checkout take care of submodules
> too and get rid of the necessity to call "git submodule update" every
> time a submodule needs to be updated ...

I agree. Checkout should be perfectly capable of handling this. Submodules are a powerful feature, but they are one of the least user-friendly aspects of git in my opinion.

-Kevin Ballard

  reply	other threads:[~2010-09-20  6:40 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-29 15:49 [RFC PATCH 0/2] Teach fetch and pull to recursively fetch submodules too Jens Lehmann
2010-08-29 15:50 ` [PATCH 1/2] fetch/pull: Recursively fetch populated submodules Jens Lehmann
2010-08-29 15:51 ` [PATCH 2/2] Submodules: Add the new "fetch" config option Jens Lehmann
2010-08-30  7:34   ` Junio C Hamano
2010-08-30 17:37     ` [PATCH 2/2 v2] Submodules: Add the new "fetch" config option for fetch and pull Jens Lehmann
2010-08-29 17:29 ` [RFC PATCH 0/2] Teach fetch and pull to recursively fetch submodules too Ævar Arnfjörð Bjarmason
2010-08-29 22:34   ` Jens Lehmann
2010-08-30  5:58 ` Junio C Hamano
2010-08-30 17:41   ` Jens Lehmann
2010-09-15  0:18   ` Kevin Ballard
2010-09-15  2:40     ` Kevin Ballard
2010-09-16 13:55       ` [PATCH] fetch: Get submodule paths from index and not from .gitmodules Jens Lehmann
2010-09-16 19:29         ` Kevin Ballard
2010-09-17 11:31           ` Jens Lehmann
2010-09-17 12:06             ` Johannes Sixt
2010-09-17 12:22               ` Jens Lehmann
2010-09-17 12:32                 ` Johannes Sixt
2010-09-17 14:01                   ` Jens Lehmann
2010-09-17 14:14                     ` Johannes Sixt
2010-09-18  0:29                 ` Kevin Ballard
2010-09-18 22:32                   ` [PATCH 0/2] fix problems with recursive submodule fetching Jens Lehmann
2010-09-18 22:33                     ` [PATCH 1/2] fetch: Fix a bug swallowing the output of " Jens Lehmann
2010-09-18 22:35                     ` [PATCH 2/2] fetch: Get submodule paths from index and not from .gitmodules Jens Lehmann
2010-09-19  3:54                     ` [PATCH 0/2] fix problems with recursive submodule fetching Kevin Ballard
2010-09-19 16:40                       ` Jens Lehmann
2010-09-20  6:40                         ` Kevin Ballard [this message]
2010-10-05 20:43                           ` [PATCH v2 0/3] Teach fetch and pull to recursively fetch submodules too Jens Lehmann
2010-10-05 20:43                             ` [PATCH 1/3] fetch/pull: Recursively fetch populated submodules Jens Lehmann
2010-10-05 20:44                             ` [PATCH 2/3] Submodules: Add the new "fetch" config option for fetch and pull Jens Lehmann
2010-10-07 13:33                               ` Jon Seymour
2010-10-09 19:22                                 ` Jens Lehmann
2010-10-09 19:54                                   ` Jonathan Nieder
2010-10-09 20:12                                     ` Jens Lehmann
2010-10-05 20:45                             ` [PATCH 3/3] Add the 'fetch.recursive' config setting Jens Lehmann
2010-10-05 21:06                             ` [PATCH v2 0/3] Teach fetch and pull to recursively fetch submodules too Junio C Hamano
2010-10-06 22:52                             ` Kevin Ballard
2010-10-06 23:22                               ` Jonathan Nieder
2010-10-09 19:28                                 ` Jens Lehmann
2010-10-09 20:02                                   ` Jonathan Nieder
2010-10-09 20:37                                     ` Jens Lehmann
2010-10-21 18:29                                       ` Jonathan Nieder
2010-10-21 21:15                                         ` Jens Lehmann
2010-10-09 19:17                               ` Jens Lehmann
2010-10-13 14:48                                 ` Marc Branchaud
2010-10-13 19:32                                   ` Jens Lehmann
2010-10-13 19:34                                     ` Kevin Ballard
2010-10-13 20:06                                       ` Jens Lehmann
2010-10-13 20:11                                         ` Kevin Ballard
2010-10-14  1:01                                         ` Chris Packham
2010-10-14 18:14                                           ` Jens Lehmann
2010-10-14 18:31                                             ` Chris Packham
2010-10-13 21:27                                       ` Marc Branchaud
2010-10-13 21:31                                         ` Kevin Ballard
2010-09-15 11:32     ` [RFC PATCH 0/2] " Jens Lehmann
2010-09-15 23:12       ` Kevin Ballard

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=28BC3A45-D3CF-4A8C-A818-B92A9827C8FB@sb.org \
    --to=kevin@sb.org \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.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.
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).