[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [RFE] Make 'svn patch' read from STDIN

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 1 Feb 2016 13:01:58 +0100

On Mon, Feb 01, 2016 at 12:44:38PM +0100, Andreas Scherer wrote:
> Am Montag, 1. Februar 2016, 10:51:39 schrieb Stefan Sperling:
> > So we could consider extending svn patch to run without a path argument
> > and read the patch from stdin.
> >
> > [...] this feature falls squarly into the domain of the command line client
> > and not the API.
> >
> > Also, I think we should preserve the following behaviour
> > $ svn patch
> > svn: E205001: Try 'svn help patch' for more information
> > svn: E205001: Not enough arguments provided
> > Invoking 'svn patch' with a path to a patch file must remain a valid
> > use case. We cannot break backwards compatibilty here.
>
> > > gzip -dc patch-0042.gz | svn patch -P patch-0042 -
> That's why my suggested invocation had a hyphen '-' at the end, playing the
> role of a place-holder for 'stdin'. This preserves both current situations,
> i.e., 'svn patch' being called without an argument (--> error) and with a
> filename (--> normal processing).

Sure. My idea was to auto-detect based on stdin being tty or file
instead of requiring the user to pass a hyphen to indicate that
stdin should be used. But either approach should work.

> Also, 'svn patch -' should _require_ to be
> supplied with the '-P' option and a filename for storage.

What does -P do? I cannot seem to find it in documentation for BSD patch,
GNU patch, git apply, and svn patch.
Received on 2016-02-01 13:02:06 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.