Jguer / yay

Yet another Yogurt - An AUR Helper written in Go
GNU General Public License v3.0
10.9k stars 357 forks source link

yay --diffmenu using kompare opens empty #2478

Open nihakuto opened 1 month ago

nihakuto commented 1 month ago

Affected Version

yay v12.3.5 - libalpm v14.0.0

Describe the bug

When using yay to compile/install AUR software, if the user opts to view diffs, the configured diff tool kompare is opened but without the files preselected, resulting in a kompare window with empty fields.

Reproduction Steps

  1. Configure kompare as the diff tool for yay (via git's config, the $GIT_PAGER or $PAGER environment variables).
  2. Use yay to update an AUR package.
  3. When prompted to view diffs, select "Yes".
  4. Observe that kompare opens but without preselecting the diff files/PKGBUILD.

Expected behavior

kompare should open with the diff files preselected, showing the differences between the files.

Output


$ yay -Pg
{
    "aururl": "https://aur.archlinux.org",
    "aurrpcurl": "https://aur.archlinux.org/rpc?",
    "buildDir": "/home/dois/.cache/yay",
    "editor": "",
    "editorflags": "",
    "makepkgbin": "makepkg",
    "makepkgconf": "",
    "pacmanbin": "pacman",
    "pacmanconf": "/etc/pacman.conf",
    "redownload": "no",
    "answerclean": "",
    "answerdiff": "",
    "answeredit": "",
    "answerupgrade": "",
    "gitbin": "git",
    "gpgbin": "gpg",
    "gpgflags": "",
    "mflags": "",
    "sortby": "votes",
    "searchby": "name-desc",
    "gitflags": "",
    "removemake": "ask",
    "sudobin": "sudo",
    "sudoflags": "",
    "version": "12.3.5",
    "requestsplitn": 150,
    "completionrefreshtime": 7,
    "maxconcurrentdownloads": 5,
    "bottomup": true,
    "sudoloop": false,
    "timeupdate": false,
    "devel": false,
    "cleanAfter": false,
    "keepSrc": false,
    "provides": true,
    "pgpfetch": true,
    "cleanmenu": true,
    "diffmenu": true,
    "editmenu": true,
    "combinedupgrade": false,
    "useask": false,
    "batchinstall": false,
    "singlelineresults": false,
    "separatesources": true,
    "debug": false,
    "rpc": true,
    "doubleconfirm": true,
    "rebuild": "no"
}
Jguer commented 1 month ago

what arguments does kompare expect to work?

can you run with the config json entry "debug": true and share the output as well?

nihakuto commented 1 month ago

what arguments does kompare expect to work?

kompare expects two arguments, one for each file to compare, in this pattern: kompare $FILE1 $FILE2

(-c can be used for remote files' respective URLs)

can you run with the config json entry "debug": true and share the output as well?

I have no AUR packages in need of an update right now. I tried to force it by changing the PKGBUILD in the yay/cache, but was unable to. I must be missing something stupid. I'll either wait for an updated release to come, or try again to force later. If you know how to do so easily, tips are appreciated.

nihakuto commented 1 month ago

Here is the output, with diff menu, and debug active:

:: Synchronizing package databases... endeavouros is up to date core is up to date extra 7.2 MiB 7.83 MiB/s 00:01 [--------------------------------------------------------------------------------] 100% multilib is up to date :: Starting full system upgrade... there is nothing to do [DEBUG:db] populating db executor package caches. sync_len 1370 remote_len 33 :: Searching AUR for updates... [DEBUG:runtime] packages to query [alpm_octopi_utils aur-auto-vote-git bgrep-git bookmarksync-git check-broken-packages-pacman-hook-git cider2-bin code-features code-marketplace firefox-pwa floorp-bin freetype2-macos freetype2-macos-browsers-binary-patcher harmony2 koi kvantum-theme-catppuccin-git kwin-effect-rounded-corners-git lightlyshaders-plasma6-git localsend-bin mailspring masterpdfeditor-free mission-center octopi onlyoffice-bin pacdiff-pacman-hook-git pacman-log-orphans-hook plasma5-wallpapers-dynamic qt-sudo rustdesk snapd spotify tela-icon-theme termius waveterm-bin] [DEBUG:runtime] rpc request https://aur.archlinux.org/rpc?[.....EDITED FOR LENGTH......] [DEBUG:grapher] localsend-bin provides: localsend :: Searching databases for updates... :: 1 package to upgrade/install. 1 aur/localsend-bin 1.15.2-1 -> 1.15.3-1 ==> Packages to exclude: (eg: "1 2 3", "1-3", "^4" or repo name) -> Excluding packages may cause partial upgrades and break systems ==> AUR Explicit (1): localsend-bin-1.15.3-1 [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin pull --rebase --autostash :: (1/1) Downloaded PKGBUILD: localsend-bin [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin reset --hard HEAD [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin merge --no-edit --ff 1 localsend-bin (Installed) (Build Files Exist) ==> Packages to cleanBuild? ==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) ==> 1 localsend-bin (Installed) (Build Files Exist) ==> Diffs to show? ==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) ==> a [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin rev-parse --quiet --verify AUR_SEEN [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin rev-parse AUR_SEEN [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin rev-parse --quiet --verify AUR_SEEN [DEBUG:runner] capturing /usr/bin/git -C /home/dois/.cache/yay/localsend-bin rev-parse AUR_SEEN HEAD@{upstream} [DEBUG:runner] running /usr/bin/git -C /home/dois/.cache/yay/localsend-bin diff 29eb28f662fa88dce8cee29b0456cd300e80f653..HEAD@{upstream} --src-prefix /home/dois/.cache/yay/localsend-bin/ --dst-prefix /home/dois/.cache/yay/localsend-bin/ -- . :(exclude).SRCINFO --color=always :: Proceed with install? [Y/n]

nihakuto commented 3 weeks ago

Running something like the below command works, by making a file that kompare can actually ready. But I am struggling to get kompare to accept direct input from git diff.

git -C /home/dois/.cache/yay/floorp-bin diff 738607074dc5d113685783f4dda9159378820c44..HEAD@{upstream} > /tmp/diff.patch kompare /tmp/diff.patch

Was anyone able to reproduce this?


/usr/bin/git -C /home/dois/.cache/yay/floorp-bin diff 738607074dc5d113685783f4dda9159378820c44..HEAD@{upstream} --src-prefix /home/dois/.cache/yay/floorp-bin/ --dst-prefix /home/dois/.cache/yay/floorp-bin/ | kompare -o -

The command above successfully pipes the correct differences to kompare, but I wouldn't know how to modify yay to do this by default.