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

Re: Lack of system-level excludesFile

From
Sparr <sparr0@gmail.com>
Date
Oct 3, 2024, 17:45 UTC
Message-ID
<CANp3UNB_4_mcK4CV3WF7p3AWaLTK6qb13tS3imDBGU5XBOzG0A@mail.gmail.com>
In-Reply-To
<xmqq34ldjiup.fsf@gitster.g>
On Thu, Oct 3, 2024 at 11:40 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> If you take the reasoning one step further [*], it may make sense to
> have a list of ignored patterns that applies to everybody on the
> system, regardless of who they are, what editor they use, and what
> project they work on.
>
> Having said all that, wouldn't that be already supported?  What
> prevents you to set core.excludesFile in /etc/gitconfig?

I tried to cover this in my original email. You can set that and it will apply to all users who haven't set up their own core.excludesFile. But this has two problems.

1. It will disable the default behavior of a user being able to put
their own ignore rules in $XDG_CONFIG_HOME/git/ignore which I suspect
more than a few current git users rely on.
2. As soon as a user sets core.excludesFile in their account-level
config, to be able to create account-level ignore rules, such as based
on their desktop environment or editor or all the other stuff people
typically want to put in their excludesFile, they will lose the
functionality provided by the system level ignore file.
Show 5 quoted lines
>  * This may be a larger step though, as the set of projects that a
>    single user works on is much narrower than the set of projects
>    that any users on the same system work on (hence the types of
>    files that are potentially tracked by these projects are much
>    wider for system-wide exclude list to take into consideration).

I agree that these two scopes are very different, and that's why I want to be able to set them both! ~Every user on a macOS computer (which might be a few on a family desktop, and was dozens last time I managed a macOS server) wants to ignore `.DS_Store`, `.AppleDouble`, and `.LSOverride` in ~every repo they work on.

Show 7 quoted lines
>    On the other hand, are massively multi-user systems (like the
>    time-shared system studends 30-years ago used at Universities)
>    still a thing?  If not, then having a pattern that may hurt
>    people with other preference on the system-wide list would not be
>    a problem at all---after all, you have the entire system without
>    anybody else.  But at that point, system-wide and per-user would
>    become the same thing ;-)

That's not quite true even on single-user computers. It's pretty common that one user might run things as their user account or as root. It's less common but not unheard of for one user to have multiple accounts (e.g. one for work and one for not work) or for non-user accounts to perform git operations.

Previous: Junio C HamanoNext: Jeff King
Message 4 of 6 in “Lack of system-level excludesFile”
  1. SparrOct 3, 2024
  2. brian m. carlsonOct 3, 2024
  3. Junio C HamanoOct 3, 2024
  4. SparrOct 3, 2024
  5. Jeff KingOct 3, 2024
  6. Junio C HamanoOct 3, 2024

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.