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

[PATCH v3 0/4] difftools in tabbed mode

From
NGNicholas Guriev <nicholas@guriev.su>
Date
Jan 25, 2021, 21:21 UTC
Message-ID
<20210125212132.894458-1-nicholas@guriev.su>
In-Reply-To
<20210118210003.3071205-1-nicholas@guriev.su>

Junio C Hamano, thank you for the comment. I added the diff_combo_supported function as you suggested. Though it calls to the `true` or the `false` builtins as I find them much clearer than the "return" command with inverted status. It is really confusing that C and most other programming languages adequately interpret non-zero as truth value and zero as falsity value unlike Unix Shell. Are such changes acceptable?

As regards broken tests, it may seem silly but that error was due to a single missing colon. I corrected the mistake and added some automated tests of this new feature.

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 529d55c96d..85a6dc9c30 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -31,7 +31,7 @@ prompt_before_launch () {
 	do
 		printf "Launch '%s' [Y/n]? " "${GIT_DIFFTOOL_EXTCMD:-$merge_tool}"
 		read ans 2>/dev/null || return 1
-		case "${ans-y}" in
+		case "${ans:-y}" in
 		[yY]*) return 0 ;;
 		[nN]*) return 1 ;;
 		esac

Changes compared to v2:
 * Introduced the diff_combo_supported function.
 * Fixed default answer to difftool prompting.
 * More docs about the diff tool mechanism.
 * New auto-tests of the feature.

Nicholas Guriev (4):
  mergetools: support difftool.tabbed setting
  difftool-helper: conciliate difftool.tabbed and difftool.prompt
    settings
  doc: describe new difftool.tabbed feature
  t7800: new tests of difftool.tabbed feature

 Documentation/config/difftool.txt    |   6 +
 Documentation/git-difftool.txt       |  19 ++-
 Documentation/git-mergetool--lib.txt |  62 ++++++++++
 Documentation/git.txt                |   8 ++
 builtin/difftool.c                   |   7 +-
 diff.c                               |  10 +-
 git-difftool--helper.sh              |  39 ++++--
 git-mergetool--lib.sh                |  71 ++++++++++-
 mergetools/meld                      |   8 ++
 mergetools/vimdiff                   |  21 ++++
 t/t7800-difftool.sh                  | 175 ++++++++++++++++++++++++++-
 11 files changed, 401 insertions(+), 25 deletions(-)
-- 
2.27.0
Previous: Nicholas GurievNext: Nicholas Guriev
Message 7 of 14 in “mergetools: support difftool.tabbed setting”
  1. mergetools: support difftool.tabbed settingNicholas Guriev, Jan 13, 2021
  2. 0/3 implement tabbed mode in difftoolsNicholas Guriev, Jan 18, 2021
  3. 2/3 difftool-helper: conciliate difftool.tabbed and difftool.prompt settingsNicholas Guriev, Jan 18, 2021
  4. 1/3 mergetools: support difftool.tabbed settingNicholas Guriev, Jan 18, 2021
  5. Junio C HamanoJan 18, 2021
  6. 3/3 doc: describe new difftool.tabbed featureNicholas Guriev, Jan 18, 2021
  7. 0/4 difftools in tabbed modeNicholas Guriev, Jan 25, 2021
  8. 4/4 t7800: new tests of difftool.tabbed featureNicholas Guriev, Jan 25, 2021
  9. 3/4 doc: describe new difftool.tabbed featureNicholas Guriev, Jan 25, 2021
  10. 1/4 mergetools: support difftool.tabbed settingNicholas Guriev, Jan 25, 2021
  11. 2/4 difftool-helper: conciliate difftool.tabbed and difftool.prompt settingsNicholas Guriev, Jan 25, 2021
  12. Junio C HamanoJan 25, 2021
  13. David AguilarFeb 12, 2021
  14. Junio C HamanoFeb 12, 2021

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.