* * *

Author Topic: Lazarus's missing Delphi features  (Read 10942 times)

x2nie

  • Sr. Member
  • ****
  • Posts: 467
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Lazarus's missing Delphi features
« Reply #15 on: January 25, 2016, 01:33:07 pm »
... then click Create Patch on the menu, after you finish editing the source. ...
Well, I tried. Not so bad! (I've sent the patch) :D
Thanks you GetMem. It was easiest way to create patch.
I have been has trouble to remember the steps of creating patch, yours is easy to do easy to remember.
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

GetMem

  • Hero Member
  • *****
  • Posts: 3018
Re: Lazarus's missing Delphi features
« Reply #16 on: January 25, 2016, 01:33:42 pm »
Ok,  I'm glad it's working! :)
« Last Edit: January 25, 2016, 01:36:38 pm by GetMem »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3365
  • I like bugs.
Re: Lazarus's missing Delphi features
« Reply #17 on: January 25, 2016, 01:34:58 pm »
It's much easier for developer to apply the patch.

Easier and safer. Just copy-pasting a block of code can easily overwrite some other recent change. The "patch" command immediately notices such a conflict and refuses to overwrite it.

The diff format used in patches has other benefits, too. It is easy read and understand by humans. A developer can see from a patch directly if it makes sense or not, even without applying it.
Good revision control systems + the diff format for patches are great inventions! Let's use them.

We have seen people making patches with weird and complicated ways, like making changes to a release version sources and using an external diff tool to compare them against a separate development source tree. The generated diff will then revert all changes since the last release.
Some people have desperately copied files around before making a diff.
None of that is needed. The revision control tool already knows what the latest revision contains and make the diff against it.
Just "svn diff" or "Create Patch" with TortoiseSVN is enough. It almost feels "too good to be true".

Git formatted patches are OK, too, made with "git format-patch".

x2nie

  • Sr. Member
  • ****
  • Posts: 467
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Lazarus's missing Delphi features
« Reply #18 on: January 25, 2016, 01:44:40 pm »
Just copy-pasting a block of code can easily overwrite some other recent change.
.. people making patches with weird and complicated ways, like making changes to a release version sources and using an external diff tool to compare them


Wow it was me! I mean, I am working alone and always using non-diff tool (WinMerge) to compare. :-[



I really hope that someday, just using Lazarus I can create a patch!
Nowadays: Lazarus -> Help -> Report a Bug is useless menu item. 8)

you know, Lazarus has real DIFF tool inside, but no menu to activate it unless the files in editor is edited outside Lazarus by accident .
« Last Edit: January 25, 2016, 01:48:22 pm by x2nie »
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3365
  • I like bugs.
