git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/6] difftool and mergetool improvements

From
Denton Liu <liu.denton@gmail.com>
Date
Apr 24, 2019, 22:46 UTC
Message-ID
<cover.1556142510.git.liu.denton@gmail.com>
In-Reply-To
<cover.1556009181.git.liu.denton@gmail.com>
Thanks for the review, Junio.

I hadn't thought about using the return code for `get_merge_tool` so thanks for that suggestion. It should be a lot cleaner now.

---
Changes since v2:
* Unsuppress output in t7610
* Make `get_merge_tool` return 1 on guessed so we don't have to deal
  with parsing '$guessed:$merge_tool'
Changes since v1:
* Introduce get_merge_tool_guessed function instead of changing
  get_merge_tool
* Remove unnecessary if-tower in mutual exclusivity logic
Denton Liu (6):
  t7610: unsuppress output
  t7610: add mergetool --gui tests
  mergetool: use get_merge_tool function
  mergetool: fallback to tool when guitool unavailable
  difftool: make --gui, --tool and --extcmd mutually exclusive
  difftool: fallback on merge.guitool
 Documentation/git-difftool.txt       |   4 +-
 Documentation/git-mergetool--lib.txt |   4 +-
 Documentation/git-mergetool.txt      |   4 +-
 builtin/difftool.c                   |  13 +--
 git-difftool--helper.sh              |   2 +-
 git-mergetool--lib.sh                |  32 ++++--
 git-mergetool.sh                     |  12 +-
 t/t7610-mergetool.sh                 | 163 +++++++++++++++++----------
 t/t7800-difftool.sh                  |  24 ++++
 9 files changed, 167 insertions(+), 91 deletions(-)
Range-diff against v2:
-:  ---------- > 1:  9f9922cab3 t7610: unsuppress output
1:  c436765684 ! 2:  0f632ca6bf t7610: add mergetool --gui tests
    @@ -23,14 +23,14 @@
     +	test_when_finished "git reset --hard" &&
     +	git checkout -b test$test_count branch1 &&
     +	git submodule update -N &&
    -+	test_must_fail git merge master >/dev/null 2>&1 &&
    -+	( yes "" | git mergetool --gui both >/dev/null 2>&1 ) &&
    ++	test_must_fail git merge master &&
    ++	( yes "" | git mergetool --gui both ) &&
     +	( yes "" | git mergetool -g file1 file1 ) &&
    -+	( yes "" | git mergetool --gui file2 "spaced name" >/dev/null 2>&1 ) &&
    -+	( yes "" | git mergetool --gui subdir/file3 >/dev/null 2>&1 ) &&
    -+	( yes "d" | git mergetool --gui file11 >/dev/null 2>&1 ) &&
    -+	( yes "d" | git mergetool --gui file12 >/dev/null 2>&1 ) &&
    -+	( yes "l" | git mergetool --gui submod >/dev/null 2>&1 ) &&
    ++	( yes "" | git mergetool --gui file2 "spaced name" ) &&
    ++	( yes "" | git mergetool --gui subdir/file3 ) &&
    ++	( yes "d" | git mergetool --gui file11 ) &&
    ++	( yes "d" | git mergetool --gui file12 ) &&
    ++	( yes "l" | git mergetool --gui submod ) &&
     +	test "$(cat file1)" = "gui master updated" &&
     +	test "$(cat file2)" = "gui master new" &&
     +	test "$(cat subdir/file3)" = "gui master new sub" &&
2:  9f8e76a421 < -:  ---------- mergetool: use get_merge_tool_guessed function
-:  ---------- > 3:  ff83d25ff2 mergetool: use get_merge_tool function
3:  4847e64e46 ! 4:  e975fe4a8b mergetool: fallback to tool when guitool unavailable
    @@ -81,18 +81,18 @@
      	git commit -m "branch1 resolved with mergetool"
      '
      
    -+test_expect_success 'gui mergetool without merge.guitool set fallsback to merge.tool' '
    ++test_expect_success 'gui mergetool without merge.guitool set falls back to merge.tool' '
     +	test_when_finished "git reset --hard" &&
     +	git checkout -b test$test_count branch1 &&
     +	git submodule update -N &&
    -+	test_must_fail git merge master >/dev/null 2>&1 &&
    -+	( yes "" | git mergetool --gui both >/dev/null 2>&1 ) &&
    ++	test_must_fail git merge master &&
    ++	( yes "" | git mergetool --gui both ) &&
     +	( yes "" | git mergetool -g file1 file1 ) &&
    -+	( yes "" | git mergetool --gui file2 "spaced name" >/dev/null 2>&1 ) &&
    -+	( yes "" | git mergetool --gui subdir/file3 >/dev/null 2>&1 ) &&
    -+	( yes "d" | git mergetool --gui file11 >/dev/null 2>&1 ) &&
    -+	( yes "d" | git mergetool --gui file12 >/dev/null 2>&1 ) &&
    -+	( yes "l" | git mergetool --gui submod >/dev/null 2>&1 ) &&
    ++	( yes "" | git mergetool --gui file2 "spaced name" ) &&
    ++	( yes "" | git mergetool --gui subdir/file3 ) &&
    ++	( yes "d" | git mergetool --gui file11 ) &&
    ++	( yes "d" | git mergetool --gui file12 ) &&
    ++	( yes "l" | git mergetool --gui submod ) &&
     +	test "$(cat file1)" = "master updated" &&
     +	test "$(cat file2)" = "master new" &&
     +	test "$(cat subdir/file3)" = "master new sub" &&
4:  bc8cadaf55 = 5:  bc3e229171 difftool: make --gui, --tool and --extcmd mutually exclusive
5:  e5e4dc3dd2 = 6:  f39b15efbd difftool: fallback on merge.guitool
-- 
2.21.0.1000.g7817e26e80
Previous: Denton LiuNext: Denton Liu
Message 20 of 48 in “difftool and mergetool improvements”
  1. 0/5 difftool and mergetool improvementsDenton Liu, Apr 22, 2019
  2. 1/5 t7610: add mergetool --gui testsDenton Liu, Apr 22, 2019
  3. 2/5 mergetool: use get_merge_tool functionDenton Liu, Apr 22, 2019
  4. Eric SunshineApr 22, 2019
  5. Denton LiuApr 22, 2019
  6. 3/5 mergetool: fallback to tool when guitool unavailableDenton Liu, Apr 22, 2019
  7. 4/5 difftool: make --gui, --tool and --extcmd exclusiveDenton Liu, Apr 22, 2019
  8. Eric SunshineApr 22, 2019
  9. 5/5 difftool: fallback on merge.guitoolDenton Liu, Apr 22, 2019
  10. Jeff HostetlerApr 22, 2019
  11. Denton LiuApr 22, 2019
  12. 0/5 difftool and mergetool improvementsDenton Liu, Apr 23, 2019
  13. 1/5 t7610: add mergetool --gui testsDenton Liu, Apr 23, 2019
  14. Junio C HamanoApr 24, 2019
  15. 2/5 mergetool: use get_merge_tool_guessed functionDenton Liu, Apr 23, 2019
  16. Junio C HamanoApr 24, 2019
  17. 3/5 mergetool: fallback to tool when guitool unavailableDenton Liu, Apr 23, 2019
  18. 4/5 difftool: make --gui, --tool and --extcmd mutually exclusiveDenton Liu, Apr 23, 2019
  19. 5/5 difftool: fallback on merge.guitoolDenton Liu, Apr 23, 2019
  20. 0/6 difftool and mergetool improvementsDenton Liu, Apr 24, 2019
  21. 1/6 t7610: unsuppress outputDenton Liu, Apr 24, 2019
  22. Junio C HamanoApr 25, 2019
  23. 2/6 t7610: add mergetool --gui testsDenton Liu, Apr 24, 2019
  24. 3/6 mergetool: use get_merge_tool functionDenton Liu, Apr 24, 2019
  25. Junio C HamanoApr 25, 2019
  26. 4/6 mergetool: fallback to tool when guitool unavailableDenton Liu, Apr 24, 2019
  27. Junio C HamanoApr 25, 2019
  28. Denton LiuApr 25, 2019
  29. 5/6 difftool: make --gui, --tool and --extcmd mutually exclusiveDenton Liu, Apr 24, 2019
  30. 6/6 difftool: fallback on merge.guitoolDenton Liu, Apr 24, 2019
  31. Junio C HamanoApr 25, 2019
  32. 0/6 difftool and mergetool improvementsDenton Liu, Apr 25, 2019
  33. 1/6 t7610: unsuppress outputDenton Liu, Apr 25, 2019
  34. 2/6 t7610: add mergetool --gui testsDenton Liu, Apr 25, 2019
  35. 3/6 mergetool: use get_merge_tool functionDenton Liu, Apr 25, 2019
  36. David AguilarApr 28, 2019
  37. 4/6 mergetool: fallback to tool when guitool unavailableDenton Liu, Apr 25, 2019
  38. David AguilarApr 28, 2019
  39. 5/6 difftool: make --gui, --tool and --extcmd mutually exclusiveDenton Liu, Apr 25, 2019
  40. 6/6 difftool: fallback on merge.guitoolDenton Liu, Apr 25, 2019
  41. 0/7 difftool and mergetool improvementsDenton Liu, Apr 29, 2019
  42. 1/7 t7610: unsuppress outputDenton Liu, Apr 29, 2019
  43. 2/7 t7610: add mergetool --gui testsDenton Liu, Apr 29, 2019
  44. 3/7 mergetool: use get_merge_tool functionDenton Liu, Apr 29, 2019
  45. 4/7 mergetool--lib: create gui_mode functionDenton Liu, Apr 29, 2019
  46. 5/7 mergetool: fallback to tool when guitool unavailableDenton Liu, Apr 29, 2019
  47. 6/7 difftool: make --gui, --tool and --extcmd mutually exclusiveDenton Liu, Apr 29, 2019
  48. 7/7 difftool: fallback on merge.guitoolDenton Liu, Apr 29, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.