You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jim Correia <ji...@pobox.com> on 2004/12/22 01:17:22 UTC

[BUG] svn commit ignores --non-interactive

Using r12491 (tip of trunk as of when I wrote this:

$ ./subversion/clients/cmdline/svn ci --editor-cmd emacs 
--non-interactive /path/to/wc

Log message unchanged or not specified
a)bort, c)ontinue, e)dit
a
$

When the log message came up in emacs, I exited without changing the 
text. I was given the prompt above even though I specified 
--non-interactive which claims

	  --non-interactive        : do no interactive prompting

I would have expected it to abort by default, and log something to 
stderr claiming it had done so as a result of --non-interactive.

Bug? Should I file an issue?

Thanks,
Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by "C. Michael Pilato" <cm...@collab.net>.
Scott Palmer <Sc...@2connected.org> writes:

> C. Michael Pilato wrote:
> 
> >Nah, I think Jim is right.  --non-interactive *was* written for
> >authentication prompts, but the spirit behind the change was to
> >prevent Subversion from hanging while waiting for input when run from
> >scripts that can't provide that input.  Let just go ahead and make
> >--non-interactive disable *all* interactivity.  That means that if you
> >do a commit with --non-interactive and no -m or -F, your commit fails
> >with an explanatory error message.
> >
> Why not just leave it up to also using --editor-cmd ?  If set
> appropriately couldn't yet get the best of both worlds?

That rather feels like a hack.  "Hey, Subversion, please use the
following editor to prompt me:  HAHA!  Just kidding!  I've got no
editor, sucker!"

Passing --non-interactive will have the affect that, if Subversion
needs to prompt for auth, it won't and will instead just fail
(regardless of what editor you've told it to use or not use).  And if
Subversion doesn't need to prompt for auth, ... well, then you didn't
need to pass --non-interactive, did you?  :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Scott Palmer <Sc...@2connected.org>.
C. Michael Pilato wrote:

>Nah, I think Jim is right.  --non-interactive *was* written for
>authentication prompts, but the spirit behind the change was to
>prevent Subversion from hanging while waiting for input when run from
>scripts that can't provide that input.  Let just go ahead and make
>--non-interactive disable *all* interactivity.  That means that if you
>do a commit with --non-interactive and no -m or -F, your commit fails
>with an explanatory error message.
>  
>
Why not just leave it up to also using --editor-cmd ?  If set 
appropriately couldn't yet get the best of both worlds?

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Julian Foad <ju...@btopenworld.com>.
C. Michael Pilato wrote:
> Nah, I think Jim is right.  --non-interactive *was* written for
> authentication prompts, but the spirit behind the change was to
> prevent Subversion from hanging while waiting for input when run from
> scripts that can't provide that input.  Let just go ahead and make
> --non-interactive disable *all* interactivity.  That means that if you
> do a commit with --non-interactive and no -m or -F, your commit fails
> with an explanatory error message.

+1.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by "C. Michael Pilato" <cm...@collab.net>.
Nah, I think Jim is right.  --non-interactive *was* written for
authentication prompts, but the spirit behind the change was to
prevent Subversion from hanging while waiting for input when run from
scripts that can't provide that input.  Let just go ahead and make
--non-interactive disable *all* interactivity.  That means that if you
do a commit with --non-interactive and no -m or -F, your commit fails
with an explanatory error message.

Ben Reser <be...@reser.org> writes:

> On Wed, Dec 22, 2004 at 02:58:14PM -0500, Jim Correia wrote:
> > On Dec 22, 2004, at 2:36 PM, Philip Martin wrote:
> > 
> > >--non-interactive applies to authentication prompts.
> > 
> > The documentation isn't so specific. It simply says:
> > 
> > 	  --non-interactive        : do no interactive prompting
> > 
> > >If we are going to extend it to the log message then would it not make 
> > >more sense for
> > >it to prevent use of the editor as well, i.e. require you to use
> > >either -m or -F.
> > 
> > I'm not sure about that.
> > 
> > The reason that I ran into it was that I was using it in a scripted 
> > environment where it was appropriate to use the editor (i.e. I was 
> > sitting there ready to type a commit message), but the script wasn't 
> > attached to a TTY, so printing something to stdout/stderr and expecting 
> > to be able to read an answer back from stdin is wrong.
> > 
> > My expectation was that this would be covered under by "do no 
> > interactive prompting."
> 
> Can't we just check to see if stdin is a tty?  I suppose that's probably
> not a portable solution.  But I know a lot of unix apps use that to
> decide if they should interactively propmpt.
> 
> -- 
> Ben Reser <be...@reser.org>
> http://ben.reser.org
> 
> "Conscience is the inner voice which warns us somebody may be looking."
> - H.L. Mencken
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Ben Reser <be...@reser.org>.
On Wed, Dec 22, 2004 at 02:58:14PM -0500, Jim Correia wrote:
> On Dec 22, 2004, at 2:36 PM, Philip Martin wrote:
> 
> >--non-interactive applies to authentication prompts.
> 
> The documentation isn't so specific. It simply says:
> 
> 	  --non-interactive        : do no interactive prompting
> 
> >If we are going to extend it to the log message then would it not make 
> >more sense for
> >it to prevent use of the editor as well, i.e. require you to use
> >either -m or -F.
> 
> I'm not sure about that.
> 
> The reason that I ran into it was that I was using it in a scripted 
> environment where it was appropriate to use the editor (i.e. I was 
> sitting there ready to type a commit message), but the script wasn't 
> attached to a TTY, so printing something to stdout/stderr and expecting 
> to be able to read an answer back from stdin is wrong.
> 
> My expectation was that this would be covered under by "do no 
> interactive prompting."

Can't we just check to see if stdin is a tty?  I suppose that's probably
not a portable solution.  But I know a lot of unix apps use that to
decide if they should interactively propmpt.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Jim Correia <ji...@pobox.com>.
On Dec 22, 2004, at 2:36 PM, Philip Martin wrote:

> --non-interactive applies to authentication prompts.

The documentation isn't so specific. It simply says:

	  --non-interactive        : do no interactive prompting

> If we are going to extend it to the log message then would it not make 
> more sense for
> it to prevent use of the editor as well, i.e. require you to use
> either -m or -F.

I'm not sure about that.

The reason that I ran into it was that I was using it in a scripted 
environment where it was appropriate to use the editor (i.e. I was 
sitting there ready to type a commit message), but the script wasn't 
attached to a TTY, so printing something to stdout/stderr and expecting 
to be able to read an answer back from stdin is wrong.

My expectation was that this would be covered under by "do no 
interactive prompting."

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Jim Correia <ji...@pobox.com>.
On Dec 23, 2004, at 7:17 AM, Max Bowsher wrote:

> I think that your script is broken right now, and working purely 
> because of a bug in subversion. The option is --non-interactive, after 
> all, not --partially-interactive.

Is it possible to otherwise get the message template that svn commit 
would send to the editor? (Grepping status would give a close 
approximation, but it isn't exactly the same.)

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Max Bowsher <ma...@ukf.net>.
Jim Correia wrote:
> On Dec 22, 2004, at 2:53 PM, Max Bowsher wrote:
>
>> Oliver Klozoff wrote:
>>>> --non-interactive applies to authentication prompts.  If we
>>>> are going to extend it to the log message then would it not
>>>> make more sense for it to prevent use of the editor as well,
>>>> i.e. require you to use either -m or -F.
>>>> --
>>>> Philip Martin
>>> I can write a quick patch that errors if --non-interactive is
>>> specified
>>> without -m or -F.  Would anybody want that?
>>
>> +1.
>>
>> I think this would definitely be a good idea.
>
> As I alluded to in my previous message, if you do that, you'll break my
> script. It runs from a GUI process (where it cannot do interactive
> prompting since stdin isn't a TTY). It works because --editor-cmd
> causes a GUI text editor to edit the log message - the problem is in
> what happens when the user (me) inadvertently leaves the message blank
> (for example, by fat fingering the keyboard and closing the editor
> window.)

I think that your script is broken right now, and working purely because of 
a bug in subversion. The option is --non-interactive, after all, 
not --partially-interactive.

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: [BUG] svn commit ignores --non-interactive

Posted by Oliver Klozoff <st...@fastmail.fm>.
> As I alluded to in my previous message, if you do that, 
> you'll break my script. It runs from a GUI process (where it 
> cannot do interactive prompting since stdin isn't a TTY). It 
> works because --editor-cmd causes a GUI text editor to edit 
> the log message - the problem is in what happens when the 
> user (me) inadvertently leaves the message blank (for 
> example, by fat fingering the keyboard and closing the editor
> window.)

Okay, now I understand your problem.

The only way I can think of to *correctly* solve this problem is to add a
field to svn_client_ctx_t that contains the 'non-interactive' flag, and then
have svn_cl__get_log_message (in util.c) check this flag before asking for a
prompt.

We *could* solve the problem more locally by adding placing the flag in the
log_msg_baton function, but the problem with that is, we have to change
something else if something *elsewhere* decides to start prompting.


An alternative would be to not prompt the user under any circumstances, and
if they want to commit a blank log message, they have to use -m '' (or
perhaps --force-log).


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Jim Correia <ji...@pobox.com>.
On Dec 22, 2004, at 2:53 PM, Max Bowsher wrote:

> Oliver Klozoff wrote:
>>> --non-interactive applies to authentication prompts.  If we
>>> are going to extend it to the log message then would it not
>>> make more sense for it to prevent use of the editor as well,
>>> i.e. require you to use either -m or -F.
>>> --
>>> Philip Martin
>> I can write a quick patch that errors if --non-interactive is 
>> specified
>> without -m or -F.  Would anybody want that?
>
> +1.
>
> I think this would definitely be a good idea.

As I alluded to in my previous message, if you do that, you'll break my 
script. It runs from a GUI process (where it cannot do interactive 
prompting since stdin isn't a TTY). It works because --editor-cmd 
causes a GUI text editor to edit the log message - the problem is in 
what happens when the user (me) inadvertently leaves the message blank 
(for example, by fat fingering the keyboard and closing the editor 
window.)

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Max Bowsher <ma...@ukf.net>.
Oliver Klozoff wrote:
>> --non-interactive applies to authentication prompts.  If we
>> are going to extend it to the log message then would it not
>> make more sense for it to prevent use of the editor as well,
>> i.e. require you to use either -m or -F.
>> 
>> --
>> Philip Martin
> 
> I can write a quick patch that errors if --non-interactive is specified
> without -m or -F.  Would anybody want that?

+1.

I think this would definitely be a good idea.

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: [BUG] svn commit ignores --non-interactive

Posted by Oliver Klozoff <st...@fastmail.fm>.
> --non-interactive applies to authentication prompts.  If we 
> are going to extend it to the log message then would it not 
> make more sense for it to prevent use of the editor as well, 
> i.e. require you to use either -m or -F.
> 
> --
> Philip Martin

I can write a quick patch that errors if --non-interactive is specified
without -m or -F.  Would anybody want that?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] svn commit ignores --non-interactive

Posted by Philip Martin <ph...@codematters.co.uk>.
Jim Correia <ji...@pobox.com> writes:

> Using r12491 (tip of trunk as of when I wrote this:
>
> $ ./subversion/clients/cmdline/svn ci --editor-cmd emacs
> --non-interactive /path/to/wc
>
> Log message unchanged or not specified
> a)bort, c)ontinue, e)dit
> a
> $
>
> When the log message came up in emacs, I exited without changing the
> text. I was given the prompt above even though I specified
> --non-interactive which claims
>
> 	  --non-interactive        : do no interactive prompting
>
> I would have expected it to abort by default, and log something to
> stderr claiming it had done so as a result of --non-interactive.
>
> Bug? Should I file an issue?

--non-interactive applies to authentication prompts.  If we are going
to extend it to the log message then would it not make more sense for
it to prevent use of the editor as well, i.e. require you to use
either -m or -F.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org