From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
Junio C Hamano <junkio@cox.net>,
"Randal L. Schwartz" <merlyn@stonehenge.com>,
Jakub Narebski <jnareb@gmail.com>
Subject: Re: [PATCH] user-manual: Add section on ignoring files
Date: Wed, 16 May 2007 09:38:57 +0200 [thread overview]
Message-ID: <200705160938.57608.johan@herland.net> (raw)
In-Reply-To: <20070516033032.GA20022@fieldses.org>
On Wednesday 16 May 2007, J. Bruce Fields wrote:
> On Wed, May 16, 2007 at 02:31:40AM +0200, Johan Herland wrote:
> > The todo list at the end of the user manual says that something must be
> > said about .gitignore. Also, there seems to be a lack of documentation
> > on how to choose between the various types of ignore files (.gitignore
> > vs. .git/info/exclude, etc.).
>
> Thanks for doing this!
>
> > --- a/Documentation/user-manual.txt
> > +++ b/Documentation/user-manual.txt
> > @@ -1188,6 +1188,75 @@ description. Tools that turn commits into email, for example, use
> > the first line on the Subject line and the rest of the commit in the
> > body.
> >
> > +[[ignoring-files]]
> > +Ignoring files
> > +--------------
>
> This looks like a sensible place to add it....
>
> > +A project will often generate files that you do 'not' want to track with git.
> > +This typically includes files generated by a build process or temporary
> > +backup files made by your editor. Of course, 'not' tracking files with git
> > +is just a matter of 'not' calling "`git add`" on them. But it quickly becomes
> > +annoying to have these untracked files lying around; e.g. they make
> > +"`git add .`" and "`git commit -a`" practically useless, and they keep
> > +showing up in the output of "`git status`", etc.
>
> It might be cute to introduce this with an example; "suppose you just
> imported a new project into git, build it, and run git-status. The
> output you get might look like:..." etc.
This would of course work as well, but I was trying to keep it as short as possible.
Ignoring files isn't a big part of what git is really about, so I'd like for this
section to stay as short and to-the-point as possible.
> > +Git therefore provides "exclude patterns" for telling git which files to
> > +actively ignore. Exclude patterns are thoroughly explained in the
> > +"Exclude Patterns" section of the gitlink:git-ls-files[1] manual page,
> > +but the heart of the concept is simply a list of files which git should
> > +ignore. Entries in the list may contain globs to specify multiple files,
> > +or may be prefixed by "`!`" to explicitly include (un-ignore) a previously
> > +excluded (ignored) file (i.e. later exclude patterns override earlier ones).
>
> It might simplify things just to start off by talking about .gitignore
> exclusively, rather than talking about exclude patterns in general;
> something like: "Git therefore allows you to provide .gitignore files,
> which consist of a list of entries, processed in order from top to
> bottom, each telling git about some files to ignore...."
>
> Then introduce the other options at the end: "for exclude patterns that
> you want to be used just by one repo, or by a group of repos on one
> computer, you can use .git/info/exclude or core.excludesfile." In fact,
> I'd be *almost* tempted just to leave the discussion of these local
> exclude files at that, and refer elsewhere for the details. Do people
> really find them useful?
Sounds like a good idea. Feel free to rewrite. But the original impetus for
the section was Randal's question on the difference between the various
ignore files, so make sure that's still in there somewhere.
> But those are nits. I'll happily take it as is and then revise
> later....
Thanks :)
Have fun!
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
prev parent reply other threads:[~2007-05-16 7:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-15 22:47 [PATCH] user-manual: Add section on ignoring files Johan Herland
2007-05-15 23:24 ` Jakub Narebski
2007-05-15 23:31 ` Johan Herland
2007-05-15 23:30 ` Junio C Hamano
2007-05-16 0:31 ` Johan Herland
2007-05-16 0:42 ` Junio C Hamano
2007-05-16 7:28 ` Johan Herland
2007-05-16 3:30 ` J. Bruce Fields
2007-05-16 7:38 ` Johan Herland [this message]
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=200705160938.57608.johan@herland.net \
--to=johan@herland.net \
--cc=bfields@fieldses.org \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=junkio@cox.net \
--cc=merlyn@stonehenge.com \
/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;
as well as URLs for NNTP newsgroup(s).