threads / discuss / 62695

/etc/git/

Subject: /etc/git/

## tl;dr

5 messages between Dec 26, 2024 and Dec 31, 2024.

replies: 4people: 2as markdown or json

Alejandro Colomar· Dec 26, 2024, 17:10 UTC · lore
Hi!

I'd like to have all system-wide configuration under a single directory. What do you think of adding /etc/git/, and reading a 'config', 'ignore', and 'attributes' files from there? /etc/gitconfig and /etc/gitattributes isn't very clean.

Have a lovely night! Alex

-- 
<https://www.alejandro-colomar.es/>
rsbecker@nexbridge.com· Dec 26, 2024, 17:20 UTC · re: Alejandro Colomar · lore

RE: /etc/git/

On December 26, 2024 12:11 PM, Alejandro Colomar wrote:
>I'd like to have all system-wide configuration under a single directory.
>What do you think of adding /etc/git/, and reading a 'config', 'ignore', and
>'attributes' files from there?  /etc/gitconfig and /etc/gitattributes isn't very clean.

Have a look at GIT_CONFIG_SYSTEM documented in https://git-scm.com/docs/git and let us know whether this might work for you.

--Randall
Alejandro Colomar· Dec 26, 2024, 20:41 UTC · re: rsbecker@nexbridge.com · lore

Re: /etc/git/

Hi Randall,
On Thu, Dec 26, 2024 at 12:20:34PM -0500, rsbecker@nexbridge.com wrote:
Show 7 quoted lines
> On December 26, 2024 12:11 PM, Alejandro Colomar wrote:
> >I'd like to have all system-wide configuration under a single directory.
> >What do you think of adding /etc/git/, and reading a 'config', 'ignore', and
> >'attributes' files from there?  /etc/gitconfig and /etc/gitattributes isn't very clean.
> 
> Have a look at GIT_CONFIG_SYSTEM documented in https://git-scm.com/docs/git
> and let us know whether this might work for you.

That's a workaround, which would involve appending some line in /etc/bash.bashrc or somewhere similar. In the end, the git configuration would be spread and unorganized, just in a different way. In fact, I think I prefer having several /etc/gitsomething files than having a dir and then having to clutter the system-wide bashrc.

So, I prefer /etc/gitconfig over /etc/git/config + GIT_CONFIG_SYSTEM, but I prefer /etc/git/config over both.

Have a lovely night! Alex

> 
> --Randall
> 
-- 
<https://www.alejandro-colomar.es/>
rsbecker@nexbridge.com· Dec 26, 2024, 20:46 UTC · re: Alejandro Colomar · lore

RE: /etc/git/

On December 26, 2024 3:42 PM, Alejandro Colomar wrote:
Show 18 quoted lines
>On Thu, Dec 26, 2024 at 12:20:34PM -0500, rsbecker@nexbridge.com wrote:
>> On December 26, 2024 12:11 PM, Alejandro Colomar wrote:
>> >I'd like to have all system-wide configuration under a single directory.
>> >What do you think of adding /etc/git/, and reading a 'config',
>> >'ignore', and 'attributes' files from there?  /etc/gitconfig and /etc/gitattributes
>isn't very clean.
>>
>> Have a look at GIT_CONFIG_SYSTEM documented in
>> https://git-scm.com/docs/git and let us know whether this might work for you.
>
>That's a workaround, which would involve appending some line in /etc/bash.bashrc
>or somewhere similar.  In the end, the git configuration would be spread and
>unorganized, just in a different way.
>In fact, I think I prefer having several /etc/gitsomething files than having a dir and
>then having to clutter the system-wide bashrc.
>
>So, I prefer /etc/gitconfig over /etc/git/config + GIT_CONFIG_SYSTEM, but I prefer
>/etc/git/config over both.

One possible thing is to have your central git config, wherever you put it, use [include] sections. These allow flexibility to pull in relevant configurations depending on the qualification of the include. Maybe something else to think about.

An enhancement like this is high impact and would touch a fair amount of code. It is not Just for --system, but --global and --local also. The semantic of specifying and resolving Configurations and attributes (inherited in repositories) are significant.

--Randall
Alejandro Colomar· Dec 31, 2024, 21:03 UTC · re: rsbecker@nexbridge.com · lore

Re: /etc/git/

Hi Randall,
On Thu, Dec 26, 2024 at 03:46:29PM -0500, rsbecker@nexbridge.com wrote:
Show 6 quoted lines
> >So, I prefer /etc/gitconfig over /etc/git/config + GIT_CONFIG_SYSTEM, but I prefer
> >/etc/git/config over both.
> 
> One possible thing is to have your central git config, wherever you put it, use [include] sections.
> These allow flexibility to pull in relevant configurations depending on the qualification
> of the include. Maybe something else to think about.

I had forgotten about core.attributesFile and core.excludesFile. I now have /etc/gitconfig, and then everything else under /etc/git/, and have

[core]
	attributesFile = /etc/git/attributes
	excludesFile = /etc/git/ignore
This seems quite decent.

Have a lovely new year! Alex

Show 9 quoted lines
> 
> An enhancement like this is high impact and would touch a fair amount of code. It is not
> Just for --system, but --global and --local also. The semantic of specifying and resolving 
> Configurations and attributes (inherited in repositories) are significant.
> 
> --Randall
> 
> 
> 
-- 
<https://www.alejandro-colomar.es/>

← back to recent threads