Re: [Bug] Properties diff not subject to external diff command

Branko Čibej <[email protected]> Sat, 7 Jun 2025 15:00:15 +0200
Newsgroups gmane.comp.version-control.subversion.user
Organization The Apache Software Foundation
Message-ID <[email protected]>
On 7. 6. 25 12:19, Yasuhito FUTATSUKI wrote:
> Hello,
>
> On 2025/06/07 18:09, Daniel Sahlberg wrote:
>> lör 7 juni 2025 kl. 10:46 skrev Michael Osipov<[email protected]>:
>>
>>> Folks,
>>>
>>> using
>>> svn, Version 1.14.5 (r1922182)
>>>     übersetzt am Apr  6 2025, um 14:15:38 auf amd64-portbld-freebsd13.4
>>>
>>> with config
>>> $ cat /usr/local/etc/subversion/config
>>> [helpers]
>>> diff-cmd = colordiff
>>>
>>> Consider the following status:
>>>> $ svn st --ignore-externals Bastille/templates/
>>> poudriere/options/general/ | grep -v X
>>>>   M
>>> Bastille/templates/cafe-custom-uis/software-install-config-ports/var/db/ports
>>>>   M
>>> Bastille/templates/indocs/software-install-config-ports/var/db/ports
>>>> D       poudriere/options/general/devel_apache-ant
>>>> D       poudriere/options/general/devel_protobuf-c
>>>> D       poudriere/options/general/emulators_linux_base-c7
>>>> D       poudriere/options/general/emulators_linux_base-rl9
>>>> D       poudriere/options/general/security_py-gssapi
>>> Properties and content have been modified. colordiff should now colorize
>>> output for all items.
>>> Running "svn diff Bastille/templates/ poudriere/options/general/" does no
>>> colorize diff on properties. See
>>> https://people.freebsd.org/~michaelo/subversion/svn-propdiff-nocolor.png
>>>
>>> Let me know what you think,
>> Is colordiff this program:
>> https://www.colordiff.org
>>
>> In that case you should probably work with them to improve their parsing, I
>> don’t think there is anything we can do on our side since it isn’t
>> Subversion colouring the output.
> The problem is that property diff never use external diff program.
>
> with dummy diff program bin/show_args.sh:
> [[[
> #!/bin/sh
> n=0
> while [ $n -le $# ] ; do
>      echo \$$n = \'`eval 'echo $'${n}`\'
>      n=$((${n}+1))
> done
> ]]]
>
> sample result of content diff:
> [[[
> $ svn diff -c 2236 --diff-cmd=bin/show_args.shfile:///var/db/svn/sysadmin/
> Index: vendor/FreeBSD/releng/14.0/etc/periodic/daily/480.leapfile-ntpd
> ===================================================================
> $0 = 'bin/show_args.sh'
> $1 = '-u'
> $2 = '-L'
> $3 = 'vendor/FreeBSD/releng/14.0/etc/periodic/daily/480.leapfile-ntpd (revision 2235)'
> $4 = '-L'
> $5 = 'vendor/FreeBSD/releng/14.0/etc/periodic/daily/480.leapfile-ntpd (revision 2236)'
> $6 = '/tmp/svn-TANZb0'
> $7 = '/tmp/svn-LMvZZl'
> ]]]
>
> sample result of property diff:
> [[[
> $ svn diff -c 2237 --diff-cmd=bin/show_args.shfile:///var/db/svn/sysadmin/
> Index: vendor/FreeBSD/releng/14.0/root
> ===================================================================
> --- vendor/FreeBSD/releng/14.0/root     (revision 2236)
> +++ vendor/FreeBSD/releng/14.0/root     (revision 2237)
>
> Property changes on: vendor/FreeBSD/releng/14.0/root
> ___________________________________________________________________
> Added:svn:ignore
> ## -0,0 +1,10 ##
> +.bundle
> +.cargo
> +.config
> +.history
> +.lesshst
> +.local
> +.lsof_*
> +.mysql_history
> +.pgsql_history
> +.python_history
> ]]]

That's not so much a problem than the simple fact that there are not 
many external tools that know how to handle Subversion's properties. 
Colordiff doesn't for example. So if we somehow sent properties to an 
external diff, just for starters, the diffs wouldn't be formatted correctly.

-- Brane