From: Junio C Hamano <gitster@pobox.com>
To: Petr Baudis <pasky@suse.cz>
Cc: Kirill Smelkov <kirr@landau.phys.spbu.ru>,
Daniel Barkalow <barkalow@iabervon.org>,
Bert Wesarg <bert.wesarg@googlemail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Default exclude rules for Git
Date: Fri, 19 Sep 2008 08:46:34 -0700 [thread overview]
Message-ID: <7v8wtouoit.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080919142211.GE10360@machine.or.cz> (Petr Baudis's message of "Fri, 19 Sep 2008 16:22:11 +0200")
Petr Baudis <pasky@suse.cz> writes:
> I think it would actually make most sense to insert some conservative
> default ignore rules to the Git's stock excludes template. (Or better,
> have a single file with default Git's exclude rules. Tools newly
> installed on the system could even add their entries there during
> installation as Git's quest on world dominations progresses.) I'd
> shamelessly propose Cogito's set of default excludes for starters:
>
> *.[ao]
> .*
> !.git*
> tags
> *~
> #*
>
> (or omit the first line if that feels too C-specific - but I think it
> should be extremely rare to find files you _want_ to track even in non-C
> projects; and I'd argue anytime that by default ignoring hidden files
> is absolutely the sanest thing to do.)
I do not see a need to change any canned template shipped with git. I
actually think it is a grave regression to add anything arbitrary, even if
one person happens to think the choice is conservative, to the set of
tool-wide ignore patterns. And here is why.
I haven't personally seen any project that wants its users to _edit_ a
file whose names end with ".a" or ".o" and track it. That does not
however mean that there can be no project and/or environment that validly
wants to track files with ".o" suffix (isn't it the case that windows shop
use ".obj" for object files and ".o" suffix do not have any particular
meaning to them?) By placing "*.o" to tool-wide ignore file, your version
of git is making life for participants in such a project harder because
they can now easily forget to add a newly created "*.o" files (status
won't show them). The tool should be extremely conservative not to
encourage such mistakes.
The best place to express such a project wide policy (e.g. "in this
project, '*.o' files will never, or rarely if ever, be tracked and we
expect our developers to appreciate not seeing them in status output by
default") is a tracked .gitignore file.
I earlier said that "*~" should not be in project-wide .gitignore file
because use of Emacs vs vi is a matter of personal taste, and Emacs
specific "*~" pattern does not belong to a project policy, just like
vim "*.swp" pattern doesn't.
But I think that reasoning is flawed. The right criteria should not be
about "use of Emacs vs vi", but about "do we in this project ever want to
track files that match *~ or *.swp as legitimate contents". If a project
expects not to have a tracked file whose name ends with ".swp", even if it
does _not_ mean to encourage use of vim over Emacs or any other editor, I
think it is fine to add such to its tracked .gitignore file for its
developer's benefit.
next prev parent reply other threads:[~2008-09-19 15:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-18 16:29 A couple of TopGit tweaks Kirill Smelkov
2008-09-18 16:29 ` [TopGit PATCH] .gitignore += vim swap files Kirill Smelkov
2008-09-18 17:24 ` martin f krafft
2008-09-18 17:30 ` Kirill Smelkov
2008-09-18 17:38 ` Bert Wesarg
2008-09-18 17:43 ` Kirill Smelkov
2008-09-18 17:56 ` Bert Wesarg
2008-09-18 17:50 ` Kirill Smelkov
2008-09-18 17:54 ` martin f krafft
2008-09-18 19:30 ` Daniel Barkalow
2008-09-19 5:06 ` Kirill Smelkov
2008-09-19 7:10 ` Bert Wesarg
2008-09-19 7:28 ` Kirill Smelkov
2008-09-19 7:51 ` Andreas Ericsson
2008-09-19 7:52 ` Kirill Smelkov
2008-09-19 10:50 ` Bert Wesarg
2008-09-19 14:22 ` Default exclude rules for Git Petr Baudis
2008-09-19 15:46 ` Junio C Hamano [this message]
2008-09-19 16:33 ` Petr Baudis
2008-09-19 16:42 ` Avery Pennarun
2008-09-18 16:29 ` [TopGit PATCH] tg help: <something>: improve readability Kirill Smelkov
2008-09-18 16:29 ` [TopGit PATCH] tg import: fix + make more robust Kirill Smelkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v8wtouoit.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=bert.wesarg@googlemail.com \
--cc=git@vger.kernel.org \
--cc=kirr@landau.phys.spbu.ru \
--cc=pasky@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox