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

Re: [PATCH v3 2/4] difftool-helper: conciliate difftool.tabbed and difftool.prompt settings

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 25, 2021, 23:04 UTC
Message-ID
<xmqqa6swy5y6.fsf@gitster.c.googlers.com>
In-Reply-To
<20210125212132.894458-3-nicholas@guriev.su>
Nicholas Guriev <nicholas@guriev.su> writes:
Show 8 quoted lines
> The commit combines paths of compared files into a separate temporary
> file and prints them before launch the tool on last invocation of the
> helper. All temporary files will be removed before exiting after that.
> At least, we try. But it may happen the files remain in case of a bug
> or a random SIGKILL.
>
> Signed-off-by: Nicholas Guriev <nicholas@guriev.su>
> ---

Isn't the introduction of prompt_before_launch etc. would be a welcome change before step [v3 1/4]? If it makes a pure improvement of the existing code without adding any new/additional feature like the "tabbed" stuff, it would be better be discussed before anything else in the series.

Then the new "tabbed" stuff can take advantage of the cleaned up code with the new helpers---the patch that introduces the feature will become more concise and easier to follow, I would think.

If I am reading the patches right, [v3 1&2/4] goes the other way around: "let's add a new feature first in an ad-hoc way. ah, it seems that the code added for the new feature can be simplified if we tweak a few things, and while we are doing so, we can adjust old feature to use the same simplification again".

Regarding what [v3 1/4] does (which if we follow thru the above suggestion would become [v4 2/4]), I am not sure that we want to add 'if tabbed mode, do this, otherwise do that' to run_diff_cmd. It would become awkward to keep piling such a change on top in the function in the longer run. I am wondering if each mergetool can override run_diff_cmd as a whole, when it is dot-sourced to set up itself. The logic you added inside is_difftool_tabbed in [v3 1/4] would probably need to be made available to the dot-sourced backends so that they can just call something without reimplementing the same logic, but by doing so, diff_combo_supported would become unneeded. Tools that do not support the "combo" mode just do not have to do anything.

But such a change would become easier to review if we do restructure like this [v3 2/4] does earlier in the series _before_ a new feature gets introduced.

Thanks.
Previous: Nicholas GurievNext: David Aguilar
Message 12 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.