threads / patch / 53542

patchDocumentation fix related to hash algorithm

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

## tl;dr

4 messages between May 25, 2020 and May 25, 2020. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Toon Claes· May 25, 2020, 14:41 UTC · lore

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· May 25, 2020, 14:41 UTC · re: Toon Claes · lore

[PATCH 1/1] Documentation: correct hash environment variable

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(-)
Show changes to Documentation/git.txt +1 −1
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· May 25, 2020, 16:42 UTC · re: Toon Claes · lore

Re: [PATCH 1/1] Documentation: correct hash environment variable

On Mon, 25 May 2020 at 16:52, Toon Claes <toon@iotcl.com> wrote:
Show 6 quoted lines
>
> 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...
Show 5 quoted lines
> -`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· May 25, 2020, 17:57 UTC · re: Martin Ågren · lore

Re: [PATCH 1/1] Documentation: correct hash environment variable

On 2020-05-25 at 16:42:57, Martin Ågren wrote:
Show 11 quoted lines
> > -`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

← back to recent threads