1. 19 9月, 2011 2 次提交
  2. 27 8月, 2011 1 次提交
  3. 27 5月, 2011 1 次提交
    • J
      clean up calling conventions for pretty.c functions · 6bf13944
      Jeff King 提交于
      We have a pretty_print_context representing the parameters
      for a pretty-print session, but we did not use it uniformly.
      As a result, functions kept growing more and more arguments.
      
      Let's clean this up in a few ways:
      
        1. All pretty-print pp_* functions now take a context.
           This lets us reduce the number of arguments to these
           functions, since we were just passing around the
           context values separately.
      
        2. The context argument now has a cmit_fmt field, which
           was passed around separately. That's one less argument
           per function.
      
        3. The context argument always comes first, which makes
           calling a little more uniform.
      
      This drops lines from some callers, and adds lines in a few
      places (because we need an extra line to set the context's
      fmt field). Overall, we don't save many lines, but the lines
      that are there are a lot simpler and more readable.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6bf13944
  4. 17 5月, 2011 1 次提交
  5. 07 5月, 2011 1 次提交
  6. 12 4月, 2011 3 次提交
  7. 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
  8. 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
  9. 24 3月, 2011 2 次提交
  10. 10 3月, 2011 3 次提交
  11. 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
  12. 16 2月, 2011 3 次提交
  13. 29 12月, 2010 1 次提交
  14. 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
  15. 16 11月, 2010 1 次提交
  16. 04 11月, 2010 1 次提交
  17. 23 10月, 2010 1 次提交
  18. 10 9月, 2010 3 次提交
  19. 04 9月, 2010 3 次提交
  20. 27 8月, 2010 1 次提交
  21. 19 8月, 2010 1 次提交
  22. 16 8月, 2010 1 次提交
  23. 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