Re: Lazarus's missing Delphi features
« Reply #19 on: January 25, 2016, 01:51:57 pm »
Well, I tried. Not so bad! (I've sent the patch) :D
Thanks you GetMem. It was easiest way to create patch.
I have been has trouble to remember the steps of creating patch, yours is easy to do easy to remember.

I am curious. Did you earlier copy files around and used an external diff tool?

It has always puzzled me that some people who a capable of making valid changes to a huge Lazarus code base, find it too difficult to run "svn diff" command or to click "Create Patch".
It is explained in every SVN tutorial. It is explained in Lazarus wiki. The "Create Patch" in TortoiseSVN does not even need an explanation because it is so obvious.
So, how can it be difficult for a person who is able to fix bugs in a > 2000000 LOC SW project?

Sorry I wrote this, it just feels like an impossible equation for me. :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3365
  • I like bugs.
Re: Lazarus's missing Delphi features
« Reply #20 on: January 25, 2016, 02:09:21 pm »
Wow it was me! I mean, I am working alone and always using non-diff tool (WinMerge) to compare. :-[

Uhhh... :(

BTW, if "working alone" means "working off-line" then I can recommend Git for you. I use it myself, too.

Quote
I really hope that someday, just using Lazarus I can create a patch!
Nowadays: Lazarus -> Help -> Report a Bug is useless menu item. 8)

you know, Lazarus has real DIFF tool inside, but no menu to activate it unless the files in editor is edited outside Lazarus by accident .

No no no!
I see no reason why patches should be made with the Lazarus DIFF tool. Actually I don't see how it would happen technically. It would inevitably require some clumsy and error-prone copy-pasting, wouldn't it?
It is especially dangerous in Lazarus Tools menu because people would create patches from the release version.
No good!
I tried to move the Lazarus DIFF tool to a package but IDE's code depends on it and IDEIntf must be extended. Yes, that tool has been misused for making invalid diffs which are then offered as patches.
It is still in my ToDo list to remove it from the default installation.

Lazarus also has a SVN plugin. You can create patches with it, although the plugin otherwise sucks.
But hey, why would you use Lazarus to create a patch?
TortoiseSVN allows to create it with a single "Create Patch" click. How could Lazarus make it any simpler?
The whole patch concept logically belongs to the domain of revision control tools. Why do you want to turn this simple process into a more complicated process?
« Last Edit: January 25, 2016, 02:14:38 pm by JuhaManninen »

x2nie

  • Sr. Member
  • ****
  • Posts: 467
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Lazarus's missing Delphi features
« Reply #21 on: January 25, 2016, 02:19:11 pm »
Quote
Did you earlier copy files around and used an external diff tool?
Yes as always.


Quote
It is explained in every SVN tutorial. It is explained in Lazarus wiki. The "Create Patch" in TortoiseSVN does not even need an explanation because it is so obvious.
So, how can it be difficult for a person who is able to fix bugs in a > 2000000 LOC SW project?
If "a person" was me, it because..., for honest, I don't know what shall I do with *.patch. see?


I know git. But still don't want any patch. I usually only "pull request" github.
patch is not that intuitive for my eye.


Quote
It has always puzzled me that some people who a capable of making valid changes to a huge Lazarus code base, find it too difficult to run "svn diff" command or to click "Create Patch".
Hey, let your puzzle being answered with this caricature (not a joke, but it funny):
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

x2nie

  • Sr. Member
  • ****
  • Posts: 467
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Lazarus's missing Delphi features
« Reply #22 on: January 25, 2016, 02:36:37 pm »
Actually I don't see how it would happen technically. It would inevitably require some clumsy and error-prone copy-pasting, wouldn't it?
It is especially dangerous in Lazarus Tools menu because people would create patches from the release version.
No good!
wrong. >:D  it would be very good and easy.
1) It should be able to run with svn/git source-coded Lazarus.
2) Current lazarus build/compiling is already able to detect whether svn available.
So if it release version (no svn nor git), just hide the menu. Otherwise the "Create Patch" menu visible.



Quote
But hey, why would you use Lazarus to create a patch?
TortoiseSVN allows to create it with a single "Create Patch" click. How could Lazarus make it any simpler?
The whole patch concept logically belongs to the domain of revision control tools. Why do you want to turn this simple process into a more complicated process?
No, not you, it should I am who say to you, "Why you turn this simple process into more complicated?" ! O:-)
Assumed I am opening+editing+testing the "blablaba.pas" using Lazarus. Why then I need to open command line (console terminal) for getting the patch of the file I am reading?
No need to do that (if Lazarus was just capable).

Well okay, it maybe "a single click". But in fact it would  not really that "single click". I need to open Windows Explorer, right? and then "several click" to open the folder. And wait, I need to type the path of the correct folder or I need to exactly remember the path! whooaa....

I never do that ! (opening folders by clicks). (At least, I did as the last options. I don't want do that.)
What I did is done almost in Lazarus: Ctrl+Shift+F. It will find all founded occurrences of match words I searched. 
« Last Edit: January 25, 2016, 02:44:09 pm by x2nie »
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3365
  • I like bugs.
Re: Lazarus's missing Delphi features
« Reply #23 on: January 25, 2016, 02:43:35 pm »
I know git. But still don't want any patch. I usually only "pull request" github.
patch is not that intuitive for my eye.

Actually GitHub's "pull request" and a patch file are conceptually the same thing. A revision control tool, including Git, stores the revisions as diffs. It is the same diff format that is used in patch files.
Thus doing a "pull request" in GitHub and uploading a patch file into Mantis bug tracker are essentially the same thing. They both offer your code diff to be applied to the main repository.
In both cases applying the diff requires action from somebody else, from a maintainer essentially.
Thus it is very similar also process-wise. A "pull request" can be ignored for a long time just like a patch can, if maintainers are busy or lazy.

Quote
Hey, let your puzzle being answered with this caricature (not a joke, but it funny):

Heh, that's a good one. :)
« Last Edit: January 25, 2016, 02:48:02 pm by JuhaManninen »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3365
  • I like bugs.
Re: Lazarus's missing Delphi features
« Reply #24 on: January 25, 2016, 03:02:02 pm »
wrong. >:D  it would be very good and easy.
1) It should be able to run with svn/git source-coded Lazarus.
2) Current lazarus build/compiling is already able to detect whether svn available.
So if it release version (no svn nor git), just hide the menu. Otherwise the "Create Patch" menu visible.

Ok, that is possible although I still feel it belongs to the SVN plugin territory.
Many people get Lazarus sources from the fixes branch which is the most stable choice. Fixes branch is not suitable for making patches, they must be made against trunk always. Thus, having sources from SVN is no proof that the IDE should create patches from it.

The current SVN plugin should be replaced with a more generic revision control plugin maybe. It cannot be extended easily and is buggy.
I remember BigChimp, before he passed away, started a plugin that would support also Git and Hg. It is somewhere in his repositories maybe in early alpha state, I don't know. Anyway it would be a good project for somebody to continue.

x2nie

  • Sr. Member
  • ****
  • Posts: 467
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Lazarus's missing Delphi features
« Reply #25 on: January 25, 2016, 03:07:13 pm »
I know git. But still don't want any patch. I usually only "pull request" github.
patch is not that intuitive for my eye.

Actually GitHub's "pull request" and a patch file are conceptually the same thing.


And, (possibly you aren't noticed that) I do that with really single click inside tortoise git commit dialogbox or sometime inside GithubDesktop while in home.
So, why not just easy as real single click inside Lazarus? 8)

Anyway, who want to create a patch is who have already has the repository (svn/git/hg) in his local machine.
Meaning: user of release version can do nothing for creating patch.




Overall, I respect to your advice. I really shall learn to create patch file and learn how to make them useful.

When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

GetMem

  • Hero Member
  • *****
  • Posts: 3018
Re: Lazarus's missing Delphi features
« Reply #26 on: January 26, 2016, 08:46:58 am »
4. #29510

GetMem

  • Hero Member
  • *****
  • Posts: 3018
Re: Lazarus's missing Delphi features
« Reply #27 on: January 26, 2016, 07:57:40 pm »
@x2nie

With r51422 the circle is complete. Thanks @Juha, @Ondrej!

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 366
Re: Lazarus's missing Delphi features
« Reply #28 on: January 26, 2016, 09:35:10 pm »
With r51422 the circle is complete. Thanks @Juha, @Ondrej!

Is there available time to all these changes still be merged into Lazarus 1.6.0?
« Last Edit: January 26, 2016, 09:43:24 pm by valdir.marcos »

GetMem

  • Hero Member
  • *****
  • Posts: 3018
Re: Lazarus's missing Delphi features
« Reply #29 on: January 26, 2016, 09:47:36 pm »
Quote
@valdir.marcos
Is there available time to all these changes still be merged into Lazarus 1.6.0?
Probably not, it's high chance for regression. Though it would be nice, if at least the Ctrl + Click feature would make it to Lazarus 1.6. @Juha what do you think?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus