1. 12 4月, 2011 3 次提交
  2. 08 4月, 2011 1 次提交
    • J
      merge: allow "-" as a short-hand for "previous branch" · 4e8115ff
      Junio C Hamano 提交于
      Just like "git checkout -" is a short-hand for "git checkout @{-1}" to
      conveniently switch back to the previous branch, "git merge -" is a
      short-hand for "git merge @{-1}" to conveniently merge the previous branch.
      
      It will allow me to say:
      
          $ git checkout -b au/topic
          $ git am -s ./+au-topic.mbox
          $ git checkout pu
          $ git merge -
      
      which is an extremely typical and repetitive operation during my git day.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4e8115ff
  3. 26 3月, 2011 1 次提交
    • J
      merge: merge unborn index before setting ref · 97b1b4f3
      Jeff King 提交于
      When we merge into an unborn branch, there are basically two
      steps:
      
        1. Write the sha1 of the new commit into the ref pointed
           to by HEAD.
      
        2. Update the index with the new content, and check it out
           to the working tree.
      
      We currently do them in this order. However, (2) is the step
      that is much more likely to fail, since it can be blocked by
      things like untracked working tree files. When it does, the
      merge fails and we are left with an empty index but an
      updated HEAD.
      
      This patch switches the order, so that a failure in updating
      the index leaves us unchanged. Of course, a failure in
      updating the ref now leaves us with an updated index and
      mis-matched HEAD. That is arguably not much better, but it
      is probably less likely to actually happen.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      97b1b4f3
  4. 24 3月, 2011 2 次提交
  5. 10 3月, 2011 3 次提交
  6. 22 2月, 2011 2 次提交
    • J
      Introduce CHERRY_PICK_HEAD · d7e5c0cb
      Jay Soffian 提交于
      When a cherry-pick conflicts git advises:
      
       $ git commit -c <original commit id>
      
      to preserve the original commit message and authorship. Instead, let's
      record the original commit id in CHERRY_PICK_HEAD and advise:
      
        $ git commit -c CHERRY_PICK_HEAD
      
      A later patch teaches git to handle the '-c CHERRY_PICK_HEAD' part.
      Note that we record CHERRY_PICK_HEAD even in the case where there
      are no conflicts so that we may use it to communicate authorship to
      commit; this will then allow us to remove set_author_ident_env from
      revert.c. However, we do not record CHERRY_PICK_HEAD when --no-commit
      is used, as presumably the user intends to further edit the commit
      and possibly even cherry-pick additional commits on top.
      
      Tests and documentation contributed by Jonathan Nieder.
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d7e5c0cb
    • J
      merge: enable progress reporting for rename detection · 99bfc669
      Jeff King 提交于
      The user can enable or disable it explicitly with the new
      --progress, but it defaults to checking isatty(2).
      
      This works only with merge-recursive and subtree. In theory
      we could pass a progress flag to other strategies, but none
      of them support progress at this point, so let's wait until
      they grow such a feature before worrying about propagating
      it.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      99bfc669
  7. 16 2月, 2011 3 次提交
  8. 29 12月, 2010 1 次提交
  9. 18 11月, 2010 2 次提交
    • J
      Provide 'git merge --abort' as a synonym to 'git reset --merge' · 35d2fffd
      Johan Herland 提交于
      Teach 'git merge' the --abort option, which verifies the existence of
      MERGE_HEAD and then invokes 'git reset --merge' to abort the current
      in-progress merge and attempt to reconstruct the pre-merge state.
      
      The reason for adding this option is to provide a user interface for
      aborting an in-progress merge that is consistent with the interface
      for aborting a rebase ('git rebase --abort'), aborting the application
      of a patch series ('git am --abort'), and aborting an in-progress notes
      merge ('git notes merge --abort').
      
      The patch includes documentation and testcases that explain and verify
      the various scenarios in which 'git merge --abort' can run. The
      testcases also document the cases in which 'git merge --abort' is
      unable to correctly restore the pre-merge state (look for the '###'
      comments towards the bottom of t/t7609-merge-abort.sh).
      
      This patch has been improved by the following contributions:
      - Jonathan Nieder: Move test documentation into test_description
      
      Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      35d2fffd
    • J
      cmd_merge(): Parse options before checking MERGE_HEAD · 2a22c1b3
      Johan Herland 提交于
      Reorder the initial part of builtin/merge.c:cmd_merge() so that command-line
      options are parsed _before_ we load the index and check for MERGE_HEAD
      (and exits if it exists). This does not change the behaviour of 'git merge',
      but is needed in preparation for the implementation of 'git merge --abort'
      (which requires MERGE_HEAD to be present).
      
      This patch has been improved by the following contributions:
      - Junio C Hamano: fixup minor style issues
      
      Thanks-to: Junio C Hamano <gitster@pobox.com>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2a22c1b3
  10. 16 11月, 2010 1 次提交
  11. 04 11月, 2010 1 次提交
  12. 23 10月, 2010 1 次提交
  13. 10 9月, 2010 3 次提交
  14. 04 9月, 2010 3 次提交
  15. 27 8月, 2010 1 次提交
  16. 19 8月, 2010 1 次提交
  17. 16 8月, 2010 1 次提交
  18. 12 8月, 2010 4 次提交
    • M
      unpack_trees: group error messages by type · e6c111b4
      Matthieu Moy 提交于
      When an error is encountered, it calls add_rejected_file() which either
      - directly displays the error message and stops if in plumbing mode
        (i.e. if show_all_errors is not initialized at 1)
      - or stores it so that it will be displayed at the end with display_error_msgs(),
      
      Storing the files by error type permits to have a list of files for
      which there is the same error instead of having a serie of almost
      identical errors.
      
      As each bind_overlap error combines a file and an old file, a list cannot be
      done, therefore, theses errors are not stored but directly displayed.
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e6c111b4
    • D
      merge-recursive: porcelain messages for checkout · 23cbf11b
      Diane Gasselin 提交于
      A porcelain message was first added in checkout.c in the commit
      8ccba008 (Junio C Hamano, Sat May 17 21:03:49 2008, unpack-trees:
      allow Porcelain to give different error messages) to give better feedback
      in the case of merge errors.
      
      This patch adapts the porcelain messages for the case of checkout
      instead. This way, when having a checkout error, "merge" no longer
      appears in the error message.
      
      While we're there, we add an advice in the case of
      would_lose_untracked_file.
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      23cbf11b
    • M
      Turn unpack_trees_options.msgs into an array + enum · 08353ebb
      Matthieu Moy 提交于
      The list of error messages was introduced as a structure, but an array
      indexed over an enum is more flexible, since it allows one to store a
      type of error message (index in the array) in a variable.
      
      This change needs to rename would_lose_untracked ->
      would_lose_untracked_file to avoid a clash with the function
      would_lose_untracked in merge-recursive.c.
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      08353ebb
    • G
      split_cmdline: Allow caller to access error string · ad9ac6db
      Greg Brockman 提交于
      This allows the caller to add its own error message to that returned
      by split_cmdline.  Thus error output following a failed split_cmdline
      can be of the form
      
      fatal: Bad alias.test string: cmdline ends with \
      
      rather than
      
      error: cmdline ends with \
      fatal: Bad alias.test string
      Signed-off-by: NGreg Brockman <gdb@mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ad9ac6db
  19. 07 8月, 2010 1 次提交
    • J
      merge-recursive --renormalize · 7610fa57
      Jonathan Nieder 提交于
      Teach "git merge-recursive" a --renormalize option to enable the
      merge.renormalize configuration.  The --no-renormalize option can
      be used to override it in the negative.
      
      So in the future, you might be able to, e.g.:
      
      	git checkout -m -Xrenormalize otherbranch
      
      or
      
      	git revert -Xrenormalize otherpatch
      
      or
      
      	git pull --rebase -Xrenormalize
      
      The bad part: merge.renormalize is still not honored for most
      commands.  And it reveals lots of places that -X has not been plumbed
      in (so we get "git merge -Xrenormalize" but not much else).
      
      NEEDSWORK: tests
      
      Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7610fa57
  20. 03 7月, 2010 1 次提交
    • E
      Avoid conflicts when merging branches with mixed normalization · f217f0e8
      Eyvind Bernhardsen 提交于
      Currently, merging across changes in line ending normalization is
      painful since files containing CRLF will conflict with normalized files,
      even if the only difference between the two versions is the line
      endings.  Additionally, any "real" merge conflicts that exist are
      obscured because every line in the file has a conflict.
      
      Assume you start out with a repo that has a lot of text files with CRLF
      checked in (A):
      
            o---C
           /     \
          A---B---D
      
      B: Add "* text=auto" to .gitattributes and normalize all files to
         LF-only
      
      C: Modify some of the text files
      
      D: Try to merge C
      
      You will get a ridiculous number of LF/CRLF conflicts when trying to
      merge C into D, since the repository contents for C are "wrong" wrt the
      new .gitattributes file.
      
      Fix ll-merge so that the "base", "theirs" and "ours" stages are passed
      through convert_to_worktree() and convert_to_git() before a three-way
      merge.  This ensures that all three stages are normalized in the same
      way, removing from consideration differences that are only due to
      normalization.
      
      This feature is optional for now since it changes a low-level mechanism
      and is not necessary for the majority of users.  The "merge.renormalize"
      config variable enables it.
      Signed-off-by: NEyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f217f0e8
  21. 11 5月, 2010 3 次提交
  22. 02 4月, 2010 1 次提交