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

[RFC PATCH v2 0/3] implement tabbed mode in difftools

From
NGNicholas Guriev <nicholas@guriev.su>
Date
Jan 18, 2021, 21:00 UTC
Message-ID
<20210118210003.3071205-1-nicholas@guriev.su>
In-Reply-To
<2fb58fd30ae730ccd3e88ec51b5fe6d80ab7a8c7.camel@guriev.su>

In this mode the "git difftool" command opens all compared files via single invocation of an editor passing to it entire list of the changed files. I find it useful, and it allows a user to switch easily forward and back between the files. You will find some screenshots demonstrating the feature in my previous message.

The patch series looks better now, and the two problems mentioned earlier have been solved. I added a new static function, forget_tempfile, into the diff.c file. It cleans diff_temp structures and do not remove the temporary files. They anyway would be deleted in an atexit handler. In this way, I can collect content of all changed files before running the editor.

For solving the second problem with spaces, I am separating file names with line-feeds, '\n', that are less common. This restriction is the same with the "git mergetool" command. I think it is acceptable at the present stage.

I have also repaired prompting in the tabbed mode. In such case, the command asks a user only once right before starting the editor. And I have described briefly the new changes to the best of my ability.

Alas, some other problems still remain. First, some automated tests failed that related to the difftool.prompt setting. I have modified its behavior a bit and it now contains a loop. Second, there are no new tests, yet I am going to add them later. And third, the main remaining problem is the method of calling of the difftool helper. I do not like that I have to write temporary files in the helper code to store its state between invocations. But maybe, someone offer a better solution that is easy to incorporate into the current architecture.

In conclusion, the patches are still not ready for merging, and any comments or testing are welcome.

Nicholas Guriev (3):
  mergetools: support difftool.tabbed setting
  difftool-helper: conciliate difftool.tabbed and difftool.prompt
    settings
  doc: describe new difftool.tabbed feature
 Documentation/config/difftool.txt |  6 +++
 Documentation/git-difftool.txt    | 19 ++++++++--
 Documentation/git.txt             |  4 ++
 builtin/difftool.c                |  7 +++-
 diff.c                            | 10 ++++-
 git-difftool--helper.sh           | 39 ++++++++++++-------
 git-mergetool--lib.sh             | 62 ++++++++++++++++++++++++++++++-
 mergetools/meld                   |  4 ++
 mergetools/vimdiff                | 17 +++++++++
 9 files changed, 148 insertions(+), 20 deletions(-)
-- 
2.27.0
Previous: Nicholas GurievNext: Nicholas Guriev
Message 2 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.