Lazarus

Using the Lazarus IDE => Designer => Topic started by: JuhaManninen on December 10, 2022, 08:21:40 pm

Title: "TestAll" project issues
Post by: JuhaManninen on December 10, 2022, 08:21:40 pm
This Aruna's quote is copied from the "Bugs in Example Projects window" thread.

I ran git blame examples/testall.lpi and below is what is of interest to us.
Code: Text  [Select][+][-]
  1. 87791326d0d (bart     2016-03-04 15:05:52 +0000  87)     <SearchPaths>
  2. 87791326d0d (bart     2016-03-04 15:05:52 +0000  88)       <IncludeFiles Value="$(ProjOutDir)"/>
  3. 5328b9a852b (juha     2019-05-06 11:32:58 +0000  89)       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
  4. 87791326d0d (bart     2016-03-04 15:05:52 +0000  90)     </SearchPaths>
  5.  

In 2019 Juha added  <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> this works for windows but does not work for Linux
as seen by the error message below.
git blame shows who touched a certain line last. It does not show further history nor the diff of the commits mentioned. For that you need another tool like gitk.
Commit 5328b9a852b is from 2019-05-06. Here is the diff :
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="10"/>
+    <Version Value="12"/>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="testall"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
@@ -47,9 +49,10 @@
       <Version Value="2"/>
     </PublishOptions>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     <RequiredPackages Count="1">
       <Item1>
@@ -83,7 +86,7 @@
     </Target>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
-      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     <CodeGeneration>
       <Checks>

There is a related commit 337b198136 from 2020-12-11. Its diff :
Code: [Select]
@@ -21,7 +21,7 @@
           </Target>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>
-            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           <CodeGeneration>
             <Optimizations>

As you can see I fixed the path delimiters so that they work also on Linux and Unix systems.

Quote
Code: Text  [Select][+][-]
  1. Unable to write state file for project Project
  2. Error: Unable to create file "/home/aruna/lazarus/examples/lib\x86_64-linux/testall.compiled": No such file or directory
  3.  
The path is all that needs to be fixed so I changed the '\' backslash after /home/aruna/lazarus/examples/lib\ to a forward slash and now it works on linux. My question to you all is the testall.lpi file contents are in XML format so how do I do something like {$ifdef linux} in a XML file for christ sake  ::) OR as is usual in my case I am missing something  obvious?
'/' in path settings works also on Windows. The IDE at some point converts it to '\' for Windows. No need for {$ifdef linux} in XML.
Why you have '\' there? I don't know.
Maybe you checked out (git checkout) a revision earlier than commit 337b198136.
Maybe you have local changes after you played with the commit history. Then do "git reset --hard" but be careful with it. You may lose changes you wanted to keep.
I assume you have the "main" branch active.
Title: Re: "TestAll" project issues
Post by: Aruna on December 11, 2022, 04:49:17 am
As you can see I fixed the path delimiters so that they work also on Linux and Unix systems.
Yes I saw that after I had sent out my email.

'/' in path settings works also on Windows. The IDE at some point converts it to '\' for Windows. No need for {$ifdef linux} in XML.
[EDIT] No wonder... I want to see how and where the IDE is converting this I was quite perplexed when it did work fine on both windows and my linux. Now I know the reason haha  :)

Why you have '\' there? I don't know.
Initially because I had checked out a branch which did not have your fix and now because 'I' went and changed it to trigger the error. It is all good now. Thank you. Sorry for causing any confusion.

Maybe you checked out (git checkout) a revision earlier than commit 337b198136.
Yes that was why.

Maybe you have local changes after you played with the commit history. Then do "git reset --hard" but be careful with it. You may lose changes you wanted to keep.
I assume you have the "main" branch active.
The main branch I check out when I need to but I am mostly on fixes_2_2 because that is the branch that has the other examples that need work.
Title: Re: "TestAll" project issues
Post by: JuhaManninen on December 11, 2022, 09:48:31 am
Quote
The main branch I check out when I need to but I am mostly on fixes_2_2 because that is the branch that has the other examples that need work.
You mean the examples that were deleted from "main"? The examples that were not deleted, were moved to another directory and can still be found in "main".
The ones that were deleted, may have been changed in "main" before the deletion. "fixes_2_2" branch does not have those changes.
At least "TestAll" was changed in "main".
Instead of working with "fixes_2_2" you should go to a "main" revision just before the deletion, then copy the examples you need somewhere and then return to "main" HEAD.
Later create a local feature branch for your own changes. That branch can be rebased against "main" from time to time.

The deletion happened in revision 31328882fb8d3acace
Date: 05/03/2022
Message: Example projects tested, categorised, metadata added, restructured by David Bannon.

The revision before that is 4030fcc52c936a, dealing with Codetools.
Do "git checkout 4030fcc52c936a", then copy the files.
Title: Re: "TestAll" project issues
Post by: JuhaManninen on December 11, 2022, 11:28:12 am
I want to see how and where the IDE is converting this I was quite perplexed when it did work fine on both windows and my linux. Now I know the reason haha  :)
Unit LazFileUtils has function SwitchPathDelims(). Search for it in all Lazarus sources, whole words only. You should get 52 matches. Study the code that calls it.
'\' path delimiter is processed also in some other functions.
Title: Re: "TestAll" project issues
Post by: JuhaManninen on December 22, 2022, 08:59:01 am
This Aruna's question was in "Bugs in Example Projects window" thread. I reply it here.

I just moved all 'testall' files to lcl/tests in branch fixes_2_2 on my local repository and pushed to my remote everything went well. Now when I try to create a merge request gitlab starts complaining please see attached screenshot.
Don't use fixes_2_2 branch when you participate in the development process. You must use the "main" branch.
Some bug fix commits are then backported to fixes_2_2 but everything goes to "main" first.

The Lazarus development version is very usable most of the time. You should consider using it exclusively unless you maintain some customer application which requires max stability.
For example I play only with the "main" development version because I don't have such projects to maintain now.

So I have to
- fork the Lazarus Repo, then..
- clone the fork to my local system, then..
- somehow get the local repo to fetch/pull from the original Lazarus main/trunk.
You can skip the GitLab merge request process if you don't like it. Patches are still supported.
Work with your changes in a local feature branch ("git switch -c myfeature") and "git rebase main" it sometimes.
Create patch(es) with "git format-patch main" while your feature branch is active. The rebasing guarantees there will be no merge conflicts when it is applied. Upload the patch to an issue report or somewhere.

For the TestAll project you don't need to create a patch. For the revision control those files are new, thus the diff format is not needed.
Just upload the files here in forum post or in mailing list post or in issue tracker as a .zip or .tgz package or similar. First make sure it compiles and works with latest "main".

I don't know well the GitHub and GitLab processes either. I used Git locally for Lazarus development already when it was in a SVN server, by using a git-svn link. It worked very well and I had a real Git repository locally with all its goodies.
Now I mostly synchronize with the server with "git pull" and "git push" using the default "main" branch. Super easy. I guess I should learn to work with remote branches better.

P.S.
Quote
Since I started working again time has become a very limited commodity for my personal projects.
Do you also work with carrots? Or some other vegetables maybe?  ;)
Title: Re: "TestAll" project issues
Post by: Aruna on December 28, 2022, 03:34:39 am
@JuhaManninen and @dbanon I tried everything and am still unable to 'sync' the Lazarus/main repository with my own fork. I have given the bash output at each stage and if someone can figure out a fix it would be most welcome. Else I am simply going to delete my fork and start from scratch.

