Re: [PATCH 2/3] mergetool-lib: keep a list of cross desktop merge tools
- From
Marco Trevisan (Treviño) <mail@3v1n0.net>
- Date
- Aug 6, 2020, 12:28 UTC
- Message-ID
- <CAALaScmKT44snh-5zTqe=Y2gjXjpo3fxRrbzotsXnr=+3Ap9ew@mail.gmail.com>
- In-Reply-To
- <CAPig+cRX3_ArTYQwc1jWHznBxLf+j0McYSo=nPq4C319J=DBvg@mail.gmail.com>
Il giorno mer 5 ago 2020 alle ore 23:08 Eric Sunshine <sunshine@sunshineco.com> ha scritto:
Show 27 quoted lines
>
> On Wed, Aug 5, 2020 at 3:53 PM Marco Trevisan (Treviño) via
> GitGitGadget <gitgitgadget@gmail.com> wrote:
> > Instead of repeating the same tools multiple times, let's just keep them
> > in another variable and list them depending the current desktop
> >
> > Signed-off-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
> > ---
> > diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> > @@ -288,11 +288,12 @@ list_merge_tool_candidates () {
> > if test -n "$DISPLAY"
> > then
> > + cross_desktop_tools="opendiff kdiff3 tkdiff xxdiff"
> > if is_desktop "GNOME"
> > then
> > - tools="meld opendiff kdiff3 tkdiff xxdiff $tools"
> > + tools="meld $cross_desktop_tools $tools"
> > else
> > - tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
> > + tools="$cross_desktop_tools meld $tools"
> > fi
>
> I have mixed feelings about this change. On the one hand, I see the
> reason for doing it if the list of tools remains substantially the
> same in each case, but it also seems like it could become a burden,
> possibly requiring factoring the list into more pieces, as new
> platforms or tools are added.I kind of agree on that, so it was mostly a proposal but I can withdraw it.
Show 5 quoted lines
> What I might find more compelling is creation of a table of tools and > the platforms for which they are suitable. It doesn't seem like it > would be too difficult to express such a table in shell and to extract > the desired rows (but that might be overkill). At any rate, I'm rather > "meh" on this change, though I don't oppose it strongly.
Yeah, I was thinking the same, but also could be a bit complicated to maintain especially when it comes using something that needs to be supported by pure sh.
-- Treviño's World - Life and Linux http://www.3v1n0.net