On 18 April 2014 10:36, <a...@bellandwhistle.net> wrote:
> "Like the $GIT_DIR/info/exclude file, gitignore files specify intentionally
> untracked files that Git should ignore. The difference is that files matched
> by a pattern in a gitignore file will be untracked for all users of the
As a data point, I have seen people add ".gitignore" to their
.gitignore file, as they don't want to share the file.
This seems like a misuse of the functionality, as
$GIT_DIR/info/exclude is a better choice for the same use case, but
I'm not sure why the misuse is there.
My guess is that users aren't aware of excludes, whilst gitignore is
placed front of mind living at the root of many repositories.
Education will help here, but is there any way to make the 'correct'
way more intuitive?
It would be possible to check for this antipattern during normal use
and provide a hint to the user, but that is probably too heavy handed
and might annoy people with a legitimate use case. For that matter, if
the gitignore file is easier to use for the 'private ignore' use case
we have a bigger problem and shouldn't dictate to users what to use.
As to the documentation, it is already quite comprehensive. All
exclusion methods are listed, and the reasons for why to use them are
well laid out. The introduction does specifically mention 'gitignore'
files, but that seems to be due to all the ignore files
($HOME/.config/git/ignore, $GIT_DIR/info/exclude, .gitignore) being
classified as 'gitignore' files.
So some possible improvements. We could replace 'gitignore' with 'git
ignore' in instances where we are referencing all forms of the ignore
file, not just the .gitignore file.
"Git ignore files specify intentionally untracked files that Git should ignore."
We could reference the multiple ignore locations earlier, for people
who don't read past the first paragraph of to documentation.
"Git ignore files specify intentionally untracked files that Git
should ignore. A git ignore file can be specified for all local
repositories, a specific local repository, or shared with other users
of a repository. Files already tracked by Git are not affected; see
the NOTES below for details."
Finally, it's a little confusing that one of the files is called 'exclude'.
It would be great to rename it to 'ignore'; $GIT_DIR/info/exclude ->
$GIT_DIR/info/ignore. Is there any reason this shouldn't be done?
I haven't checked how extensive a change this would need be, but it
would make the usage much more consistent. The only reference I have
found to this file is at http://markmail.org/message/l7shxticxo3kzdpn
from Junio in a discussion around an RFD for ignore rules.
I think these three changes together would make the intended usage
more obvious to both new and old users, though each change could stand
on its own as well.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html