git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitignore vs. exclude vs assume-unchanged?

From
Lluc.linux@mailoo.org <luc.linux@mailoo.org>
Date
Apr 26, 2014, 07:52 UTC
Message-ID
<20140426075245.GA4123@luc-arch>
In-Reply-To
<35592507346991e5c286144fcbd04097@bellandwhistle.net>
On Fri, Apr 25, 2014 at 04:09:47PM -0700, alex@bellandwhistle.net wrote:
Show 6 quoted lines
> >Andrew Ardill <andrew.ardill@gmail.com> writes:
> >
> >As a data point, I have seen people add ".gitignore" to their
> >.gitignore file, as they don't want to share the file.
> 
> Right, I've seen that too.

That something I am actually doing in my projects, because I didn't know they were other way to exclude files like .gitignore.

Show 8 quoted lines
> It confused the heck out of me. It only lends
> credence to my point about the docs. Those users want the functionality of a
> pattern in '$GIT_DIR/info/exclude', but haven't been able to figure it out
> easily enough. They've just heard about .gitignore, so they're using that.
> Yes, it's all there in the docs if you read it several times, and you
> already know what you're looking at, but not in a terribly accessible, best
> practices, "advice from a smart friend who's been through it all already"
> kind of way.
 Well documentation can be useful when you know what you're looking for,
 but I won't go read it just for discovering new features I didn't know.
Show 13 quoted lines
> Well, yes: semantics. Since they do slightly different things, they should
> have different names. It makes reference and teaching much easier. In fact,
> if a renaming were to occur, I would actually prefer even better semantics:
> 
>     .gitignore -> .shared-ignore
> 
>     $GIT_DIR/info/exclude -> $GIT_DIR/info/local-ignore
> 
> These suggested names could perhaps be improved on. But if anything, the
> names need to be more different, not less. Users should be able to instantly
> know what a speaker is talking about without having to doublecheck and ask
> if by "git-ignore", the speaker really meant "git ignore" or
> "dot-gitignore".

I agree with a new name for .gitignore. A name like shared-ignore would make explicite the fact it is shared, and then the user would look for another way to locally exclude files. This would be a good approach, but changing it won't be easy as most people already use .gitignore.

Would it be acceptable to have git display a warning when it detects that .gitignore is excluding itself, with eventually a link to the documentation or the path to $GIT_DIR/info/exclude ?

Previous: alex@bellandwhistle.netNext: Zé
Message 9 of 10 in “gitignore vs. exclude vs assume-unchanged?”
  1. alex@bellandwhistle.netApr 16, 2014
  2. Junio C HamanoApr 16, 2014
  3. alex@bellandwhistle.netApr 16, 2014
  4. Jonathan NiederApr 16, 2014
  5. alex@bellandwhistle.netApr 18, 2014
  6. Andrew ArdillApr 22, 2014
  7. Junio C HamanoApr 22, 2014
  8. alex@bellandwhistle.netApr 25, 2014
  9. luc.linux@mailoo.orgApr 26, 2014
  10. ZéApr 26, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.