# [PATCH] Allow default core.logallrefupdates to be overridden with template's config

8 messages from 2007-01-23 to 2007-01-24. Participants: Alex Riesen, Linus Torvalds, Uwe Kleine-König, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/6489

## Alex Riesen, 2007-01-23 15:54

Subject: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <81b0412b0701230754p3425ded4k1f37dd26500c1744@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0701230754p3425ded4k1f37dd26500c1744%40mail.gmail.com

```
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

Never found a use for the reflogs and tried to switch
them off. Didn't work - init-db rewrote it.

 builtin-init-db.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


From 713c4890ce795c840f5b4468db8689de44572ef8 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Tue, 23 Jan 2007 16:51:18 +0100
Subject: [PATCH] Allow default core.logallrefupdates to be overridden with template's config

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 builtin-init-db.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/builtin-init-db.c b/builtin-init-db.c
index 8e7540b..1865489 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -257,7 +257,9 @@ static int create_default_files(const char *git_dir, const char *template_path)
 	}
 	else {
 		git_config_set("core.bare", "false");
-		git_config_set("core.logallrefupdates", "true");
+		/* allow template config file to override the default */
+		if (log_all_ref_updates == -1)
+		    git_config_set("core.logallrefupdates", "true");
 	}
 	return reinit;
 }
-- 
1.5.0.rc2.g83d3


```

## Linus Torvalds, 2007-01-23 16:32

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <Pine.LNX.4.64.0701230827440.32200@woody.linux-foundation.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0701230827440.32200%40woody.linux-foundation.org
In-Reply-To: <81b0412b0701230754p3425ded4k1f37dd26500c1744@mail.gmail.com>

```

Alex,
 just out of curiosity, what _is_ your curious text-attachment thing:

   1 Shown      8 lines  Text (charset: UTF-8)
   2   OK    ~928 bytes  Text (charset: ANSI_X3.4-1968)

where your normal text is UTF-8, but then attachments are in some really 
strange encoding name (why not just call it iso-8859-15? Don't ask me..)

Anyway. Strange. 

		Linus

```

## Uwe Kleine-König, 2007-01-23 17:58

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <20070123175811.GA8070@cepheus>
URL: https://gitlist.dev/e/20070123175811.GA8070%40cepheus
In-Reply-To: <Pine.LNX.4.64.0701230827440.32200@woody.linux-foundation.org>

```
Hi Linus,

Linus Torvalds wrote:
>  just out of curiosity, what _is_ your curious text-attachment thing:
> 
>    1 Shown      8 lines  Text (charset: UTF-8)
>    2   OK    ~928 bytes  Text (charset: ANSI_X3.4-1968)
ANSI_X3.4-1968 is just the offical name for us-ascii.

	zeisberg@cepheus:~$ LANG=C locale charmap
	ANSI_X3.4-1968

I'm not sure that this was making you curious.

Another strange thing is, that Alex' MUA choosed
"Content-Transfer-Encoding: 7bit" for the first part although UTF-8 is
an 8bit charset.

Best regards
Uwe

-- 
Uwe Kleine-König

http://www.google.com/search?q=the+speed+of+light+in+m%2Fs

```

## Alex Riesen, 2007-01-23 22:06

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <81b0412b0701231406t5e5808cex31a12b2aa0b6d03e@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0701231406t5e5808cex31a12b2aa0b6d03e%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0701230827440.32200@woody.linux-foundation.org>

```
On 1/23/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
>  just out of curiosity, what _is_ your curious text-attachment thing:
>
>    1 Shown      8 lines  Text (charset: UTF-8)
>    2   OK    ~928 bytes  Text (charset: ANSI_X3.4-1968)
>
> where your normal text is UTF-8, but then attachments are in some really
> strange encoding name (why not just call it iso-8859-15? Don't ask me..)
>
> Anyway. Strange.

That's Google Mail. The Webmailer. Have no other means to send mail at
that time of day.

```

