Page 3 of 4

Re: RCS (revision control system)

Posted: Fri Apr 22, 2022 7:11 pm
by RalfR
I just know "RCS" from Atari to build GUI in separate files.

Re: RCS (revision control system)

Posted: Fri Apr 22, 2022 7:18 pm
by tofro
I don't use rcs (any more - used to use it decades agon on SunOS)

This looks more like a sloppy option handling in your version of GNU diff to me than a problem in rcsdiff:

-r actually is a command line option for diff (recurse into subdirectories). But without a space after it, it should be treated by diff as a filename. (Or, if diff really wants to be recursive, it should at least see that none of the files is a directory and -r wouldn't make any sense)

When creating a temporary filename for the checked out version, rcsdiff does in fact use "-r<revision number>" (note no space) as the name (that's normal and done by all rcss). Your specific version of diff doesn't seem to like that.

Re: RCS (revision control system)

Posted: Fri Apr 22, 2022 7:22 pm
by ppe
tofro wrote:I don't use rcs (any more - used to use it decades agon on SunOS)
Yeah, I never used RCS, only cvs, svn and git but looks like RCS is the only pony in town for QDOS :(
tofro wrote:When creating a temporary filename for the checked out version, rcsdiff does in fact use "-r<revision number>" (note no space) as the name (that's normal and done by all rcss). Your specific version of diff doesn't seem to like that.
I'm glad we arrived at the same conclusion as to the cause of the problem. I'm using GnuDiff downloaded from Dilwyn's site. Perhaps there at some point was another diff compiled for QDOS :ugeek:

Re: RCS (revision control system)

Posted: Fri Apr 22, 2022 10:02 pm
by swensont
Looking back at QHJ #28, when I looked at RCS, I reported that 'diff' came with C68. In looking at the current version of C68, I'm not seeing 'diff' on any of the three download files.

I'll look through some old diskettes and see if I have an older version of C68 with diff.

Tim

BTW, all issues of the QL Hackers Journal (QHJ) are available on Dilwyn's website.

Re: RCS (revision control system)

Posted: Fri Apr 22, 2022 11:30 pm
by Silvester
Here is version dated later to that at http://www.dilwyn.me.uk/c/GNUdiff.zip if its any help.
[file deleted]

Re: RCS (revision control system)

Posted: Sat Apr 23, 2022 8:52 am
by ppe
Silvester wrote:Here is version dated later to that at http://www.dilwyn.me.uk/c/GNUdiff.zip if its any help.
Thanks Silvester, that's the one I tested and which does not seem to work.

Re: RCS (revision control system)

Posted: Sat Apr 23, 2022 11:19 am
by XorA
tofro wrote:I don't use rcs (any more - used to use it decades agon on SunOS)

This looks more like a sloppy option handling in your version of GNU diff to me than a problem in rcsdiff:

-r actually is a command line option for diff (recurse into subdirectories). But without a space after it, it should be treated by diff as a filename. (Or, if diff really wants to be recursive, it should at least see that none of the files is a directory and -r wouldn't make any sense)

When creating a temporary filename for the checked out version, rcsdiff does in fact use "-r<revision number>" (note no space) as the name (that's normal and done by all rcss). Your specific version of diff doesn't seem to like that.
There should be a — (double minus) before -r options that are a file name. — stops argument processing in getopt.

Re: RCS (revision control system)

Posted: Sat Apr 23, 2022 1:27 pm
by ppe
Well, I finally did "the right thing" - dug out the source, sprayed some debug lines in there and found out the *actual* source of the problem.
And managed to fix it :o

Turns out the temporary file name is actually not the problem. The problem is that for some reason, which I won't bother delving into, calling system() on QDOS requires command line arguments to be quoted a bit differently than what is done in the code.

So, original version does this for running the diff when argument to system() call is expanded:

Code: Select all

system("'diff '-L1.2\tdatestring' '-Lfilename\tdatestring' 'tempfile' 'file');
but it seems that for this to work it needs to be:

Code: Select all

system("'diff '-L \"1.2\tdatestring\"' '-L \"filename\tdatestring\" 'tempfile' 'file'");
so the label arguments (-L) that contain spaces and tabs need to be enclosed in double quotes. The original way of doing single quotes around -L and its argument string is not enough.

Thank you for all the comments and feedback!

Re: RCS (revision control system)

Posted: Sat Apr 23, 2022 2:34 pm
by ppe
So.... shall I zip the patched thing up and send it to Dilwyn or shall I push the source to GitHub?

Re: RCS (revision control system)

Posted: Sat Apr 23, 2022 9:58 pm
by dilwyn
ppe wrote:So.... shall I zip the patched thing up and send it to Dilwyn or shall I push the source to GitHub?
I've never used RCS, so send it to me as a zip to replace the one on my site if the current one doesn't work. Plus any amendment needed to the description on the page.

Could go on github too for posterity!