I have been struggling with this over a week now :-( Please see below for details.

I created a remote 'personal' which is my forked repository and a 'upstream' which is lazarus/main.

Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git remote -v
  2. personal        https://gitlab.com/aruna.hewapathirane/lazarus.git (fetch)
  3. personal        https://gitlab.com/aruna.hewapathirane/lazarus.git (push)
  4. upstream        https://gitlab.com/freepascal.org/lazarus/lazarus.git (fetch)
  5. upstream        https://gitlab.com/freepascal.org/lazarus/lazarus.git (push)
  6.  

git status tells me my branch is behind by 24 commits.

Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git status
  2. On branch main
  3. Your branch is behind 'upstream/main' by 24 commits, and can be fast-forwarded.
  4.   (use "git pull" to update your local branch)
  5.  
  6. nothing to commit, working tree clean
  7.  

I do a git pull upstream

Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git pull upstream
  2. Updating fe6b88d8da..0f438c98fe
  3. Fast-forward
  4.  components/buildintf/projectintf.pas                             |   4 +-
  5.  components/codetools/finddeclarationtool.pas                     |  38 ++++++++++++------
  6.  components/ideintf/objectinspector.pp                            |   2 +-
  7.  components/jcf2/IdePlugin/lazarus/jcfuiconsts.pas                |   2 +-
  8.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.cs.po    |   2 +-
  9.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.de.po    |   4 +-
  10.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.es.po    |   2 +-
  11.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.fr.po    |   4 +-
  12.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.hu.po    |   4 +-
  13.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.it.po    |   4 +-
  14.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ja.po    |   4 +-
  15.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.lt.po    |   4 +-
  16.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pl.po    |   2 +-
  17.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pot      |   2 +-
  18.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.pt_BR.po |   4 +-
  19.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.ru.po    |   6 +--
  20.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.uk.po    |   4 +-
  21.  components/jcf2/IdePlugin/lazarus/languages/jcfuiconsts.zh_CN.po |   2 +-
  22.  components/jcf2/Parse/BuildParseTree.pas                         |   2 +-
  23.  components/jcf2/Process/Indent/Indenter.pas                      |  11 ++++-
  24.  components/jcf2/Process/Transform/SortUsesData.pas               |   4 +-
  25.  components/lazcontrols/docs/listfilteredit.xml                   |  68 +++++++++++++++++--------------
  26.  components/lazcontrols/docs/listviewfilteredit.xml               |  39 +++++++++++++++---
  27.  components/lazcontrols/docs/treefilteredit.xml                   |  52 ++++++++++++++++++++----
  28.  components/lazcontrols/listfilteredit.pas                        |   2 +-
  29.  components/lazcontrols/listviewfilteredit.pas                    |  12 +++++-
  30.  components/lazcontrols/treefilteredit.pas                        |   5 ++-
  31.  components/lazreport/source/fr3tolrf.pas                         |   2 +-
  32.  components/virtualtreeview/laz.virtualtrees.pas                  |   8 ----
  33.  docs/xml/lcl/comctrls.xml                                        |  40 ++++++++++++++----
  34.  docs/xml/lcl/editbtn.xml                                         | 107 +++++++++++++++++++++++++++++++++++++------------
  35.  docs/xml/lcl/printers.xml                                        |   2 -
  36.  examples/filteredits/filteredits.ex-meta                         |   5 +++
  37.  examples/filteredits/filtereditsdemo.ico                         | Bin 0 -> 133345 bytes
  38.  examples/filteredits/filtereditsdemo.lpi                         |  95 +++++++++++++++++++++++++++++++++++++++++++
  39.  examples/filteredits/filtereditsdemo.lpr                         |  28 +++++++++++++
  40.  examples/filteredits/filtereditsdemo.res                         | Bin 0 -> 135460 bytes
  41.  examples/filteredits/listfilterunit.lfm                          |  23 +++++++++++
  42.  examples/filteredits/listfilterunit.pas                          |  50 +++++++++++++++++++++++
  43.  examples/filteredits/listviewfilterunit.lfm                      | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  44.  examples/filteredits/listviewfilterunit.pas                      | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  45.  examples/filteredits/mainunit.lfm                                |  51 +++++++++++++++++++++++
  46.  examples/filteredits/mainunit.pas                                |  85 +++++++++++++++++++++++++++++++++++++++
  47.  examples/filteredits/treefilterunit.lfm                          |  23 +++++++++++
  48.  examples/filteredits/treefilterunit.pas                          |  50 +++++++++++++++++++++++
  49.  ide/componentlist.pas                                            |   1 -
  50.  ide/editorfilemanager.pas                                        |   1 -
  51.  ide/frames/editor_keymapping_options.pas                         |   3 +-
  52.  ide/projectinspector.pas                                         |   2 -
  53.  ide/searchresultview.pp                                          |   3 +-
  54.  ide/viewunit_dlg.pp                                              |   1 -
  55.  lcl/editbtn.pas                                                  |  57 ++++++++++++++++++--------
  56.  lcl/grids.pas                                                    |   8 ----
  57.  lcl/include/wincontrol.inc                                       |   6 ++-
  58.  lcl/interfaces/qt5/cbindings/Qt5Pas.pro                          |  11 +++--
  59.  lcl/interfaces/qt5/cbindings/src/chandles.h                      |   3 ++
  60.  lcl/interfaces/qt5/cbindings/src/pascalbind.h                    |   2 +
  61.  lcl/interfaces/qt5/cbindings/src/qnativeeventfilter_hook.h       |  87 ++++++++++++++++++++++++++++++++++++++++
  62.  lcl/interfaces/qt5/cbindings/src/qnativeeventfilter_hook_c.cpp   |  36 +++++++++++++++++
  63.  lcl/interfaces/qt5/cbindings/src/qnativeeventfilter_hook_c.h     |  23 +++++++++++
  64.  lcl/interfaces/qt5/qt56.pas                                      |   9 +++++
  65.  lcl/interfaces/qt6/cbindings/Qt6Pas.pro                          |  13 +++---
  66.  lcl/interfaces/qt6/cbindings/src/chandles.h                      |   3 ++
  67.  lcl/interfaces/qt6/cbindings/src/pascalbind.h                    |   2 +
  68.  lcl/interfaces/qt6/cbindings/src/qnativeeventfilter_hook.h       |  87 ++++++++++++++++++++++++++++++++++++++++
  69.  lcl/interfaces/qt6/cbindings/src/qnativeeventfilter_hook_c.cpp   |  36 +++++++++++++++++
  70.  lcl/interfaces/qt6/cbindings/src/qnativeeventfilter_hook_c.h     |  23 +++++++++++
  71.  lcl/interfaces/qt6/qt62.pas                                      |  10 +++++
  72.  lcl/lcltype.pp                                                   |   5 +++
  73.  packager/installpkgsetdlg.pas                                    |   4 +-
  74.  packager/packageeditor.pas                                       |  22 +++++-----
  75.  tools/runwait.sh                                                 |   7 +++-
  76.  72 files changed, 1386 insertions(+), 190 deletions(-)
  77.  create mode 100644 examples/filteredits/filteredits.ex-meta
  78.  create mode 100644 examples/filteredits/filtereditsdemo.ico
  79.  create mode 100644 examples/filteredits/filtereditsdemo.lpi
  80.  create mode 100644 examples/filteredits/filtereditsdemo.lpr
  81.  create mode 100644 examples/filteredits/filtereditsdemo.res
  82.  create mode 100644 examples/filteredits/listfilterunit.lfm
  83.  create mode 100644 examples/filteredits/listfilterunit.pas
  84.  create mode 100644 examples/filteredits/listviewfilterunit.lfm
  85.  create mode 100644 examples/filteredits/listviewfilterunit.pas
  86.  create mode 100644 examples/filteredits/mainunit.lfm
  87.  create mode 100644 examples/filteredits/mainunit.pas
  88.  create mode 100644 examples/filteredits/treefilterunit.lfm
  89.  create mode 100644 examples/filteredits/treefilterunit.pas
  90.  create mode 100644 lcl/interfaces/qt5/cbindings/src/qnativeeventfilter_hook.h
  91.  create mode 100644 lcl/interfaces/qt5/cbindings/src/qnativeeventfilter_hook_c.cpp
  92.  create mode 100644 lcl/interfaces/qt5/cbindings/src/qnativeeventfilter_hook_c.h
  93.  create mode 100644 lcl/interfaces/qt6/cbindings/src/qnativeeventfilter_hook.h
  94.  create mode 100644 lcl/interfaces/qt6/cbindings/src/qnativeeventfilter_hook_c.cpp
  95.  create mode 100644 lcl/interfaces/qt6/cbindings/src/qnativeeventfilter_hook_c.h
  96.  

Now git status says my branch is uptodate.

Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git status
  2. On branch main
  3. Your branch is up to date with 'upstream/main'.
  4.  
  5. nothing to commit, working tree clean

So I try to push what I just pulled to my remote 'personal' and nothing but grief. I need HELP!
Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git push personal
  2. Username for 'https://gitlab.com': Aruna.Hewapathirane
  3. Password for 'https://Aruna.Hewapathirane@gitlab.com':
  4. To https://gitlab.com/aruna.hewapathirane/lazarus.git
  5.  ! [rejected]              main -> main (non-fast-forward)
  6. error: failed to push some refs to 'https://gitlab.com/aruna.hewapathirane/lazarus.git'
  7. hint: Updates were rejected because the tip of your current branch is behind
  8. hint: its remote counterpart. Integrate the remote changes (e.g.
  9. hint: 'git pull ...') before pushing again.
  10. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  11. aruna@debian:/media/aruna/linux-next/lazarus$
  12.  
Title: Re: "TestAll" project issues
Post by: Aruna on December 28, 2022, 03:46:49 am
Do you also work with carrots? Or some other vegetables maybe?  ;)
I have tried to grow my own vegetables but I live in a condominium apartment so it has had limited success. I do not have land to plant on. I have to use small pots or bottles along the living room window so they get some sunlight. I am not sure if this will work but here are some pictures of my attempts at growing herbs. (https://arunajh.neocities.org/juha/)
Title: Re: "TestAll" project issues
Post by: Martin_fr on December 28, 2022, 04:14:17 am
@JuhaManninen and @dbanon I tried everything and am still unable to 'sync' the Lazarus/main repository with my own fork. I have given the bash output at each stage and if someone can figure out a fix it would be most welcome. Else I am simply going to delete my fork and start from scratch.

I have been struggling with this over a week now :-( Please see below for details.

I created a remote 'personal' which is my forked repository and a 'upstream' which is lazarus/main.

You haven't done a "git pull personal".


If you look at the "git log --oneline --graph --all" then you should see
 (or "git log --oneline --graph -n 50 main upstream/main personal/main")
1) main (your local branch / the tip of your local branch)
2) upstream/main (the tip of the main branch in the lazarus repo)
3) personal/main (the tip of the main branch in your fork)

