You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2012/08/18 02:45:17 UTC

Getting a github pull request into SVN

Hi,

So here is what I  think is the minimal amount of work to get a Github pull request committed in SVN.

I had tried playing about with patching between repos but it got complex fast.

First off pull requests can be viewed as patches in Github:
https://github.com/apache/flex/pull/2.patch

BTW This wasn't easy to find in the github docs and I really wish someone had brought it up.

Now we have 2 issues:
1. Patch is not is SVN format
2. Unicode characters have been transformed (look carefully)

So something like this in theory should work:
curl https://github.com/apache/flex/pull/2.patch | native2ascii -encoding UTF-8 -reverse | patch -p1

curl downloads the patch, native2ascii converts to UTF8 and patch -p1 converts the git patch to SVN format  and applies it by stripping off the first character off each path in the patch file.

May be other git patch file formatting issues I'm not aware of.

However it look like patch doesn't like unicode changes and applying the patch fails. 

This:
curl https://github.com/apache/flex/pull/2.patch | native2ascii -encoding UTF-8 -reverse 
Looks fine to me so not 100% sure why the patch fails.

Doing this works:
curl https://github.com/apache/flex/pull/2.patch | patch -p1

But now the unicode characters are wrong. For most patches that may be OK (if they don't contain unicode) but could introduce subtle errors if care is not taken.

I'd appreciate it if the people who voted for the "Git Branching Model on Git now" option lend a hand here and help sort this out.

This is on OSX btw I have no idea if the above works in windows.

Thanks,
Justin

RE: Getting a github pull request into SVN

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>Yep look like the patch file is not UTF8 encoded?

Yeh, its not actually encoded at all. If it were, I would expect to see:

utf32 - 0x000000F3
utf16 - 0x00F3
utf8 - 0xC3 0xB3

So, is it coming out of github's character patch generation code that way directly? If so, we could write a bit of code with some regex to fix.

Mike


Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

>> It was in another translation es_ES file inside this project, but I can not remember exactly what was that file. Making some file search would help.
All the other es_ES file are correctly encoded as far a sI can see. 

So do we know if this is an issue with the encoding of the github patch or with the original commit/push to github?

Thanks,
Justin

Re: Getting a github pull request into SVN

Posted by Jose Barragan <jo...@codeoscopic.com>.
done +1
On Aug 21, 2012, at 9:00 AM, Justin Mclean <ju...@classsoftware.com> wrote:

> Hi,
> 
>> [1] https://issues.apache.org/jira/browse/INFRA-5171
> 
> Watched and voted for!
> 
> Justin


Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> [1] https://issues.apache.org/jira/browse/INFRA-5171

Watched and voted for!

Justin

Re: Getting a github pull request into SVN

Posted by Omar Gonzalez <om...@gmail.com>.
> I was about to open an INFRA ticket to request the new mirrors after the
> SVN restructure
> I'd still do that otherwise any patches we git from git are going to be
> more and more out of date as time goes on.
>
> Thanks,
> Justin
>
>
Alrighty, I submitted a JIRA issue [1].

-omar

[1] https://issues.apache.org/jira/browse/INFRA-5171

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Hmm... not sure how messy that can get yet if we keep SVN mirroring to Git
> and merging patches into Git and sending them to SVN via git-svn.
Well as far as I can work out the git mirrors will lag behind the SVN master repo so sometimes you get a changes that don't quite match but you could get that anyway due to other changes that have been checked into SVN. Not sure if there anything we can do about this. Just need to take care and be aware that it could be an issue when apply patch files or using git-svn.

> I was about to open an INFRA ticket to request the new mirrors after the SVN restructure
I'd still do that otherwise any patches we git from git are going to be more and more out of date as time goes on.

Thanks,
Justin


Re: Getting a github pull request into SVN

Posted by Omar Gonzalez <om...@gmail.com>.
On Mon, Aug 20, 2012 at 11:20 PM, Justin Mclean <ju...@classsoftware.com>wrote:

> Hi,
>
> > We do want to get those mirrors back up before we move forward right?
> I'd guess that would take less time/infra has less objections (if at all)
> to that than the read/write Git repo so ask for the mirrors first.
>
> In order to have a read/write git repo we would have to disconnect it from
> being a SVN mirror right? Otherwise committed/pushed changes in the git
> repo could be over written. I guess we have SVN changes merged into the git
> repo and git changes merged back into SVN but I think that would get messy
> fast.
>
> Thanks,
> Justin


Hmm... not sure how messy that can get yet if we keep SVN mirroring to Git
and merging patches into Git and sending them to SVN via git-svn.

I was about to open an INFRA ticket to request the new mirrors after the
SVN restructure, but now I'm not sure if I should do that now or wait until
we figure out how to handle patches from Git/GitHub.

Perhaps I should set up a test SVN with a Git mirror to play with this
workflow? I'm going to look into this right now and see if this is
something I can set up in a reasonable amount of time (like a couple of
hours as opposed to a few days).

-omar

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> We do want to get those mirrors back up before we move forward right?
I'd guess that would take less time/infra has less objections (if at all) to that than the read/write Git repo so ask for the mirrors first.

In order to have a read/write git repo we would have to disconnect it from being a SVN mirror right? Otherwise committed/pushed changes in the git repo could be over written. I guess we have SVN changes merged into the git repo and git changes merged back into SVN but I think that would get messy fast.

Thanks,
Justin

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I want to try using git-svn to get code from GitHub/Git back to SVN, but I
> think the Git mirrors need to be updated before I try to mess with that.
Working with patch files is probably simpler, but would be good to know if it's possible.

Thanks,
Justin

Re: Getting a github pull request into SVN

Posted by Omar Gonzalez <om...@gmail.com>.
On Mon, Aug 20, 2012 at 10:42 PM, Justin Mclean <ju...@classsoftware.com>wrote:

> Hi,
>
> > * create patch file from pull request
> > 1)  Commit & Push
> > 2)  Create Pull Request
> > 3)  Save Patch File & Correct Encoding
> >
> > * create  patch file with git format-patch
> > 1) Commit & Push
> > 2) Create Patch File (git format-patch)
>
> Not 100% we have an encoding issue it may be what was checked in  was not
> encoded correctly.  Just waiting on confirmation for that.
>
> Either way would work the same way for committers ie they take the git
> patch and apply with patch -p1 to their SVN repo. So would keep but git and
> github users happy as well.
>
> Thanks,
> Justin
>
>
I want to try using git-svn to get code from GitHub/Git back to SVN, but I
think the Git mirrors need to be updated before I try to mess with that.

I sent out an email regarding the Git mirrors, if no one has requested the
mirrors are fixed by the morning I'll submit the JIRA ticket, unless
someone has a reason why we shouldn't. But I believe we need to get those
mirrors fixed to match the new SVN structure.

We do want to get those mirrors back up before we move forward right? Or
are we trying to get a read/write Git going first?

-omar

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> * create patch file from pull request
> 1)  Commit & Push
> 2)  Create Pull Request
> 3)  Save Patch File & Correct Encoding
> 
> * create  patch file with git format-patch
> 1) Commit & Push
> 2) Create Patch File (git format-patch)

Not 100% we have an encoding issue it may be what was checked in  was not encoded correctly.  Just waiting on confirmation for that.

Either way would work the same way for committers ie they take the git patch and apply with patch -p1 to their SVN repo. So would keep but git and github users happy as well.

Thanks,
Justin


Re: Getting a github pull request into SVN

Posted by Cyrill Zadra <cy...@gmail.com>.
Hi

Instead of using the patch file from a pull request it would be also
possible to create the patch file in the local repository with "git
format-patch .." ( http://git-scm.com/docs/git-format-patch )
I used this command to create my few patches. It could be even more
efficient than using the pull request for creating a svn patch file.

* create patch file from pull request
1)  Commit & Push
2)  Create Pull Request
3)  Save Patch File & Correct Encoding

* create  patch file with git format-patch
1) Commit & Push
2) Create Patch File (git format-patch)

cyrill

RE: Getting a github pull request into SVN

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
> So do we know if this is an issue with the encoding of the github patch or with the original commit/push to github?

It seems the issue was with the original commit.... as far as I understand, but that is what I was really trying to confirm. I wanted to know that I was solving the right problem

>And I'm still not sure why "native2ascii -encoding UTF-8 -reverse" fixed the patch but you then get an issue in applying it.

Nor I, but will keep trying to keep this all straight.

Mike

Re: Getting a github pull request into SVN

Posted by Om <bi...@gmail.com>.
On Tue, Aug 21, 2012 at 5:22 PM, Om <bi...@gmail.com> wrote:

> For interest here's how I applied the patch:
>
>> curl https://github.com/apache/flex/pull/7.patch | patch -p1
>>
>> So I think we can say that this is the best way on how to apply github
>> pull requests. Now just have to work out how to close them in github :-)
>>
>>
> Maybe this helps?
>
> http://developer.github.com/v3/pulls/
>
> Update a pull request
>
> PATCH /repos/:user/:repo/pulls/:number
>
> Input title *Optional* *string* body *Optional* *string* state *Optional*
> *string* - State of this Pull Request. Valid values are open and closed.
>
> {
>   "title": "new title",
>   "body": "updated body",
>   "state": "open"}
>
>
>
https://issues.apache.org/jira/browse/INFRA-4152 has some interesting
thoughts on automatically closing pull requests on GitHub.

Re: Getting a github pull request into SVN

Posted by Om <bi...@gmail.com>.
For interest here's how I applied the patch:

> curl https://github.com/apache/flex/pull/7.patch | patch -p1
>
> So I think we can say that this is the best way on how to apply github
> pull requests. Now just have to work out how to close them in github :-)
>
>
Maybe this helps?

http://developer.github.com/v3/pulls/

Update a pull request

PATCH /repos/:user/:repo/pulls/:number

Input title *Optional* *string* body *Optional* *string* state *Optional* *
string* - State of this Pull Request. Valid values are open and closed.

{
  "title": "new title",
  "body": "updated body",
  "state": "open"}

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi Jose,

> I signed my iCLA with my personal email: pepebarragan at me dot com.
> How it could simultaneously use it with this one in the list?

Should be no issues with that.

Justin

Re: Getting a github pull request into SVN

Posted by Jose Barragan <jo...@codeoscopic.com>.
I signed my iCLA with my personal email: pepebarragan at me dot com.
How it could simultaneously use it with this one in the list?

On Aug 22, 2012, at 6:20 PM, Jose Barragan <jo...@codeoscopic.com> wrote:

> Hi Justin,
> 
> I just read, signed, scanned, and sent my iCLA to secretary@apache.org.
> 
> Jose
> 
> 
> On Aug 22, 2012, at 1:35 AM, Justin Mclean <ju...@classsoftware.com> wrote:
> 
>> Hi,
>> 
>>> if I need sign any document, I'll do in order i guess contribute in any kind works thats need
>> If you want you can sign and submit an ICL. [1] But for small patches like  this it's not needed.
>> 
>>> but if any anonymous community people need too, may be nobody contribute using this way. 
>> As long as it clearly documented what's being committed in JIRA and or the list (via a patch file is best) that's OK.
>> 
>> [1] http://www.apache.org/licenses/icla.txt
>> 
>> 
> 


Re: Getting a github pull request into SVN

Posted by Jose Barragan <jo...@codeoscopic.com>.
Hi Justin,

I just read, signed, scanned, and sent my iCLA to secretary@apache.org.

Jose


On Aug 22, 2012, at 1:35 AM, Justin Mclean <ju...@classsoftware.com> wrote:

> Hi,
> 
>> if I need sign any document, I'll do in order i guess contribute in any kind works thats need
> If you want you can sign and submit an ICL. [1] But for small patches like  this it's not needed.
> 
>> but if any anonymous community people need too, may be nobody contribute using this way. 
> As long as it clearly documented what's being committed in JIRA and or the list (via a patch file is best) that's OK.
> 
> [1] http://www.apache.org/licenses/icla.txt
> 
> 


Re: Getting a github pull request into SVN

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi, for what I read anonymous people should only refer the commit "Is
shared for donation" and does not required the signed ICLA.

But, I preferred to sign the ICLA and send it to secretary@apache.org since
my intention is to work in this project in the long term and be a committer
in the end.

@Jose I'll recommend you to sign, scann the ICLA and send it. btw, thanks
to take over my patch! :)



2012/8/22 Justin Mclean <ju...@classsoftware.com>


> I'm not sure we could accept a truly anonymous contribution ie ones we
> don't who or where they come from as it may have licensing issues we are
> unaware of.
>



Carlos Rovira
Director de Tecnología
M: +34 607 22 60 05
F:  +34 912 35 57 77
<http://www.codeoscopic.com>
CODEOSCOPIC S.A. <http://www.codeoscopic.com>
Avd. del General Perón, 32
Planta 10, Puertas P-Q
28020 Madrid

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> if I need sign any document, I'll do in order i guess contribute in any kind works thats need
If you want you can sign and submit an ICL. [1] But for small patches like  this it's not needed.

> but if any anonymous community people need too, may be nobody contribute using this way. 
As long as it clearly documented what's being committed in JIRA and or the list (via a patch file is best) that's OK.

I'm not sure we could accept a truly anonymous contribution ie ones we don't who or where they come from as it may have licensing issues we are unaware of.

> I hope get an enough flexibility workflow as we can absorb external little (or big) contributes, just verified by the PPMC team only.


I did have a minor issue with the patch, but that's because the github repo is out of date with the SVN repo. Hopefully this will be fixed soon.

For interest here's how I applied the patch:
curl https://github.com/apache/flex/pull/7.patch | patch -p1

So I think we can say that this is the best way on how to apply github pull requests. Now just have to work out how to close them in github :-)

And the results.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3345  100  3345    0     0   1705      0  0:00:01  0:00:01 --:--:--  2005
patching file frameworks/projects/apache/build.xml
Hunk #1 FAILED at 108.
1 out of 1 hunk FAILED -- saving rejects to file frameworks/projects/apache/build.xml.rej
patching file frameworks/projects/apache/bundles/es_ES/apache.properties
patching file frameworks/projects/apache/src/org/apache/flex/validators/PostCodeValidator.as
Hunk #1 succeeded at 922 (offset 1 line).

The patch to the build file failed as it contained existing changes in the same place (de_CH locale added) so I had to fix by hand.

Other than that the changes look fine, just testing and I'll commit them soon.

Thanks,
Justin 

[1] http://www.apache.org/licenses/icla.txt



Re: Getting a github pull request into SVN

Posted by Jose Barragan <jo...@codeoscopic.com>.
Hi Justin, 

Done too, if I need sign any document, I'll do in order i guess contribute in any kind works thats need, but if any anonymous community people need too, may be nobody contribute using this way. 

I hope get an enough flexibility workflow as we can absorb external little (or big) contributes, just verified by the PPMC team only.

Thanks,

Jose.

On Aug 21, 2012, at 5:17 PM, Justin Mclean <ju...@classsoftware.com> wrote:

> Hi,
> 
> Sorry "legally" is probably too strong a word there - no one is sending the police around just yet :-)  Just need to be clear about what is being donated for a committer to be able to commit something and a patch (URL or file) in JIRA the best place to do that.
> 
> Thanks,
> Justin


Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

Sorry "legally" is probably too strong a word there - no one is sending the police around just yet :-)  Just need to be clear about what is being donated for a committer to be able to commit something and a patch (URL or file) in JIRA the best place to do that.

Thanks,
Justin

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I just sent two pull-request fixing the carlosrovira's commit, review and choose one of them, please.

As discussed in other threads can you please add the pull request link into JIRA. [1]

While I can find your github pull request [2] easily enough I'm not able to apply it legally as it needs to be clear that it's a donation from you to Apache and what exactly that donation consists of.

Thanks,
Justin

[1] https://issues.apache.org/jira/browse/FLEX-33171
[2] https://github.com/apache/flex/pull/5

Re: Getting a github pull request into SVN

Posted by Jose Barragan <jo...@codeoscopic.com>.
Hi Justin, 

I just sent two pull-request fixing the carlosrovira's commit, review and choose one of them, please.

Thanks,

Jose



On Aug 21, 2012, at 2:05 AM, Justin Mclean <ju...@classsoftware.com> wrote:

> Hi,
> 
> And I'm still not sure why "native2ascii -encoding UTF-8 -reverse" fixed the patch but you then get an issue in applying it.
> 
> Thanks,
> Justin


Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

And I'm still not sure why "native2ascii -encoding UTF-8 -reverse" fixed the patch but you then get an issue in applying it.

Thanks,
Justin

RE: Getting a github pull request into SVN

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>It was in another translation es_ES file inside this project, but I can not remember exactly what was that file. Making some file search would help.

Justin,

Perhaps I misunderstood. It seems like this code was manually entered from this response. Is that the case?

Mike


Re: Getting a github pull request into SVN

Posted by Carlos Rovira <ca...@codeoscopic.com>.
It was in another translation es_ES file inside this project, but I can not
remember exactly what was that file. Making some file search would help.

Right now I must turn off laptop. Please let me know what's the expected
format and I'll update the patch accordingly

Thanks on advance!

El martes, 21 de agosto de 2012, Michael A. Labriola escribió:

> >but I made it look like the first one since I saw other spanish
> translation transforming the special chars like that.
>
> Where did you do that work?
>
> Mike
>


-- 
Sent from Gmail Mobile

RE: Getting a github pull request into SVN

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>but I made it look like the first one since I saw other spanish translation transforming the special chars like that.

Where did you do that work?

Mike

Re: Getting a github pull request into SVN

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Mike and Justin,

The line showed by mike as the example:

+invalidCharPostcodeError=El c\u00f3digo postal contiene caract\u00e9res
inv\u00e1lidos.

could be changed to this:

+invalidCharPostcodeError=El código postal contiene caractéres inválidos.

but I made it look like the first one since I saw other spanish translation
transforming the special chars like that.

If the the second is like it should be I can change it without problem...

Best,

Carlos




2012/8/21 Justin Mclean <ju...@classsoftware.com>

> Hi,
>
> > Can you help me _see_ the Unicode issue better. I am clearly missing
> something. In the example patch, I see things like:
> > +invalidCharPostcodeError=El c\u00f3digo postal contiene caract\u00e9res
> inv\u00e1lidos.
> >
> > Is this what you are referring to?
>
> Yep look like the patch file is not UTF8 encoded?
>
> Doing this:
> curl https://github.com/apache/flex/pull/2.patch | native2ascii -encoding
> UTF-8 -reverse | patch -p1
>
> Which looks like it should work failed.
>
> Thanks,
> Justin
>
>


-- 
Carlos Rovira
Director de Tecnología
M: +34 607 22 60 05
F:  +34 912 35 57 77
<http://www.codeoscopic.com>
CODEOSCOPIC S.A. <http://www.codeoscopic.com>
Avd. del General Perón, 32
Planta 10, Puertas P-Q
28020 Madrid

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Can you help me _see_ the Unicode issue better. I am clearly missing something. In the example patch, I see things like:
> +invalidCharPostcodeError=El c\u00f3digo postal contiene caract\u00e9res inv\u00e1lidos.
> 
> Is this what you are referring to?

Yep look like the patch file is not UTF8 encoded?

Doing this:
curl https://github.com/apache/flex/pull/2.patch | native2ascii -encoding UTF-8 -reverse | patch -p1

Which looks like it should work failed.

Thanks,
Justin


RE: Getting a github pull request into SVN

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>Anyone have any ideas on this? Using curl and the patch URL for a pull request from github to apply a githib patch to SVN looks possible if we can sort out the unicode issue.

Justin,

Can you help me _see_ the Unicode issue better. I am clearly missing something. In the example patch, I see things like:

+invalidCharPostcodeError=El c\u00f3digo postal contiene caract\u00e9res inv\u00e1lidos.

Is this what you are referring to?

I have a ton of deep Unicode knowledge and experience and I am all over this if you can give me a push in the right direction.

Mike


Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

Anyone have any ideas on this? Using curl and the patch URL for a pull request from github to apply a githib patch to SVN looks possible if we can sort out the unicode issue.

Thanks,
Justin


Re: Getting a github pull request into SVN

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Justin,

the problems you see things like "c\u00f3digo"? I set this kind on code
based en what I see on other spanish files.

2012/8/18 Justin Mclean <ju...@classsoftware.com>

> Hi,
>
> > https://github.com/apache/flex/pull/3
>
> Looks to me like it still has the same issue:
> https://github.com/apache/flex/pull/3.patch
>
> Thanks,
> Justin
>



-- 
Carlos Rovira
Director de Tecnología
M: +34 607 22 60 05
F:  +34 912 35 57 77
 <http://www.codeoscopic.com>
CODEOSCOPIC S.A. <http://www.codeoscopic.com>
Avd. del General Perón, 32
Planta 10, Puertas P-Q
28020 Madrid

Re: Getting a github pull request into SVN

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> https://github.com/apache/flex/pull/3

Looks to me like it still has the same issue:
https://github.com/apache/flex/pull/3.patch

Thanks,
Justin

Re: Getting a github pull request into SVN

Posted by Carlos Rovira <ca...@codeoscopic.com>.
As I comented in other thread I put a new pull request fixing the enconding
problem:

https://github.com/apache/flex/pull/3

Thanks

2012/8/18 Omar Gonzalez <om...@gmail.com>

> On Friday, August 17, 2012, Justin Mclean wrote:
>
> > Hi,
> >
> > So here is what I  think is the minimal amount of work to get a Github
> > pull request committed in SVN.
> >
> > I had tried playing about with patching between repos but it got complex
> > fast.
> >
> > First off pull requests can be viewed as patches in Github:
> > https://github.com/apache/flex/pull/2.patch
> >
> > BTW This wasn't easy to find in the github docs and I really wish someone
> > had brought it up.
> >
> > Now we have 2 issues:
> > 1. Patch is not is SVN format
> > 2. Unicode characters have been transformed (look carefully)
> >
> > So something like this in theory should work:
> > curl https://github.com/apache/flex/pull/2.patch | native2ascii
> -encoding
> > UTF-8 -reverse | patch -p1
> >
> > curl downloads the patch, native2ascii converts to UTF8 and patch -p1
> > converts the git patch to SVN format  and applies it by stripping off the
> > first character off each path in the patch file.
> >
> > May be other git patch file formatting issues I'm not aware of.
> >
> > However it look like patch doesn't like unicode changes and applying the
> > patch fails.
> >
> > This:
> > curl https://github.com/apache/flex/pull/2.patch | native2ascii
> -encoding
> > UTF-8 -reverse
> > Looks fine to me so not 100% sure why the patch fails.
> >
> > Doing this works:
> > curl https://github.com/apache/flex/pull/2.patch | patch -p1
> >
> > But now the unicode characters are wrong. For most patches that may be OK
> > (if they don't contain unicode) but could introduce subtle errors if care
> > is not taken.
> >
> > I'd appreciate it if the people who voted for the "Git Branching Model on
> > Git now" option lend a hand here and help sort this out.
> >
> > This is on OSX btw I have no idea if the above works in windows.
> >
> > Thanks,
> > Justin
>
>
> Its on my todo list, but on a biz trip until tomorrow. Will be working on
> this Sunday night if someone hasn't beat me to it by then.
>
> -omar
>



-- 
Carlos Rovira
Director de Tecnología
M: +34 607 22 60 05
F:  +34 912 35 57 77
<http://www.codeoscopic.com>
CODEOSCOPIC S.A. <http://www.codeoscopic.com>
Avd. del General Perón, 32
Planta 10, Puertas P-Q
28020 Madrid

Re: Getting a github pull request into SVN

Posted by Omar Gonzalez <om...@gmail.com>.
On Friday, August 17, 2012, Justin Mclean wrote:

> Hi,
>
> So here is what I  think is the minimal amount of work to get a Github
> pull request committed in SVN.
>
> I had tried playing about with patching between repos but it got complex
> fast.
>
> First off pull requests can be viewed as patches in Github:
> https://github.com/apache/flex/pull/2.patch
>
> BTW This wasn't easy to find in the github docs and I really wish someone
> had brought it up.
>
> Now we have 2 issues:
> 1. Patch is not is SVN format
> 2. Unicode characters have been transformed (look carefully)
>
> So something like this in theory should work:
> curl https://github.com/apache/flex/pull/2.patch | native2ascii -encoding
> UTF-8 -reverse | patch -p1
>
> curl downloads the patch, native2ascii converts to UTF8 and patch -p1
> converts the git patch to SVN format  and applies it by stripping off the
> first character off each path in the patch file.
>
> May be other git patch file formatting issues I'm not aware of.
>
> However it look like patch doesn't like unicode changes and applying the
> patch fails.
>
> This:
> curl https://github.com/apache/flex/pull/2.patch | native2ascii -encoding
> UTF-8 -reverse
> Looks fine to me so not 100% sure why the patch fails.
>
> Doing this works:
> curl https://github.com/apache/flex/pull/2.patch | patch -p1
>
> But now the unicode characters are wrong. For most patches that may be OK
> (if they don't contain unicode) but could introduce subtle errors if care
> is not taken.
>
> I'd appreciate it if the people who voted for the "Git Branching Model on
> Git now" option lend a hand here and help sort this out.
>
> This is on OSX btw I have no idea if the above works in windows.
>
> Thanks,
> Justin


Its on my todo list, but on a biz trip until tomorrow. Will be working on
this Sunday night if someone hasn't beat me to it by then.

-omar