1

I'm not sure if this is a cvs bug or what it is, but I'm debugging some crusty scripts and found

cvs history -D "-1 days" -c "s-server-moo-3"

spits out

M 2018-03-02 19:06 +0000 user 1.71 s-server-moo-39 Network-Configs/configs == /opt/rancid/customers/CUSTA/var/Network-Configs

M 2018-03-02 20:06 +0000 user 1.72 s-server-moo-39 Network-Configs/configs == /opt/rancid/customers/CUSTA/var/Network-Configs

which is not what I want, it shouldn't find "39", it should only find "3". My old crusty script is totally the number of commits and logging warnings if the total is above 8 per day, therefore if s-server-moo-38 and s-server-moo-39 each have 5 commits, I get warnings.

I know I could just grep afterwards, but this seems like a very strange way for any version control system to search. I don't see anything under history in the man page that says it's supposed to behave like this (or a flag to use as a workaround).

Peter Turner
  • 1,654
  • It's been a very long time since I did anything with cvs but i just created a tiny CVS repository for testing and AFAICT this isn't possible without post-filtering with grep or something. cvs history does a search that matches the "file" specified on the command line with text that appears anywhere in any filename in the repo (so what the man page calls a "file" for history is actually a search pattern). Have you considered converting to something more modern and more sane? perhaps svn if you're committed to cvs madness but also want new and improved. git otherwise. – cas Mar 03 '18 at 09:50
  • ps: i didn't think anyone still actually used cvs. – cas Mar 03 '18 at 09:50
  • 1
    btw, i tried obvious things like appending a $ to the end of the filename, but it seems it doesn't do a regex search. google is not being helpful either - I guess cvs knowledge is one of those things that will be lost in time like tears in rain. – cas Mar 03 '18 at 09:53
  • @cas flipping to git is the plan - I'm just trying to fix a bug. The scary part is this cvs instance is just an interface for rcs under the covers :) – Peter Turner Mar 04 '18 at 21:06
  • I still use rcs for some things. Well, strictly speaking, some of my Makefiles for sysadmin tasks still do - e.g. the Makefile in my /etc/postfix still updates the /etc/postfix/RCS repo mostly because I never bothered to git rid of it after switching to etckeeper & git, and because there's history in RCS/*,v that never got imported into git. – cas Mar 05 '18 at 03:47

0 Answers0