the local "main" must be above the personal/main.

And there must be a line down connecting them.
So personal/main is on a commit that is included in local main.

If they are (the error does NOT suggest) on different lines, then they have "diverged".
But this should only be possible if you made your own commits to main and pushed that to personal/main.
(to avoid that, always make your own commits on new branches)


Title: Re: "TestAll" project issues
Post by: Aruna on December 28, 2022, 11:18:38 am

If you look at the "git log --oneline --graph --all" then you should see
 (or "git log --oneline --graph -n 50 main upstream/main personal/main")
)

Hello @Martin_fr thank you very much for taking the time to explain but this is way over my head right now. Hopefully with time I will begin to understand how git does things.
I ran git reflog. Bash output Is below. You may be able to see where I went wrong? Please do not ask me why I did whatever it is I did I was experimenting is my only reason for
all this.

[/quote]
Code: Bash  [Select][+][-]
  1.  
  2. 0f438c98fe HEAD@{0}: pull upstream: Fast-forward
  3. fe6b88d8da HEAD@{1}: reset: moving to fe6b88d8da
  4. dd428486b0 HEAD@{2}: reset: moving to dd428486b0
  5. 0f438c98fe HEAD@{3}: reset: moving to HEAD
  6. 0f438c98fe HEAD@{4}: pull upstream: Fast-forward
  7. 5f76b3e31c HEAD@{5}: pull: Fast-forward
  8. fe6b88d8da HEAD@{6}: checkout: moving from fixes_2_2 to main
  9. fe6b88d8da HEAD@{7}: checkout: moving from cfe290a58bea764f8246399038407a3af3dccae8 to fixes_2_2
  10. cfe290a58b HEAD@{8}: rebase (pick): Delete Laz_Hello.lpi
  11. 858d0032ce HEAD@{9}: rebase (pick): Upload New File
  12. 92f578a52c HEAD@{10}: rebase (pick): Upload New File
  13. ff9d3bdfba HEAD@{11}: rebase (pick): Upload New File
  14. f9610dee62 HEAD@{12}: rebase (pick): Upload New File
  15. 471e177452 HEAD@{13}: rebase (pick): Upload New File
  16. c02bf01597 HEAD@{14}: rebase (pick): Upload New File
  17. 83f083fa3e HEAD@{15}: rebase (pick): Upload New File
  18. cbe7cd4092 HEAD@{16}: rebase (pick): Upload New File
  19. 338d6ffa60 HEAD@{17}: rebase (pick): Upload New File
  20. 5050e1f5ae HEAD@{18}: rebase (pick): Add new directory
  21. 2eafc5a18d HEAD@{19}: rebase (pick): Add new directory
  22. fe6b88d8da HEAD@{20}: rebase (start): checkout main
  23. dd428486b0 HEAD@{21}: checkout: moving from c06424ac85213ff461ecaca210b62cc2fe868382 to personal/main
  24. c06424ac85 HEAD@{22}: checkout: moving from main to personal/fixes_2_2
  25. fe6b88d8da HEAD@{23}: checkout: moving from fixes_2_2 to main
  26. fe6b88d8da HEAD@{24}: checkout: moving from main to fixes_2_2
  27. fe6b88d8da HEAD@{25}: pull: Fast-forward
  28. d7e3d2231f HEAD@{26}: checkout: moving from c06424ac85213ff461ecaca210b62cc2fe868382 to main
  29. c06424ac85 HEAD@{27}: checkout: moving from main to remotes/personal/fixes_2_2
  30. d7e3d2231f HEAD@{28}: checkout: moving from c06424ac85213ff461ecaca210b62cc2fe868382 to main
  31. c06424ac85 HEAD@{29}: checkout: moving from main to remotes/personal/fixes_2_2
  32. d7e3d2231f HEAD@{30}: checkout: moving from c06424ac85213ff461ecaca210b62cc2fe868382 to main
  33. c06424ac85 HEAD@{31}: checkout: moving from main to remotes/personal/fixes_2_2
  34. d7e3d2231f HEAD@{32}: reset: moving to HEAD
  35. d7e3d2231f HEAD@{33}: clone: from https://gitlab.com/freepascal.org/lazarus/lazarus.git

