• GNU diff command, was: Re: Fun trick

    From Simon Clubley@21:1/5 to arne@vajhoej.dk on Fri Jan 17 13:11:36 2025
    On 2025-01-13, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 1/9/2025 8:01 AM, hb0815 wrote:

    $ gdiff -ub lib.pas-orig lib.pas

    $ gdiff -ub lib.for-orig lib.for

    For those that do not speak diffish:


    Then those people would benefit from learning it IMHO.

    It is far, far, superior to VMS DIFF, especially in the unified diff format used in the above command. If the licence allows it, then it would be an excellent addition to standard VMS, maybe invoked as a new qualifier on the
    VMS DIFF command.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Simon Clubley on Fri Jan 17 08:07:23 2025
    On 1/17/25 7:11 AM, Simon Clubley wrote:
    On 2025-01-13, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 1/9/2025 8:01 AM, hb0815 wrote:

    $ gdiff -ub lib.pas-orig lib.pas

    $ gdiff -ub lib.for-orig lib.for

    For those that do not speak diffish:


    Then those people would benefit from learning it IMHO.

    It is far, far, superior to VMS DIFF, especially in the unified diff format used in the above command. If the licence allows it, then it would be an excellent addition to standard VMS, maybe invoked as a new qualifier on the VMS DIFF command.

    There are BSD implementations that have the usual Berkeley license:

    https://github.com/openbsd/src/tree/master/usr.bin/diff

    Don't know about the license but git is available and it should be
    possible to get diffs outside a repository with "git diff --noindex".
    That said, I tried it just now and couldn't get it to work.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to Craig A. Berry on Fri Jan 17 08:39:37 2025
    On 1/17/25 8:07 AM, Craig A. Berry wrote:

    it should be
    possible to get diffs outside a repository with "git diff --noindex".
    That said, I tried it just now and couldn't get it to work.

    It does work, but not for VFC files and it cannot handle version numbers
    in a filename, so its usefulness on VMS is pretty limited.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hb0815@21:1/5 to Craig A. Berry on Sun Jan 19 13:25:25 2025
    On 1/17/25 15:39, Craig A. Berry wrote:

    On 1/17/25 8:07 AM, Craig A. Berry wrote:

    it should be
    possible to get diffs outside a repository with "git diff --noindex".
    That said, I tried it just now and couldn't get it to work.

    It does work, but not for VFC files and it cannot handle version numbers
    in a filename, so its usefulness on VMS is pretty limited.
    Using git to get a the output in the Unix/GNU diff style seems overkill
    to me.

    As you probably know, if you can get the GNV diff utility, you can run
    it from DCL.

    To handle VMS file version, there is a workaround. Assumed gdiff is the
    DCL symbol for the GNV diff utility:

    $ pipe define/user decc$filename_unix_only 0 && -
    gdiff -ub sys$disk:[]x.com;1 sys$disk:[]x.com;2

    As indicated, you may need a full file spec and the files have to be in Stream_LF record format.

    PS: For VMS git you should convert all files to Stream_LF and purge all
    the versions before you attempt to use git. Especially if you want to
    switch to/check out another branch or commit. VMS git is a port of the
    open sources, in that sense and despite of its name, it is more a GNV
    than a VMS tool. It helps, if you already have the sources in Stream_LF (probably copied from a non-VMS system) or an editor on VMS that creates
    this record format by default. Such editors exist. And, as you probably noticed, not everything works as expected in the initial version of VMS git.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Craig A. Berry@21:1/5 to All on Mon Jan 20 17:34:53 2025
    On 1/19/25 6:25 AM, hb0815 wrote:
    On 1/17/25 15:39, Craig A. Berry wrote:

    On 1/17/25 8:07 AM, Craig A. Berry wrote:

    it should be
    possible to get diffs outside a repository with "git diff --noindex".
    That said, I tried it just now and couldn't get it to work.

    It does work, but not for VFC files and it cannot handle version numbers
    in a filename, so its usefulness on VMS is pretty limited.

    Using git to get a the output in the Unix/GNU diff style seems overkill
    to me.

    As you probably know, if you can get the GNV diff utility, you can run
    it from DCL.

    git is available for OpenVMS x86. GNV is not yet, as far as I have seen,
    so it seemed worth giving a quick try with something people may already
    have installed. And to be a bit pedantic, there is no "GNV diff"; there
    is GNU diff, which may have been included in various GNV packages. It
    is also available various other places, such as

    http://www.antinode.info/dec/sw/diffutils.html

    To handle VMS file version, there is a workaround. Assumed gdiff is the
    DCL symbol for the GNV diff utility:

    $ pipe define/user decc$filename_unix_only 0 && -
      gdiff -ub sys$disk:[]x.com;1 sys$disk:[]x.com;2

    As indicated, you may need a full file spec and the files have to be in Stream_LF record format.

    The GNU diff I've been using for 24 years does not have those
    limitations, and also conveniently does command-line redirection:

    https://www.digiater.com/openvms/freeware/v50/gnudiffutils/

    Sometime I need to get up-to-date on Steven Schweda's port and see what
    I'm missing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hb0815@21:1/5 to Craig A. Berry on Wed Jan 22 12:58:01 2025
    On 1/21/25 00:34, Craig A. Berry wrote:
    ...
    git is available for OpenVMS x86. GNV is not yet, as far as I have seen,
    so it seemed worth giving a quick try with something people may already
    have installed.  And to be a bit pedantic, there is no "GNV diff"; there
    is GNU diff, which may have been included in various GNV packages.  It
    is also available various other places, such as

    http://www.antinode.info/dec/sw/diffutils.html
    ...

    The GNU diff I've been using for 24 years does not have those
    limitations, and also conveniently does command-line redirection:
    ...

    $ sh sys/noproc/full
    OpenVMS V8.4-2L2 on node EISNER 21-JAN-2025 08:32:02.26 Uptime 3
    08:13:50
    AlphaServer ES40
    $ sh symb gdiff
    GDIFF == "MC GNV$GNU:[USR.BIN]DIFF"
    $ gdiff -v
    diff (GNU diffutils) 3.5
    Copyright (C) 2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later
    <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by Paul Eggert, Mike Haertel, David Hayes,
    Richard Stallman, and Len Tower.
    $
    $ gdiff x.txt;1 x.txt;2
    diff: x.txt;1: no such file or directory
    diff: x.txt;2: no such file or directory
    $

    I did not expect a GNV utility to handle VMS versions. I incorrectly
    assumed that decc$filename_unix_only would be required. It is not. But I
    do not know why it requires more than just the filenames.

    $ gdiff sys$disk:[]x.txt;1 sys$disk:[]x.txt;2
    diff: sys$disk:[]x.txt;1: illegal seek
    $
    $ copy x.txt;1 y.txt
    $ gdiff -ub y.txt x.txt
    diff: y.txt: illegal seek
    $
    $ pipe dir/full x.txt;1 |search sys$pipe format
    Record format: Variable length, maximum 0 bytes, longest 39 bytes
    $
    $ convert/fdl="record; format stream_lf" x.txt;1 xx.txt
    $ convert/fdl="record; format stream_lf" x.txt;2 xx.txt
    $ gdiff sys$disk:[]xx.txt;1 sys$disk:[]xx.txt;2
    0a1
    huhu
    $

    And I do not expect that the GNV "diff (GNU diffutils)" utility does command-line redirection on VMS.

    $ gdiff sys$disk:[]xx.txt;1 sys$disk:[]xx.txt;2 >x.x
    diff: extra operand '>x.x'
    diff: Try 'diff --help' for more information.
    $

    https://www.digiater.com/openvms/freeware/v50/gnudiffutils/
    "This is a port of GNU diffutils 2.7.2 for OpenVMS."

    It contains VMS-specific source code, which is not in the current diffutils-3.10.tar.xz.

    Anyway, on systems where there is no "diff (GNU diffutils)", it seems
    worth to build it from the mentioned sources instead of using git - just
    my opinion.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Wed Jan 22 22:30:16 2025
    On Wed, 22 Jan 2025 12:58:01 +0100, hb0815 wrote:

    GDIFF == "MC GNV$GNU:[USR.BIN]DIFF"

    Is there any reason to choose this over

    GDIFF == "$GNV$GNU:[USR.BIN]DIFF"

    ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert A. Brooks@21:1/5 to Lawrence D'Oliveiro on Wed Jan 22 18:30:05 2025
    On 1/22/2025 17:30, Lawrence D'Oliveiro wrote:
    On Wed, 22 Jan 2025 12:58:01 +0100, hb0815 wrote:

    GDIFF == "MC GNV$GNU:[USR.BIN]DIFF"

    Is there any reason to choose this over

    GDIFF == "$GNV$GNU:[USR.BIN]DIFF"

    No; both do the same thing and both forms of the syntax will never go away, even if the "MCR" form is technically unsupported.

    I'm not saying it's unsupported, but several aspects of VMS are probably unsupported
    (like EDT), but will never go away.

    --
    -- Rob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Robert A. Brooks on Fri Jan 24 13:05:11 2025
    On 2025-01-22, Robert A. Brooks <FIRST.LAST@vmssoftware.com> wrote:
    On 1/22/2025 17:30, Lawrence D'Oliveiro wrote:
    On Wed, 22 Jan 2025 12:58:01 +0100, hb0815 wrote:

    GDIFF == "MC GNV$GNU:[USR.BIN]DIFF"

    Is there any reason to choose this over

    GDIFF == "$GNV$GNU:[USR.BIN]DIFF"

    No; both do the same thing and both forms of the syntax will never go away, even if the "MCR" form is technically unsupported.

    I'm not saying it's unsupported, but several aspects of VMS are probably unsupported
    (like EDT), but will never go away.


    $ set response/mode=good_natured

    TECO went away...

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Fri Jan 24 19:59:07 2025
    On 1/24/2025 8:05 AM, Simon Clubley wrote:
    On 2025-01-22, Robert A. Brooks <FIRST.LAST@vmssoftware.com> wrote:
    On 1/22/2025 17:30, Lawrence D'Oliveiro wrote:
    On Wed, 22 Jan 2025 12:58:01 +0100, hb0815 wrote:

    GDIFF == "MC GNV$GNU:[USR.BIN]DIFF"

    Is there any reason to choose this over

    GDIFF == "$GNV$GNU:[USR.BIN]DIFF"

    No; both do the same thing and both forms of the syntax will never go away, >> even if the "MCR" form is technically unsupported.

    I'm not saying it's unsupported, but several aspects of VMS are probably unsupported
    (like EDT), but will never go away.


    $ set response/mode=good_natured

    TECO went away...

    Simon.


    No, it just didn't tag along ...

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)