--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: please allow to use "external viewers" for n-way diffs
- From: Tomas Pospisek <tpo_deb@sourcepole.ch>
- Date: Fri, 05 Oct 2018 21:13:48 +0200
- Message-id: <153876682822.6639.14585424467160959021.reportbug@hier>
Package: dirdiff
Version: 2.1-7.2
Severity: wishlist
Tags: patch
It'd be nice if it'd be possible to also view n-way diffs in external
viewers (here: in vimdiff). That's just what the attached patch does:
if set then the configured external viewer is also used for n-way diffs.
There's one aspect of this patch, that's a bit ugly: the patch is pretty
much an exact copy of the code of the "proc diff2" code part, that calls
the external viewer.
This results in the params given to the external viewer being a bit
"weird". Namely what the external viewer gets as parameters is:
dir1 dir2 dir3 ... file_path
That means that the external viewer needs to check the number of
parameters and if there's more than two, then it needs to construct the
filepaths like this:
dir1/file_path dir2/file_path dir3/file_path ...
I've implemented a wrapper for vimdiff that does that. It's using
`konsole` as a terminal, but that can be changed easily:
$ cat ~/bin/dirdiff_vimdiff
#!/bin/bash
#
if [ $# -gt 2 ]; then
# dirdiff calls us with parameters:
#
# dir1 dir2 dir3 ... file_name_to_diff
# the file is the last parameter given
file_to_diff="${@:$#:1}"
# iterate over all parameters and construct
# the full_path=dir+file_to_diff
for i in $(seq 0 $(( $# - 1))); do
j=$(( $i + 1 ))
full_paths[$i]="${@:$j:1}/$file_to_diff"
done
# delete last element, since that's the file
# itself:
unset 'full_paths[-1]'
konsole --workdir `pwd` -e vimdiff "${full_paths[@]}"
else
konsole --workdir `pwd` -e vimdiff "$1" "$2"
fi
Alternatively the patch could be changed to do the path construction
inside dirdiff before calling the external program. I'll leave that
as a challenge ;-)
Thanks,
*t
-- System Information:
Debian Release: 9.5
APT prefers stable
APT policy: (990, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.9.0-8-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_CH.utf8, LC_CTYPE=de_CH.utf8 (charmap=UTF-8), LANGUAGE=de_CH:de (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages dirdiff depends on:
ii libc6 2.24-11+deb9u3
ii libtcl8.6 8.6.6+dfsg-1+b1
ii tk8.6 8.6.6-1+b1
dirdiff recommends no packages.
dirdiff suggests no packages.
-- no debconf information
--- /usr/bin/dirdiff 2018-04-29 09:19:39.000000000 +0200
+++ /tmp/dirdiff 2018-10-05 20:55:45.192961740 +0200
@@ -2517,6 +2517,7 @@
}
proc diffn {dirlist f {orig 1}} {
+ global diffprogram
global diffing diffdirs difffile difffds diffrel allf
global difflnos diffndirs diffstate difflnum nextdiffhdr diffhdr
global diffiflag diffwflag diffbflag diffdflag incline
@@ -2547,6 +2548,12 @@
catch {unset incline}
set diffopts "-u $diffiflag $diffwflag $diffbflag $diffdflag"
+
+ if { [llength $diffprogram] > 0} {
+ exec $diffprogram {*}$dirlist $f &
+ return
+ }
+
set d [lindex $dirlist 0]
set p [joinname $d $f]
set diffrel(0) 0
--- End Message ---
--- Begin Message ---
Source: dirdiff
Source-Version: 2.1-9
Done: Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com>
We believe that the bug you reported is fixed in the latest version of
dirdiff, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 910388@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com> (supplier of updated dirdiff package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Thu, 02 Jun 2022 21:03:17 -0300
Source: dirdiff
Architecture: source
Version: 2.1-9
Distribution: unstable
Urgency: medium
Maintainer: Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com>
Changed-By: Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com>
Closes: 910388 1008029
Changes:
dirdiff (2.1-9) unstable; urgency=medium
.
* New Maintainer. (Closes: #1008029)
* debian/control:
- Updated Maintainer field with my name and email.
* dedian/copyright:
- Include name new maintainer Josensilson Ferreira da Silva.
* debian/patches:
- Created 011_dirdiff_vimdiff.patch.
Makes it possible to see on-way diffs in external
viewers(vimdiff). If set, the configured external
viewer is also used for n-way differences. Thanks
Tomas Pospisek <tpo_deb@sourcepole.ch>. (Closes: #910388)
Checksums-Sha1:
a1f44fbef673ffa963f3e03bccdfce4ef67d5b43 1727 dirdiff_2.1-9.dsc
c8e70499e9ece4417e354dcce3bf9758c97d3edf 9168 dirdiff_2.1-9.debian.tar.xz
6cb27d0c7add1a935a80f2933abc22c08332e601 7078 dirdiff_2.1-9_source.buildinfo
Checksums-Sha256:
98883bfa321ec325444325cd4cc76c5ee361b6f257afdc2c447b08e2f948e5c3 1727 dirdiff_2.1-9.dsc
97e3bc2289f4080651419909c30468282e28f71901b3716ff91a4086886fd9d4 9168 dirdiff_2.1-9.debian.tar.xz
c913fd761d67f4f48308ae849e02652ceb8699b42bd80a16be2ce57c4227f282 7078 dirdiff_2.1-9_source.buildinfo
Files:
8a7f29514fb5517113491e7939b36b6c 1727 utils optional dirdiff_2.1-9.dsc
6298bca258d39c2346904579778d2e56 9168 utils optional dirdiff_2.1-9.debian.tar.xz
caca614ab43249859c9ac5f787ef97df 7078 utils optional dirdiff_2.1-9_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQHEBAEBCgAuFiEEQGIgyLhVKAI3jM5BH1x6i0VWQxQFAmKbcncQHGJhZ2VAZGVi
aWFuLm9yZwAKCRAfXHqLRVZDFDwrC/4wYPGY9r4DIwIvmfATEYsnKBDAsJioZVF4
jFMaiJWKLOAACnB6XcId3TeGwWpI0wY929E04MtnxKqt2UWC40QdKF6qLS6fDilG
6yNFf93vb3dF3tQFQP/ueQ351ce9k3U88xpmUGgIuyyjGcobmZtlIdo42GBkiyCU
ALEB+ZCuhQXzBmi04kOsffZ6DmTA74p/00Wr7BrVyis0xC2LZDtr42RbDA2lF6Sh
cE039iVqfj0Utj6BzpjwGy7hqGHQNxTuftymroe3Zk/3l3Et5BHISpweh3ZrGutK
cmfbTZ2i49/0RqF2o+PBGPHY1OSv6HqYz/t1h0bW6nFliZYz0TwuYXLpeil1pTra
gJCEdrO1veYahOId4pqfsNijDjd/JnpAd+5p4hZej2XKPZOS6nMS0wR+He/MIiiO
bYsFzz3U6QiQBqgs4lnG8Ns5kN3ZHJlPdvFzkzzBngNd6YU+5OMsua1Qjj/75e+I
VVksuu3szQz0XAYzRsMfTyMPe0SGPco=
=+Iz4
-----END PGP SIGNATURE-----
--- End Message ---