As you suggested I also ran
Code: Bash  [Select][+][-]
  1. git log --oneline --graph -n 50 main upstream/main personal/main

Bash output is below. Martin I was thinking if I have really messed things up would it not be easier to start again from scratch? Or this can still be salvaged? I am again humbled by the knowledge and experience that is available freely to anyone on this forum.
Code: Bash  [Select][+][-]
  1. * 0f438c98fe CodeTools: fix attribute resolver
  2. * 5f76b3e31c LCL: additional fix to TWinControl.GetClientRect wcfBoundsRealized (DockedFormEditor issue), issue #40052. Patch by rich2014.
  3. * 822f606e97 Docs: LCL/comctrls. Adds content for overridden TPageControl.ChildClassAllowed topic.
  4. * dea606d77f Docs: LCL/printers. Removes TODO entry that has already been handled.
  5. * eb59ad598f JCF: regenerated translations and updated Russian translation
  6. * 5719672f10 Codetools: Fix SmartHint for generic specialized types. Issue #29860.
  7. * 425db255bd Docs: LCL/editbtn. Adds and updates topics for changes in 5f4aa964.
  8. * 421193c712 Docs: LazControls/treefilteredit. Adds and updates topics for changes in 5f4aa964.
  9. * c4dcb8c515 Docs: LazControls/listviewfilteredit. Adds and updates topics for changes in 5f4aa964.
  10. * 9a99d112b5 Docs: LazControls/listfilteredit. Updates topics for changes in 5f4aa964.
  11. * c2a26476f9 buildintf: comment
  12. * 5ea4a1e270 Tools: Fix handling program parameters in runwait.sh. Issue #40045, patch by Dean Mustakinov.
  13. * edbe283fc6 Jedi Code Format: Eliminate an assertion failure in debug mode. Issue #40053, patch by Domingo Galmés.
  14. * 2e160e525d Jedi Code Format: Improve the text for an indentation option. Issue #40054, patch by Domingo Galmés.
  15. * d6bfb829cf Jedi Code Format: Fix a memory leak. Issue #40058, patch by Domingo Galmés.
  16. * 0777a5b939 Jedi Code Format: Fix indentation of generic function forward declarations. Issue #40055, patch by Domingo Galmés.
  17. * be093cd40d Add an example project for FilterEdits. Issue #40035, modified from patch by dbannon.
  18. * 5f4aa96422 LazControls, FilterEdits: Improve setting the filter programmatically. Invalidate after properties change.
  19. *   70bc333d28 Merge branch 'main' into 'main'
  20. |\  
  21. | * 2461afd1b1 Cleanup the code and update libqt*pas version
  22. | * 5d47e14a50 Added NativeEventFilter hook in qt5
  23. | * 7702f3d65a Added NativeEventFilter hook in qt6
  24. |/  
  25. * f0e459f047 FPC: Extend System.UITypes
  26. * 99caa084fc Revert TFontStyles to the original size
  27. * fe6b88d8da CI: added a comment to configuration
  28. * 57cc6997fc CI: added manual job for building docs (and emitting them as artifact) with FPDoc from stable FPC
  29. * 3e36732de6 laz.virtualtrees: fixed crash with qt widgetsets on windows. issue #40056
  30. * d115ec0399 Qt6: fixed building cbindings on windows.
  31. * d7e3d2231f Docs: LCL/lclplatformdef. Adds DirNameToDisplayName and DisplayNameToDirName topics for changes in c45dfb7a.
  32. * 2e64ec91a8 Docs: LCL/printers. Adds, updates topics with aliases to System.UITypes. Changes in 43d7f203.
  33. * d97d330495 Docs: LCL/grids. Adds content to the TCustomStringGrid.SaveColumns and TStringGridStrings topics.
  34. * 651303f114 Docs: LCL/graphics. Adds, updates topics with aliases to System.UITypes. Changes in 43d7f203.
  35. * db360c7ede Docs: LCL/forms. Adds, updates topics for aliases to System.UITypes. Changes in 43d7f203.
  36. * 967e4ee615 Docs: LCL/controls. Adds, updates topics with aliases to System.UITypes. Changes in 43d7f203.
  37. * 5f819ddd36 Docs: LazUtils/uitypes. Updates topics with aliases to System.UITypes. Changes in 43d7f203.
  38. * 21e56937cf CI: added manual jobs for building docs (and emitting them as artifacts) with FPDoc from FPC `main` and `fixes` branches
  39. * a2b7d28e68 CI: store FPDoc executables separately for different FPC versions
  40. * 1b9e56b56c lcl: fixed TWinControl.GetClientRect wcfBoundsRealized, issue #40052
  41. * f87fe0303d lcl gtk3: load theme.css only if existing
  42. * 166d1b6dbf Docs: Removed unneeded .gitignore. The one in root of the Lazarus source directory already has relevant entries.
  43. * ebdc3913ed IDE/images: Add some update and missing icons in File menu. By Roland Hahn.
  44. * 829f320095 FPC: Extend System.UITypes
  45. * c45dfb7a56 IDE: Show Widgetset display name instead of dir name in selection list for project. Issue #40040, patch by theo222.
  46. * 43d7f20349 FPC: Extend System.UITypes
  47. * 5b0ed449f3 Docs: LCL/grids. Updates TCustomStringGrid.Modified topic to reflect usage.
  48. * b72d31e3dc Docs: LazUtils/lconvencoding. Adds and updates topics for changes in 0ae37a90.
  49. * 62f886435d Docs: LazUtils/codepagescommon. Adds topics for changes in 0ae37a90.
  50. * 0ae37a906c LConvEncoding: add EncodingCP865. Patch by Alexey Torgashin. Issue #40041.
  51. * b40000c46c Docs: LCL/comctrl. Updates topic content.
  52. * d7f0ef81fe CI: added archive with CHM docs for stable FPC to build image (needed for building Lazarus docs)

Title: Re: "TestAll" project issues
Post by: Aruna on December 28, 2022, 11:57:46 am
You haven't done a "git pull personal".

I am confused now @Martin_fr I thought the steps below are what I have to do to 'sync' the repos?

1 - Fork Lazarus main/trunk
2 - clone the fork to my local system
3 - make changes/test/experiment on my local clone( on a separate branch as you pointed out )
4 - push the changes to my remote fork ( in this case 'personal')
5 - create a merge/pull request from my remote 'personal' to lazarus main/trunk (in this case 'upstream')
6 - when needed git pull upstream to 'sync' things again?

So why do I need to git pull personal? personal is the fork which has no changes so why pull it? very confused here..
Or as is usual I am not seeing the big picture?
Title: Re: "TestAll" project issues
Post by: Martin_fr on December 28, 2022, 04:03:01 pm
Ok, I think I found what is going on. I did have a look at your online repo at gitlab.

The top commit in your main branch https://gitlab.com/aruna.hewapathirane/lazarus/-/commits/main is
Code: Text  [Select][+][-]
  1. Commit dd428486
  2. authored 5 Dec 2022, 15:50 by Aruna Hewapathirane's avatar Aruna Hewapathirane
  3. Merge remote-tracking branch 'upstream/main'
And if you look at the graph https://gitlab.com/aruna.hewapathirane/lazarus/-/network/main (you have to scroll down a bit),
you will find that this merge contains your working branch (ending with Commit 9db84220 "Delete Laz_Hello.lpi")

So you did do commits to the "main" branch.
And you pushed them.
And that is why you are getting errors.

But before I get into detail, a bit of background and some other info.

Steps to fix are at the end of this post. So you can skip forward



1) "git log --graph --oneline"

