1. 25 2月, 2014 4 次提交
    • W
      Documentation: describe 'submodule update --remote' use case · 9937e65d
      W. Trevor King 提交于
      Make it clear that there is no implicit floating going on; --remote
      lets you explicitly integrate the upstream branch in your current
      HEAD (just like running 'git pull' in the submodule).  The only
      distinction with the current 'git pull' is the config location and
      setting used for the upstream branch, which is hopefully clear now.
      Signed-off-by: NW. Trevor King <wking@tremily.us>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9937e65d
    • W
      submodule: explicit local branch creation in module_clone · 23d25e48
      W. Trevor King 提交于
      The previous code only checked out branches in cmd_add.  This commit
      moves the branch-checkout logic into module_clone, where it can be
      shared by cmd_add and cmd_update.  I also update the initial checkout
      command to use 'reset' to preserve branches setup during module_clone.
      
      With this change, folks cloning submodules for the first time via:
      
        $ git submodule update ...
      
      will get a local branch instead of a detached HEAD, unless they are
      using the default checkout-mode updates.  This is a change from the
      previous situation where cmd_update always used checkout-mode logic
      (regardless of the requested update mode) for updates that triggered
      an initial clone, which always resulted in a detached HEAD.
      
      This commit does not change the logic for updates after the initial
      clone, which will continue to create detached HEADs for checkout-mode
      updates, and integrate remote work with the local HEAD (detached or
      not) in other modes.
      
      The motivation for the change is that developers doing local work
      inside the submodule are likely to select a non-checkout-mode for
      updates so their local work is integrated with upstream work.
      Developers who are not doing local submodule work stick with
      checkout-mode updates so any apparently local work is blown away
      during updates.  For example, if upstream rolls back the remote branch
      or gitlinked commit to an earlier version, the checkout-mode developer
      wants their old submodule checkout to be rolled back as well, instead
      of getting a no-op merge/rebase with the rolled-back reference.
      
      By using the update mode to distinguish submodule developers from
      black-box submodule consumers, we can setup local branches for the
      developers who will want local branches, and stick with detached HEADs
      for the developers that don't care.
      
      Testing
      =======
      
      In t7406, just-cloned checkouts now update to the gitlinked hash with
      'reset', to preserve the local branch for situations where we're not
      on a detached HEAD.
      
      I also added explicit tests to t7406 for HEAD attachement after
      cloning updates, showing that it depends on their update mode:
      
      * Checkout-mode updates get detached HEADs
      * Everyone else gets a local branch, matching the configured
        submodule.<name>.branch and defaulting to master.
      
      The 'initial-setup' tag makes it easy to reset the superproject to a
      known state, as several earlier tests commit to submodules and commit
      the changed gitlinks to the superproject, but don't push the new
      submodule commits to the upstream subprojects.  This makes it
      impossible to checkout the current super master, because it references
      submodule commits that don't exist in the upstream subprojects.  For a
      specific example, see the tests that currently generate the
      'two_new_submodule_commits' commits.
      
      Documentation
      =============
      
      I updated the docs to describe the 'submodule update' modes in detail.
      The old documentation did not distinguish between cloning and
      non-cloning updates and lacked clarity on which operations would lead
      to detached HEADs, and which would not.  The new documentation
      addresses these issues while updating the docs to reflect the changes
      introduced by this commit's explicit local branch creation in
      module_clone.
      
      I also add '--checkout' to the usage summary and group the update-mode
      options into a single set.
      Signed-off-by: NW. Trevor King <wking@tremily.us>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      23d25e48
    • W
      9adfc1cf
    • W
      submodule: make 'checkout' update_module mode more explicit · a2aed08b
      W. Trevor King 提交于
      This avoids the current awkwardness of having either '' or 'checkout'
      for checkout-mode updates, which makes testing for checkout-mode
      updates (or non-checkout-mode updates) easier.
      Signed-off-by: NW. Trevor King <wking@tremily.us>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a2aed08b
  2. 08 1月, 2014 1 次提交
    • F
      git-submodule.sh: 'checkout' is a valid update mode · efa8fd7e
      Francesco Pretto 提交于
      'checkout' is documented as one of the valid values for the
      'submodule.<name>.update' variable, and in a repository with the
      variable set to 'checkout', "git submodule update" command does
      update using the 'checkout' mode.
      
      However, it has been an accident that the implementation works this
      way; any unknown value would trigger the same codepath and update
      using the 'checkout' mode.
      
      Explicitly list 'checkout' as one of the known update modes, and
      error out when an unknown update mode is used.
      
      Teach the codepath that initializes the configuration variable from
      an in-tree .gitmodules that 'checkout' is one of the valid values.
      The code since ac1fbbda (submodule: do not copy unknown update mode
      from .gitmodules, 2013-12-02) used to treat the value 'checkout' as
      unknown and mapped it to 'none', which made little sense.  With this
      change, 'checkout' specified in .gitmodules will stay to be 'checkout'.
      Signed-off-by: NFrancesco Pretto <ceztko@gmail.com>
      Signed-off-by: NSigned-off-by: Junio C Hamano <gitster@pobox.com>
      efa8fd7e
  3. 31 12月, 2013 1 次提交
  4. 18 12月, 2013 15 次提交
  5. 04 12月, 2013 2 次提交
  6. 03 12月, 2013 3 次提交
    • J
      Sync with 1.8.4.5 · be38bee8
      Junio C Hamano 提交于
      be38bee8
    • J
      Git 1.8.4.5 · 2f93541d
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2f93541d
    • J
      submodule: do not copy unknown update mode from .gitmodules · ac1fbbda
      Junio C Hamano 提交于
      When submodule.$name.update is given as hint from the upstream in
      the .gitmodules file, we used to blindly copy it to .git/config,
      unless there already is a value defined for the submodule.
      
      However, there is no reason to expect that the update mode hinted by
      the upstream is available in the version of Git the user is using,
      and a really custom "!cmd" prepared by an upstream person running on
      Linux may not even be available to a user on Windows.  It is simply
      irresponsible to copy the setting blindly and to attempt to use it
      during a later "submodule update" without validating it first.
      
      Just show the suggested value to the diagnostic output, and set the
      value to 'none' in the configuration, if it is not one of the ones
      that are known to be supported by this version of Git.
      Helped-by: NJens Lehmann <Jens.Lehmann@web.de>
      Helped-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ac1fbbda
  7. 28 11月, 2013 5 次提交
  8. 26 11月, 2013 1 次提交
    • J
      Merge branch 'rh/remote-hg-bzr-updates' (early part) · c302941c
      Junio C Hamano 提交于
      Unbreaks a recent breakage due to use of unquote-c-style.
      
      This may need to be cherry-picked down to 1.8.4.x series.
      
      * 'rh/remote-hg-bzr-updates' (early part):
        remote-hg: don't decode UTF-8 paths into Unicode objects
      c302941c
  9. 22 11月, 2013 1 次提交
  10. 21 11月, 2013 6 次提交
  11. 19 11月, 2013 1 次提交