# [PATCH 0/1] Documentation fix related to hash algorithm

4 messages from 2020-05-25 to 2020-05-25. Participants: Toon Claes, Martin Ågren, brian m. carlson.
Thread: https://gitlist.dev/t/53542

## Toon Claes, 2020-05-25 14:41

Subject: [PATCH 0/1] Documentation fix related to hash algorithm
Message-ID: <20200525144138.1624272-1-toon@iotcl.com>
URL: https://gitlist.dev/e/20200525144138.1624272-1-toon%40iotcl.com

```
I was doing some research on the SHA256 implementation, and I discovered a
mismatch between the docs and the code. I have a patch attached that fixes the
docs.

Toon Claes (1):
  Documentation: correct hash environment variable

 Documentation/git.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.27.0.rc1.72.g3440a8306a

```

## Toon Claes, 2020-05-25 14:41

Subject: [PATCH 1/1] Documentation: correct hash environment variable
Message-ID: <20200525144138.1624272-2-toon@iotcl.com>
URL: https://gitlist.dev/e/20200525144138.1624272-2-toon%40iotcl.com
In-Reply-To: <20200525144138.1624272-1-toon@iotcl.com>

```
To set the default hash algorithm you can set the `GIT_DEFAULT_HASH` environment
variable. In the documentation this variable was named
`GIT_DEFAULT_HASH_ALGORITHM`, which was incorrect.

Signed-off-by: Toon Claes <toon@iotcl.com>
---
 Documentation/git.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git.txt b/Documentation/git.txt
index 9d6769e95a..12890841c4 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -493,7 +493,7 @@ double-quotes and respecting backslash escapes. E.g., the value
 	details. This variable has lower precedence than other path
 	variables such as GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY...
 
-`GIT_DEFAULT_HASH_ALGORITHM`::
+`GIT_DEFAULT_HASH`::
 	If this variable is set, the default hash algorithm for new
 	repositories will be set to this value. This value is currently
 	ignored when cloning; the setting of the remote repository
-- 
2.27.0.rc1.72.g3440a8306a


```

## Martin Ågren, 2020-05-25 16:42

Subject: Re: [PATCH 1/1] Documentation: correct hash environment variable
Message-ID: <CAN0heSoyxvTTaJaRmnQADTaMrWa4QBbGnXi8MUZp7ksibejc8g@mail.gmail.com>
URL: https://gitlist.dev/e/CAN0heSoyxvTTaJaRmnQADTaMrWa4QBbGnXi8MUZp7ksibejc8g%40mail.gmail.com
In-Reply-To: <20200525144138.1624272-2-toon@iotcl.com>

```
On Mon, 25 May 2020 at 16:52, Toon Claes <toon@iotcl.com> wrote:
>
> To set the default hash algorithm you can set the `GIT_DEFAULT_HASH` environment
> variable. In the documentation this variable was named
> `GIT_DEFAULT_HASH_ALGORITHM`, which was incorrect.
>
> Signed-off-by: Toon Claes <toon@iotcl.com>

I would replace both instances of "was" with "is", since you're
describing the state immediately before applying your patch, not after.

Changing that and wrapping at 72 characters yields something like

  To set the default hash algorithm you can set the `GIT_DEFAULT_HASH`
  environment variable. In the documentation this variable is named
  `GIT_DEFAULT_HASH_ALGORITHM`, which is incorrect.

Nits aside...

> -`GIT_DEFAULT_HASH_ALGORITHM`::
> +`GIT_DEFAULT_HASH`::
>         If this variable is set, the default hash algorithm for new
>         repositories will be set to this value. This value is currently
>         ignored when cloning; the setting of the remote repository

Indeed. This discrepancy is visible in the commit which added both the
documentation and the implementation, 3c9331a129 ("builtin/init-db: add
environment variable for new repo hash", 2020-02-22). As
developers-only as this variable is, that commit was not in v2.26.0, so
this might be worth fixing before cutting v2.27.0.

Martin

```

## brian m. carlson, 2020-05-25 17:57

Subject: Re: [PATCH 1/1] Documentation: correct hash environment variable
Message-ID: <20200525175758.GE1915090@camp.crustytoothpaste.net>
URL: https://gitlist.dev/e/20200525175758.GE1915090%40camp.crustytoothpaste.net
In-Reply-To: <CAN0heSoyxvTTaJaRmnQADTaMrWa4QBbGnXi8MUZp7ksibejc8g@mail.gmail.com>

```
On 2020-05-25 at 16:42:57, Martin Ågren wrote:
> > -`GIT_DEFAULT_HASH_ALGORITHM`::
> > +`GIT_DEFAULT_HASH`::
> >         If this variable is set, the default hash algorithm for new
> >         repositories will be set to this value. This value is currently
> >         ignored when cloning; the setting of the remote repository
> 
> Indeed. This discrepancy is visible in the commit which added both the
> documentation and the implementation, 3c9331a129 ("builtin/init-db: add
> environment variable for new repo hash", 2020-02-22). As
> developers-only as this variable is, that commit was not in v2.26.0, so
> this might be worth fixing before cutting v2.27.0.

Yeah, thanks for catching this.  I think this is worth fixing.  It
doesn't do anything right now except produce an error, but we might as
well not mislead people.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

```
