History log of /openbsd-current/usr.bin/rcs/rlog.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.75 15-Oct-2020 naddy

Accommodate POSIX basename(3) that takes a non-const parameter and
may modify the string buffer.
ok martijn@ millert@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.74 16-Oct-2016 okan

Quiet compiler warnings; as applied to usr.bin/cvs by millert@

ok millert@


# 1.73 31-Aug-2016 jcs

rlog: add -E and -S options to configure revision separators, to
work around commits that might have the default strings in them

ok tom deraadt


# 1.72 26-Aug-2016 guenther

Pull in <time.h> for struct tm, used in rcs.h

ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.71 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


# 1.70 28-Nov-2014 otto

consistency in calling usage, from Fritjof Bornebusch


# 1.69 10-Oct-2014 otto

Zap some stored values never read; From Fritjof Bornebusch; ok nicm@


# 1.68 02-Oct-2014 otto

exit in usage functions themselves; from Fritjof Bornebusch; ok nicm@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.67 07-Jan-2014 deraadt

ctype cleanups; ok okan


Revision tags: OPENBSD_5_4_BASE
# 1.66 03-Jun-2013 jcs

properly handle commitid tokens found in rcs files

ok deraadt


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.65 14-Jul-2011 sobrado

spacing, no binary change.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.64 30-Jul-2010 ray

Check date_parse return values.

OK xsa


# 1.63 23-Jul-2010 ray

Reduce variable/function name and whitespace differences between
cvs/rcs.

OK xsa zinovik


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.62 15-Feb-2009 joris

support rlog -d
prodded & tested by sthen@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.61 02-Feb-2008 xsa

Fix broken indentation introduced in last commit.
Spotted by Pierre Riteau.


# 1.60 02-Feb-2008 xsa

From src/usr.bin/cvs:

> add changed lines support to log and rlog (the + and - stuff)
> from Pierre Riteau;


# 1.59 09-Sep-2007 ray

Have rlog exit 1 if any of the files could not be opened.
Don't mention -q flag, which is there for compatibility.

From Pierre Riteau.

OK joris for first part, OK niallo and jmc for second.


Revision tags: OPENBSD_4_2_BASE
# 1.58 30-Jun-2007 xsa

Sync revisions and time buffers size to be consistent with each others.
Simplifies further size tweaks if needed.
OK ray@.


Revision tags: OPENBSD_4_1_BASE
# 1.57 27-Feb-2007 xsa

As done in OpenCVS, general includes cleanup sweep. OK otto@.


# 1.56 12-Oct-2006 niallo

- convert some warnx() to warn(), which fixes a few stupidly un-informative error messages (found by tom@)
- make rcs_choosefile() save wrt errno, input from ray@

ok joris@ xsa@


Revision tags: OPENBSD_4_0_BASE
# 1.55 27-May-2006 ray

Remove rcs_statfile(). It was just a wrapper for rcs_choosefile(),
handling exceptions oddly.

OK joris@


# 1.54 09-May-2006 ray

Remove /* NOTREACHED */ comments, now that lint is smart about
__dead. I never should have put them there.

OK xsa@.


# 1.53 28-Apr-2006 xsa

fix date format output if a timezone is specified (-z);


# 1.52 26-Apr-2006 joris

prevent file races by obtaining an fd for the RCS file and
do our operations on that, this is safe and guarantees we
can operate on the file until we close(2) it.

a fix is coming for the remaining races in our diff code.
okay niallo@ and ray@


# 1.51 26-Apr-2006 joris

fork our code we shared between openrcs/cvs into the openrcs dir.

this was starting to become inhuman to maintain without
ugly ugly hacks in the shared code, and it will be easier
to make specific changes for openrcs without touching the
soon-to-be-replaced opencvs code.


# 1.50 25-Apr-2006 xsa

fatal() -> err()/errx() as we try to not depend on heavy cvs_log().
OK joriski.


# 1.49 21-Apr-2006 xsa

move shared functions into rcsutil.[ch]; this makes rcsprog.c cleaner;
"the voices in my head say OK!" joris@.


# 1.48 21-Apr-2006 xsa

remove overkill cvs_log() and rather use warn()/warnx().
OK ray@ and discussed with joris@.


# 1.47 19-Apr-2006 xsa

switch -q handling to bitwise flags; OK ray@ niallo@.


# 1.46 15-Apr-2006 xsa

dont stupidly duplicate code. make rlog use rcs_rev_select() and thus
nuke rlog_rev_select(). OK niallo@.


# 1.45 14-Apr-2006 joris

- don't append the extension if it's already there (PR 5076).
- show magic branches in rlog (thanks for that nicer hack niall).
- correct output in rcsdiff, so we perfectly match gnu's

all these bugs were found by sturm@ while he was using cvsweb
(which uses the RCS tools).

"it is in my view that you should put it in" niallo@


# 1.44 14-Apr-2006 ray

Remove global variable RCSFILE.

OK joris@


# 1.43 14-Apr-2006 ray

Remove extraneous argument from rlog_file().

OK joris@


# 1.42 14-Apr-2006 ray

Short-circuit rlog when the -l flag is specified but there are no locks.

OK joris@


# 1.41 14-Apr-2006 deraadt

excessive addition to brackets is a mental disease. you will go
blind, too. seek help. no binary change, ok joris


# 1.40 13-Apr-2006 joris

fix -z option for openrcs, this was broken by xsa
when he yanked the code out of rcs.c and placed it in rcstime.c.

struct tm ltb, *tb;
tb = &ltb;
return (tb);

isn't really the most perfect idiom to return a value to the caller, now is it?

as a bonus -z for rlog now works too.
okay niallo@


# 1.39 10-Apr-2006 niallo

- zap some whitespace.


# 1.38 06-Apr-2006 xsa

-z can take no argument.


# 1.37 06-Apr-2006 xsa

small knf;


# 1.36 30-Mar-2006 ray

Add rlog -r[REV1][:][REV2] support

From Pierre-Yves Ritschard.

OK niallo@


# 1.35 28-Mar-2006 xsa

match GNU's output when no revision are present.


# 1.34 27-Mar-2006 pat

Plug a memory leak for all cvs_strsplit call sites; ok xsa@


# 1.33 24-Mar-2006 ray

Allow the -x flag to be used without an extension.

``that makes sense'' xsa@


# 1.32 23-Mar-2006 xsa

rlog_file() will never return non-zero; change its return type to void.


# 1.31 20-Mar-2006 xsa

add missing xfree()'s after we are done with cvs_strsplit();
spotted by ray@, OK joris@.


# 1.30 17-Mar-2006 xsa

rlog_strsplit() -> cvs_strsplit() and move it to util.c so it can be reused
by `cvs log' and some other RCS utilities. "Looks good" ray@.


# 1.29 16-Mar-2006 ray

Follow exit() with /* NOTREACHED*/ for lint.

``OK niallo@'' niallo@


# 1.28 08-Mar-2006 xsa

fix usage();


# 1.27 07-Mar-2006 xsa

missing break;


# 1.26 07-Mar-2006 joris

-z support for RCS;


# 1.25 06-Mar-2006 jmc

update usage();


# 1.24 06-Mar-2006 jmc

move compat flags into a STANDARDS section;


Revision tags: OPENBSD_3_9_BASE
# 1.23 25-Jan-2006 xsa

add support for `-l[lockers]'. Some (needed) cleanup will follow.
Test & OK niallo@.


# 1.22 24-Jan-2006 xsa

print locker's name if revision is locked;


# 1.21 23-Jan-2006 xsa

display usage if an unknown option is specified;


# 1.20 23-Jan-2006 xsa

add support for `-sstates' and `-w[logins]' options; tested and OK niallo@.


# 1.19 05-Jan-2006 xsa

cleanup, move log.h and rcs.h inclusion into rcsprog.h;


# 1.18 02-Jan-2006 xsa

#include's cleanup; ok joris@ niallo@.


# 1.17 27-Dec-2005 niallo

- rlog(1) needs RCS_PARSE_FULLY too.


# 1.16 02-Dec-2005 xsa

split the printing part into a separate function, rlog_rev_print();
might be useful for future work needed in rlog(1);


# 1.15 28-Nov-2005 xsa

sync usage() for `-xsuffixes';


# 1.14 21-Nov-2005 xsa

enable `-xsuffixes' support as it has been added a few days ago
in rcs_statfile();
niallo ok


# 1.13 17-Nov-2005 xsa

indent;


# 1.12 28-Oct-2005 xsa

print RCS file info too;


# 1.11 28-Oct-2005 xsa

add support for `-L'; niallo ok


# 1.10 26-Oct-2005 xsa

print locker's name and rev number for locked revisions; ok joris niallo


# 1.9 26-Oct-2005 xsa

correct -R behaviour;


# 1.8 25-Oct-2005 xsa

-T is kept for compatibility with other RCS commands here too;


# 1.7 25-Oct-2005 xsa

missed that in previous commit;


# 1.6 24-Oct-2005 xsa

output tweaks;


# 1.5 13-Oct-2005 joris

To be fully compatibly with the GNU RCS tools we need to have the
same way of parsing commandline options. Since getopt(3) allows spaces
between arguments and GNU RCS tools does not we needed to roll out our
own way of option handling, and here it is.

ok niallo@


# 1.4 12-Oct-2005 deraadt

various usage cleanup; ok joris


# 1.3 07-Oct-2005 niallo

basic `ci' support is here! more coming soon.

combined effort with joris.

ok joris@


# 1.2 06-Oct-2005 niallo

