Create a patch compatible with SVN using a external tool

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Create a patch compatible with SVN using a external tool

SmartGit mailing list
Some background:
I'm a long time svn user with some private repositories and collaborate to
public projects that uses. I even owns two licenses of SmartSVN. In the
last year, i started to collaborate with projects that use git
repositories. Currently i use SmartSVN / Github Windows sometimes
concomitant what is far from ideal.


The switch to SmartGit that also supports svn, unifying my SCM needs, is
the next logical step. But one thing is preventing to fully migrate to it.


There's a project (freepascal) that i collaborate but don't have commit
access to svn repository, so i need to send patches through their bug
system.


When i saw support for create / apply patch in last version i think all i
need was there.


But the format-patch feature produces a patch file that is incompatible
with svn.


I looked at
http://stackoverflow.com/questions/708202/git-format-patch-to-be-svn-compatible
and found that "git diff --no-prefix master..branch" would work


So i tried to create a external tool.


Commands: ${gitDir}\bin\bash.exe
Args: "${smartGitDir}\lib\diff-patch.sh" ${fileSave}  ${commit} ${commit2}
diff-patch.sh:
#!/bin/bash
file=$1
from=$2
to=$3
if ! [ -z "$to" ]; then
  git diff --no-prefix $from..$to > $file
else
  git diff --no-prefix  -1 $from > $file
fi


I go to the log, select the commit i want to patch and select the command
but only get an empty file.


Any ideas?


Luiz
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Create a patch compatible with SVN using a external tool

SmartGit mailing list
> So i tried to create a external tool.
> ...
>   git diff --no-prefix  -1 $from > $file

I think the correct command would be:

git diff --no-prefix $from^ $from

However "--no-prefix" doesn't make a difference for me, so not sure if it's actually what you are looking for.

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


11/27/2014 13:30 - luiz americo pereira camara [hidden email] [smartgit] wrote:

> Some background:
> I'm a long time svn user with some private repositories and collaborate to
> public projects that uses. I even owns two licenses of SmartSVN. In the
> last year, i started to collaborate with projects that use git
> repositories. Currently i use SmartSVN / Github Windows sometimes
> concomitant what is far from ideal.
>
>
> The switch to SmartGit that also supports svn, unifying my SCM needs, is
> the next logical step. But one thing is preventing to fully migrate to it.
>
>
> There's a project (freepascal) that i collaborate but don't have commit
> access to svn repository, so i need to send patches through their bug
> system.
>
>
> When i saw support for create / apply patch in last version i think all i
> need was there.
>
>
> But the format-patch feature produces a patch file that is incompatible
> with svn.
>
>
> I looked at
> http://stackoverflow.com/questions/708202/git-format-patch-to-be-svn-compatible
> and found that "git diff --no-prefix master..branch" would work
>
>
> So i tried to create a external tool.
>
>
> Commands: ${gitDir}\bin\bash.exe
> Args: "${smartGitDir}\lib\diff-patch.sh" ${fileSave}  ${commit} ${commit2}
> diff-patch.sh:
> #!/bin/bash
> file=$1
> from=$2
> to=$3
> if ! [ -z "$to" ]; then
>   git diff --no-prefix $from..$to > $file
> else
>   git diff --no-prefix  -1 $from > $file
> fi
>
>
> I go to the log, select the commit i want to patch and select the command
> but only get an empty file.
>
>
> Any ideas?
>
>
> Luiz
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Create a patch compatible with SVN using a external tool

SmartGit mailing list
Thanks. It worked.

I'll keep the evaluation and ask again if necessary

Luiz

2014-11-27 10:49 GMT-03:00 syntevo Support [hidden email] [smartgit] <
[hidden email]>:

>
>
> > So i tried to create a external tool.
> > ...
> > git diff --no-prefix -1 $from > $file
>
> I think the correct command would be:
>
> git diff --no-prefix $from^ $from
>
> However "--no-prefix" doesn't make a difference for me, so not sure if
> it's actually what you are looking for.
>
> --
> Best regards,
> Marc Strapetz
> syntevo GmbH
> http://www.syntevo.com
> http://blog.syntevo.com
>
>
> 11/27/2014 13:30 - luiz americo pereira camara [hidden email]
> [smartgit] wrote:
>
> > Some background:
> > I'm a long time svn user with some private repositories and collaborate
> to
> > public projects that uses. I even owns two licenses of SmartSVN. In the
> > last year, i started to collaborate with projects that use git
> > repositories. Currently i use SmartSVN / Github Windows sometimes
> > concomitant what is far from ideal.
> >
> >
> > The switch to SmartGit that also supports svn, unifying my SCM needs, is
> > the next logical step. But one thing is preventing to fully migrate to
> it.
> >
> >
> > There's a project (freepascal) that i collaborate but don't have commit
> > access to svn repository, so i need to send patches through their bug
> > system.
> >
> >
> > When i saw support for create / apply patch in last version i think all i
> > need was there.
> >
> >
> > But the format-patch feature produces a patch file that is incompatible
> > with svn.
> >
> >
> > I looked at
> >
> http://stackoverflow.com/questions/708202/git-format-patch-to-be-svn-compatible
> > and found that "git diff --no-prefix master..branch" would work
> >
> >
> > So i tried to create a external tool.
> >
> >
> > Commands: ${gitDir}\bin\bash.exe
> > Args: "${smartGitDir}\lib\diff-patch.sh" ${fileSave} ${commit} ${commit2}
> > diff-patch.sh:
> > #!/bin/bash
> > file=$1
> > from=$2
> > to=$3
> > if ! [ -z "$to" ]; then
> > git diff --no-prefix $from..$to > $file
> > else
> > git diff --no-prefix -1 $from > $file
> > fi
> >
> >
> > I go to the log, select the commit i want to patch and select the command
> > but only get an empty file.
> >
> >
> > Any ideas?
> >
> >
> > Luiz
> >
>
>  
>
Loading...