Re: diff in commit message (was: Multiple-line log message)
On Mon, Oct 23, 2000 at 14:59 -0500, Giang, Richard P wrote: > > Does anyone know how to enter a log message that expands > multiple lines using command line cvs commit -m? Does anyone know a method how to incorporate "cvs diff" into the "cvs commit" message and thus aid the committer with showing what has changed when he is asked to specify what he did and why? As a background: At the moment I employ a homegrown wrapper script around RCS to catch the diff before invoking an editor with the diff log and the "tell me why you did it" message. I tried to accomplish something similar in CVS, but failed miserably. :( The rcsinfo is too static (updated only with "cvs update", not referenced when -m is specified). Setting an CVSEDITOR pointing to a script to invoke "cvs diff" and "$EDITOR" hangs due to the lock already set by "cvs commit". So I realized I had to fiddle with the source and narrowed it down to commit.c at a time where start_server() is done but do_editor() is not yet. That's where I would catch the diff output and append it to the saved_message. Where am I wrong? What did I miss? Has someone already done this successfully? virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" [EMAIL PROTECTED] -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
> On Mon, Oct 23, 2000 at 14:59 -0500, Giang, Richard P wrote: > > > > Does anyone know how to enter a log message that expands > > multiple lines using command line cvs commit -m? > > Does anyone know a method how to incorporate "cvs diff" into the > "cvs commit" message and thus aid the committer with showing what > has changed when he is asked to specify what he did and why? > > As a background: At the moment I employ a homegrown wrapper > script around RCS to catch the diff before invoking an editor > with the diff log and the "tell me why you did it" message. > > I tried to accomplish something similar in CVS, but failed > miserably. :( The rcsinfo is too static (updated only with "cvs > update", not referenced when -m is specified). Setting an > CVSEDITOR pointing to a script to invoke "cvs diff" and "$EDITOR" > hangs due to the lock already set by "cvs commit". So I realized > I had to fiddle with the source and narrowed it down to commit.c > at a time where start_server() is done but do_editor() is not > yet. That's where I would catch the diff output and append it to > the saved_message. I think hacking the source is overkill. Your locking problem can be solved by running diff with the -n option (proceed without lock). Do you want to see the diff output to assist in typing the "this is what I did" message? If not, consider using the loginfo file. I think the commitinfo or editinfo files can help if you want it in the editor window, but I haven't done this personally. -Rick ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
On Tue, Oct 24, 2000 at 08:54:37PM +0200, Gerhard Sittig wrote: > Does anyone know a method how to incorporate "cvs diff" into the > "cvs commit" message and thus aid the committer with showing what > has changed when he is asked to specify what he did and why? I would have to say, this is probably the ugliest idea I have ever seen. You really want to do this on a regular basis? Why? this information can ALWAYS be regenerated outside of the log message. > As a background: At the moment I employ a homegrown wrapper > script around RCS to catch the diff before invoking an editor > with the diff log and the "tell me why you did it" message. Why not a mycommit.sh that looks like the following: CVSEDITLOG=/tmp/log.$$ cvs up > $CVSEDITLOG CVSEDITOR=mycommitedit.sh export CVSEDITLOG CVSEDITOR cvs commit rm /tmp/log And mycommitedit.sh that looks like: cat $CVSEDITLOG >> $1 vi $1 That is, instead of trying to shoe horn into cvs commit, put a wrapper around it. mrc -- Mike Castle Life is like a clock: You can work constantly [EMAIL PROTECTED] and be right all the time, or not work at all www.netcom.com/~dalgoda/ and be right at least twice a day. -- mrc We are all of us living in the shadow of Manhattan. -- Watchmen ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
Mike Castle wrote: > On Tue, Oct 24, 2000 at 08:54:37PM +0200, Gerhard Sittig wrote: > > Does anyone know a method how to incorporate "cvs diff" into the > > "cvs commit" message and thus aid the committer with showing what > > has changed when he is asked to specify what he did and why? > > I would have to say, this is probably the ugliest idea I have ever seen. > You really want to do this on a regular basis? Why? this information can > ALWAYS be regenerated outside of the log message. I have to agree with Mike and Richard that your proposal seems to implement redundant functionality. I might put diffs in emails (a function there are scripts out there for already), but CVS will already allow me to view diffs and log messages so diffs in log messages seems like wasted space and useless clutter. Still, if you really want to try it, I have a patch built on top of my *info stuff that adds a tmpltfilterinfo file which works like loginfo and the rest but provides a filter script which accepts the text from rcsinfo on stdin and spits out the new text for the log message. It was originally intended to help integrate CVS with a BTS system but it's not perfect yet - it's still running on the client and doesn't quite work on NT. If this were to become popular I'd want the script execution moved to the server before integration with the main trunk. Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com ) -- That liberty [is pure] which is to go to all, and not to the few or the rich alone. - Thomas Jefferson to H. Gates, 1798. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
"Derek R. Price" wrote: > Still, if you really want to try it, I have a patch built on top of my *info > stuff that adds a tmpltfilterinfo file which works like loginfo and the rest > but provides a filter script which accepts the text from rcsinfo on stdin and > spits out the new text for the log message. It was originally intended to > help integrate CVS with a BTS system but it's not perfect yet - it's still > running on the client and doesn't quite work on NT. If this were to become > popular I'd want the script execution moved to the server before integration > with the main trunk. Whoops. Almost forgot the link. The diff is against 1.11: http://alumni.engin.umich.edu/~oberon/ccvs.tmpltfilter.final.diff Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com ) -- That liberty [is pure] which is to go to all, and not to the few or the rich alone. - Thomas Jefferson to H. Gates, 1798. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
On Tue, Oct 24, 2000 at 14:21 -0500, Richard J. Duncan wrote: > > > > Does anyone know a method how to incorporate "cvs diff" into > > the "cvs commit" message and thus aid the committer with > > showing what has changed when he is asked to specify what he > > did and why? > > > > As a background: At the moment I employ a homegrown wrapper > > script around RCS to catch the diff before invoking an editor > > with the diff log and the "tell me why you did it" message. > > > > [ ... ] > > I think hacking the source is overkill. > > Your locking problem can be solved by running diff with the -n > option (proceed without lock). You pushed me in the right direction! Although -n means "don't actually do it", I found out about the (general) -R option for "the repo is on a ro medium". And since I'm used to feed back to where I get something from, here's what I came up with until now after a (very) little toying: export CVSEDITOR=/path/to/cvscommiteditor.sh export EDITOR=/whatever/you/are/used/to #!/bin/sh # - cvscommiteditor.sh -- FILE=$1 cvs -R diff | sed 's/^/CVS: /' >> $FILE ${EDITOR:-vi} "$@" # - E O F --- I'm still not sure if this $CVSEDITOR script will always get only this one argument. But it looks like it was so. The next step could be to fetch the list of involved files from $FILE and draw the diff just over them. This would better reflect what will be covered by commit. This probably would be with a perl script extracting the "modified / added / removed" (pretty printed) section. The only sorrow I could see arise is when somebody has the Bright Idea(TM) to translate or beautify the prefix strings and thus breaks recognition. It's already bad enough when people think to know how wide my screen is (think of 80 char text in 80 char wide terminals in vi with "se nu" on). > Do you want to see the diff output to assist in typing the > "this is what I did" message? Yes, exactly. I'm aware of the fact that commenting on what the code next to the comment _does_ is somewhat pointless (the code should be written in a way to make this clear already). Instead the comment should give hints about what the code is trying to _achieve_ and respect that the particular algorithm is just an implementation detail and actually doesn't matter in the abstract problem solution. It's exactly the "what was done" against the "what was meant to be done" thing. We don't change code for fun but to achieve results, don't we? :) On Thu, Oct 26, 2000 at 10:19 -0400, Derek R. Price wrote: > Mike Castle wrote: > > > On Tue, Oct 24, 2000 at 08:54:37PM +0200, Gerhard Sittig wrote: > > > > > > Does anyone know a method how to incorporate "cvs diff" > > > into the "cvs commit" message and thus aid the committer > > > with showing what has changed when he is asked to specify > > > what he did and why? > > > > I would have to say, this is probably the ugliest idea I have > > ever seen. You really want to do this on a regular basis? > > Why? this information can ALWAYS be regenerated outside of > > the log message. > > I have to agree with Mike and Richard that your proposal seems > to implement redundant functionality. I might put diffs in > emails (a function there are scripts out there for already), > but CVS will already allow me to view diffs and log messages so > diffs in log messages seems like wasted space and useless > clutter. Umm, obviously I've been unclear there. :) Of course it doesn't make much of a sense to put the diffs into the commit message. I meant to get them somehow into the "template" the editor sees to aid the user in his thinking "what was it that I did to the code?". And yes, a wrapper could have done. But telling the users to issue "cvs ci" as they are used to from everywhere and can read in all the doc is easier than teaching them to specify "mycvs ci" which is nonstandard and confusing. And yes, even "missing" mycvs wrappers can be handled by doing "cvs diff; cvs ci" -- but it always is extra work and can easily be thought about and handled once and for all. virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" [EMAIL PROTECTED] -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
Gerhard Sittig writes: > > You pushed me in the right direction! Although -n means "don't > actually do it", I found out about the (general) -R option for > "the repo is on a ro medium". There's no such option in standard CVS -- you should use -n (which means ``don't modify stuff on the disk'', not ``don't do it'', and also frequently means ``don't bother locking''. -Larry Jones Well of course the zipper's going to get stuck if everyone stands around WATCHING me! -- Calvin ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
On Fri, Oct 27, 2000 at 10:48 -0400, Larry Jones wrote: > Gerhard Sittig writes: > > > > You pushed me in the right direction! Although -n means "don't > > actually do it", I found out about the (general) -R option for > > "the repo is on a ro medium". > > There's no such option in standard CVS -- you should use -n (which ^^ > means ``don't modify stuff on the disk'', not ``don't do it'', and also > frequently means ``don't bother locking''. What does that mean? I researched this on a FreeBSD 4.1 system with - cvs --version - Concurrent Versions System (CVS) 1.10.7 (client/server) Copyright (c) 1989-1998 Brian Berliner, david d `zoo' zuhn, Jeff Polk, and other authors CVS may be copied only under the terms of the GNU General Public License, a copy of which can be found with the CVS distribution kit. Specify the --help option for further information about CVS - cvs --version - The manpage has no hint about any customization or "difference to the original". Should I expect to not everywhere find what I'm getting used to working with this program in this environment? Until now I thought the "$FreeBSD$" macro to be the only special thing about this version. Where can I learn about those "issues"? And should there be any kind of flag in the --version output as soon as any patch not in the "standard distro" went in? I'm sorry to ask this here on the list, but I don't have success to any other platform with another 1.10.7 cvs from here. PS: Having "cvs -n diff | ... >> $FILE" does its job as well in the $CVSEDITOR script. :) virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" [EMAIL PROTECTED] -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
Gerhard Sittig writes: > > On Fri, Oct 27, 2000 at 10:48 -0400, Larry Jones wrote: > > > > There's no such option in standard CVS -- you should use -n (which > ^^ > What does that mean? I researched this on a FreeBSD 4.1 system with [...] > The manpage has no hint about any customization or "difference to > the original". Should I expect to not everywhere find what I'm > getting used to working with this program in this environment? Sounds like it. I have no idea what the FreeBSD folks have done to CVS, but it appears that they have at least added a global option. To my knowledge, they've made no attempt to get input from the CVS developers or share their changes with us. > Until now I thought the "$FreeBSD$" macro to be the only special > thing about this version. Where can I learn about those > "issues"? And should there be any kind of flag in the --version > output as soon as any patch not in the "standard distro" went in? It certainly would prevent confusion -- you may want to suggest it (strongly!) to whoever is working on CVS for FreeBSD. You may also want to suggest that they communicate a bit better with the CVS developers. -Larry Jones Oh, now YOU'RE going to start in on me TOO, huh? -- Calvin ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
On Sat, Oct 28, 2000 at 22:30 -0400, Larry Jones wrote: > > [ ... ] I have no idea what the FreeBSD folks have done to > CVS, but it appears that they have at least added a global > option. To my knowledge, they've made no attempt to get input > from the CVS developers or share their changes with us. For a quick overview here's what I could dig up after you implanted the feeling in me that "FreeBSD's CVS is somewhat different from the standard CVS": There's a file /usr/src/contrib/cvs/FREEBSD-upgrade (if only I had the bookmark around with the web frontend to the FreeBSD source repo -- I can provide it on Tuesday) with the most important section for you at its end: - ... Current local changes: - CVS_LOCAL_BRANCH_NUM environment variable support for choosing the magic branch number. (for CVSup local-commit support) - CVSREADONLYFS environment variable and global option -R to enable no-locking readonly mode (eg: cvs repo is a cdrom or mirror) - the verify message script can edit the submitted log message. - if pserver username is "anoncvs", implicitly use a password of "anoncvs". - CVSROOT/options file - Variable keyword expansion controls including custom keywords. - $ CVSHeader$ keyword - like Header, but with $CVSROOT stripped off. - > [ ... ] you may want to suggest it (strongly!) to whoever is > working on CVS for FreeBSD. You may also want to suggest that > they communicate a bit better with the CVS developers. I copied your request for feedback to [EMAIL PROTECTED] who seems to maintain the cvs contrib package. FYI: FreeBSD's -STABLE branch comes with cvs 1.10.7, -CURRENT has imported 1.11 lately. virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" [EMAIL PROTECTED] -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: diff in commit message (was: Multiple-line log message)
On Sun, Oct 29, 2000 at 09:00 +0100, Gerhard Sittig wrote: > > There's a file /usr/src/contrib/cvs/FREEBSD-upgrade (if only I > had the bookmark around with the web frontend to the FreeBSD > source repo -- I can provide it on Tuesday) with the most > important section for you at its end: http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/cvs/ virtually yours 82D1 9B9C 01DC 4FB4 D7B4 61BE 3F49 4F77 72DE DA76 Gerhard Sittig true | mail -s "get gpg key" [EMAIL PROTECTED] -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs