Bug 20267

Summary: Add basic .gitignore
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Architecture, internals, and plumbingAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, maksim.sen, mtj, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 20267: Add basic .gitignore
Bug 20267: Add basic .gitignore
Hi Maksim,
Bug 20267: Add basic .gitignore
Bug 20267: Add more ignores
Bug 20267: .gitignore do not need to be mapped in Makefile

Description Julian Maurice 2018-02-22 09:51:16 UTC
Ignore the files generated by ExtUtils::MakeMaker
Comment 1 Julian Maurice 2018-02-22 09:52:22 UTC
Created attachment 72067 [details] [review]
Bug 20267: Add basic .gitignore

Ignore files generated by ExtUtils::MakeMaker
Comment 2 Maksim Sen 2018-02-23 20:12:05 UTC
Hey Julian,

Can you put a test plan for the patch? (even if it's a very simple one)

Thanks a bunch,

Maksim Sen
Comment 3 Julian Maurice 2018-02-26 08:18:01 UTC
Hi Maksim,

here's a possible test plan:

1. Run `perl Makefile.PL` followed by `make` to generate the files MYMETA.json, MYMETA.yml, Makefile, pm_to_blib and directory blib/
2. See that those files appear in the output of `git status`
3. Apply patch
4. Run `git status` again and see that they are no longer displayed.
Comment 4 Mark Tompsett 2018-02-26 13:37:08 UTC
Created attachment 72203 [details] [review]
Bug 20267: Add basic .gitignore

Ignore files generated by ExtUtils::MakeMaker

NOTE: Limited scope does not affect files created
      by translation utilities

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 5 Maksim Sen 2018-03-02 21:41:08 UTC
Created attachment 72389 [details]
Hi Maksim,

here's a possible test plan:

1. Run `perl Makefile.PL` followed by `make` to generate the files MYMETA.json, MYMETA.yml, Makefile, pm_to_blib and directory blib/
2. See that those files appear in the output of `git status`
3. Apply patch
4. Run `git status` again and see that they are no longer displayed.

Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
Comment 6 Maksim Sen 2018-03-02 21:42:12 UTC
Comment on attachment 72389 [details]
Hi Maksim,

>From 2b8905cb588a594d54843ec5ffeef578d92c8d3c Mon Sep 17 00:00:00 2001
>From: Julian Maurice <julian.maurice@biblibre.com>
>Date: Thu, 22 Feb 2018 10:51:27 +0100
>Subject: [PATCH] Bug 20267: Add basic .gitignore
>
>Ignore files generated by ExtUtils::MakeMaker
>
>NOTE: Limited scope does not affect files created
>      by translation utilities
>
>Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
>Signed-off-by: Maksim Sen <maksim.sen@inlibro.com>
>---
> .gitignore | 4 ++++
> 1 file changed, 4 insertions(+)
> create mode 100644 .gitignore
>
>diff --git a/.gitignore b/.gitignore
>new file mode 100644
>index 0000000..7befa23
>--- /dev/null
>+++ b/.gitignore
>@@ -0,0 +1,4 @@
>+/MYMETA.*
>+/blib/
>+/Makefile
>+/pm_to_blib
>-- 
>2.7.4
Comment 7 Maksim Sen 2018-03-02 21:44:11 UTC
Ignore comment 6,

I accidentally submitted a patch when I tried to sign off your patch.

Sorry about that.
Comment 8 Tomás Cohen Arazi (tcohen) 2018-03-09 13:15:58 UTC
Created attachment 72590 [details] [review]
Bug 20267: Add basic .gitignore

Ignore files generated by ExtUtils::MakeMaker

NOTE: Limited scope does not affect files created
      by translation utilities

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 9 Tomás Cohen Arazi (tcohen) 2018-03-09 13:16:07 UTC
Created attachment 72591 [details] [review]
Bug 20267: Add more ignores

This patch adds more known files that should be ignored:
- Devel::Cover output
- NTYProf output
- Known used IDE files

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Julian Maurice 2018-03-09 13:30:38 UTC
I'm not sure the IDE's stuff should go in there. It's not related to Koha and is different for everyone (I use Vim, some use Emacs and some strange people even use Eclipse :))
I'd rather keep these "personal settings" in $HOME/.config/git/ignore or .git/info/exclude
Comment 11 Tomás Cohen Arazi (tcohen) 2018-03-09 14:00:40 UTC
(In reply to Julian Maurice from comment #10)
> I'm not sure the IDE's stuff should go in there. It's not related to Koha
> and is different for everyone (I use Vim, some use Emacs and some strange
> people even use Eclipse :))
> I'd rather keep these "personal settings" in $HOME/.config/git/ignore or
> .git/info/exclude

We could add those too :-D

Feel free to remove them if you wish.
Comment 12 Julian Maurice 2018-03-09 15:15:09 UTC
(In reply to Tomás Cohen Arazi from comment #11)
> (In reply to Julian Maurice from comment #10)
> > I'm not sure the IDE's stuff should go in there. It's not related to Koha
> > and is different for everyone (I use Vim, some use Emacs and some strange
> > people even use Eclipse :))
> > I'd rather keep these "personal settings" in $HOME/.config/git/ignore or
> > .git/info/exclude
> 
> We could add those too :-D
I don't need to, Vim temporary files are already ignored by my global git config

> Feel free to remove them if you wish.
I won't remove them (it won't affect me after all) and I'll let RM have the final word.

But let me try to convince you :)
- If anyone adds their personal preferences to this file, it can quickly become bloated (for instance I also use ctags, so I choose to ignore /.ctags and /TAGS, and I also have .proverc and .prove)
- If you add these preferences to $HOME/.config/git/ignore instead, the rules work across all your git repositories, so you don't have add them again and again to all the repositories you are working on.
So it's good for Koha (clean .gitignore) and good for you (your custom ignore rules all in one place) :)
Comment 13 Jonathan Druart 2018-03-19 18:50:17 UTC
I agree with Julian, personal stuffs should go to .git/info/exclude and not tracked.
Comment 14 Jonathan Druart 2018-03-26 20:38:07 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 15 Jonathan Druart 2018-03-26 22:35:35 UTC
Created attachment 73295 [details] [review]
Bug 20267: .gitignore do not need to be mapped in Makefile
Comment 16 Jonathan Druart 2018-03-27 16:44:42 UTC
Last patch pushed to master.
Comment 17 Nick Clemens (kidclamp) 2018-04-23 22:42:17 UTC
Enhancement, skipping for stable