Re: add .cvsrc to skel
On 2013/03/31 16:17, Marc Espie wrote: +update -P Do we want -Pd here?
Re: add .cvsrc to skel
On 2013/03/31 16:17, Marc Espie wrote: +diff -uNp oh, and there is one thing about -p as a default: it increases the chances of a messed-up terminal if the file has binary crap in it, as it does not do any strnvis() or similar.
Re: add .cvsrc to skel
On Sun, Mar 31, 2013 at 03:22:01PM +0100, Stuart Henderson wrote: On 2013/03/31 16:17, Marc Espie wrote: +update -P Do we want -Pd here? I'm not sure. I think it would be surprising, especially if you have a partial tree checked out. -P will remove directories where files have been moved to the attic. But say, if you just checkout a few directories from src, you may want to update them without the -d. Then again, not having new directories appear is almost as problematic as having old stuff stay around. I think we will need to reach consensus on that one. Or maybe something like: # cvs -f will ignore cvsrc contents update -Pd
Re: add .cvsrc to skel
On Sun, Mar 31, 2013 at 03:26:56PM +0100, Stuart Henderson wrote: On 2013/03/31 16:17, Marc Espie wrote: +diff -uNp oh, and there is one thing about -p as a default: it increases the chances of a messed-up terminal if the file has binary crap in it, as it does not do any strnvis() or similar. We could (should) fix that. That's rather trivial to do...
Re: add .cvsrc to skel
On Sun, Mar 31, 2013 at 04:32:05PM +0200, Marc Espie wrote: On Sun, Mar 31, 2013 at 03:26:56PM +0100, Stuart Henderson wrote: On 2013/03/31 16:17, Marc Espie wrote: +diff -uNp oh, and there is one thing about -p as a default: it increases the chances of a messed-up terminal if the file has binary crap in it, as it does not do any strnvis() or similar. We could (should) fix that. That's rather trivial to do... Actually, no. It makes little sense. The diff itself doesn't encode its input. The function name that -p outputs is just as dangerous as the source file contents itself...
Re: add .cvsrc to skel
Date: Sun, 31 Mar 2013 15:22:01 +0100 From: Stuart Henderson s...@spacehopper.org On 2013/03/31 16:17, Marc Espie wrote: +update -P Do we want -Pd here? I don't. If you have a cvs repository that uses modules and you only check out a single module, -d will actually cause cvs update to check out the entire repository instead of just the module. The gdb/binutils CVS repository is an example of such a repository.
Re: add .cvsrc to skel
On 2013/03/31 16:46, Marc Espie wrote: On Sun, Mar 31, 2013 at 04:32:05PM +0200, Marc Espie wrote: On Sun, Mar 31, 2013 at 03:26:56PM +0100, Stuart Henderson wrote: On 2013/03/31 16:17, Marc Espie wrote: +diff -uNp oh, and there is one thing about -p as a default: it increases the chances of a messed-up terminal if the file has binary crap in it, as it does not do any strnvis() or similar. We could (should) fix that. That's rather trivial to do... Actually, no. It makes little sense. The diff itself doesn't encode its input. The function name that -p outputs is just as dangerous as the source file contents itself... You know what you're going to get if you edit a line with/near lines like this and then diff it, but the function name can be a bit unexpected (I had minor trouble with this in the past with update-patches in ports). Not particularly major, just thought it worth mentioning if we're talking about adding this to default config.
Re: add .cvsrc to skel
On Sun, Mar 31, 2013 at 08:49:03PM +0100, Stuart Henderson wrote: On 2013/03/31 16:46, Marc Espie wrote: On Sun, Mar 31, 2013 at 04:32:05PM +0200, Marc Espie wrote: On Sun, Mar 31, 2013 at 03:26:56PM +0100, Stuart Henderson wrote: On 2013/03/31 16:17, Marc Espie wrote: +diff -uNp oh, and there is one thing about -p as a default: it increases the chances of a messed-up terminal if the file has binary crap in it, as it does not do any strnvis() or similar. We could (should) fix that. That's rather trivial to do... Actually, no. It makes little sense. The diff itself doesn't encode its input. The function name that -p outputs is just as dangerous as the source file contents itself... You know what you're going to get if you edit a line with/near lines like this and then diff it, but the function name can be a bit unexpected (I had minor trouble with this in the past with update-patches in ports). Not particularly major, just thought it worth mentioning if we're talking about adding this to default config. If it's really a valid concern, as far as I can tell, It's just a question of Index: usr.bin/diff/diffreg.c === RCS file: /home/openbsd/cvs/src/usr.bin/diff/diffreg.c,v retrieving revision 1.82 diff -u -p -r1.82 diffreg.c --- usr.bin/diff/diffreg.c 8 Jul 2012 15:48:56 - 1.82 +++ usr.bin/diff/diffreg.c 31 Mar 2013 14:43:18 - @@ -77,6 +77,7 @@ #include stdlib.h #include string.h #include unistd.h +#include vis.h #include diff.h #include pathnames.h @@ -1329,7 +1330,8 @@ match_function(const long *f, int pos, F if (!state) state = (public); } else { - strlcpy(lastbuf, buf, sizeof lastbuf); + strnvis(lastbuf, buf, sizeof lastbuf, + VIS_SAFE); if (state) strlcat(lastbuf, state, sizeof lastbuf); Index: usr.bin/rcs/diff.c === RCS file: /home/openbsd/cvs/src/usr.bin/rcs/diff.c,v retrieving revision 1.33 diff -u -p -r1.33 diff.c --- usr.bin/rcs/diff.c 20 Apr 2011 19:34:16 - 1.33 +++ usr.bin/rcs/diff.c 31 Mar 2013 14:44:28 - @@ -72,8 +72,10 @@ #include stdarg.h #include stddef.h #include stdio.h +#include stdlib.h #include string.h #include unistd.h +#include vis.h #include buf.h #include diff.h @@ -1176,10 +1178,8 @@ match_function(const long *f, int pos, F if (!state) state = (public); } else { - if (strlcpy(lastbuf, buf, - sizeof(lastbuf)) = sizeof(lastbuf)) - errx(1, - match_function: strlcpy); + strnvis(lastbuf, buf, sizeof(lastbuf), + VIS_SAFE); lastmatchline = pos; return lastbuf; }
Re: add .cvsrc to skel
On 03/31/13 16:17, Marc Espie wrote: +diff -uNp yes +update -P I think auto-prune (-P) without auto-add (-d) could be surprising. Personally I'd rather go without this. +checkout -P I'm indifferent here. Being a non-frequent user of cvs checkout on an already checked out tree, I consulted cvs(1) which indicated it implied '-d' behaviour, so maybe it makes more sense here. /Alexander