Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Ignore #24

Open
throughnothing opened this issue Mar 2, 2012 · 3 comments
Open

Git Ignore #24

throughnothing opened this issue Mar 2, 2012 · 3 comments

Comments

@throughnothing
Copy link

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.

@jquelin
Copy link
Owner

jquelin commented Mar 3, 2012

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}}*

@madsen
Copy link
Contributor

madsen commented Mar 4, 2012

.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.

@throughnothing
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants