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

Re: gitignore vs. exclude vs assume-unchanged?

From
Aalex@bellandwhistle.net <alex@bellandwhistle.net>
Date
Apr 25, 2014, 23:09 UTC
Message-ID
<35592507346991e5c286144fcbd04097@bellandwhistle.net>
In-Reply-To
<xmqqtx9l5jxn.fsf@gitster.dls.corp.google.com>
> 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. 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.

> ... 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.

Yes, the 'gitignore' versus '.gitignore' distinction is hopelessly subtle. It is very easy for a newcomer to think these are exactly the same thing. I certainly did.

Show 5 quoted lines
> 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?

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".

Thanks, Alex

Previous: Junio C HamanoNext: luc.linux@mailoo.org
Message 8 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.