git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicholas Guriev <nicholas@guriev.su>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3 2/4] difftool-helper: conciliate difftool.tabbed and difftool.prompt settings
Date: Mon, 25 Jan 2021 15:04:01 -0800	[thread overview]
Message-ID: <xmqqa6swy5y6.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20210125212132.894458-3-nicholas@guriev.su> (Nicholas Guriev's message of "Tue, 26 Jan 2021 00:21:30 +0300")

Nicholas Guriev <nicholas@guriev.su> writes:

> 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.

  reply	other threads:[~2021-01-25 23:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  5:59 [RFC PATCH] mergetools: support difftool.tabbed setting Nicholas Guriev
2021-01-18 21:00 ` [RFC PATCH v2 0/3] implement tabbed mode in difftools Nicholas Guriev
2021-01-18 21:00   ` [RFC PATCH v2 1/3] mergetools: support difftool.tabbed setting Nicholas Guriev
2021-01-18 23:25     ` Junio C Hamano
2021-01-18 21:00   ` [RFC PATCH v2 2/3] difftool-helper: conciliate difftool.tabbed and difftool.prompt settings Nicholas Guriev
2021-01-18 21:00   ` [RFC PATCH v2 3/3] doc: describe new difftool.tabbed feature Nicholas Guriev
2021-01-25 21:21   ` [PATCH v3 0/4] difftools in tabbed mode Nicholas Guriev
2021-01-25 21:21     ` [PATCH v3 1/4] mergetools: support difftool.tabbed setting Nicholas Guriev
2021-01-25 21:21     ` [PATCH v3 2/4] difftool-helper: conciliate difftool.tabbed and difftool.prompt settings Nicholas Guriev
2021-01-25 23:04       ` Junio C Hamano [this message]
2021-01-25 21:21     ` [PATCH v3 3/4] doc: describe new difftool.tabbed feature Nicholas Guriev
2021-01-25 21:21     ` [PATCH v3 4/4] t7800: new tests of " Nicholas Guriev
2021-02-12  5:51 ` [RFC PATCH] mergetools: support difftool.tabbed setting David Aguilar
2021-02-12 22:21   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa6swy5y6.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=nicholas@guriev.su \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).