You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Benson Margulies <bi...@gmail.com> on 2014/02/05 01:29:21 UTC

Having trouble applying a PR to svn

So, I did:

wget https://github.com/apache/lucene-solr/pull/18.diff

and then:

svn patch --dry-run --strip 1 18.diff

and some of the pathnames have 2 components stripped -- but not all.

Has anyone got another approach? I hesitate to use git-svn, but I'll
follow someone else's lead.


svn patch --dry-run --strip 1 18.diff
U         solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
A         core
A         core/src
A         core/src/test-files
A         core/src/test-files/solr
A         core/src/test-files/solr/analysisconfs
A         core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
A         solr/core/src/test-files/solr/analysisconfs
A         solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
A         core
A         core/src
A         core/src/test
A         core/src/test/org
A         core/src/test/org/apache
A         core/src/test/org/apache/solr
A         core/src/test/org/apache/solr/analysis
A         core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
A         solr/core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
A         core
A         core/src
A         core/src/test
A         core/src/test/org
A         core/src/test/org/apache
A         core/src/test/org/apache/solr
A         core/src/test/org/apache/solr/update
A         core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
A         solr/core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Having trouble applying a PR to svn

Posted by Robert Muir <rc...@gmail.com>.
yes, I think for patches actually made from svn, svn patch may be better?

to me, the key advantage with 'standard patch --merge' is that it works for
git patches (which may not have svn revision information) or patches you
make yourself with 'diff', as well as svn patches: its universal.


On Tue, Feb 4, 2014 at 4:48 PM, Chris Hostetter <ho...@fucit.org>wrote:

>
> : Personally, never tried svn patch.
>
> Yeah ... i think it has some explicit assumptions about the patch file
> being generated by "svn diff" so it can use some of the header bits to
> know when files mentioned in a patch should be "svn rm", "svn mv", or "svn
> add"
>
> In particular, if you note that files that are going wonky for you, it's
> the newly added files -- and in the git diff the "old" version of those
> files are refered to as "/dev/null".  in an equivilent "svn diff"
> generated patch file the true path would be used.
>
> : # for git patches (maybe out of date)
> : patch -p1 --merge < patch.txt
>
> ...which works fine for your patch (although i personally don't mind hte
> reject files) ...
>
> hossman@frisbee:~/lucene/dev$ curl
> https://github.com/apache/lucene-solr/pull/18.diff | patch -p1
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time
>  Current
>                                  Dload  Upload   Total   Spent    Left
>  Speed
> 100  8196  100  8196    0     0   9138      0 --:--:-- --:--:-- --:--:--
> 14034
> patching file
> solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
> patching file
> solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
> patching file
> solr/core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
> patching file
> solr/core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
> hossman@frisbee:~/lucene/dev$ svn status
> ?
> solr/core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
> ?
> solr/core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
> ?       solr/core/src/test-files/solr/analysisconfs
> M       solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
>
>
>
> -Hoss
> http://www.lucidworks.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Having trouble applying a PR to svn

Posted by Chris Hostetter <ho...@fucit.org>.
: Personally, never tried svn patch.

Yeah ... i think it has some explicit assumptions about the patch file 
being generated by "svn diff" so it can use some of the header bits to 
know when files mentioned in a patch should be "svn rm", "svn mv", or "svn 
add"

In particular, if you note that files that are going wonky for you, it's 
the newly added files -- and in the git diff the "old" version of those 
files are refered to as "/dev/null".  in an equivilent "svn diff" 
generated patch file the true path would be used.

: # for git patches (maybe out of date)
: patch -p1 --merge < patch.txt

...which works fine for your patch (although i personally don't mind hte 
reject files) ...

hossman@frisbee:~/lucene/dev$ curl https://github.com/apache/lucene-solr/pull/18.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8196  100  8196    0     0   9138      0 --:--:-- --:--:-- --:--:-- 
14034
patching file solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
patching file solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
patching file solr/core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
patching file solr/core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
hossman@frisbee:~/lucene/dev$ svn status
?       solr/core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
?       solr/core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
?       solr/core/src/test-files/solr/analysisconfs
M       solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java



-Hoss
http://www.lucidworks.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Having trouble applying a PR to svn

Posted by Robert Muir <rc...@gmail.com>.
Personally, never tried svn patch.

if you have a recent version of gnu patch (i think 2.7+ ? you might have to
install from source for some macs, i did), then i tend to just do this:

# for git patches (maybe out of date)
patch -p1 --merge < patch.txt
# for svn patches (maybe out of date
patch -p0 --merge < patch.txt

If there are conflicts, you get the normal <<< and >>> stuff rather than
.rej files and so on.

I use this all the time for applying patches, so that if they are a little
out of date I have no hassles.



On Tue, Feb 4, 2014 at 4:29 PM, Benson Margulies <bi...@gmail.com>wrote:

> So, I did:
>
> wget https://github.com/apache/lucene-solr/pull/18.diff
>
> and then:
>
> svn patch --dry-run --strip 1 18.diff
>
> and some of the pathnames have 2 components stripped -- but not all.
>
> Has anyone got another approach? I hesitate to use git-svn, but I'll
> follow someone else's lead.
>
>
> svn patch --dry-run --strip 1 18.diff
> U
> solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
> A         core
> A         core/src
> A         core/src/test-files
> A         core/src/test-files/solr
> A         core/src/test-files/solr/analysisconfs
> A         core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
> A         solr/core/src/test-files/solr/analysisconfs
> A
> solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
> A         core
> A         core/src
> A         core/src/test
> A         core/src/test/org
> A         core/src/test/org/apache
> A         core/src/test/org/apache/solr
> A         core/src/test/org/apache/solr/analysis
> A
> core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
> A
> solr/core/src/test/org/apache/solr/analysis/ThrowingMockTokenFilterFactory.java
> A         core
> A         core/src
> A         core/src/test
> A         core/src/test/org
> A         core/src/test/org/apache
> A         core/src/test/org/apache/solr
> A         core/src/test/org/apache/solr/update
> A
> core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
> A
> solr/core/src/test/org/apache/solr/update/AnalysisErrorHandlingTest.java
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>