For some reason your output does not contain any branch/tag names at all. Here is what I get (and what afaik should be default).
You can see some lines start with "(" and then branch names. (on the console this usually is colored).
- So the commit on the first line is at "HEAD" which points to the branch "main_gitlab".
  It also is at origin/main and origin/HEAD
- The 2nd line is at "main" (that is my local main branch)

Code: Text  [Select][+][-]
  1. * cbef44b7ef (HEAD -> main_gitlab, origin/main, origin/HEAD) CodeTools: fix attribute resolver - remove exception handling
  2. | * 4190c37981 (main) DebuggerOptions, EnvironmentOptions: move class-config
  3. | * e215aa22c2 EnvironmentOptions: When saving data, don't destroy any existing xml. (if data on disk changed)
  4. |/
  5. * 0f438c98fe CodeTools: fix attribute resolver

This allows me to quickly see where the "tips" of all my branches are.



2) "branch" / "tip" or "head" of a branch .... (nomenclature)

Maybe worth, making sure we talk about the same thing....

The (English) word "branch" is used for a variety of things.
It can be
- A series of commits known by the branch name (i.e. all the commits that "git log <branchname>" will show)
  Mind that the branch starts at the very first commit of the repo. Not at the "fork-point" (where the branch was created / diverts from another branch).
  So some (older) commits on a branch are usually shared with other branches
- A reference to the "branchname"
- The "tip" (sometimes also "head of") of the branch. That is the latest commit made to the branch.
  This is the commit on which "git log" will display the branch-name


3) "branch" local vs remote (vs "distributed")

There exists more than one "branch" called "main".
(And the same is true for most other branches / well any branch that is pushed/pulled to/from a remote)

* All the below is using "main". But applies to any other branch that exists on a remote.

You can have a git repo without remote (only your local copy). Then you only have one "main" branch.
You commit to it, and the tip of main will be on the new commit.

Now if you have a remote, the remote may have 3 commit in main (left = oldest)
REMOTE:
   A - B - C (main)

If you clone/pull that remote to a local repo:
- then your local repo will remember that the remote has "main" on "C". ("origin" in the example is the name of the remote)
- your local repo will create a local main branch on the same commit. (or it will be created when you switch/checkout to it)

LOCAL
   A - B - C (main, origin/main)

If you make a commit to "main" you make it locally. So it affects your local branch.
Both:
- The series of commits. As you have one more commit
- The "tip" of the branch. As it move forward

LOCAL (with your commit)
   A - B - C (origin/main) - D (main)

As you can see, your local repo still has a memory where the remote has (or maybe had) the tip of its branch.

If you push then you send all the commits that you added to the remote.
=> Well, if all goes as expected.

But what if someone else pushed to the remote...

If someone else pushed to the remote, then you don't have that persons commit.

REMOTE (with someone's commit):
   A - B - C - E (main)

LOCAL (with your commit)
   A - B - C (origin/main) - D (main)

So now there are 3 versions of the main branch.
1) Your local "main"
2) Your local last-know-remote "origin/main"
3) the actual remote "main"

Unlike SVN which will merge at the server, git will not accept your push.
GIT always requires that you do the merging yourself.

To be precise: Git requires that your "origin/main" and the actual remote's "main" are the same, in order for you to push.

So the push then can just add the new commits you made, to the tip of the remote. And the remote will be 100% the same as your local copy.

(Mind, your local repo has 2 remotes. So it has to memorized-remote branches upstream/main and personal/main)




4) "git pull"  and tracking

The local branch usually knows to which remote branch it belongs. (called tracking).
That is, your local branch does not have to have the same name, it could be called anything. In most cases such relationships are defined by tracking (usually set at creating time, or when first pushing). The name only matters in a few cases.

REMOTE (with someone's commit):
   A - B - C - E (main)

LOCAL (without any commit by you)
   A - B - C (main, origin/main)

Now if you do "git pull" it will get the commit "E". And the "origin/main" will be pointing to that (since it will be the last we have seen on the remote).

In this case your local "main" will also be changed. It will be "fast forwarded" (i.e. it will move forward to the commit E).
(Note that fast-forward is considered a "merge", even though there is no merge-commit)


But in case of

REMOTE (with someone's commit):
   A - B - C - E (main)

LOCAL (with your commit)
   A - B - C (origin/main) - D (main)

You get
LOCAL (after pull - before any update to your local "main")
   A - B - C - E (origin/main)
           \ - D (main)

The (versions of the)  "main" branch have "diverged" => they are no longer in a straight line.

"git pull" will by default merge them. It will create a Merge commit "F":
(And that is what happened to you)
   A - B - C - E (origin/main) - F (main)
           \ - D -              /



=> Avoiding merge commits by pull "git config pull.ff only"
https://wiki.freepascal.org/SVN_to_GIT_Cheatsheet#Recommended

And then "git rebase" or configure pull to do the rebase => check the git manpages.




5) The error you got

Now your pushed the above merge commit to your forked remote "personal"....
But that commit is not in our Lazarus git repo.

You local branch "main" is tracking our remote main.
- So "git pull upstream" will affect the local "main".
- "git pull personal" will not affect the local "main"

Anyway your your remote "personal" main now has a commit (the merge) that is not in our remote "upstream" main. 
And your local "main" is "up to date" with "upstream/main" (your git status said so).
So your local main does not contain the merge commit (including all your commits that were merged) that you pushed to "personal".
And that means you can't push this commit to personal.




6) Fixing your situation...
(and make sure you change "git pull" as above)

You want "personal/main" to be an exact copy of our "upstream/main".
So you need to move your commits to a new branch.

a) create the new branch.

  git branch my-diverged-main main
Creating my-diverged-main to replace "main" (because we later move/reset "personal/main", and then the new branch makes sure all your commits are kept)

  git branch my-work 9db8422087ac5c156d5d20f8c20feaf329f65ae2
The sha1 is from your online repo (but will be the same in your local repo). It is the "Delete Laz_Hello.lpi" commit
You now have a branch "my-work" on that commit.

Create any other branches you may need for any local commits you have made since (i.e. not yet pushed)


  git push  --set-upstream  personal  my-diverged-main
  git push  --set-upstream  personal  my-work
Now you have your work on your remote. As a new branch.
Check that gitlab shows this

Pushing my-diverged-main is optional. It only contains the merge-commit, which likely you will not need.

b) change/correct personal/main

  git push --force-with-lease personal main

This will override the remote branch.
That is, the current "main" on the upstream remote will be replaced (deleted) by the new "main" as it is in your local repo (and that is up to date with upstream).

Mind, it only "deletes" the old location (tip). of the branch.

The commits will remain, because you created new branches that also contain the new commits.
If you had not created those new branches, then the commits would become unreachable.

Once fixed, and assuming you do not add your own commits to main again, then you will not need the "force with lease" again. It should work with just
  git push personal main





8) git switch vs git checkout

If your have a current version of git, I recommend you look up "git switch" and use it instead of "git checkout".
But it's a personal decision.
See the wiki page that I linked.

Title: Re: "TestAll" project issues
Post by: Martin_fr on December 28, 2022, 04:08:15 pm
Please note "--force-with-lease" is the fix ONLY in this case.

In other similar cases, you want to keep things, and integrate the branches with each other => so you would need to do some merges or rebases....
Not going into detail....

But do not use "--force-with-lease" for any other issues. (Unless you really really know what you do).

And never ever use just "--force" for a push.
Title: Re: "TestAll" project issues
Post by: Aruna on December 29, 2022, 03:47:37 am
@Martin_fr I am speechless. No human can do what you just did. That kind of analytical prowess is usually reserved for the Gods.

Thank you so very much for what you sent. That is probably one of the best (if not the best) explanations and troubleshooting I have enjoyed reading in a very long while. Wow, you should go teach university my friend! Actually in an advisory capacity to the IT professors and their departments.

Someday I will learn to think like this ( I wish... sigh!) That took a lot of your time and some considerable analysis so for what it's worth should we ever meet in person the food and beer is on me. 

It is getting late here in Tronto and been a long day I am going to crash soon. I will respond in detail tomorrow.
Title: Re: "TestAll" project issues
Post by: Aruna on January 02, 2023, 09:51:34 am
Happy New Year 2023 to everyone..

  git push --force-with-lease personal main

This will override the remote branch.
That is, the current "main" on the upstream remote will be replaced (deleted) by the new "main" as it is in your local repo (and that is up to date with upstream).

Hi @Martin_fr I tried to follow your instructions to the letter and I learnt a lot along the way I am very grateful for all the guidance and explanations. But I am getting git errors again. Please see below.
Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git push --force-with-lease personal main
  2. Username for 'https://gitlab.com': Aruna.Hewapathirane
  3. Password for 'https://Aruna.Hewapathirane@gitlab.com':
  4. Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
  5. remote: GitLab: You are not allowed to force push code to a protected branch on this project.
  6. To https://gitlab.com/aruna.hewapathirane/lazarus.git
  7.  ! [remote rejected]       main -> main (pre-receive hook declined)
  8. error: failed to push some refs to 'https://gitlab.com/aruna.hewapathirane/lazarus.git'

I am on this branch below.
Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git branch
  2.   fixes_2_2
  3.   main
  4. * my-diverged-main
  5.   my-work
  6.   testall
  7.  

I am going to reset the HEAD to my initial fork clone commit that hopefully should get me back to a clean main with nothing pushed from me.

Code: Bash  [Select][+][-]
  1. d7e3d2231f (HEAD -> main, personal/my-diverged-main, testall, my-diverged-main) HEAD@{43}: clone: from https://gitlab.com/freepascal.org/lazarus/lazarus.git

Code: Bash  [Select][+][-]
  1. git reset --hard d7e3d2231f

If I still start hitting brick walls after doing so I think it is time to delete this repo and start with a clean slate? Thank you so much for your time, I have learnt so much.
Title: Re: "TestAll" project issues
Post by: JuhaManninen on January 07, 2023, 09:08:37 pm
Just Zip the TestAll project and upload it here. :)
Title: Re: "TestAll" project issues
Post by: Aruna on January 15, 2023, 02:22:27 pm
Just Zip the TestAll project and upload it here. :)
I will do that Juha but I want to get things working using GitLab because at some stage I will have to start using Gitlab to contribute. I have also started to study the testall code in depth and now I realize all it actually tests are the mouse functions mostly but the full code is IMHO  a very useful resource so I will keep digging and learning and hopefully zip an upload here but may not be any time soon.

The other thing is I used a credit card and verified my identity in Gitlab but now it tells me prepcache has failed. Please see attached screenshot. Sigh... I suppose drop kicking Gitlab in the head is out of the question eh? %)
Title: Re: "TestAll" project issues
Post by: JuhaManninen on January 30, 2023, 07:00:22 pm
Sorry I failed to notice your post earlier.

The other thing is I used a credit card and verified my identity in Gitlab but now it tells me prepcache has failed. Please see attached screenshot. Sigh... I suppose drop kicking Gitlab in the head is out of the question eh? %)
Do you mean you paid something for the account? You don't need to. A free account is enough for these FOSS projects.
I also feel uncomfortable with the GitHub and GitLab interfaces and server branches because I have not practiced much.
For you it would be much easier to skip all that and contribute with patches. They are still fully supported as I wrote earlier. Create local feature branches and switch between them. Sometimes rebase against "main". When a feature or fix is ready, create a patch and upload it to bug tracker or somewhere. Easy!

You can continue studying and improving the TestAll project also after it gets added to Lazarus sources. Release early, release often. FOSS development.
Title: Re: "TestAll" project issues
Post by: Aruna on February 01, 2023, 10:51:52 am
Just Zip the TestAll project and upload it here. :)
Hello @Juha I have attached a testall.zip.  Please see if you can get this back into the main trunk when you have time. Thank you.
Title: Re: "TestAll" project issues
Post by: Aruna on February 01, 2023, 11:00:16 am
Sorry I failed to notice your post earlier.
No worries..

Do you mean you paid something for the account? You don't need to. A free account is enough for these FOSS projects.
No no just used it to verify I am who I say I am nothing was paid.

I also feel uncomfortable with the GitHub and GitLab interfaces and server branches because I have not practiced much.
For you it would be much easier to skip all that and contribute with patches. They are still fully supported as I wrote earlier. Create local feature branches and switch between them. Sometimes rebase against "main". When a feature or fix is ready, create a patch and upload it to bug tracker or somewhere. Easy!

You can continue studying and improving the TestAll project also after it gets added to Lazarus sources. Release early, release often. FOSS development.
I have sent in a testall.zip and once you get it added back to the Lazarus sources I will start improving it. The testall.zip has all the original files with no changes. I think what you have said will be much easier than trying to get things working with Gitlab. So I will do what you asked me to and try to send in patches  :)
Title: Re: "TestAll" project issues
Post by: JuhaManninen on February 04, 2023, 12:46:01 pm
Hello @Juha I have attached a testall.zip.  Please see if you can get this back into the main trunk when you have time. Thank you.
I placed it in lcl/tests/testall/ and tried to compile. I got :
 Error: Can't open resource file "/home/juha/SW/lazarus/lcl/tests/testall/../images/components_images.res"

I have sent in a testall.zip and once you get it added back to the Lazarus sources I will start improving it. The testall.zip has all the original files with no changes. I think what you have said will be much easier than trying to get things working with Gitlab. So I will do what you asked me to and try to send in patches
I thought you fixed some issues for Linux, but adding the original files is perfectly OK, too.

Yes, when you work with local feature branches and patches, you don't need to create a fork in GitLab. Just clone the official repo like everybody else and then work locally.
I do the same thing basically. I happen to have commit rights and thus I do "git push" instead of uploading a patch somewhere.
I have many feature branches here. Most of them are experimental and will never be used for the official repository.
Title: Re: "TestAll" project issues
Post by: Aruna on February 04, 2023, 02:37:24 pm
Hello @Juha I have attached a testall.zip.  Please see if you can get this back into the main trunk when you have time. Thank you.
I placed it in lcl/tests/testall/ and tried to compile. I got :
 Error: Can't open resource file "/home/juha/SW/lazarus/lcl/tests/testall/../images/components_images.res"
This error is due to a path issue because we moved the files into a new location lcl/tests/testall. Instead of one level we have to now go up three levels so Lazarus can find the *.res files. Fix is shown below. The file is testallform.pp and line numbers are 171 and 172. 

Original code below that causes error.
Code: Pascal  [Select][+][-]
  1. {$R ../images/laz_images.res}
  2. {$R ../images/components_images.res}

The fix is below.
Code: Pascal  [Select][+][-]
  1. {$R ../../../images/laz_images.res}
  2. {$R ../../../images/components_images.res}

I have sent in a testall.zip and once you get it added back to the Lazarus sources I will start improving it. The testall.zip has all the original files with no changes. I think what you have said will be much easier than trying to get things working with Gitlab. So I will do what you asked me to and try to send in patches
I thought you fixed some issues for Linux, but adding the original files is perfectly OK, too.
Yes I did but then I thought let us just start from scratch the way it was. I did a git shortlog examples/testallform.pp in branch fixes_2_2 and I think attribution is important and I have no idea once we add the files I sent to lcl/tests/testall if the git history of who did what and when will remain intact? See below..

Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git shortlog examples/testallform.pp
  2. bart (6):
  3.       Examples: Fix resource loading in TestAll project.
  4.       Examples: Start completely rewrting the TestAll apllication.
  5.       Examples: TestAll: add a test (work in progress).
  6.       Examples: TestAll: - make dummy procedures for all tests and call them in the menu's onclick event - fix typo - refactor - cleanup
  7.      Examples: TestAll: more component tests.
  8.      Examples: TestAll: don't write an extra '$' in front of Key when logging Key events.
  9.  
  10. joost (1):
  11.       general: Updated address of the Free Software Foundation in copyright messages
  12.  
  13. juha (3):
  14.       LCL (mostly), Replace Assert(False... with //DebugLn(...  Now Assert can be used for its original purpose again.
  15.       IDE etc.: unify 3 dots in GUI string to have a space ( ...).
  16.       Examples: Fix compilation when function wrappers in FileUtil are disabled (define NoLazUTF8Wrappers). Clean uses sections.
  17.  
  18. laurent (1):
  19.       IDE: rename the images to avoid overload
  20.  
  21. lazarus (11):
  22.       + added "testall" demo provided by <christer.t.johansson@se.abb.com> stoppok
  23.       +Rebuilt from beginning to V0.2 +Prepared for non existent components (total 60 components). (Changes by Christer, commited by stoppok)
  24.       * Fixed crash caused by missing pixmaps * using resources now instead of xpm file
  25.       * enhanced testdialog for TBevel * basic test for TPaintBox stoppok
  26.       MG: minor fixes
  27.       TPanel implemented. Basic graphic primitives split into GraphType package, so that we can reference it from interface (GTK, Win32) units. New Frame3d canvas method that uses native (themed) drawing (GTK only). New overloaded Canvas.TextRect method. LCLLinux and Graphics was split, so a bunch of files had to be modified.
  28.       + Enhanced testall-app with demo for TPanel, stoppok
  29.       MG: updated licenses
  30.       MG: TNoteBook now starts with no Page and TPage has no auto names
  31.       MG: fixed compiling examples
  32.       MG: added interfaces unit
  33.  
  34. marc (1):
  35.       * Fixed compilation and some memleaks
  36.  
  37. martin (1):
  38.       Examples: Fix testallform for fpc2.3.1 (issue #14184)
  39.  
  40. mattias (7):
  41.       fixed testall example
  42.       renamed LCLLinux to LCLIntf
  43.       fixed testall
  44. bart (6):
  45.       Examples: Fix resource loading in TestAll project.
  46.       Examples: Start completely rewrting the TestAll apllication.
  47.       Examples: TestAll: add a test (work in progress).
  48.       Examples: TestAll: - make dummy procedures for all tests and call them in the menu's onclick event - fix typo - refactor - cleanup
  49.      Examples: TestAll: more component tests.
  50.      Examples: TestAll: don't write an extra '$' in front of Key when logging Key events.
  51.  
  52. joost (1):
  53.       general: Updated address of the Free Software Foundation in copyright messages
  54.  
  55. juha (3):
  56.       LCL (mostly), Replace Assert(False... with //DebugLn(...  Now Assert can be used for its original purpose again.
  57.       IDE etc.: unify 3 dots in GUI string to have a space ( ...).
  58.       Examples: Fix compilation when function wrappers in FileUtil are disabled (define NoLazUTF8Wrappers). Clean uses sections.
  59.  
  60. laurent (1):
  61.       IDE: rename the images to avoid overload
  62.  
  63. lazarus (11):
  64.       + added "testall" demo provided by <christer.t.johansson@se.abb.com> stoppok
  65.       +Rebuilt from beginning to V0.2 +Prepared for non existent components (total 60 components). (Changes by Christer, commited by stoppok)
  66.       * Fixed crash caused by missing pixmaps * using resources now instead of xpm file
  67.       * enhanced testdialog for TBevel * basic test for TPaintBox stoppok
  68.       MG: minor fixes
  69.       TPanel implemented. Basic graphic primitives split into GraphType package, so that we can reference it from interface (GTK, Win32) units. New Frame3d canvas method that uses native (themed) drawing (GTK only). New overloaded Canvas.TextRect method. LCLLinux and Graphics was split, so a bunch of files had to b
  70. bart (6):
  71.       Examples: Fix resource loading in TestAll project.
  72.       Examples: Start completely rewrting the TestAll apllication.
  73.       Examples: TestAll: add a test (work in progress).
  74.       Examples: TestAll: - make dummy procedures for all tests and call them in the menu's onclick event - fix typo - refactor - cleanup
  75.      Examples: TestAll: more component tests.
  76.      Examples: TestAll: don't write an extra '$' in front of Key when logging Key events.
  77.  
  78. joost (1):
  79.       general: Updated address of the Free Software Foundation in copyright messages
  80.  
  81. juha (3):
  82.       LCL (mostly), Replace Assert(False... with //DebugLn(...  Now Assert can be used for its original purpose again.
  83.       IDE etc.: unify 3 dots in GUI string to have a space ( ...).
  84.       Examples: Fix compilation when function wrappers in FileUtil are disabled (define NoLazUTF8Wrappers). Clean uses sections.
  85.  
  86. laurent (1):
  87.       IDE: rename the images to avoid overload
  88.  
  89. lazarus (11):
  90.       + added "testall" demo provided by <christer.t.johansson@se.abb.com> stoppok
  91.       +Rebuilt from beginning to V0.2 +Prepared for non existent components (total 60 components). (Changes by Christer, commited by stoppok)
  92.       * Fixed crash caused by missing pixmaps * using resources now instead of xpm file
  93.       * enhanced testdialog for TBevel * basic test for TPaintBox stoppok
  94. aruna@debian:/media/aruna/linux-next/lazarus$
  95.  
  96.  
  I feel it is important to keep this info but I do not know how we are going to do this if we just plug the files into lcl/tests/testall? Or as usual I am not seeing the obvious?

Yes, when you work with local feature branches and patches, you don't need to create a fork in GitLab. Just clone the official repo like everybody else and then work locally.
I do the same thing basically. I happen to have commit rights and thus I do "git push" instead of uploading a patch somewhere.
I have many feature branches here. Most of them are experimental and will never be used for the official repository.
I stopped trying to get Gitlab to work it is simply too time-consuming and frustrating. Your way is very much simpler and hopefully will work for me. Thank you.
Title: Re: "TestAll" project issues
Post by: JuhaManninen on February 04, 2023, 06:11:35 pm
This error is due to a path issue because we moved the files into a new location lcl/tests/testall. Instead of one level we have to now go up three levels so Lazarus can find the *.res files.
Yes, it was easy to fix.

Quote
Yes I did but then I thought let us just start from scratch the way it was. I did a git shortlog examples/testallform.pp in branch fixes_2_2 and I think attribution is important and I have no idea once we add the files I sent to lcl/tests/testall if the git history of who did what and when will remain intact?
It will remain intact in "main" and in "fixes_2_2". Nothing will change the existing history.
Anyway the TestAll project should be copied from "main" branch before its deletion from examples directory, thus including all changes. Is this version from there?

Quote
I feel it is important to keep this info but I do not know how we are going to do this if we just plug the files into lcl/tests/testall? Or as usual I am not seeing the obvious?
The version in lcl/tests/ will have its own commit history once we start committing code.
Title: Re: "TestAll" project issues
Post by: Aruna on February 04, 2023, 06:43:37 pm
Anyway the TestAll project should be copied from "main" branch before its deletion from the examples directory, thus including all changes. Is this version from there?
As it is right now in "main" branch if you check for testall by running ls -alh examples/test* there is nothing. Testall was removed at some point from "main" but it is still there under branch "fixes_2_2" and I copied it from branch "fixes_2_2". I vaguely remember asking where is "testall" and @dbannon pointed me in the right direction by saying I can find it under branch "fixes_2_2" but it is most definitely no longer in branch "main".
 
Title: Re: "TestAll" project issues
Post by: JuhaManninen on February 05, 2023, 12:39:26 am
As it is right now in "main" branch if you check for testall by running ls -alh examples/test* there is nothing. Testall was removed at some point from "main" but it is still there under branch "fixes_2_2" and I copied it from branch "fixes_2_2". I vaguely remember asking where is "testall" and @dbannon pointed me in the right direction by saying I can find it under branch "fixes_2_2" but it is most definitely no longer in branch "main".
It got bugfixes in "main" branch before it was removed. Thus you must go to the last commit before the removal and copy it. I even explained it in some earlier post in detail.
Title: Re: "TestAll" project issues
Post by: Aruna on February 05, 2023, 12:43:17 pm
It got bugfixes in "main" branch before it was removed. Thus you must go to the last commit before the removal and copy it. I even explained it in some earlier post in detail.

I ran git log -S TestAllForm and got what is below..
Code: Bash  [Select][+][-]
  1. commit 31328882fb8d3acace2ea1e906073c7c429fb146
  2. Author: Juha <juha@lazarus-ide.org>
  3. Date:   Sat Mar 5 16:51:45 2022 +0200
  4.  
  5.     Example projects tested, categorised, metadata added, restructured by David Bannon.
  6.  
  7. commit 95ca76e85edc433d7d03f14daf28aafbcd92fa36
  8. Author: mattias <nc-gaertnma@netcologne.de>
  9. Date:   Sat Oct 1 00:38:04 2005 +0000
  10.  
  11.     added .lpi for examples
  12.    
  13.     git-svn-id: trunk@7869 -
  14.  
  15. commit 09138261ffe900180e59df2d3c0ab21345d2c926
  16. Author: lazarus <lazarus@lazarus-ide.org>
  17. Date:   Tue Oct 29 08:22:33 2002 +0000
  18.  
  19.     MG: added interfaces unit
  20.    
  21.     git-svn-id: trunk@3578 -
  22.  
  23. commit 6c9464c470122f2f48889e91d031da545fbd9b4c
  24. Author: lazarus <lazarus@lazarus-ide.org>
  25. Date:   Fri May 10 06:57:51 2002 +0000
  26.  
  27.     MG: updated licenses
  28.    
  29.     git-svn-id: trunk@1668 -
  30. aruna@debian:/media/aruna/linux-next/lazarus$
  31.  

So I am guessing the commit I must go back to is commit 95ca76e85edc433d7d03f14daf28aafbcd92fa36 Author: mattias <nc-gaertnma@netcologne.de> Date:   Sat Oct 1 00:38:04 2005 +0000 ?
Title: Re: "TestAll" project issues
Post by: JuhaManninen on February 05, 2023, 01:52:03 pm
So I am guessing the commit I must go back to is commit 95ca76e85edc433d7d03f14daf28aafbcd92fa36 Author: mattias <nc-gaertnma@netcologne.de> Date:   Sat Oct 1 00:38:04 2005 +0000 ?
Don't go so far in history. See the third post in this thread for details.
Title: Re: "TestAll" project issues
Post by: Aruna on February 05, 2023, 02:28:48 pm
So I am guessing the commit I must go back to is commit 95ca76e85edc433d7d03f14daf28aafbcd92fa36 Author: mattias <nc-gaertnma@netcologne.de> Date:   Sat Oct 1 00:38:04 2005 +0000 ?
Don't go so far in history. See the third post in this thread for details.
Oh my goodness you told me exactly what to do but I did not understand this at that time, I do now. Thank you Juha.
Title: Re: "TestAll" project issues
Post by: JuhaManninen on February 17, 2023, 03:36:10 pm
I added the latest TestAll project from "main" examples/ directory to lcl/tests in c1e41c6f962c. Please test.
Why does it test only a small subset of LCL controls? The name TestAll is misleading. Can you Aruna please take a look?
Further code improvements must happen as patches or merge requests.
Title: Re: "TestAll" project issues
Post by: Aruna on February 18, 2023, 10:20:58 pm
I added the latest TestAll project from "main" examples/ directory to lcl/tests in c1e41c6f962c. Please test.
Juha thank you very much but what you added does not have the necessary git history. You can see this below.

Code: Bash  [Select][+][-]
  1. aruna@debian:/media/aruna/linux-next/lazarus$ git log lcl/tests/testall/testall.lpi
  2. commit c1e41c6f962ce308ed3d81ea50b230be49a19f0f
  3. Author: Juha <juha@lazarus-ide.org>
  4. Date:   Fri Feb 17 16:16:35 2023 +0200
  5.  
  6.     LCL: Restore TestAll project but this time in lcl/tests directory.
  7. aruna@debian:/media/aruna/linux-next/lazarus$
  8.  
I was busy with work I did not have time to fix this. I will do so soon.

Why does it test only a small subset of LCL controls? The name TestAll is misleading. Can you Aruna please take a look?
This was how I found the original source. Only 4 controls were tested the others had placeholders but someone has to write code to test. If you go through testallform_include.inc starting at line 117 you will see the reason why. Some code is below.

Code: Pascal  [Select][+][-]
  1.  taCompImplemented: Array[taComponents] of Boolean = (
  2.     True, //tacTarrow,
  3.     True, //tacTbitbtn,
  4.     True, //tacTbutton,
  5.     True, //tacTbuttonpanel,
  6.     False, //tacTcalcedit,
  7.     False, //tacTcalendar,
  8.     False, //tacTcheckbox,
  9.     False, //tacTcheckcombobox,
  10.     False, //tacTcheckgroup,
  11.     False, //tacTchecklistbox,
  12.     False, //tacTcolorbox,


 
Further code improvements must happen as patches or merge requests.
Understood and will comply. Thank you Juha.
Title: Re: "TestAll" project issues
Post by: Aruna on February 19, 2023, 03:48:09 pm
Please disregard my concerns about the commit history in the earlier reply. I just found out about git log --follow and this shows me the history.
Code: Pascal  [Select][+][-]
  1. git log --follow ../lcl/tests/testallform.pp

I have no idea if this will work every time but it does work for me for now. Sadly I am unable to use git blame as there is no direct commit history, I am trying to figure a work around. Maybe more experienced folks can suggest ways to do so?

Why does it test only a small subset of LCL controls? The name TestAll is misleading. Can you Aruna please take a look?

I took a look using git log testallform_include.inc and the reason why is shown in line #6 given below..

Code: Text  [Select][+][-]
  1. commit 96ba7a6b4036f65806c2720da31331a29de63e1d
  2. Author: bart <9132501-flyingsheep@users.noreply.gitlab.com>
  3. Date:   Sat Mar 5 13:09:33 2016 +0000
  4.  
  5.     Examples: TestAll:
  6.     - make dummy procedures for all tests and call them in the menu's onclick event
  7.     - fix typo
  8.     - refactor
  9.     - cleanup
  10.    
  11.     git-svn-id: trunk@51826 -
TinyPortal © 2005-2018