git-commit-vandalism/Documentation/technical
Derrick Stolee 665d70ad03 commit-graph: use the "hash version" byte
The commit-graph format reserved a byte among the header of the file to
store a "hash version". During the SHA-256 work, this was not modified
because file formats are not necessarily intended to work across hash
versions. If a repository has SHA-256 as its hash algorithm, it
automatically up-shifts the lengths of object names in all necessary
formats.

However, since we have this byte available for adjusting the version, we
can make the file formats more obviously incompatible instead of relying
on other context from the repository.

Update the oid_version() method in commit-graph.c to add a new value, 2,
for sha-256. This automatically writes the new value in a SHA-256
repository _and_ verifies the value is correct. This is a breaking
change relative to the current 'master' branch since 092b677 (Merge
branch 'bc/sha-256-cvs-svn-updates', 2020-08-13) but it is not breaking
relative to any released version of Git.

The test impact is relatively minor: the output of 'test-tool
read-graph' lists the header information, so those instances of '1' need
to be replaced with a variable determined by GIT_TEST_DEFAULT_HASH. A
more careful test is added that specifically creates a repository of
each type then swaps the commit-graph files. The important value here is
that the "git log" command succeeds while writing a message to stderr.

Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-17 16:45:14 -07:00
..
.gitignore
api-error-handling.txt api-error-handling doc: typofix 2015-03-28 09:24:55 -07:00
api-index-skel.txt Documentation: avoid poor-man's small caps GIT 2013-02-01 13:53:25 -08:00
api-index.sh
api-merge.txt merge: move doc to ll-merge.h 2019-11-18 15:21:28 +09:00
api-parse-options.txt strvec: update documention to avoid argv_array 2020-07-28 15:02:18 -07:00
api-trace2.txt trace2: teach Git to log environment variables 2020-03-23 13:14:53 -07:00
bitmap-format.txt
bundle-format.txt bundle: add new version for use with SHA-256 2020-07-30 09:16:48 -07:00
commit-graph-format.txt commit-graph: use the "hash version" byte 2020-08-17 16:45:14 -07:00
commit-graph.txt Merge branch 'jk/lore-is-the-archive' 2019-12-06 15:09:23 -08:00
directory-rename-detection.txt Merge branch 'ja/dir-rename-doc-markup-fix' 2019-04-10 02:14:21 +09:00
hash-function-transition.txt Merge branch 'jk/lore-is-the-archive' 2019-12-06 15:09:23 -08:00
http-protocol.txt doc: fix wrong 4-byte length of pkt-line message 2020-05-21 10:52:01 -07:00
index-format.txt Documentation: fix a bunch of typos, both old and new 2019-11-07 13:42:00 +09:00
long-running-process-protocol.txt Docs: split out long-running subprocess handshake 2018-01-25 11:24:32 -08:00
multi-pack-index.txt Merge branch 'jb/doc-multi-pack-idx-fix' 2020-01-08 12:44:12 -08:00
pack-format.txt pack-format: correct multi-pack-index description 2020-02-10 09:01:48 -08:00
pack-heuristics.txt
pack-protocol.txt doc: fix wrong 4-byte length of pkt-line message 2020-05-21 10:52:01 -07:00
packfile-uri.txt Documentation: add Packfile URIs design doc 2020-06-10 18:06:34 -07:00
partial-clone.txt Merge branch 'jk/lore-is-the-archive' 2019-12-06 15:09:23 -08:00
protocol-capabilities.txt Documentation: document v1 protocol object-format capability 2020-05-13 18:14:08 -07:00
protocol-common.txt Merge branch 'ls/packet-line-protocol-doc-fix' 2016-08-31 10:03:51 -07:00
protocol-v2.txt Merge branch 'bc/sha-256-part-2' 2020-07-06 22:09:13 -07:00
racy-git.txt doc: replace LKML link with lore.kernel.org 2019-12-04 10:26:52 -08:00
reftable.txt reftable: define version 2 of the spec to accomodate SHA256 2020-06-09 13:48:36 -07:00
repository-version.txt doc: move extensions.worktreeConfig to the right place 2018-11-16 14:10:31 +09:00
rerere.txt Documentation: fix a bunch of typos, both old and new 2019-11-07 13:42:00 +09:00
send-pack-pipeline.txt
shallow.txt technical/shallow: describe why shallow cannot use replace refs 2018-04-30 11:12:31 +09:00
signature-format.txt Documentation/technical: signed merge tag format 2016-06-17 12:10:48 -07:00
trivial-merge.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00