# Git to use XDG Base Directory Standard

4 messages from 2012-08-22 to 2012-08-23. Participants: Lanoxx, Carlos Martín Nieto, David Aguilar.
Thread: https://gitlist.dev/t/31324

## Lanoxx, 2012-08-22 21:33

Subject: Git to use XDG Base Directory Standard
Message-ID: <50355044.7040201@gmx.net>
URL: https://gitlist.dev/e/50355044.7040201%40gmx.net

```
Hi,

Git and Gitk are currently using the ~/.gitconfig and ~/.gitk files in 
the $HOME directory. It would be nice to use the XDG Base Directory 
standard for the location instead, see [1] and [2]. Are there any plans 
regarding this standard?

Best Regards
Lanoxx

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
[2] https://live.gnome.org/GnomeGoals/XDGConfigFolders

```

## Carlos Martín Nieto, 2012-08-22 21:44

Subject: Re: Git to use XDG Base Directory Standard
Message-ID: <871uiy8uuw.fsf@centaur.cmartin.tk>
URL: https://gitlist.dev/e/871uiy8uuw.fsf%40centaur.cmartin.tk
In-Reply-To: <50355044.7040201@gmx.net>

```
Lanoxx <lanoxx@gmx.net> writes:

> Hi,
>
> Git and Gitk are currently using the ~/.gitconfig and ~/.gitk files in
> the $HOME directory. It would be nice to use the XDG Base Directory
> standard for the location instead, see [1] and [2]. Are there any
> plans regarding this standard?

Git does this starting at 1.7.12. See the release notes, e.g. at
https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.12.txt#L18-23

   cmn

```

## David Aguilar, 2012-08-23 02:57

Subject: Re: Git to use XDG Base Directory Standard
Message-ID: <CAJDDKr6Jh0c9W1coQLOqrQKW-X7CCF9t_Nr2pW-7ivh0Ae9xrw@mail.gmail.com>
URL: https://gitlist.dev/e/CAJDDKr6Jh0c9W1coQLOqrQKW-X7CCF9t_Nr2pW-7ivh0Ae9xrw%40mail.gmail.com
In-Reply-To: <871uiy8uuw.fsf@centaur.cmartin.tk>

```
On Wed, Aug 22, 2012 at 2:44 PM, Carlos Martín Nieto <cmn@elego.de> wrote:
> Lanoxx <lanoxx@gmx.net> writes:
>
>> Hi,
>>
>> Git and Gitk are currently using the ~/.gitconfig and ~/.gitk files in
>> the $HOME directory. It would be nice to use the XDG Base Directory
>> standard for the location instead, see [1] and [2]. Are there any
>> plans regarding this standard?
>
> Git does this starting at 1.7.12. See the release notes, e.g. at
> https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.12.txt#L18-23
>
>    cmn

I do not recall whether gitk learned about it (I don't think so).

Like all big sweeping changes, these were done in a
backwards-compatible way that will allow users to switch over when
they are ready.  If you are interested in attacking this from the gitk
angle then you will want to follow a similar strategy.
-- 
David

```

## Lanoxx, 2012-08-23 07:22

Subject: Re: Git to use XDG Base Directory Standard
Message-ID: <5035DA3C.4030404@gmx.net>
URL: https://gitlist.dev/e/5035DA3C.4030404%40gmx.net
In-Reply-To: <CAJDDKr6Jh0c9W1coQLOqrQKW-X7CCF9t_Nr2pW-7ivh0Ae9xrw@mail.gmail.com>

```

On 23/08/12 04:57, David Aguilar wrote:
> On Wed, Aug 22, 2012 at 2:44 PM, Carlos Martín Nieto <cmn@elego.de> wrote:
>> Lanoxx <lanoxx@gmx.net> writes:
>>
>>> Hi,
>>>
>>> Git and Gitk are currently using the ~/.gitconfig and ~/.gitk files in
>>> the $HOME directory. It would be nice to use the XDG Base Directory
>>> standard for the location instead, see [1] and [2]. Are there any
>>> plans regarding this standard?
>> Git does this starting at 1.7.12. See the release notes, e.g. at
>> https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.12.txt#L18-23
>>
>>     cmn
> I do not recall whether gitk learned about it (I don't think so).
>
> Like all big sweeping changes, these were done in a
> backwards-compatible way that will allow users to switch over when
> they are ready.  If you are interested in attacking this from the gitk
> angle then you will want to follow a similar strategy.

I just checked it, the code is in 
https://github.com/git/git/blob/master/gitk-git/gitk:2710 and following. 
Currently it still saves it to ~/.gitk-new and then renames it to ~/.gitk

Unfortunately I do not know Tcl/Tk so I can't provide a patch. But if 
someone could provide a patch that would be really nice.

```
