Re: [PATCH v2 1/1] git-clean.txt: clarify ignore pattern files
- Date: Thu, 07 Mar 2019 15:56:57 +0900
- From: Junio C Hamano <gitster@xxxxxxxxx>
- Subject: Re: [PATCH v2 1/1] git-clean.txt: clarify ignore pattern files
Denton Liu <liu.denton@xxxxxxxxx> writes:
> -e <pattern>::
> - In addition to those found in .gitignore (per directory) and
> - $GIT_DIR/info/exclude, also consider these patterns to be in the
> - set of the ignore rules in effect.
> + Use the exclude pattern in addition to those found in
> + `.gitignore` and similar files (see linkgit:gitignore).
> - Don't use the standard ignore rules read from .gitignore (per
> - directory) and $GIT_DIR/info/exclude, but do still use the ignore
> + Don't use the standard ignore rules read from `.gitignore` and
> + similar files (see linkgit:gitignore), but do still use the ignore
> rules given with `-e` options. This allows removing all untracked
> files, including build products. This can be used (possibly in
> conjunction with 'git reset') to create a pristine
I do agree with the direction to abandon the attempt to be
exhaustive, which has failed us and will fail. I am not sure if
".gitignore and similar files" is a good phrasing, though.
Don't use the standard ignored rules (see linkgit:gitignore),
but use the ignore rules given with `-e` options from the
perhaps? I dunno.
A related tangent.
"git add --help" also has this bit.
The optional configuration variable `core.excludesFile` indicates a path to a
file containing patterns of file names to exclude from git-add, similar to
$GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to
those in info/exclude. See linkgit:gitignore.
I do not think the omission of per-directory .gitignore from this
description is because the description predates the feature (which
is the reason why "git clean" doc does not mention, by the way), but
this probably needs a simliar treatment.
Or perhaps this configuration section should just be removed (or
moved to gitignore(5)), as it is not specific to "git add".