both files reminding future developers to keep them in sync.
Signed-off-by: brian m. carlson
---
.clang-format | 2 ++
.editorconfig | 2 ++
2 files changed, 4 insertions(+)
diff --git a/.clang-format b/.clang-format
index 12a89f95f9..de1c8b5c77 100644
--- a/.clang-format
+++ b/.clang-format
@@
Replace several 40-based constants with references to GIT_MAX_HEXSZ or
the_hash_algo, as appropriate.
Signed-off-by: brian m. carlson
---
apply.c | 18 ++
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/apply.c b/apply.c
index e485fbc6bc..792ecea36a 100644
--- a
Switch uses of GIT_SHA1_HEXSZ to use the_hash_algo so that they are
appropriate for the any given hash length.
Signed-off-by: brian m. carlson
---
refs/packed-backend.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs/packed-backend.c b/refs/packed
Express the various constants used in terms of the_hash_algo.
Signed-off-by: brian m. carlson
---
pack-revindex.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/pack-revindex.c b/pack-revindex.c
index bb521cf7fb..3756ec71a8 100644
--- a/pack-revindex.c
+++ b/pack
Rename these structure members to "new_oid_prefix" and "old_oid_prefix".
Signed-off-by: brian m. carlson
---
apply.c | 40
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/apply.c b/apply.c
index 792ecea36a..b9eb02ec12
With SHA-256, the length of the all-zeros object ID is longer. Add a
function to git-submodule.sh to check if a full hex object ID is the
all-zeros value, and use it to check the output we're parsing from git
diff-files or diff-index.
Signed-off-by: brian m. carlson
---
git-submodule.s
named "hash" instead of "sha1".
Signed-off-by: brian m. carlson
---
rerere.c | 81 +---
1 file changed, 42 insertions(+), 39 deletions(-)
diff --git a/rerere.c b/rerere.c
index 7aa149e849..ceb98015ff 100644
--- a/rer
Signed-off-by: brian m. carlson
---
tag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tag.c b/tag.c
index 1db663d716..7445b8f6ea 100644
--- a/tag.c
+++ b/tag.c
@@ -144,7 +144,7 @@ int parse_tag_buffer(struct repository *r, struct tag
*item, const void *data, u
Use parse_oid_hex to compute a pointer instead of using GIT_SHA1_HEXSZ.
This simplifies the code and makes it independent of the hash length.
Signed-off-by: brian m. carlson
---
transport.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/transport.c b/transport.c
Signed-off-by: brian m. carlson
---
pack-bitmap-write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index fc82f37a02..6f0c78d6aa 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -37,7 +37,7 @@ struct bitmap_writer
Instead of using GIT_SHA1_HEXSZ, use parse_oid_hex to compute a pointer
and use that in comparisons. This is both simpler to read and works
independent of the hash length. Update references to SHA-1 in the same
function to refer to object IDs instead.
Signed-off-by: brian m. carlson
Convert all uses of the GIT_SHA1_HEXSZ to use the_hash_algo so that they
are appropriate for any given hash length.
Signed-off-by: brian m. carlson
---
upload-pack.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c
index 62a1000f44
Replace uses of GIT_SHA1_RAWSZ with references to the_hash_algo to avoid
dependence on a particular hash length.
Signed-off-by: brian m. carlson
---
packfile.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/packfile.c b/packfile.c
index 841b36182f..17f993b5bf 100644
This is the fifteenth series in the ongoing hash function transition.
This series includes several conversions to use the_hash_algo, combined
with some use of parse_oid_hex and GIT_MAX_RAWSZ. None of the
transformations here are especially surprising.
brian m. carlson (14):
pack-bitmap-write
Instead of using a hard-coded constant for the size of a hex object ID,
switch to use the computed pointer from parse_oid_hex that points after
the parsed object ID.
Signed-off-by: brian m. carlson
---
builtin/mktree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin
Signed-off-by: brian m. carlson
---
builtin/repack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/repack.c b/builtin/repack.c
index c6a7943d5c..e77859062d 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -407,8 +407,8 @@ int cmd_repack(int argc, const
On Mon, Oct 08, 2018 at 10:53:52PM +0200, Ævar Arnfjörð Bjarmason wrote:
>
> It looks like we can add at least "pm" and "pl" to that pattern:
Sure. I didn't think we had any of those, but you've just proven me
wrong. I'll send a v3 shortly.
--
bri
nges since v1:
* Add notes to both .editorconfig and .clang-format that they should be
kept in sync.
* Add commit message line length.
brian m. carlson (2):
editorconfig: provide editor settings for Git developers
editorconfig: indicate settings should be kept in sync
.clang-f
rsion support and forcing Unix-style line endings might
cause problems for those users.
Finally, leave out a root directive, which would prevent reading other
EditorConfig files higher up in the tree, in case someone wants to set
the end of line type for their system in such a file.
Signed
both files reminding future developers to keep them in sync.
Signed-off-by: brian m. carlson
---
.clang-format | 2 ++
.editorconfig | 2 ++
2 files changed, 4 insertions(+)
diff --git a/.clang-format b/.clang-format
index 12a89f95f9..de1c8b5c77 100644
--- a/.clang-format
+++ b/.clang-format
@@
ult keyrings and even read gpg.conf when explicitly told
> not to. I suspect that is what is going on here.
It might be worth checking to see if you have a gpg binary or script in
your PATH that isn't the one you expect. That's broken things for me in
the past.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
y even be an overkill.
>
> A comment addressed to those who edit one file to look at the other
> file on both files would be sufficient, I suspect.
Sure. Let me reroll with that change.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Mon, Sep 24, 2018 at 10:39:02AM -0700, Jonathan Nieder wrote:
> Hi,
>
> brian m. carlson wrote:
>
> > I think this commit message makes sense. I apparently still fail to
> > understand how the .mailmap format works, so I can't tell you if the
> > patch is
ast one process (sh) per commit. So I
don't think there's anything that Git can do to make this faster on our
end without a redesign.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Sat, Sep 22, 2018 at 03:52:58PM -0400, Jeff King wrote:
> On Sat, Sep 22, 2018 at 06:02:31PM +0000, brian m. carlson wrote:
>
> > On Fri, Sep 21, 2018 at 02:47:43PM -0400, Taylor Blau wrote:
> > > +expect_haves () {
> > > + printf "%s .
s like you're trying to match a NUL here in the sed expression,
but from my reading of it, POSIX doesn't permit BREs to match NUL.
Perhaps someone can come up with a better solution, but I'd write this
as the following:
depacketize - | perl -ne 'next unless /\.have/; s/\0.*$//g; prin
to try to come up
> with such a tool (unless somebody is really interested in doing it,
> that is).
Would it be helpful if I sent a script that ran during CI to ensure they
stayed in sync for the couple places where they overlap? I'm happy to
do so if you think it would b
On Thu, Sep 20, 2018 at 10:35:04PM -0400, Jeff King wrote:
> On Thu, Sep 20, 2018 at 10:26:47PM -0400, Eric Sunshine wrote:
>
> > On Wed, Sep 19, 2018 at 8:00 PM brian m. carlson
> > wrote:
> > > (I am having trouble getting make style to work, though, because it
eable via the following:
>
> [COMMIT_EDITMSG]
> max_line_length = 72
That's an interesting thought. I know different people have different
settings for this: 70, 72, 74. 72 characters is typical for emails, and
since our commits end up as emails, I think standardizing on 72 would
make sense.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Tue, Sep 18, 2018 at 08:00:27PM -0700, Junio C Hamano wrote:
> "brian m. carlson" writes:
>
> > To make automatically configuring one's editor easier, provide an
> > EditorConfig file. This is an INI-style configuration file that can be
> > use
eading other
EditorConfig files higher up in the tree, in case someone wants to set
the end of line type for their system in such a file.
Signed-off-by: brian m. carlson
---
I was incentivized to write this when I started using worktrees for
development and found that I had inserted spaces into
On Mon, Sep 17, 2018 at 11:18:00AM -0700, Jonathan Nieder wrote:
> v2.18.0-rc0~70^2 (mailmap: update brian m. carlson's email address,
> 2018-05-08) changed the mailmap to map
>
> sand...@crustytoothpaste.ath.cx
> -> brian m. carlson
>
> instead of
>
be easier for me to just
send a completely fixed version in the future since it doesn't have any
dependencies with the rest of the series.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1407-worktree-ref-store.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1406-submodule-ref-store.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406
Switch a hard-coded all-zeros object ID to use a variable instead.
Signed-off-by: brian m. carlson
---
t/t1400-update-ref.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 7c8df20955..6072650686 100755
--- a/t/t1400-update
Compute the size of the tree and commit objects we're creating by
checking for the size of an object ID and computing the resulting sizes
accordingly.
Signed-off-by: brian m. carlson
---
t/t1006-cat-file.sh | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t100
ed-by: Eric Sunshine
Signed-off-by: Eric Sunshine
Signed-off-by: brian m. carlson
---
t/README| 22 +
t/oid-info/README | 19
t/oid-info/hash-info| 8 +
t/oid-info/oid | 29 +
t/t-basic.sh| 37 ++
Compute test values of the appropriate size instead of hard-coding
40-character values. Rename the echo20 function to echoid, since the
values may be of varying sizes.
Signed-off-by: brian m. carlson
---
t/t0064-sha1-array.sh | 49 ---
1 file changed, 27
If the hash we're using is 32 bytes in size, attempting to insert a
20-byte object name won't work. Since these are synthesized objects
that are almost all zeros, look them up in a translation table.
Signed-off-by: brian m. carlson
---
t/t-basic.sh | 13 +++--
1 file
From: Derrick Stolee
Signed-off-by: Derrick Stolee
Signed-off-by: brian m. carlson
---
t/t5318-commit-graph.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 0c500f7ca2..75fe09521f 100755
--- a/t/t5318-commit
helper to update these assertions and provide values
for both SHA-1 and SHA-256.
These object IDs were synthesized using a set of scripts that created
the objects for both SHA-1 and SHA-256 using the same method to ensure
that they are indeed the correct values.
Signed-off-by: brian m. carlson
--
formation in the shell.
* Simplified lookup of HEAD in t0002.
* Switched to using existing helper function in t0027.
* Simplified handling of IDs in t0064.
Derrick Stolee (1):
t5318: use test_oid for HASH_LEN
brian m. carlson (11):
t: add test functions to translate hash-related values
t
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes.
Signed-off-by: brian m. carlson
---
t/t0002-gitfile.sh | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index
compactness.
Signed-off-by: brian m. carlson
---
t/t0027-auto-crlf.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index beb5927f77..dfb46bbe86 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -15,7 +15,8
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1405-main-ref-store.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
ly better
addressed as an issue there: https://github.com/git-for-windows/git.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
test-scrap-cache-tree.o
> -TEST_BUILTINS_OBJS += test-sha1-array.o
> TEST_BUILTINS_OBJS += test-sha1.o
> +TEST_BUILTINS_OBJS += test-sha1-array.o
> TEST_BUILTINS_OBJS += test-sigchain.o
> TEST_BUILTINS_OBJS += test-strcmp-offset.o
> TEST_BUILTINS_OBJS += test-string-list.o
T
try in that array.
If you want both a collection that is always sorted and has efficient
lookup for an arbitrary entry, then a B-tree is probably a better
choice. That's the primitive that Rust provides for that situation.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Mon, Sep 03, 2018 at 08:01:35PM -0400, Eric Sunshine wrote:
> On Mon, Sep 3, 2018 at 7:25 PM brian m. carlson
> wrote:
> > Add several test functions to make working with various hash-related
> > values easier.
> > [...]
> > diff --git a/t/test-lib-function
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1407-worktree-ref-store.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1406-submodule-ref-store.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406
If the hash we're using is 32 bytes in size, attempting to insert a
20-byte object name won't work. Since these are synthesized objects
that are almost all zeros, look them up in a translation table.
Signed-off-by: brian m. carlson
---
t/t-basic.sh | 13 +++--
1 file
Compute test values of the appropriate size instead of hard-coding
40-character values. Rename the echo20 function to echoid, since the
values may be of varying sizes.
Signed-off-by: brian m. carlson
---
t/t0064-sha1-array.sh | 49 ---
1 file changed, 27
From: Derrick Stolee
Signed-off-by: Derrick Stolee
Signed-off-by: brian m. carlson
---
t/t5318-commit-graph.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 3c1ffad491..d286516f0e 100755
--- a/t/t5318-commit
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes.
Signed-off-by: brian m. carlson
---
t/t0002-gitfile.sh | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index
Switch a hard-coded all-zeros object ID to use a variable instead.
Signed-off-by: brian m. carlson
---
t/t1400-update-ref.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 7c8df20955..6072650686 100755
--- a/t/t1400-update
ed-by: Eric Sunshine
Signed-off-by: Eric Sunshine
Signed-off-by: brian m. carlson
---
t/README| 22 ++
t/oid-info/README | 19
t/oid-info/hash-info| 8 +
t/oid-info/oid | 29 ++
t/t-basic.sh| 37 +++
Compute the size of the tree and commit objects we're creating by
checking for the size of an object ID and computing the resulting sizes
accordingly.
Signed-off-by: brian m. carlson
---
t/t1006-cat-file.sh | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t100
helper to update these assertions and provide values
for both SHA-1 and SHA-256.
These object IDs were synthesized using a set of scripts that created
the objects for both SHA-1 and SHA-256 using the same method to ensure
that they are indeed the correct values.
Signed-off-by: brian m. carlson
--
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1405-main-ref-store.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
):
t5318: use test_oid for HASH_LEN
brian m. carlson (11):
t: add test functions to translate hash-related values
t: use hash translation table
t: update tests for SHA-256
t0002: abstract away SHA-1 specific constants
t0027: make hash size independent
t0064: make hash size indepen
compactness.
Signed-off-by: brian m. carlson
---
t/t0027-auto-crlf.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index beb5927f77..dfb46bbe86 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -15,7 +15,8
lipped in a use of test_oid_init, which is now required. Thanks for
the patch.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
to run both 'tr' and 'sed'
> when 'sed itself could do the entire job since 'sed' has 'tr'
> functionality built in (see sed's "y" command)?
It doesn't. I went for a minimal change, but I could switch to using
both s/// and y/// in sed instead.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Thu, Aug 30, 2018 at 02:21:51AM +, brian m. carlson wrote:
> On Wed, Aug 29, 2018 at 11:37:25AM +0200, Ævar Arnfjörð Bjarmason wrote:
>
> > It seems to me that aside from t/helper/test-hash-speed.c and
> > t/t0014-hash.sh everything being added here modifies existing f
On Wed, Aug 29, 2018 at 08:41:36AM -0400, Derrick Stolee wrote:
> On 8/28/2018 8:58 PM, brian m. carlson wrote:
> > Instead of using hard-coded constants for object sizes, use
> > the_hash_algo to look them up. In addition, use a function call to look
> > up the object ID ve
I believe, but either way I'd be fine
with it.
It wasn't my intention to offer code I didn't wholly author, so thanks
for clarifying.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Wed, Aug 29, 2018 at 11:32:08AM +0200, Ævar Arnfjörð Bjarmason wrote:
>
> On Wed, Aug 29 2018, brian m. carlson wrote:
>
> > SHA-1 is weak and we need to transition to a new hash function. For
> > some time, we have referred to this new function as NewHash.
> >
>
On Wed, Aug 29, 2018 at 10:53:01AM +0200, Ævar Arnfjörð Bjarmason wrote:
>
> On Wed, Aug 29 2018, brian m. carlson wrote:
>
> > Generally, one gets better performance out of cryptographic routines
> > written in assembly than C, and this is also true for SHA-256
>
&g
. Maybe splitting into two
> evals would work?
>
> var=test_oid_${test_hash_algo}_$1 &&
>
> eval "test -n \"\${$var+set}\"" &&
> eval "printf '%s\n' \"\${$var}\""
>
> What is the initial test meant to do? Can this function get a
> documentation comment? Are we relying on "test -n" to return a failing
> result if the variable is unset, or could the test be omitted (relying
> on "\${$var}" to evaluate to "" when the variable is unset)? Should
> this call 'error' when the variable is unset?
Yes. The test -n will return false if the variable is unset, since
${$var+set} evaluates to nothing if the variable is unset and "set" if
it is set. I will admit that I had to look this up in the shell
documentation, so I'm not surprised that this is confusing at first
glance.
Switching to error is probably better.
> Can t/README describe the new test helpers?
Sure. I wasn't aware that there was one to add this to, but now that
you've pointed it out, it makes sense to add them.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Wed, Aug 29, 2018 at 08:37:48AM -0400, Derrick Stolee wrote:
> On 8/28/2018 8:56 PM, brian m. carlson wrote:
> > + rawsz="$(test_oid rawsz)" &&
> > + hexsz="$(test_oid hexsz)" &&
>
> These are neat helpers! The 'git commit-graph
in any serialized data formats.
Signed-off-by: brian m. carlson
---
sha1-file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sha1-file.c b/sha1-file.c
index 97b7423848..5223e3d1ce 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -97,7 +97,7 @@ const struct
them. If conversion to another form is necessary, this
internal constant can be used to look up the proper data in the
hash_algos array.
Signed-off-by: brian m. carlson
---
hash.h | 13 +
sha1-file.c | 21 +
2 files changed, 34 insertions(+)
diff --git a
is a
dependency of GnuPG. libgcrypt is also faster than the SHA1DC
implementation for messages of a few KiB and larger. It is licensed
under the LGPL 2.1, which is compatible with the GPL.
Add an implementation of SHA-256 that uses libgcrypt.
Signed-off-by: brian m. carlson
---
Makefile
Since the commit-graph code wants to serialize the hash algorithm into
the data store, specify a version number for each supported algorithm.
Note that we don't use the values of the constants themselves, as they
are internal and could change in the future.
Signed-off-by: brian m. ca
We already have OpenSSL routines available for SHA-1, so add routines
for SHA-256 as well.
Signed-off-by: brian m. carlson
---
Makefile | 7 +++
hash.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/Makefile b/Makefile
index 86867af083..8b7df4dfc5 100644
--- a/Makefile
+++ b
st of hash algorithms, and add a test that the
algorithm works correctly.
Note that with this patch, it is still not possible to switch to using
SHA-256 in Git. Additional patches are needed to prepare the code to
handle a larger hash algorithm and further test fixes are needed.
Signed-off-b
Add a utility (which is less for the testsuite and more for developers)
that can compute hash speeds for whatever hash algorithms are
implemented. This allows developers to test their personal systems to
determine the performance characteristics of various algorithms.
Signed-off-by: brian m
Instead of using hard-coded constants for object sizes, use
the_hash_algo to look them up. In addition, use a function call to look
up the object ID version and produce the correct value.
Signed-off-by: brian m. carlson
---
commit-graph.c | 31 ---
1 file changed
ation.
Signed-off-by: brian m. carlson
---
Makefile | 1 +
t/helper/{test-sha1.c => test-hash.c} | 19 +-
t/helper/test-sha1.c | 52 +--
t/helper/test-tool.h | 2 ++
4 files changed, 14 insertion
There is one place we need the hash algorithm block size: the HMAC code
for push certs. Expose this constant in struct git_hash_algo and expose
values for SHA-1 and for the largest value of any hash.
Signed-off-by: brian m. carlson
---
cache.h | 4
hash.h | 3 +++
sha1-file.c | 2
to_hex
with a hash_to_hex that handles the_hash_algo, and taking an algorithm
pointer is the easiest way to handle all of the variants in use.
Signed-off-by: brian m. carlson
---
cache.h | 14 --
hex.c | 32
2 files changed, 32 insertions(+), 14 d
testing additional algorithms to verify that their
implementations are working as expected.
Signed-off-by: brian m. carlson
---
t/t0014-hash.sh | 29 +
1 file changed, 29 insertions(+)
create mode 100755 t/t0014-hash.sh
diff --git a/t/t0014-hash.sh b/t/t0014-hash.sh
new
e
welcome to do so under their normal license terms. If not, that's fine,
too.
brian m. carlson (12):
sha1-file: rename algorithm to "sha1"
sha1-file: provide functions to look up hash algorithms
hex: introduce functions to print arbitrary hashes
t: add basic tests for our SHA-1 im
Compute test values of the appropriate size instead of hard-coding
40-character values. Rename the echo20 function to echoid, since the
values may be of varying sizes.
Signed-off-by: brian m. carlson
---
t/t0064-sha1-array.sh | 49 ---
1 file changed, 27
If the hash we're using is 32 bytes in size, attempting to insert a
20-byte object name won't work. Since these are synthesized objects
that are almost all zeros, look them up in a translation table.
Signed-off-by: brian m. carlson
---
t/t-basic.sh | 13 +++--
1 file
Switch a hard-coded all-zeros object ID to use a variable instead.
Signed-off-by: brian m. carlson
---
t/t1400-update-ref.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 7c8df20955..6072650686 100755
--- a/t/t1400-update
helper to update these assertions and provide values
for both SHA-1 and SHA-256.
These object IDs were synthesized using a set of scripts that created
the objects for both SHA-1 and SHA-256 using the same method to ensure
that they are indeed the correct values.
Signed-off-by: brian m. carlson
--
Compute the size of the tree and commit objects we're creating by
checking for the size of an object ID and computing the resulting sizes
accordingly.
Signed-off-by: brian m. carlson
---
t/t1006-cat-file.sh | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t100
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1405-main-ref-store.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1407-worktree-ref-store.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree
Instead of hard-coding a 40-based constant, split the output of
for-each-ref and for-each-reflog by field.
Signed-off-by: brian m. carlson
---
t/t1406-submodule-ref-store.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes.
Signed-off-by: brian m. carlson
---
t/t0002-gitfile.sh | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index
We transform various object IDs into all-zero object IDs for comparison.
Adjust the length as well so that this works for all hash algorithms.
Signed-off-by: brian m. carlson
---
t/t0027-auto-crlf.sh | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t0027-auto-crlf.sh
that due to the implementation used, names used for lookup can
currently consist only of shell identifier characters. If this is a
problem in the future, we can hash the names before use.
Signed-off-by: Eric Sunshine
Signed-off-by: brian m. carlson
---
t/oid-info/hash-info| 8
t
andling of IDs in t0064.
brian m. carlson (11):
t: add tool to translate hash-related values
t: use hash translation table
t: update tests for SHA-256
t0002: abstract away SHA-1 specific constants
t0027: make hash size independent
t0064: make hash size independent
t1006: make
on, and is it from the repo or a tarball?
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
On Tue, Aug 28, 2018 at 05:21:27PM -0400, Jeff King wrote:
> On Sun, Aug 26, 2018 at 08:56:21PM +0000, brian m. carlson wrote:
> > I would quite like to see this series picked up for v2.20. If we want
> > to minimize performance regressions with the SHA-256 work, I think it&
.g. case-insensitive ones)?
What version of Git are you using? What does "git status" say before
you run git clean?
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature
601 - 700 of 2732 matches
Mail list logo