1. 13 5月, 2009 1 次提交
  2. 23 4月, 2009 1 次提交
  3. 20 4月, 2009 2 次提交
  4. 08 4月, 2009 1 次提交
  5. 03 4月, 2009 1 次提交
  6. 24 3月, 2009 1 次提交
  7. 23 3月, 2009 3 次提交
  8. 04 3月, 2009 1 次提交
  9. 19 2月, 2009 1 次提交
  10. 18 1月, 2009 5 次提交
  11. 15 1月, 2009 1 次提交
  12. 04 1月, 2009 1 次提交
  13. 08 12月, 2008 1 次提交
  14. 28 11月, 2008 1 次提交
  15. 13 11月, 2008 1 次提交
    • J
      checkout: Fix "initial checkout" detection · fa7b3c2f
      Junio C Hamano 提交于
      Earlier commit 55218834 (checkout: do not lose staged removal, 2008-09-07)
      tightened the rule to prevent switching branches from losing local
      changes, so that staged removal of paths can be protected, while
      attempting to keep a loophole to still allow a special case of switching
      out of an un-checked-out state.
      
      However, the loophole was made a bit too tight, and did not allow
      switching from one branch (in an un-checked-out state) to check out
      another branch.
      
      The change to builtin-checkout.c in this commit loosens it to allow this,
      by not insisting the original commit and the new commit to be the same.
      
      It also introduces a new function, is_index_unborn (and an associated
      macro, is_cache_unborn), to check if the repository is truly in an
      un-checked-out state more reliably, by making sure that $GIT_INDEX_FILE
      did not exist when populating the in-core index structure.  A few places
      the earlier commit 55218834 added the check for the initial checkout
      condition are updated to use this function.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fa7b3c2f
  16. 10 11月, 2008 1 次提交
  17. 20 10月, 2008 1 次提交
  18. 13 10月, 2008 1 次提交
  19. 06 10月, 2008 1 次提交
  20. 25 9月, 2008 1 次提交
  21. 22 9月, 2008 1 次提交
  22. 10 9月, 2008 1 次提交
    • J
      checkout: do not lose staged removal · 55218834
      Junio C Hamano 提交于
      The logic to checkout a different commit implements the safety to never
      lose user's local changes.  For example, switching from a commit to
      another commit, when you have changed a path that is different between
      them, need to merge your changes to the version from the switched-to
      commit, which you may not necessarily be able to resolve easily.  By
      default, "git checkout" refused to switch branches, to give you a chance
      to stash your local changes (or use "-m" to merge, accepting the risks of
      getting conflicts).
      
      This safety, however, had one deliberate hole since early June 2005.  When
      your local change was to remove a path (and optionally to stage that
      removal), the command checked out the path from the switched-to commit
      nevertheless.
      
      This was to allow an initial checkout to happen smoothly (e.g. an initial
      checkout is done by starting with an empty index and switching from the
      commit at the HEAD to the same commit).  We can tighten the rule slightly
      to allow this special case to pass, without losing sight of removal
      explicitly done by the user, by noticing if the index is truly empty when
      the operation begins.
      
      For historical background, see:
      
          http://thread.gmane.org/gmane.comp.version-control.git/4641/focus=4646
      
      This case is marked as *0* in the message, which both Linus and I said "it
      feels somewhat wrong but otherwise we cannot start from an empty index".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      55218834
  23. 04 9月, 2008 1 次提交
    • J
      checkout: fix message when leaving detached HEAD · bea005e2
      Jeff King 提交于
      The shell version of git checkout would print:
      
        Previous HEAD position was 1234abcd... commit subject line
      
      when leaving a detached HEAD for another commit. Ths C
      version attempted to implement this, but got the condition
      wrong such that the behavior never triggered.
      
      This patch simplifies the conditions for showing the message
      to the ones used by the shell version: any time we are
      leaving a detached HEAD and the new and old commits are not
      the same (this suppresses it for the "git checkout -b new"
      case recommended when you enter the detached state).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bea005e2
  24. 01 9月, 2008 1 次提交
    • J
      checkout --conflict=<style>: recreate merge in a non-default style · eac5a401
      Junio C Hamano 提交于
      This new option does essentially the same thing as -m option when checking
      unmerged paths out of the index, but it uses the specified style instead
      of configured merge.conflictstyle.
      
      Setting "merge.conflictstyle" to "diff3" is usually less useful than using
      the default "merge" style, because the latter allows a conflict that
      results by both sides changing the same region in a very similar way to
      get simplified substancially by reducing the common lines.  However, when
      one side removed a group of lines (perhaps a function was moved to some
      other file) while the other side modified it, the default "merge" style
      does not give any clue as to why the hunk is left conflicting.  You would
      need the original to understand what is going on.
      
      The recommended use would be not to set merge.conflictstyle variable so
      that you would usually use the default "merge" style conflict, and when
      the result in a path in a particular merge is too hard to understand, use
      "git checkout --conflict=diff3 $path" to check it out with the original to
      review what is going on.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      eac5a401
  25. 31 8月, 2008 5 次提交
    • M
      merge-recursive: introduce merge_options · 8a2fce18
      Miklos Vajna 提交于
      This makes it possible to avoid passing the labels of branches as
      arguments to merge_recursive(), merge_trees() and
      merge_recursive_generic().
      
      It also takes care of subtree merge, output buffering, verbosity, and
      rename limits - these were global variables till now in
      merge-recursive.c.
      
      A new function, named init_merge_options(), is introduced as well, it
      clears the struct merge_info, then initializes with default values,
      finally updates the default values based on the config and environment
      variables.
      Signed-off-by: NMiklos Vajna <vmiklos@frugalware.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8a2fce18
    • J
      checkout -m: recreate merge when checking out of unmerged index · 0cf8581e
      Junio C Hamano 提交于
      This teaches git-checkout to recreate a merge out of unmerged
      index entries while resolving conflicts.
      
      With this patch, checking out an unmerged path from the index
      now have the following possibilities:
      
       * Without any option, an attempt to checkout an unmerged path
         will atomically fail (i.e. no other cleanly-merged paths are
         checked out either);
      
       * With "-f", other cleanly-merged paths are checked out, and
         unmerged paths are ignored;
      
       * With "--ours" or "--theirs, the contents from the specified
         stage is checked out;
      
       * With "-m" (we should add "--merge" as synonym), the 3-way merge
         is recreated from the staged object names and checked out.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0cf8581e
    • J
      checkout --ours/--theirs: allow checking out one side of a conflicting merge · 38901a48
      Junio C Hamano 提交于
      This lets you to check out 'our' (or 'their') version of an
      unmerged path out of the index while resolving conflicts.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      38901a48
    • J
      checkout -f: allow ignoring unmerged paths when checking out of the index · db941099
      Junio C Hamano 提交于
      Earlier we made "git checkout $pathspec" to atomically refuse
      the operation of $pathspec matched any path with unmerged
      stages.  This patch allows:
      
          $ git checkout -f a b c
      
      to ignore, instead of error out on, such unmerged paths.  The
      fix to prevent checkout of an unmerged path from random stages
      is still there.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      db941099
    • J
      checkout: do not check out unmerged higher stages randomly · 8fdcf312
      Junio C Hamano 提交于
      During a conflicted merge when you have unmerged stages for a
      path F in the index, if you said:
      
          $ git checkout F
      
      we rewrote F as many times as we have stages for it, and the
      last one (typically "theirs") was left in the work tree, without
      resolving the conflict.
      
      This fixes it by noticing that a specified pathspec pattern
      matches an unmerged path, and by erroring out.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8fdcf312
  26. 23 8月, 2008 1 次提交
  27. 12 8月, 2008 1 次提交
  28. 25 7月, 2008 1 次提交
    • P
      git-checkout: improve error messages, detect ambiguities. · 859fdaba
      Pierre Habouzit 提交于
      The patch is twofold: it moves the option consistency checks just under
      the parse_options call so that it doesn't get in the way of the tree
      reference vs. pathspecs desambiguation.
      
      The other part rewrites the way to understand arguments so that when
      git-checkout fails it does with an understandable message. Compared to the
      previous behavior we now have:
      
        - a better error message when doing:
      
              git checkout <blob reference> --
      
          now complains about the reference not pointing to a tree, instead of
          things like:
      
              error: pathspec <blob reference> did not match any file(s) known to git.
              error: pathspec '--' did not match any file(s) known to git.
      
        - a better error message when doing:
      
              git checkout <path> --
      
          It now complains about <path> not being a reference instead of the
          completely obscure:
      
              error: pathspec '--' did not match any file(s) known to git.
      
        - an error when -- wasn't used, and the first argument is ambiguous
          (i.e. can be interpreted as both ref and as path).
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      859fdaba
  29. 24 7月, 2008 1 次提交