1. 30 11月, 2016 2 次提交
    • D
      mergetools/vimdiff: trust Vim's exit code · 29672844
      David Aguilar 提交于
      Allow vimdiff users to signal that they do not want to use the
      result of a merge by exiting with ":cquit", which tells Vim to
      exit with an error code.
      
      This is better than the current behavior because it allows users
      to directly flag that the merge is bad, using a standard Vim
      feature, rather than relying on a timestamp heuristic that is
      unforgiving to users that save in-progress merge files.
      
      The original behavior can be restored by configuring
      mergetool.vimdiff.trustExitCode to false.
      Reported-by: NDun Peal <dunpealer@gmail.com>
      Signed-off-by: NDavid Aguilar <davvid@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      29672844
    • D
      mergetool: honor mergetool.$tool.trustExitCode for built-in tools · 7c10605d
      David Aguilar 提交于
      Built-in merge tools contain a hard-coded assumption about
      whether or not a tool's exit code can be trusted to determine
      the success or failure of a merge.  Tools whose exit codes are
      not trusted contain calls to check_unchanged() in their
      merge_cmd() functions.
      
      A problem with this is that the trustExitCode configuration is
      not honored for built-in tools.
      
      Teach built-in tools to honor the trustExitCode configuration.
      Extend run_merge_cmd() so that it is responsible for calling
      check_unchanged() when a tool's exit code cannot be trusted.
      Remove check_unchanged() calls from scriptlets since they are no
      longer responsible for calling it.
      
      When no configuration is present, exit_code_trustable() is
      checked to see whether the exit code should be trusted.
      The default implementation returns false.
      
      Tools whose exit codes can be trusted override
      exit_code_trustable() to true.
      Reported-by: NDun Peal <dunpealer@gmail.com>
      Signed-off-by: NDavid Aguilar <davvid@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7c10605d
  2. 05 4月, 2016 2 次提交
  3. 13 2月, 2016 1 次提交
  4. 21 5月, 2015 1 次提交
  5. 22 11月, 2014 1 次提交
  6. 22 10月, 2014 1 次提交
  7. 17 10月, 2014 1 次提交
  8. 23 4月, 2014 1 次提交
  9. 14 10月, 2013 1 次提交
  10. 10 5月, 2013 1 次提交
  11. 14 3月, 2013 2 次提交
    • K
      mergetools/p4merge: create a base if none available · 4549162e
      Kevin Bracey 提交于
      Originally, with no base, Git gave P4Merge $LOCAL as a dummy base:
      
         p4merge "$LOCAL" "$LOCAL" "$REMOTE" "$MERGED"
      
      Commit 0a0ec7bd changed this to:
      
         p4merge "empty file" "$LOCAL" "$REMOTE" "$MERGED"
      
      to avoid the problem of being unable to save in some circumstances with
      similar inputs.
      
      Unfortunately this approach produces much worse results on differing
      inputs. P4Merge really regards the blank file as the base, and once you
      have just a couple of differences between the two branches you end up
      with one a massive full-file conflict. The 3-way diff is not readable,
      and you have to invoke "difftool MERGE_HEAD HEAD" manually to get a
      useful view.
      
      The original approach appears to have invoked special 2-way merge
      behaviour in P4Merge that occurs only if the base filename is "" or
      equal to the left input.  You get a good visual comparison, and it does
      not auto-resolve differences. (Normally if one branch matched the base,
      it would autoresolve to the other branch).
      
      But there appears to be no way of getting this 2-way behaviour and being
      able to reliably save. Having base==left appears to be triggering other
      assumptions. There are tricks the user can use to force the save icon
      on, but it's not intuitive.
      
      So we now follow a suggestion given in the original patch's discussion:
      generate a virtual base, consisting of the lines common to the two
      branches. This is the same as the technique used in resolve and octopus
      merges, so we relocate that code to a shared function.
      
      Note that if there are no differences at the same location, this
      technique can lead to automatic resolution without conflict, combining
      everything from the 2 files.  As with the other merges using this
      technique, we assume the user will inspect the result before saving.
      Signed-off-by: NKevin Bracey <kevin@bracey.fi>
      Reviewed-by: NDavid Aguilar <davvid@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4549162e
    • K
      mergetools/p4merge: swap LOCAL and REMOTE · c699a7cc
      Kevin Bracey 提交于
      Reverse LOCAL and REMOTE when invoking P4Merge as a mergetool, so that
      the incoming branch is now in the left-hand, blue triangle pane, and the
      current branch is in the right-hand, green circle pane.
      
      This change makes use of P4Merge consistent with its built-in help, its
      reference documentation, and Perforce itself. But most importantly, it
      makes merge results clearer. P4Merge is not totally symmetrical between
      left and right; despite changing a few text labels from "theirs/ours" to
      "left/right" when invoked manually, it still retains its original
      Perforce "theirs/ours" viewpoint.
      
      Most obviously, in the result pane P4Merge shows changes that are common
      to both branches in green. This is on the basis of the current branch
      being green, as it is when invoked from Perforce; it means that lines in
      the result are blue if and only if they are being changed by the merge,
      making the resulting diff clearer.
      
      Note that P4Merge now shows "ours" on the right for both diff and merge,
      unlike other diff/mergetools, which always have REMOTE on the right.
      But observe that REMOTE is the working tree (ie "ours") for a diff,
      while it's another branch (ie "theirs") for a merge.
      
      Ours and theirs are reversed for a rebase - see "git help rebase".
      However, this does produce the desired "show the results of this commit"
      effect in P4Merge - changes that remain in the rebased commit (in your
      branch, but not in the new base) appear in blue; changes that do not
      appear in the rebased commit (from the new base, or common to both) are
      in green. If Perforce had rebase, they'd probably not swap ours/theirs,
      but make P4Merge show common changes in blue, picking out our changes in
      green. We can't do that, so this is next best.
      Signed-off-by: NKevin Bracey <kevin@bracey.fi>
      Reviewed-by: NDavid Aguilar <davvid@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c699a7cc
  12. 11 2月, 2013 1 次提交
  13. 02 2月, 2013 1 次提交
  14. 29 1月, 2013 1 次提交
  15. 28 1月, 2013 1 次提交
  16. 27 1月, 2013 1 次提交
  17. 27 12月, 2012 1 次提交
  18. 12 10月, 2012 1 次提交
  19. 26 9月, 2012 1 次提交
  20. 10 8月, 2012 1 次提交
  21. 06 3月, 2012 1 次提交
  22. 11 2月, 2012 1 次提交
    • J
      mergetools/meld: Use --help output to detect --output support · 759a904e
      Jonathan Nieder 提交于
      In v1.7.7-rc0~3^2 (2011-08-19), git mergetool's "meld" support learned
      to use the --output option when calling versions of meld that are
      detected to support it (1.5.0 and newer, hopefully).
      
      Alas, it misdetects old versions (before 1.1.5, 2006-06-11) of meld as
      supporting the option, so on systems with such meld, instead of
      getting a nice merge helper, the operator gets a dialog box with the
      text "Wrong number of arguments (Got 5)".  (Version 1.1.5 is when meld
      switched to using optparse.  One consequence of that change was that
      errors in usage are detected and signalled through the exit status
      even when --help was passed.)
      
      Luckily there is a simpler check that is more reliable: the usage
      string printed by "meld --help" reliably reflects whether --output is
      supported in a given version.  Use it.
      Reported-by: NJeff Epler <jepler@unpythonic.net>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      759a904e
  23. 16 10月, 2011 1 次提交
  24. 20 8月, 2011 1 次提交
  25. 19 8月, 2011 1 次提交