sync rlog_usage() with reality.


# 1.1 06-Oct-2005 joris

support rlog command;


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.74 16-Oct-2016 okan

Quiet compiler warnings; as applied to usr.bin/cvs by millert@

ok millert@


# 1.73 31-Aug-2016 jcs

rlog: add -E and -S options to configure revision separators, to
work around commits that might have the default strings in them

ok tom deraadt


# 1.72 26-Aug-2016 guenther

Pull in <time.h> for struct tm, used in rcs.h

ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.71 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


# 1.70 28-Nov-2014 otto

consistency in calling usage, from Fritjof Bornebusch


# 1.69 10-Oct-2014 otto

Zap some stored values never read; From Fritjof Bornebusch; ok nicm@


# 1.68 02-Oct-2014 otto

exit in usage functions themselves; from Fritjof Bornebusch; ok nicm@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.67 07-Jan-2014 deraadt

ctype cleanups; ok okan


Revision tags: OPENBSD_5_4_BASE
# 1.66 03-Jun-2013 jcs

properly handle commitid tokens found in rcs files

ok deraadt


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.65 14-Jul-2011 sobrado

spacing, no binary change.


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.64 30-Jul-2010 ray

Check date_parse return values.

OK xsa


# 1.63 23-Jul-2010 ray

Reduce variable/function name and whitespace differences between
cvs/rcs.

OK xsa zinovik


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.62 15-Feb-2009 joris

support rlog -d
prodded & tested by sthen@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.61 02-Feb-2008 xsa

Fix broken indentation introduced in last commit.
Spotted by Pierre Riteau.


# 1.60 02-Feb-2008 xsa

From src/usr.bin/cvs:

> add changed lines support to log and rlog (the + and - stuff)
> from Pierre Riteau;


# 1.59 09-Sep-2007 ray

Have rlog exit 1 if any of the files could not be opened.
Don't mention -q flag, which is there for compatibility.

From Pierre Riteau.

OK joris for first part, OK niallo and jmc for second.


Revision tags: OPENBSD_4_2_BASE
# 1.58 30-Jun-2007 xsa

Sync revisions and time buffers size to be consistent with each others.
Simplifies further size tweaks if needed.
OK ray@.


Revision tags: OPENBSD_4_1_BASE
# 1.57 27-Feb-2007 xsa

As done in OpenCVS, general includes cleanup sweep. OK otto@.


# 1.56 12-Oct-2006 niallo

- convert some warnx() to warn(), which fixes a few stupidly un-informative error messages (found by tom@)
- make rcs_choosefile() save wrt errno, input from ray@

ok joris@ xsa@


Revision tags: OPENBSD_4_0_BASE
# 1.55 27-May-2006 ray

Remove rcs_statfile(). It was just a wrapper for rcs_choosefile(),
handling exceptions oddly.

OK joris@


# 1.54 09-May-2006 ray

Remove /* NOTREACHED */ comments, now that lint is smart about
__dead. I never should have put them there.

OK xsa@.


# 1.53 28-Apr-2006 xsa

fix date format output if a timezone is specified (-z);


# 1.52 26-Apr-2006 joris

prevent file races by obtaining an fd for the RCS file and
do our operations on that, this is safe and guarantees we
can operate on the file until we close(2) it.

a fix is coming for the remaining races in our diff code.
okay niallo@ and ray@


# 1.51 26-Apr-2006 joris

fork our code we shared between openrcs/cvs into the openrcs dir.

this was starting to become inhuman to maintain without
ugly ugly hacks in the shared code, and it will be easier
to make specific changes for openrcs without touching the
soon-to-be-replaced opencvs code.


# 1.50 25-Apr-2006 xsa

fatal() -> err()/errx() as we try to not depend on heavy cvs_log().
OK joriski.


# 1.49 21-Apr-2006 xsa

move shared functions into rcsutil.[ch]; this makes rcsprog.c cleaner;
"the voices in my head say OK!" joris@.


# 1.48 21-Apr-2006 xsa

remove overkill cvs_log() and rather use warn()/warnx().
OK ray@ and discussed with joris@.


# 1.47 19-Apr-2006 xsa

switch -q handling to bitwise flags; OK ray@ niallo@.


# 1.46 15-Apr-2006 xsa

dont stupidly duplicate code. make rlog use rcs_rev_select() and thus
nuke rlog_rev_select(). OK niallo@.


# 1.45 14-Apr-2006 joris

- don't append the extension if it's already there (PR 5076).
- show magic branches in rlog (thanks for that nicer hack niall).
- correct output in rcsdiff, so we perfectly match gnu's

all these bugs were found by sturm@ while he was using cvsweb
(which uses the RCS tools).

"it is in my view that you should put it in" niallo@


# 1.44 14-Apr-2006 ray

Remove global variable RCSFILE.

OK joris@


# 1.43 14-Apr-2006 ray

Remove extraneous argument from rlog_file().

OK joris@


# 1.42 14-Apr-2006 ray

Short-circuit rlog when the -l flag is specified but there are no locks.

OK joris@


# 1.41 14-Apr-2006 deraadt

excessive addition to brackets is a mental disease. you will go
blind, too. seek help. no binary change, ok joris


# 1.40 13-Apr-2006 joris

fix -z option for openrcs, this was broken by xsa
when he yanked the code out of rcs.c and placed it in rcstime.c.

struct tm ltb, *tb;
tb = &ltb;
return (tb);

isn't really the most perfect idiom to return a value to the caller, now is it?

as a bonus -z for rlog now works too.
okay niallo@


# 1.39 10-Apr-2006 niallo

- zap some whitespace.


# 1.38 06-Apr-2006 xsa

-z can take no argument.


# 1.37 06-Apr-2006 xsa

small knf;


# 1.36 30-Mar-2006 ray

Add rlog -r[REV1][:][REV2] support

From Pierre-Yves Ritschard.

OK niallo@


# 1.35 28-Mar-2006 xsa

match GNU's output when no revision are present.


# 1.34 27-Mar-2006 pat

Plug a memory leak for all cvs_strsplit call sites; ok xsa@


# 1.33 24-Mar-2006 ray

Allow the -x flag to be used without an extension.

``that makes sense'' xsa@


# 1.32 23-Mar-2006 xsa

rlog_file() will never return non-zero; change its return type to void.


# 1.31 20-Mar-2006 xsa

add missing xfree()'s after we are done with cvs_strsplit();
spotted by ray@, OK joris@.


# 1.30 17-Mar-2006 xsa

rlog_strsplit() -> cvs_strsplit() and move it to util.c so it can be reused
by `cvs log' and some other RCS utilities. "Looks good" ray@.


# 1.29 16-Mar-2006 ray

Follow exit() with /* NOTREACHED*/ for lint.

``OK niallo@'' niallo@


# 1.28 08-Mar-2006 xsa

fix usage();


# 1.27 07-Mar-2006 xsa

missing break;


# 1.26 07-Mar-2006 joris

-z support for RCS;


# 1.25 06-Mar-2006 jmc

update usage();


# 1.24 06-Mar-2006 jmc

move compat flags into a STANDARDS section;


Revision tags: OPENBSD_3_9_BASE
# 1.23 25-Jan-2006 xsa

add support for `-l[lockers]'. Some (needed) cleanup will follow.
Test & OK niallo@.


# 1.22 24-Jan-2006 xsa

print locker's name if revision is locked;


# 1.21 23-Jan-2006 xsa

display usage if an unknown option is specified;


# 1.20 23-Jan-2006 xsa

add support for `-sstates' and `-w[logins]' options; tested and OK niallo@.


# 1.19 05-Jan-2006 xsa

cleanup, move log.h and rcs.h inclusion into rcsprog.h;


# 1.18 02-Jan-2006 xsa

#include's cleanup; ok joris@ niallo@.


# 1.17 27-Dec-2005 niallo

- rlog(1) needs RCS_PARSE_FULLY too.


# 1.16 02-Dec-2005 xsa

split the printing part into a separate function, rlog_rev_print();
might be useful for future work needed in rlog(1);


# 1.15 28-Nov-2005 xsa

sync usage() for `-xsuffixes';


# 1.14 21-Nov-2005 xsa

enable `-xsuffixes' support as it has been added a few days ago
in rcs_statfile();
niallo ok


# 1.13 17-Nov-2005 xsa

indent;


# 1.12 28-Oct-2005 xsa

print RCS file info too;


# 1.11 28-Oct-2005 xsa

add support for `-L'; niallo ok


# 1.10 26-Oct-2005 xsa

print locker's name and rev number for locked revisions; ok joris niallo


# 1.9 26-Oct-2005 xsa

correct -R behaviour;


# 1.8 25-Oct-2005 xsa

-T is kept for compatibility with other RCS commands here too;


# 1.7 25-Oct-2005 xsa

missed that in previous commit;


# 1.6 24-Oct-2005 xsa

output tweaks;


# 1.5 13-Oct-2005 joris

To be fully compatibly with the GNU RCS tools we need to have the
same way of parsing commandline options. Since getopt(3) allows spaces
between arguments and GNU RCS tools does not we needed to roll out our
own way of option handling, and here it is.

ok niallo@


# 1.4 12-Oct-2005 deraadt

various usage cleanup; ok joris


# 1.3 07-Oct-2005 niallo

basic `ci' support is here! more coming soon.

combined effort with joris.

ok joris@


# 1.2 06-Oct-2005 niallo

sync rlog_usage() with reality.


# 1.1 06-Oct-2005 joris

support rlog command;