mirror of
https://github.com/git/git.git
synced 2024-05-31 20:06:18 +02:00
f5ed359d4f
The murmur3 implementation in bloom.c has a bug when converting series of 4 bytes into network-order integers when char is signed (which is controllable by a compiler option, and the default signedness of char is platform-specific). When a string contains characters with the high bit set, this bug causes results that, although internally consistent within Git, does not accord with other implementations of murmur3 (thus, the changed path filters wouldn't be readable by other off-the-shelf implementatios of murmur3) and even with Git binaries that were compiled with different signedness of char. This bug affects both how Git writes changed path filters to disk and how Git interprets changed path filters on disk. Therefore, introduce a new version (2) of changed path filters that corrects this problem. The existing version (1) is still supported and is still the default, but users should migrate away from it as soon as possible. Because this bug only manifests with characters that have the high bit set, it may be possible that some (or all) commits in a given repo would have the same changed path filter both before and after this fix is applied. However, in order to determine whether this is the case, the changed paths would first have to be computed, at which point it is not much more expensive to just compute a new changed path filter. So this patch does not include any mechanism to "salvage" changed path filters from repositories. There is also no "mixed" mode - for each invocation of Git, reading and writing changed path filters are done with the same version number; this version number may be explicitly stated (typically if the user knows which version they need) or automatically determined from the version of the existing changed path filters in the repository. There is a change in write_commit_graph(). graph_read_bloom_data() makes it possible for chunk_bloom_data to be non-NULL but bloom_filter_settings to be NULL, which causes a segfault later on. I produced such a segfault while developing this patch, but couldn't find a way to reproduce it neither after this complete patch (or before), but in any case it seemed like a good thing to include that might help future patch authors. The value in t0095 was obtained from another murmur3 implementation using the following Go source code: package main import "fmt" import "github.com/spaolacci/murmur3" func main() { fmt.Printf("%x\n", murmur3.Sum32([]byte("Hello world!"))) fmt.Printf("%x\n", murmur3.Sum32([]byte{0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff})) } Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
commitGraph.generationVersion::
|
|
Specifies the type of generation number version to use when writing
|
|
or reading the commit-graph file. If version 1 is specified, then
|
|
the corrected commit dates will not be written or read. Defaults to
|
|
2.
|
|
|
|
commitGraph.maxNewFilters::
|
|
Specifies the default value for the `--max-new-filters` option of `git
|
|
commit-graph write` (c.f., linkgit:git-commit-graph[1]).
|
|
|
|
commitGraph.readChangedPaths::
|
|
Deprecated. Equivalent to commitGraph.changedPathsVersion=-1 if true, and
|
|
commitGraph.changedPathsVersion=0 if false. (If commitGraph.changedPathVersion
|
|
is also set, commitGraph.changedPathsVersion takes precedence.)
|
|
|
|
commitGraph.changedPathsVersion::
|
|
Specifies the version of the changed-path Bloom filters that Git will read and
|
|
write. May be -1, 0, 1, or 2. Note that values greater than 1 may be
|
|
incompatible with older versions of Git which do not yet understand
|
|
those versions. Use caution when operating in a mixed-version
|
|
environment.
|
|
+
|
|
Defaults to -1.
|
|
+
|
|
If -1, Git will use the version of the changed-path Bloom filters in the
|
|
repository, defaulting to 1 if there are none.
|
|
+
|
|
If 0, Git will not read any Bloom filters, and will write version 1 Bloom
|
|
filters when instructed to write.
|
|
+
|
|
If 1, Git will only read version 1 Bloom filters, and will write version 1
|
|
Bloom filters.
|
|
+
|
|
If 2, Git will only read version 2 Bloom filters, and will write version 2
|
|
Bloom filters.
|
|
+
|
|
See linkgit:git-commit-graph[1] for more information.
|