You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Glasser <gl...@mit.edu> on 2007/02/09 14:50:15 UTC

Re: svn commit: r23357 - trunk/contrib/client-side

On 2/6/07, cmpilato@tigris.org <cm...@tigris.org> wrote:
> +    "  -X, --extra-args ARG  append arguments from file ARG (one per line,\n"
> +    "                        use \"STDIN\" to read from standard input)\n"

I think - is a more standard "use standard input instead of a file"
argument.  (Or /dev/fd/0 will just work on some platforms.)

--dave

-- 
David Glasser | glasser@mit.edu | http://www.davidglasser.net/

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

Re: svn commit: r23357 - trunk/contrib/client-side

Posted by "C. Michael Pilato" <cm...@collab.net>.
C. Michael Pilato wrote:
> David Glasser wrote:
>> On 2/12/07, C. Michael Pilato <cm...@collab.net> wrote:
>>> David Glasser wrote:
>>>> I think - is a more standard "use standard input instead of a file"
>>>> argument.  (Or /dev/fd/0 will just work on some platforms.)
>>> Oh, +1.  But testing indicated that passing "-X -" confused the APR
>>> getopt
>>> code (which was expecting an option flag to follow that naked
>>> hyphen).  This
>>> being a contrib script, I punted.  Do we know how to trivially make this
>>> work, though, because I'd really prefer to use the "-" convention?
>> Hmm.  In 'svn', the arg-parsing works at least (although
>> svn_stringbuf_from_file still barfs):
>>
>> macbook:/tmp/x/w glasser$ echo adsdasfkjadfl  | svn ps asdf -F - .
>> svn: Reading from stdin is currently broken, so disabled
> 
> Hrm.  Maybe my test case was horked.  I'll give it another shot.

Okay, well it seems to work fine now.  Not sure what exactly I did wrong the
first time.  Fixed MUCC to look for "-" instead of "STDIN" in r23427.

> By the way, anybody else find it odd that it's svn_stringbuf_from_file()
> that is complaining about reading from stdin in Dave's example?  The
> docstring sez:
> 
>  * ### Someday, "-" will fill @a *result from stdin.  The problem right
>  * now is that if the same command invokes the editor, stdin is crap,
>  * and the editor acts funny or dies outright.  One solution is to
>  * disallow stdin reading and invoking the editor, but how to do that
>  * reliably?
> 
> But that looks like a problem with a specific usage scenario that has
> managed to find its way into what is supposed to be a generic API.
> 
> I'll try to fix that, too.

Fixed this in r23426.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r23357 - trunk/contrib/client-side

Posted by "C. Michael Pilato" <cm...@collab.net>.
David Glasser wrote:
> On 2/12/07, C. Michael Pilato <cm...@collab.net> wrote:
>> David Glasser wrote:
>> > I think - is a more standard "use standard input instead of a file"
>> > argument.  (Or /dev/fd/0 will just work on some platforms.)
>>
>> Oh, +1.  But testing indicated that passing "-X -" confused the APR
>> getopt
>> code (which was expecting an option flag to follow that naked
>> hyphen).  This
>> being a contrib script, I punted.  Do we know how to trivially make this
>> work, though, because I'd really prefer to use the "-" convention?
> 
> Hmm.  In 'svn', the arg-parsing works at least (although
> svn_stringbuf_from_file still barfs):
> 
> macbook:/tmp/x/w glasser$ echo adsdasfkjadfl  | svn ps asdf -F - .
> svn: Reading from stdin is currently broken, so disabled

Hrm.  Maybe my test case was horked.  I'll give it another shot.

By the way, anybody else find it odd that it's svn_stringbuf_from_file()
that is complaining about reading from stdin in Dave's example?  The
docstring sez:

 * ### Someday, "-" will fill @a *result from stdin.  The problem right
 * now is that if the same command invokes the editor, stdin is crap,
 * and the editor acts funny or dies outright.  One solution is to
 * disallow stdin reading and invoking the editor, but how to do that
 * reliably?

But that looks like a problem with a specific usage scenario that has
managed to find its way into what is supposed to be a generic API.

I'll try to fix that, too.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r23357 - trunk/contrib/client-side

Posted by David Glasser <gl...@mit.edu>.
On 2/12/07, C. Michael Pilato <cm...@collab.net> wrote:
> David Glasser wrote:
> > I think - is a more standard "use standard input instead of a file"
> > argument.  (Or /dev/fd/0 will just work on some platforms.)
>
> Oh, +1.  But testing indicated that passing "-X -" confused the APR getopt
> code (which was expecting an option flag to follow that naked hyphen).  This
> being a contrib script, I punted.  Do we know how to trivially make this
> work, though, because I'd really prefer to use the "-" convention?

Hmm.  In 'svn', the arg-parsing works at least (although
svn_stringbuf_from_file still barfs):

macbook:/tmp/x/w glasser$ echo adsdasfkjadfl  | svn ps asdf -F - .
svn: Reading from stdin is currently broken, so disabled

--dave


-- 
David Glasser | glasser@mit.edu | http://www.davidglasser.net/

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

Re: svn commit: r23357 - trunk/contrib/client-side

Posted by "C. Michael Pilato" <cm...@collab.net>.
David Glasser wrote:
> On 2/6/07, cmpilato@tigris.org <cm...@tigris.org> wrote:
>> +    "  -X, --extra-args ARG  append arguments from file ARG (one per
>> line,\n"
>> +    "                        use \"STDIN\" to read from standard
>> input)\n"
> 
> I think - is a more standard "use standard input instead of a file"
> argument.  (Or /dev/fd/0 will just work on some platforms.)
> 
> --dave
> 

Oh, +1.  But testing indicated that passing "-X -" confused the APR getopt
code (which was expecting an option flag to follow that naked hyphen).  This
being a contrib script, I punted.  Do we know how to trivially make this
work, though, because I'd really prefer to use the "-" convention?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand