git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Expanding Includes in .gitignore
@ 2016-10-27  0:22 Aaron Pelly
  2016-10-27  2:22 ` Stefan Beller
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Aaron Pelly @ 2016-10-27  0:22 UTC (permalink / raw)
  To: git

I want a feature. It may be a bad-idea(tm). Advice appreciated.

I want git to be able to include, in its gitignore files, sub-files of
ignores or have it understand a directory of ignore files. Or both.

The use case for this is where I did not write my own rules, but I want
to keep them updated. https://github.com/github/gitignore is a damn good
resource, but I want to pull it and include relevant bits project by
project and/or system wide. I don't want to have to update many projects
manually if that, or any other, repo changes.

A very brief look at dir.c would indicate that a recursive call from
add_excludes to itself when it parses some sort of include tag would do
it within a file. I'm sure it'd be pretty straight forward to hook into
something in dir.c to parse directories too.

I'm thinking something like ". path/to/include/file" in an ignore file,
and/or creating .gitignore.d and/or allowing $HOME/.config/git/ignore
and $GIT_DIR/info/exclude to be directories. Or some sane and consistent
mixture of these things.

In the case of a directory the plan would be to add links to files
stored/sourced elsewhere. This does pose a precedence question which I
haven't thought about yet, but probably makes it too hard for the
limited value it brings.

There is also the issue of malicious/accidental recursion which I
haven't thought about deeply either.

I would like to know the desirability/practicality/stupidity of such a
feature as I believe it is within my skillset to implement it.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-10-30 12:54 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-27  0:22 Expanding Includes in .gitignore Aaron Pelly
2016-10-27  2:22 ` Stefan Beller
2016-10-27  9:51   ` Aaron Pelly
2016-10-27  8:19 ` Alexei Lozovsky
2016-10-27 10:33   ` Aaron Pelly
2016-10-27 10:50 ` Jeff King
2016-10-27 19:48   ` Jacob Keller
2016-10-27 20:59     ` Aaron Pelly
2016-10-27 21:04     ` Jeff King
2016-10-27 21:26       ` Aaron Pelly
2016-10-27 21:39       ` Jacob Keller
2016-10-30  3:09       ` Duy Nguyen
2016-10-27 20:28   ` Aaron Pelly
2016-10-27 20:55     ` Jeff King
2016-10-27 21:07       ` Jeff King
2016-10-27 22:30         ` Aaron Pelly
2016-10-27 23:07         ` Aaron Pelly
2016-10-28  2:54         ` Junio C Hamano
2016-10-28  9:32           ` Aaron Pelly
2016-10-30  3:16             ` Duy Nguyen
2016-10-30 12:54             ` Jeff King
2016-10-27 21:55       ` Aaron Pelly
2016-10-27 22:17         ` Aaron Pelly
2016-10-28  8:10           ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).