dist-zilla-plugin-git
dist-zilla-plugin-git copied to clipboard
Git Ignore
I'd like to enable this plugin to create a default .gitignore file that will ignore things like My-Package-* so that it can auto-ignore these build directories and tarballs created by dzil.
It seems like more people would be having an issue with these directories/files when using git::check ?
I have 2 ideas for how to do it and was wondering which you would prefer/think is best.
One is just to add ignore
config options to git::init, and have it default to My-Package-* with an override being possible with an empty ignore
line.
The other is to make a new plugin Git::Ignore, that accepts the same ignore lines with the same defaults, and presumably you would include this before Git::Init.
Thoughts/suggestions? Thanks.
bug already opened here: https://rt.cpan.org/Ticket/Display.html?id=59647
my initial position would be to just add a .gitignore in .dzil/profiles/default/skel but since you guys keep requesting, i'm ok to merge what you'll come up with. i definitely do not think adding a new git::ignore plugin would be the right way, though - just enhance git::init.
so here's the deal - submit a pull request implementing it, and i'll merge. note that some other files need to be skipped:
# avoid version control files
.git
# avoid temp and backup files
*~
*#
*.bak
*.old
*.rej
*.swp
*.tmp
# avoid utility files
.build
_build
# avoid archives of this distribution
/{{$dist->name}}*
.git
is unnecessary; Git is smart enough to ignore its own directory. (There'd be horrible recursive problems if it wasn't.)
Also, my position is that editor backup files (like *~
) belong in your global core.excludesfile
(e.g. ~/.gitexclude
). Not everybody uses the same editor, and .gitignore
shouldn't have to list every backup file created by every text editor in existence.
.gitignore
is for things that everyone who uses the project is likely to encounter. So .build
, /{{$dist->name}}*
, etc. make sense.
But it needs at least a config option to turn it off, because I (and probably many others) already have a suitable skel/.gitignore
set up, and don't want this to conflict. In fact, it should probably be disabled by default.
After thinking about this more, and envisioning what the arguments will be about what the default .ignores should be etc, and the fact that it isn't too difficult for people to get full customization via their profile skeleton, I think I'm going to stick with that route for now. @jquelin I think I maybe agree with your initial position now, that is probably the best and most unix-like approach.