Re: Command-line multi-line messages for commit
On Wed, 2003-06-04 at 02:44, Eric Siegerman wrote: On Tue, Jun 03, 2003 at 12:46:42PM +0300, Stephen Biggs wrote: I got it to work using another way which actually works better if you don't want to be so interactive (one press of the enter key instead of 3): $ cvs ci -m line 1'$\n'line 2'$\n'line 3 Yikes! Non-interactive it may be, but pretty painful! How about writing a wrapper shell script? You would invoke it as: cvs-wrapper -m 'message\ncontaining\nmultiple lines' other-args It would have to do something like: - extract (and remove) the -m and its value from the command line - turn the \ns into newlines (and any other transformations you like) - export CVSEDITOR=`which cat` into the environment - go: echo $transformed_log_message | cvs $other_args -- --snip signature-- Actually, your method sounds to me much more painful because I have to learn how to use sed to do this and run and test the wrapper script over and over again until I debug it due to my limited expertise in coding shell scripts, living with bogus messages in a junk repository until I get it right. My way is quicker and much simpler for me as long as I remember to put the quotes right. E.g., I actually meant to say: cvs ci -m line 1$'\n'line 2$'\n'line 3 ... note the change in the position of the single quote and the $. ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: Command-line multi-line messages for commit
[ On , June 8, 2003 at 10:46:45 (+0300), Stephen Biggs wrote: ] Subject: Re: Command-line multi-line messages for commit Actually, your method sounds to me much more painful because I have to learn how to use sed to do this and run and test the wrapper script over and over again until I debug it due to my limited expertise in coding shell scripts, living with bogus messages in a junk repository until I get it right. My way is quicker and much simpler for me as long as I remember to put the quotes right. Why the heck don't you use a proper command shell and then you can just type multi-line comments right there on the command-line!?!?!? cvs commit -m 'first line second line third line' filname.c I.e. DO NOT use 'csh'. It is the source of your problems. Use a POSIX compatible shell instead (e.g. sh or ksh or one of their close variants). Here's a demonstration copied from a terminal window. The $ is of course my primary shell prompt ($PS1). The is my secondary shell prompt ($PS2): $ echo 'first line second line third line' first line second line third line $ Note too that if you're going to be doing this kind of thing it wouldn't hurt to learn to use the other tools you could find useful. -- Greg A. Woods +1 416 218-0098;[EMAIL PROTECTED]; [EMAIL PROTECTED] Planix, Inc. [EMAIL PROTECTED]; VE3TCP; Secrets of the Weird [EMAIL PROTECTED] ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: Command-line multi-line messages for commit
On Sun, Jun 08, 2003 at 13:07:59 -0400, Greg A. Woods sent 1.5K bytes: [ On , June 8, 2003 at 10:46:45 (+0300), Stephen Biggs wrote: ] Subject: Re: Command-line multi-line messages for commit Actually, your method sounds to me much more painful because I have to learn how to use sed to do this and run and test the wrapper script over and over again until I debug it due to my limited expertise in coding shell scripts, living with bogus messages in a junk repository until I get it right. My way is quicker and much simpler for me as long as I remember to put the quotes right. Why the heck don't you use a proper command shell and then you can just type multi-line comments right there on the command-line!?!?!? cvs commit -m 'first line second line third line' filname.c I.e. DO NOT use 'csh'. It is the source of your problems. Use a POSIX compatible shell instead (e.g. sh or ksh or one of their close variants). Properness and POSIX compliance aside, csh (and tcsh) handle this fine, although the method looks a little different: % cvs commit -m 'first line \ ? second line \ ? third line' filename.c '%' and '?' are prompts. snip HTH Scott ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: Command-line multi-line messages for commit
On Tue, Jun 03, 2003 at 12:46:42PM +0300, Stephen Biggs wrote: I got it to work using another way which actually works better if you don't want to be so interactive (one press of the enter key instead of 3): $ cvs ci -m line 1'$\n'line 2'$\n'line 3 Yikes! Non-interactive it may be, but pretty painful! How about writing a wrapper shell script? You would invoke it as: cvs-wrapper -m 'message\ncontaining\nmultiple lines' other-args It would have to do something like: - extract (and remove) the -m and its value from the command line - turn the \ns into newlines (and any other transformations you like) - export CVSEDITOR=`which cat` into the environment - go: echo $transformed_log_message | cvs $other_args -- | | /\ |-_|/ Eric Siegerman, Toronto, Ont.[EMAIL PROTECTED] | | / When I came back around from the dark side, there in front of me would be the landing area where the crew was, and the Earth, all in the view of my window. I couldn't help but think that there in front of me was all of humanity, except me. - Michael Collins, Apollo 11 Command Module Pilot ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
Re: Command-line multi-line messages for commit
Stephen Biggs [EMAIL PROTECTED] writes: Greetings all, How do I enter in multi-line log messages when I want to commit? There are two typical ways to do this. Use either cat EOF logmessage This is a multiline log message. EOF cvs commit -F logmessage or cvs commit -m 'This is a multiline log message.' to do your commit. I tried using \n, \\n, ^L in the quoted text string for the -m option but no go; all are on the same line with the quoted string in the log message. Running bash on Linux, Redhat 8.0. I tried embedding for bash using $'\n' but this whole string gets put into the log. Just use multiple lines in bash with your string broken across multiple lines. Basically how do I embed 0xa characters directly into the command line for the commit command? This might be more related to straight Linux command line usage, and if this is off-topic, please excuse. Any assistance would be appreciated. Enjoy! -- Mark ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs
RE: Command-line multi-line messages for commit
Thanks, all, for your replies. I didn't try this: $ cvs ci -m 'line 1 line 2 line 3' I got it to work using another way which actually works better if you don't want to be so interactive (one press of the enter key instead of 3): $ cvs ci -m line 1'$\n'line 2'$\n'line 3 On Tue, 2003-06-03 at 11:02, Lemke, Michael IZ/HZA-IC1 wrote: -Original Message- From: Stephen Biggs [mailto:[EMAIL PROTECTED] Sent: Sunday, June 01, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: Command-line multi-line messages for commit Greetings all, How do I enter in multi-line log messages when I want to commit? I tried using \n, \\n, ^L in the quoted text string for the -m option but no go; all are on the same line with the quoted string in the log message. Running bash on Linux, Redhat 8.0. I tried embedding for bash using $'\n' but this whole string gets put into the log. Basically how do I embed 0xa characters directly into the command line for the commit command? This might be more related to straight Linux command line usage, and if this is off-topic, please excuse. Any assistance would be appreciated. Don't think so complicated. Why not try the simplest of all: $ cvs ci -m 'line 1 line 2 line 3' $ Needs a Bourne Shell derivative. I didn't try it but unless cvs plays some internal tricks it should work. Michael ___ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs