Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-07

Creating patches

11 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Florian Klämpfl
to Hans-Peter Diettrich: How can I create and apply patches to Lazarus? First problem is SVN, which does not allow…
Hans-Peter Diettrich wrote 5 lines
How can I create and apply patches to Lazarus? First problem is SVN, which does not allow for "incremental" patches, i.e. a big patch cannot be split into smaller steps, as frequently requested by the developers. Solutions?

Ask for an svn branch with write access.

Show quoted text 5 lines
Next problem are patches created by Git, which seem to be undecipherable by TortoiseSVN "Apply patch..." on Windows. Which tools can be used, on which platform, to apply diffs or patches? [see TabCtrl0/1.patch on Mantis http://bugs.freepascal.org/view.php?id=19575].

svn-apply can be used to apply patches to svn created by git format-patch:
http://svn.freepascal.org/svn/fpcbuild/scripts/florian/unix/svn-apply

Tested on unix only.

Reply by email

Hans-Peter Diettrich

How can I create and apply patches to Lazarus?

First problem is SVN, which does not allow for "incremental" patches, i.e. a big patch cannot be split into smaller steps, as frequently requested by the developers. Solutions?

Next problem are patches created by Git, which seem to be undecipherable by TortoiseSVN "Apply patch..." on Windows. Which tools can be used, on which platform, to apply diffs or patches? [see TabCtrl0/1.patch on Mantis http://bugs.freepascal.org/view.php?id=19575].

DoDi

Reply by email

Hans-Peter Diettrich
to Florian Klämpfl: Ask for an svn branch with write access. svn-apply can be used to apply patches to svn…
Show quoted text 8 lines
Am 08.07.2011 23:42, schrieb Hans-Peter Diettrich: > How can I create and apply patches to Lazarus? > > First problem is SVN, which does not allow for "incremental" patches, > i.e. a big patch cannot be split into smaller steps, as frequently > requested by the developers. Solutions? Ask for an svn branch with write access.

Ask whom?
[I've already write access to the docs and examples directories, but lost my passwords with my old machine]

Show quoted text 10 lines
> Next problem are patches created by Git, which seem to be undecipherable > by TortoiseSVN "Apply patch..." on Windows. Which tools can be used, on > which platform, to apply diffs or patches? [see TabCtrl0/1.patch on > Mantis http://bugs.freepascal.org/view.php?id=19575]. svn-apply can be used to apply patches to svn created by git format-patch: http://svn.freepascal.org/svn/fpcbuild/scripts/florian/unix/svn-apply Tested on unix only.

How do I use it at all? On Windows?

In Ubuntu 10.4 I tried Kompare, which only damaged the working copy of Lazarus (directories vanished...). The patches have been visualized correctly until I tried Apply All - then the changes to a couple of files were undone, and some files were stored in /tmp with meaningless names, with a "cannot modify..." message. All affected directory trees (e.g. lcl/) seem to have disappeared afterwards :-(

DoDi

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich: How can I create and apply patches to Lazarus? First problem is SVN, which does not allow…
Hans-Peter Diettrich wrote
First problem is SVN, which does not allow for "incremental" patches, i.e. a big patch cannot be split into smaller steps, as frequently requested by the developers. Solutions?

Use Git instead of SVN.

Next problem are patches created by Git, which seem to be undecipherable by TortoiseSVN "Apply patch..." on Windows. Which tools can be used, on which

I have no problem doing this. I commit often to a SubVersion repository from Git (or via git generated patches).

Using git to manage a SubVersion repository:

Step Command
------------------------------------------------------------------ 1 git checkout -b wip
2 [edit your code and make various commits locally] 3 git checkout master
4 git svn rebase <-- gets latest changes from SubVersion repository
5 git rebase wip <-- blend your local commits from WIP branch into main branch
6 git svn dcommit <-- commit all new commits to the SubVersion repository
7 git checkout wip
8 git rebase master <--- get your WIP branch back on track with the latest SubVersion
commits.

Step 5 can be changed to merge all local commits into one large commit, or deleting some unnecessary commits etc. A nice time to clean up the history a bit - if needed.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 36 lines
On 8 July 2011 23:42, Hans-Peter Diettrich wrote: > > First problem is SVN, which does not allow for "incremental" patches, i.e. a > big patch cannot be split into smaller steps, as frequently requested by the > developers. Solutions? Use Git instead of SVN. > Next problem are patches created by Git, which seem to be undecipherable by > TortoiseSVN "Apply patch..." on Windows. Which tools can be used, on which I have no problem doing this. I commit often to a SubVersion repository from Git (or via git generated patches). Using git to manage a SubVersion repository: Step Command ------------------------------------------------------------------ 1 git checkout -b wip 2 [edit your code and make various commits locally] 3 git checkout master 4 git svn rebase <-- gets latest changes from SubVersion repository 5 git rebase wip <-- blend your local commits from WIP branch into main branch 6 git svn dcommit <-- commit all new commits to the SubVersion repository 7 git checkout wip 8 git rebase master <--- get your WIP branch back on track with the latest SubVersion commits. Step 5 can be changed to merge all local commits into one large commit, or deleting some unnecessary commits etc. A nice time to clean up the history a bit - if needed.

Any volunteer to create a git plugin for Lazarus?

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
Any volunteer to create a git plugin for Lazarus?

I have been thinking of this already. The problem is that I have never seen a "IDE integrated scm" that works as well as the command line executable. I'll try and find some other IDE's that have Git integration to see how they handle various tasks like: switching branches, rebasing branches, commits, selective commits (not the whole file, just some lines of code) etc... Those are features I use on a daily basis and is what I would consider the minimum requirement.

Anybody know of IDE's with integrated Git support. I believe Eclipse and IntelliJ's IDEA has such support. Apparently the latter is a very good IDE, so I'll start there.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Florian Klämpfl
to Hans-Peter Diettrich: Ask whom? [I've already write access to the docs and examples directories, but lost my…
Hans-Peter Diettrich wrote 13 lines
Florian Kl?mpfl schrieb: > Am 08.07.2011 23:42, schrieb Hans-Peter Diettrich: >> How can I create and apply patches to Lazarus? >> >> First problem is SVN, which does not allow for "incremental" patches, >> i.e. a big patch cannot be split into smaller steps, as frequently >> requested by the developers. Solutions? > > Ask for an svn branch with write access. Ask whom? [I've already write access to the docs and examples directories, but lost my passwords with my old machine]

Some of the lazarus people? Mattias, Vincents, Marc ...

Show quoted text 13 lines
>> Next problem are patches created by Git, which seem to be undecipherable >> by TortoiseSVN "Apply patch..." on Windows. Which tools can be used, on >> which platform, to apply diffs or patches? [see TabCtrl0/1.patch on >> Mantis http://bugs.freepascal.org/view.php?id=19575]. > > svn-apply can be used to apply patches to svn created by git > format-patch: > http://svn.freepascal.org/svn/fpcbuild/scripts/florian/unix/svn-apply > > Tested on unix only. How do I use it at all? On Windows?

No idea, I use it only on linux.

But I'am pretty sure, if you publish a git branch, someone of the lazarus people will be able to apply such a branch to svn. It's not needed to attach a patch to the bug reports, a link to a patch or a git/hg branch is probably fine as well.

Reply by email

Hans-Peter Diettrich
to Florian Klämpfl
Show quoted text 8 lines
>> svn-apply can be used to apply patches to svn created by git >> format-patch: >> http://svn.freepascal.org/svn/fpcbuild/scripts/florian/unix/svn-apply >> >> Tested on unix only. > How do I use it at all? On Windows? No idea, I use it only on linux.

I just wrote an converter for Git patches into TortoiseMerge format :-)

Now I hope that I can create patches for Lazarus easier, using Git for the development, and SVN for the final verification.

DoDi

Reply by email

Alexander Klenin
to Graeme Geldenhuys: I have been thinking of this already. The problem is that I have never seen a "IDE…
Graeme Geldenhuys wrote 7 lines
On 9 July 2011 12:22, Mattias Gaertner wrote: > > Any volunteer to create a git plugin for Lazarus? I have been thinking of this already. The problem is that I have never seen a "IDE integrated scm" that works as well as the command line executable.

In general, I agree. I think that SCM package should not aim to replace native SCM interface, but instead implement only a few functions which really benefit from tight integration.
For example, log, blame and partial commit (git add -p) could benefit from tight SynEdit integration.

Alexander S. Klenin

Reply by email

Sven Barth
to Graeme Geldenhuys: I have been thinking of this already. The problem is that I have never seen a "IDE…
Graeme Geldenhuys wrote 7 lines
On 9 July 2011 12:22, Mattias Gaertner wrote: > > Any volunteer to create a git plugin for Lazarus? I have been thinking of this already. The problem is that I have never seen a "IDE integrated scm" that works as well as the command line executable.

Then here is your opportunity to do the first one that does that right(TM). ;)

Regards,
Sven

Reply by email