1. 01 6月, 2017 1 次提交
  2. 02 9月, 2016 1 次提交
    • J
      submodule: avoid auto-discovery in prepare_submodule_repo_env() · 10f5c526
      Junio C Hamano 提交于
      The function is used to set up the environment variable used in a
      subprocess we spawn in a submodule directory.  The callers set up a
      child_process structure, find the working tree path of one submodule
      and set .dir field to it, and then use start_command() API to spawn
      the subprocess like "status", "fetch", etc.
      
      When this happens, we expect that the ".git" (either a directory or
      a gitfile that points at the real location) in the current working
      directory of the subprocess MUST be the repository for the submodule.
      
      If this ".git" thing is a corrupt repository, however, because
      prepare_submodule_repo_env() unsets GIT_DIR and GIT_WORK_TREE, the
      subprocess will see ".git", thinks it is not a repository, and
      attempt to find one by going up, likely to end up in finding the
      repository of the superproject.  In some codepaths, this will cause
      a command run with the "--recurse-submodules" option to recurse
      forever.
      
      By exporting GIT_DIR=.git, disable the auto-discovery logic in the
      subprocess, which would instead stop it and report an error.
      
      The test illustrates existing problems in a few callsites of this
      function.  Without this fix, "git fetch --recurse-submodules", "git
      status" and "git diff" keep recursing forever.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      10f5c526
  3. 02 3月, 2016 1 次提交
  4. 17 12月, 2015 2 次提交
  5. 21 3月, 2015 1 次提交
  6. 21 6月, 2011 1 次提交
    • J
      fetch: Also fetch submodules in subdirectories in on-demand mode · ea2d325b
      Jens Lehmann 提交于
      When on-demand mode was active examining the new commits just fetched in
      the superproject (to check if they record commits for submodules which are
      not downloaded yet) wasn't done recursively. Because of that fetch did not
      recursively fetch submodules living in subdirectories even when it should
      have.
      
      Fix that by adding the RECURSIVE flag to the diff_options used to check
      the new commits and avoid future regressions in this area by moving a
      submodule in t5526 into a subdirectory.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ea2d325b
  7. 13 4月, 2011 1 次提交
    • J
      i18n: do not overuse C_LOCALE_OUTPUT · cabdee2c
      Junio C Hamano 提交于
      It is too coarse-grained way that led to artificial splitting of a
      logically single test case into "do" and "check only without poison".
      As the majority of check is done by comparing expected and actual output
      stored in a file with test_cmp anyway, just introduce test_i18ncmp that
      pretends the actual output matched the expected one when gettext-poison
      is in effect.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cabdee2c
  8. 10 3月, 2011 6 次提交
    • Æ
      i18n: git-fetch formatting messages · 502681cd
      Ævar Arnfjörð Bjarmason 提交于
      Translate some of the formatting messages that appear on git-fetch
      showing how branches/tags etc. were updated.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      502681cd
    • J
      fetch/pull: Don't recurse into a submodule when commits are already present · c16c3e40
      Jens Lehmann 提交于
      When looking for submodules where new commits have been recorded in the
      superproject ignore those cases where the submodules commits are already
      present locally. This can happen e.g. when the submodule has been rewound
      to an earlier state. Then there is no need to fetch the submodule again
      as the commit recorded in the newly fetched superproject commit has
      already been fetched earlier into the submodule.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c16c3e40
    • J
      Submodules: Add 'on-demand' value for the 'fetchRecurseSubmodule' option · bf42b384
      Jens Lehmann 提交于
      Now the behavior of fetch and pull can be configured to the recently added
      'on-demand' mode separately for each submodule too.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bf42b384
    • J
      config: teach the fetch.recurseSubmodules option the 'on-demand' value · 1fb25502
      Jens Lehmann 提交于
      To enable the user to change the default behavior of "git fetch" and "git
      pull" regarding submodule recursion add the new "on-demand" value which
      has just been added to the "--recurse-submodules" command line option.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1fb25502
    • J
      fetch/pull: Add the 'on-demand' value to the --recurse-submodules option · 8f0700dd
      Jens Lehmann 提交于
      Until now the --recurse-submodules option could only be used to either
      fetch all populated submodules recursively or to disable recursion
      completely. As fetch and pull now by default just fetch those submodules
      for which new commits have been fetched in the superproject, a command
      line option to enforce that behavior is needed to be able to override
      configuration settings.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8f0700dd
    • J
      fetch/pull: recurse into submodules when necessary · 88a21979
      Jens Lehmann 提交于
      To be able to access all commits of populated submodules referenced by the
      superproject it is sufficient to only then let "git fetch" recurse into a
      submodule when the new commits fetched in the superproject record new
      commits for it. Having these commits present is extremely useful when
      using the "--submodule" option to "git diff" (which is what "git gui" and
      "gitk" do since 1.6.6), as all submodule commits needed for creating a
      descriptive output can be accessed. Also merging submodule commits (added
      in 1.7.3) depends on the submodule commits in question being present to
      work. Last but not least this enables disconnected operation when using
      submodules, as all commits necessary for a successful "git submodule
      update -N" will have been fetched automatically. So we choose this mode as
      the default for fetch and pull.
      
      Before a new or changed ref from upstream is updated in update_local_ref()
      "git rev-list <new-sha1> --not --branches --remotes" is used to determine
      all newly fetched commits. These are then walked and diffed against their
      parent(s) to see if a submodule has been changed. If that is the case, its
      path is stored to be fetched after the superproject fetch is completed.
      
      Using the "--recurse-submodules" or the "--no-recurse-submodules" option
      disables the examination of the fetched refs because the result will be
      ignored anyway.
      
      There is currently no infrastructure for storing deleted and new
      submodules in the .git directory of the superproject. That's why fetch and
      pull for now only fetch submodules that are already checked out and are
      not renamed.
      
      In t7403 the "--no-recurse-submodules" argument had to be added to "git
      pull" to avoid failure because of the moved upstream submodule repo.
      
      Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
      Thanks-to: Heiko Voigt <hvoigt@hvoigt.net>
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      88a21979
  9. 01 2月, 2011 1 次提交
  10. 13 11月, 2010 3 次提交
    • J
      Submodules: Add the "fetchRecurseSubmodules" config option · c1a3c364
      Jens Lehmann 提交于
      The new boolean "fetchRecurseSubmodules" config option controls the
      behavior for "git fetch" and "git pull". It specifies if these commands
      should recurse into submodules and fetch new commits there too and can be
      set separately for each submodule.
      
      In the .gitmodules file "submodule.<name>.fetchRecurseSubmodules" entries
      are read before looking for them in .git/config. Thus settings found in
      .git/config will override those from .gitmodules, thereby allowing the
      user to ignore settings given by the remote side while also letting
      upstream set reasonable defaults for those users who don't have special
      needs.
      
      This configuration can be overridden by the command line option
      "--[no-]recurse-submodules" of "git fetch" and "git pull".
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c1a3c364
    • J
      Add the 'fetch.recurseSubmodules' config setting · be254a0e
      Jens Lehmann 提交于
      This new boolean option can be used to override the default for "git
      fetch" and "git pull", which is to not recurse into populated submodules
      and fetch all new commits there too.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      be254a0e
    • J
      fetch/pull: Add the --recurse-submodules option · 7dce19d3
      Jens Lehmann 提交于
      Until now you had to call "git submodule update" (without -N|--no-fetch
      option) or something like "git submodule foreach git fetch" to fetch
      new commits in populated submodules from their remote.
      
      This could lead to "(commits not present)" messages in the output of
      "git diff --submodule" (which is used by "git gui" and "gitk") after
      fetching or pulling new commits in the superproject and is an obstacle for
      implementing recursive checkout of submodules. Also "git submodule
      update" cannot fetch changes when disconnected, so it was very easy to
      forget to fetch the submodule changes before disconnecting only to
      discover later that they are needed.
      
      This patch adds the "--recurse-submodules" option to recursively fetch
      each populated submodule from the url configured in the .git/config of the
      submodule at the end of each "git fetch" or during "git pull" in the
      superproject. The submodule paths are taken from the index.
      
      The hidden option "--submodule-prefix" is added to "git fetch" to be able
      to print out the full paths of nested submodules.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7dce19d3