bug-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggested new feature for ci


From: Keith Thompson
Subject: Re: Suggested new feature for ci
Date: Mon, 8 Nov 2010 22:09:02 -0800
User-agent: Mutt/1.5.19 (2009-01-05)

On Tue 10-11-09 05:05, Thien-Thi Nguyen wrote:
> () Keith Thompson <address@hidden>
> () Mon, 8 Nov 2010 12:36:47 -0800
> 
>    The "-m" option of the "ci" command makes it difficult to specify
>    an empty log message.  A workaround I often use is
>        ci -l filename < /dev/null
> 
>    Note that "cvs commit" has a similar "-m" option, but the log message
>    is always given as a separate argument, not bundled with the option.
>    Just copying that behavior for ci would probably break too many
>    existing scripts.
> 
> Yes, that way is problematic.
> 
>    One possible solution, though it's a bit ugly, might be to define
>    behavior for an argument consisting of just "-m" (which is currently
>    an error):
> 
>        -mmsg       Uses "msg" as the message.
>        -m          Uses the following argument as the message.
> 
>    So
>        ci -m '' foo
>    would check in "foo" with an empty log message, and a non-empty message
>    could be given either as:
>        ci -mmessage foo
>    or
>        ci -m message foo
> 
> Interesting idea.  It doesn't seem ugly by itself, at first glance, but
> it being different from all the other options is indeed a disadvantage.
> 
> Another idea is to check an env var (say, RCS_DEFAULT_LOG_MESSAGE)
> to use prior to throwing "missing message for -m option" error.
> What do you think of that?

Personally, I find that uglier than the version with the environment
variable.  It's one more thing the user would have to think about.

Note that the new behavior would occur only if you have "-m" as one
of the arguments, which currently is always an error.  I doubt that
any (non-contrived) scripts currently depend on it being an error.

An alternative would be to define yet another option  that specifies
an empty log message.  But -M is already taken, and I can't think
of anything else that would be mnemonic.

Or a plain "-m" could specify an empty log message rather than
being an error.

Hmm.  That's actually consistent with the current documentation:

`-mMSG'
     Use MSG as the log message.

It would just allow MSG to be empty.  But it could be slightly
error-prone; if I type "ci -m foo bar" intending to use "foo"
as the log message, and I happen to have a file called "foo",
it will check in both "foo" and "bar" with empty log messages.
But I think that's livable.

-- 
Keith Thompson (The_Other_Keith) address@hidden  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]