## Junio C Hamano, 2007-01-24 01:34

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <7v64axmcmr.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v64axmcmr.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <81b0412b0701230754p3425ded4k1f37dd26500c1744@mail.gmail.com>

```
> ---
>  builtin-init-db.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin-init-db.c b/builtin-init-db.c
> index 8e7540b..1865489 100644
> --- a/builtin-init-db.c
> +++ b/builtin-init-db.c
> @@ -257,7 +257,9 @@ static int create_default_files(const char *git_dir, const char *template_path)
>  	}
>  	else {
>  		git_config_set("core.bare", "false");
> -		git_config_set("core.logallrefupdates", "true");
> +		/* allow template config file to override the default */
> +		if (log_all_ref_updates == -1)
> +		    git_config_set("core.logallrefupdates", "true");
>  	}
>  	return reinit;
>  }

It is sensible to let the user say "I do not want steenking
reflogs" (or "I love reflogs and want one everywhere").  But I
think the above is not really doing that.

We seem to read ~/.gitconfig while running git-init-db, and I do
not think doing so necessarily is a bug.  After all, there may
be some configurations you would want to have in ~/.gitconfig to
control the way git-init-db operates (right now I do not think
there is any).

That makes your new check depend on what is in ~/.gitconfig when
core.logallrefupdates is not set (either true or false) in the
template config.

Forgetting the case of having the variable in ~/.gitconfig, what
does it mean to have core.logallrefupdates set in a template
config?  Setting it to true is obvious -- "I want reflogs
everywhere", and I think it happens with or without your patch,
because create_default_files() copies the template.

However, when set to false, your check says "Do not set it
per-repo".  This tells git to follow the default "use reflog in
non-bare repositories" and it does not mean "I do not want
steenking reflogs anywhere".  So I think at least you would need
to check for (log_all_ref_updates == 0) and set it explicitly to
"false".

While on the topic of config files, we should fix the config
reader not to allow per-repository variables in ~/.gitconfig
(issuing warning and ignoring, or erroring out), as some
variables such as core.sharedrepository are inherently per
repository.  core.repositoryformatversion has the same issue,
but we do set it per repository explicitly with init-db, which
makes sure that whatever value in ~/.gitconfig is ignored.

```

## Johannes Schindelin, 2007-01-24 01:49

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <Pine.LNX.4.63.0701240245440.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0701240245440.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <7v64axmcmr.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Tue, 23 Jan 2007, Junio C Hamano wrote:

> While on the topic of config files, we should fix the config
> reader not to allow per-repository variables in ~/.gitconfig

So we finally get this central place where all possible config variables 
are listed, with options (a la struct cmd_struct) which tell more about 
where they may be used?

While I think this might make sense, I feel quite uneasy about such a 
drastic change between -rc2 and -final.

Ciao,
Dscho

```

## Junio C Hamano, 2007-01-24 01:51

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <7v4pqhkx93.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v4pqhkx93.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0701240245440.22628@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> While on the topic of config files, we should fix the config
>> reader not to allow per-repository variables in ~/.gitconfig
>
> So we finally get this central place where all possible config variables 
> are listed, with options (a la struct cmd_struct) which tell more about 
> where they may be used?
>
> While I think this might make sense, I feel quite uneasy about such a 
> drastic change between -rc2 and -final.

I do not like the "config registry" in 1.5.0 but a simple
blacklisting should work, shouldn't it?

```

## Junio C Hamano, 2007-01-24 01:53

Subject: Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config
Message-ID: <7vy7ntjile.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vy7ntjile.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7v64axmcmr.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> However, when set to false, your check says "Do not set it
> per-repo".  This tells git to follow the default "use reflog in
> non-bare repositories" and it does not mean "I do not want
> steenking reflogs anywhere".

This part is not true -- as we copy the templated config which
has explicit "no steenking reflog" to the new repository.

So I am Ok with your patch.

```
