From 8b8f7189dff1f9ee2e3d65dfaafc2fc9f4956232 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sat, 22 Feb 2020 20:17:38 +0000 Subject: builtin/init-db: allow specifying hash algorithm on command line Allow the user to specify the hash algorithm on the command line by using the --object-format option to git init. Validate that the user is not attempting to reinitialize a repository with a different hash algorithm. Ensure that if we are writing a non-SHA-1 repository that we set the repository version to 1 and write the objectFormat extension. Restrict this option to work only when ENABLE_SHA256 is set until the codebase is in a situation to fully support this. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- Documentation/git-init.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt index 32880aafb0..adc6adfd38 100644 --- a/Documentation/git-init.txt +++ b/Documentation/git-init.txt @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git init' [-q | --quiet] [--bare] [--template=] - [--separate-git-dir ] + [--separate-git-dir ] [--object-format=]] [directory] @@ -48,6 +48,11 @@ Only print error and warning messages; all other output will be suppressed. Create a bare repository. If `GIT_DIR` environment is not set, it is set to the current working directory. +--object-format=:: + +Specify the given object format (hash algorithm) for the repository. The valid +values are 'sha1' and (if enabled) 'sha256'. 'sha1' is the default. + --template=:: Specify the directory from which templates will be used. (See the "TEMPLATE -- cgit v1.3-5-g9baa