Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up a flatpak version of Meld as git mergetool?

Installing Meld as a regular Linux package, it is fairly straighforward to setup Meld as git merge tool, here is an extract of my .gitconfig.

[merge]
  tool = meld
[mergetool "meld"]
  trustExitCode = true
  cmd = meld --args --auto-merge \"$PWD/$LOCAL\" \"$PWD/$BASE\" \"$PWD/$REMOTE\" --output=\"$PWD/$MERGED\"

But what about the flatpak version of Meld which you cannot execute simply with the command meld? I guess the cmd part should be something like

cmd = flatpak run org.gnome.meld --args --auto-merge \"$PWD/$LOCAL\" \"$PWD/$BASE\" \"$PWD/$REMOTE\" --output=\"$PWD/$MERGED\"

but this exact command doesn't work. How should it be modified?

like image 452
oidualc Avatar asked Oct 17 '25 16:10

oidualc


2 Answers

After going through this process today, I figured I would share my final working solution for a 3-way merge. It is based on the possible translation from VonC above.

[merge]
  tool = meld_flatpak

[mergetool "meld_flatpak"]
  cmd = flatpak run --file-forwarding org.gnome.meld \"@@\" $LOCAL \"@@\" \"@@\" $BASE \"@@\" \"@@\" $REMOTE \"@@\" --output \"@@\" $MERGED \"@@\"

[mergetool]
  prompt = false
  keepBackup = false
  writeToTemp = true
like image 187
Mike Avatar answered Oct 19 '25 05:10

Mike


Check if this is similar to flatpak issue 1423:

You need the following command:

My .gitconfig:

[diff]
    tool = meld_flatpak


[difftool "meld_flatpak"]
    cmd = flatpak run --file-forwarding org.gnome.meld \"@@\" $LOCAL \"@@\" \"@@\" $REMOTE \"@@\"


[difftool]
    prompt = false

A possible translation for mergetool (considering the syntax for meld):

cmd = flatpak run --file-forwarding org.gnome.meld $LOCAL \"@@\" $BASE \"@@\" $REMOTE \"@@\" --output=$MERGED \"@@\""
like image 41
VonC Avatar answered Oct 19 '25 07:10

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!