Sign in Join

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

Mailing lists / lazarus / 2012-06

.gitignore removed when build cleanup

13 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner
to Zaher Dirkey
Show quoted text 5 lines
Hi, When i make "Cleanup build", it remove my git file .gitignore, i think Lazarus must exclude doted.files. Can i report it as bug?

No.
But you can create a patch to define exclusions. For example masks starting with minus.

I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
> When i make "Cleanup build", it remove my git file .gitignore, i think > Lazarus must exclude doted.files. > Can i report it as bug? No.

[...I haven't tested...]

Does Lazarus remove the .SVN directory too? If not, then why is git repository files treated like a second class citizen and subversion not?

@Zaher
If the problem only pertains to files, and not directories like the .SVN or .GIT directories, then maybe move your ignore masks to the .git/info/exclude file instead.

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 10 lines
On 17 June 2012 09:24, Mattias Gaertner wrote: >> When i make "Cleanup build", it remove my git file .gitignore, i think >> Lazarus must exclude doted.files. >> Can i report it as bug? > > No. [...I haven't tested...] Does Lazarus remove the .SVN directory too?

Yes.

There is normally no reason to store the output directory in svn.

Mattias

Reply by email

Zaher Dirkey
to Graeme Geldenhuys: [...I haven't tested...] Does Lazarus remove the .SVN directory too? If not, then why is…
Graeme Geldenhuys wrote 13 lines
On 17 June 2012 09:24, Mattias Gaertner wrote: >> When i make "Cleanup build", it remove my git file .gitignore, i think >> Lazarus must exclude doted.files. >> Can i report it as bug? > > No. [...I haven't tested...] Does Lazarus remove the .SVN directory too? If not, then why is git repository files treated like a second class citizen and subversion not?

Ignore files stored in SVN database, so no . files for svn in ingored files

Show quoted text 6 lines
@Zaher If the problem only pertains to files, and not directories like the .SVN or .GIT directories, then maybe move your ignore masks to the .git/info/exclude file instead.

Thank, it is good idea :D

Best Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120617/94a6559e/attachment-0001.html>

Reply by email

Bernd
to Zaher Dirkey

I don't understand the problem. Does Lazarus arbitrarily delete .files with . in the *project* directory when cleaning up? Or are we talking about it removing the entire lib folder with everyting within it?

Reply by email

Mattias Gaertner
to Bernd
I don't understand the problem. Does Lazarus arbitrarily delete .files with . in the *project* directory when cleaning up? Or are we talking about it removing the entire lib folder with everyting within it?

It's about the manual clean up in "Run / Clean up Build files". The default mask is "*" so it deletes all files in the output directory.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
It's about the manual clean up in "Run / Clean up Build files". The default mask is "*" so it deletes all files in the output directory.

In that case the only true solution for Git users would be to add your ignore masks in <project_root_dir>/.git/info/exclude file. Like Zaher, I also used to use various .gitignore files in such cases - so build files don't appear in 'git gui' etc output. Applying the new solution [using the 'exclude' file] still gives the desired result, and that location is not touched by Lazarus.

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

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Sun, 17 Jun 2012 16:02:26 +0100 Yes. There is normally no reason to store the output…
Mattias Gaertner wrote
There is normally no reason to store the output directory in svn.

I store a '.gitignore' file inside those directories, and that is version controlled by Git. The benefit of this was that a new checkout via git would recreate the complete directory structure, and those new cloned repositories would have the correct ignore files in place. The recreated directory structure is also an important point, because I don't always compile my projects with Lazarus (which creates output directories on demand). eg: compiling my projects directly with FPC, FPC doesn't auto-create output directories.

My alternative solution (the .git/info/exclude file) is a private ignore mask, and is not version controlled by git. So only I benefit from it. Other users of the project will have to edit there own files after a checkout.

So the only 100% true solution would be to implement a "ignore files mask" in Lazarus IDE. Now the next question is, where would this "ignore files mask" settings be stored. For it to work in a project with multiple developers, it will have to be stored as part of the project settings (*.lpi file), and not as a user customised setting.

Or.... just don't use the "clean up build files" feature in Lazarus and save yourself a lot of hassle. ;-)

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 7 lines
On 17 June 2012 16:09, Mattias Gaertner wrote: > > There is normally no reason to store the output directory in svn. I store a '.gitignore' file inside those directories, and that is version controlled by Git.

The output directories usually have the form lib/cpu-os/ Is it possible to put a .gitignore in "lib"?

Show quoted text 7 lines
The benefit of this was that a new checkout via git would recreate the complete directory structure, and those new cloned repositories would have the correct ignore files in place. The recreated directory structure is also an important point, because I don't always compile my projects with Lazarus (which creates output directories on demand). eg: compiling my projects directly with FPC, FPC doesn't auto-create output directories.

Then you have to add the command line params manually. I guess you don't create them every time manually. Probably you are lazy like me and store them in some file or doc and use copy and paste. Then it is easy to prepend the "mkdir -p" command too.

Apropos not building with laz:
fpmake creates the output directory too.

[...]

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner

Hi,

Mattias Gaertner wrote
The output directories usually have the form lib/cpu-os/ Is it possible to put a .gitignore in "lib"?

Yes I can, but recreating the directory structure is still going to be a problem.

Then you have to add the command line params manually. I guess you don't create them every time manually. Probably you are lazy like me

No, I use a config file that contains the compiler parameters as follows...

fpc @settings.cfg myproject.lpr

Before Lazarus IDE had build mode support, I used the same config file idea to differentiate between debug builds and release builds. Each build mode had its own *.cfg file.

fpmake creates the output directory too.

Last time I used fpmake (a year ago), there was still many issues with it. I guess now that FPC is actually starting to use it themselves, maybe I should take another
Regards,
? - Graeme -

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

Reply by email

Zaher Dirkey
to Bernd
Bernd wrote 14 lines
how about something like this: .gitignore src/ src/foo.lpi src/foo.lpr bin/README.txt bin/other.versioned.stuff and in the project settings set the target file name (-o) to ../bin/myprogram

I put .gitingore in a folder to add/commit the that empty folder, because git not add empty Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120618/dc1b4ff6/attachment.html>

Reply by email