maphew

Visually compare git branches on Bluefin Linux, a quest

I’m new to the atomic image world, and haven’t used fedora for so long it might as well be never. After installing a flatpack app it’s not available in terminal. What’s the standard way of fixing that?

For instance: meld launches fine from app menu but not terminal:

❯ flatpak list |grep meld
    61:	Meld	org.gnome.meld	3.22.2	stable	x86_64	flathub	system

~ 
❯ meld
bash: meld: command not found

~ 
❯ locate meld
/sysroot/ostree/deploy/default/deploy/07aa527aa39c75c39203ae00e828242526f9d34869539d95d1e81916337b2a7a.0/usr/libexec/git-core/mergetools/meld
/usr/libexec/git-core/mergetools/meld
/var/home/matt/.cache/gnome-software/icons/12627a6340d33c1a6429c784f962c796be69647e-org.gnome.meld.desktop.png
/var/home/matt/.cache/gnome-software/icons/353ba98565e2321f1b351c5ff78ad4e15c7aaf79-org.gnome.meld.desktop.png

~ 
❯ usr/libexec/git-core/mergetools/meld
bash: usr/libexec/git-core/mergetools/meld: No such file or directory

What is the actual command to run meld? What is the idiomatic way of figuring this out?

A (inffy):

flatpak run org.gnome.meld

 

Is there a standard method for “enable cmd line for my flatpack apps”? I mean I know that armed with the above I can add alias meld='flatpak run org.gnome.meld' to .bashrc, but is that an expected app-by-app user task or is there a general solution/setting I just haven’t run across yet?

❯ which meld
alias meld='flatpak run org.gnome.meld'
    /usr/bin/flatpak

❯ git difftool -d develop feature/bare2share
The diff tool meld is not available as 'meld'
warning: failed: 1

shit.

gippity says

Your meld command is an alias for flatpak run org.gnome.meld, but git difftool expects meld to be a direct executable in your PATH.

Create a shell script wrapper for meld and add it to your PATH

(and proceeded to give wrong bin etc. that's ok, I got the info I needed

#!/bin/sh
flatpak run org.gnome.meld "$@"

still not working:

Article Image

Good grief. I started this 3 hours ago. On Windows I would fire up Git Extensions, check out a branch, select other branch or commit in the graph tree >> r-click >> Diff, which would open up my configured diff tool WinMerge, and I'm off to the races. Argh!

This isn't a windoze-is-better gripe. It took me awhile to find and decide on Git Extensions, and WinMerge. I just expected a smoother Linux experience. It is after all the home for developers, right?, and Bluefin is 

“For end users it provides a system as reliable as a Chromebook with near-zero maintenance while providing developers with a powerful cloud-native development mode. Built with next generation tech, for people who need their machines to get work done.”

sigh. not today, not for me. Someone is in the kitchen scrubbing the stove. There's real world work to be done and I'm still here not doing what I sat down to do. Time to give up and do housework. The tools there at least will work and be unsurprising.

Later courtesy of https://github.com/flatpak/flatpak/issues/1423#issuecomment-497959576 :

The --file-forwarding option only exports files, so it does not work with git difftool --dir-diff. However the alternative suggestion to use --filesystem=/tmp works instead.

Rather than expose all of /tmp, this could be changed to --filesystem=$LOCAL --filesystem=$REMOTE, except that $LOCAL and $REMOTE need to be converted to absolute paths first.

These settings in .gitconfig seem to work (although it is uglier):

[diff]
	tool = meld_flatpak

[difftool "meld_flatpak"]
        cmd = flatpak run \"--filesystem=$(realpath \"$LOCAL\")\" \"--filesystem=$(realpath \"$REMOTE\")\" org.gnome.meld \"$LOCAL\" \"$REMOTE\"

Also reported in: flathub/org.gnome.meld#11