[PATCH v3 2/2] editorconfig: indicate settings should be kept in sync

2018-10-08 Thread brian m. carlson
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 @@

[PATCH 11/14] apply: replace hard-coded constants

2018-10-08 Thread brian m. carlson
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

[PATCH 07/14] refs/packed-backend: express constants using the_hash_algo

2018-10-08 Thread brian m. carlson
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

[PATCH 05/14] pack-revindex: express constants in terms of the_hash_algo

2018-10-08 Thread brian m. carlson
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

[PATCH 12/14] apply: rename new_sha1_prefix and old_sha1_prefix

2018-10-08 Thread brian m. carlson
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

[PATCH 13/14] submodule: make zero-oid comparison hash function agnostic

2018-10-08 Thread brian m. carlson
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

[PATCH 14/14] rerere: convert to use the_hash_algo

2018-10-08 Thread brian m. carlson
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

[PATCH 10/14] tag: express constant in terms of the_hash_algo

2018-10-08 Thread brian m. carlson
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

[PATCH 09/14] transport: use parse_oid_hex instead of a constant

2018-10-08 Thread brian m. carlson
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

[PATCH 01/14] pack-bitmap-write: use GIT_MAX_RAWSZ for allocation

2018-10-08 Thread brian m. carlson
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

[PATCH 04/14] builtin/fetch-pack: remove constants with parse_oid_hex

2018-10-08 Thread brian m. carlson
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

[PATCH 08/14] upload-pack: express constants in terms of the_hash_algo

2018-10-08 Thread 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

[PATCH 06/14] packfile: express constants in terms of the_hash_algo

2018-10-08 Thread brian m. carlson
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

[PATCH 00/14] Hash function transition part 15

2018-10-08 Thread brian m. carlson
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

[PATCH 03/14] builtin/mktree: remove hard-coded constant

2018-10-08 Thread brian m. carlson
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

[PATCH 02/14] builtin/repack: replace hard-coded constant

2018-10-08 Thread brian m. carlson
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

Re: [PATCH v2 1/2] editorconfig: provide editor settings for Git developers

2018-10-08 Thread brian m. carlson
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

[PATCH v2 0/2] EditorConfig file

2018-10-08 Thread brian m. carlson
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

[PATCH v2 1/2] editorconfig: provide editor settings for Git developers

2018-10-08 Thread brian m. carlson
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

[PATCH v2 2/2] editorconfig: indicate settings should be kept in sync

2018-10-08 Thread brian m. carlson
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 @@

Re: Fixing constant preference prompts during tests

2018-09-27 Thread brian m. carlson
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

Re: [PATCH] Add an EditorConfig file

2018-09-27 Thread brian m. carlson
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

Re: [PATCH v2] mailmap: consistently normalize brian m. carlson's name

2018-09-24 Thread brian m. carlson
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

Re: Import/Export as a fast way to purge files from Git?

2018-09-23 Thread brian m. carlson
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

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-23 Thread brian m. carlson
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 .

Re: [PATCH v2 2/3] transport.c: introduce core.alternateRefsCommand

2018-09-22 Thread brian m. carlson
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

Re: [PATCH] Add an EditorConfig file

2018-09-21 Thread brian m. carlson
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

Re: [PATCH] Add an EditorConfig file

2018-09-21 Thread brian m. carlson
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

Re: [PATCH] Add an EditorConfig file

2018-09-19 Thread brian m. carlson
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

Re: [PATCH] Add an EditorConfig file

2018-09-19 Thread brian m. carlson
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

[PATCH] Add an EditorConfig file

2018-09-17 Thread brian m. carlson
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

Re: [PATCH] mailmap: consistently normalize brian m. carlson's name

2018-09-17 Thread brian m. carlson
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 >

Re: What's cooking in git.git (Sep 2018, #03; Fri, 14)

2018-09-16 Thread brian m. carlson
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

[PATCH v5 11/12] t1407: make hash size independent

2018-09-12 Thread 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/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

[PATCH v5 10/12] t1406: make hash-size independent

2018-09-12 Thread 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/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

[PATCH v5 08/12] t1400: switch hard-coded object ID to variable

2018-09-12 Thread brian m. carlson
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

[PATCH v5 07/12] t1006: make hash size independent

2018-09-12 Thread 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

[PATCH v5 01/12] t: add test functions to translate hash-related values

2018-09-12 Thread brian m. carlson
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 ++

[PATCH v5 06/12] t0064: make hash size independent

2018-09-12 Thread brian m. carlson
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

[PATCH v5 02/12] t0000: use hash translation table

2018-09-12 Thread brian m. carlson
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

[PATCH v5 12/12] t5318: use test_oid for HASH_LEN

2018-09-12 Thread brian m. carlson
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

[PATCH v5 03/12] t0000: update tests for SHA-256

2018-09-12 Thread brian m. carlson
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 --

[PATCH v5 00/12] Hash-independent tests (part 3)

2018-09-12 Thread 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

[PATCH v5 04/12] t0002: abstract away SHA-1 specific constants

2018-09-12 Thread brian m. carlson
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

[PATCH v5 05/12] t0027: make hash size independent

2018-09-12 Thread brian m. carlson
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

[PATCH v5 09/12] t1405: make hash size independent

2018-09-12 Thread 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

Re: Multiple GIT Accounts & HTTPS Client Certificates - Config

2018-09-12 Thread brian m. carlson
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

Re: [PATCH 1/6] t/helper: keep test-tool command list sorted

2018-09-09 Thread brian m. carlson
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

Re: ordered string-list considered harmful, was Re: [PATCH v3] Allow aliases that include other aliases

2018-09-08 Thread brian m. carlson
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

Re: [PATCH v4 01/12] t: add test functions to translate hash-related values

2018-09-05 Thread brian m. carlson
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

[PATCH v4 11/12] t1407: make hash size independent

2018-09-03 Thread 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/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

[PATCH v4 10/12] t1406: make hash-size independent

2018-09-03 Thread 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/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

[PATCH v4 02/12] t0000: use hash translation table

2018-09-03 Thread brian m. carlson
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

[PATCH v4 06/12] t0064: make hash size independent

2018-09-03 Thread brian m. carlson
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

[PATCH v4 12/12] t5318: use test_oid for HASH_LEN

2018-09-03 Thread brian m. carlson
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

[PATCH v4 04/12] t0002: abstract away SHA-1 specific constants

2018-09-03 Thread brian m. carlson
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

[PATCH v4 08/12] t1400: switch hard-coded object ID to variable

2018-09-03 Thread brian m. carlson
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

[PATCH v4 01/12] t: add test functions to translate hash-related values

2018-09-03 Thread brian m. carlson
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 +++

[PATCH v4 07/12] t1006: make hash size independent

2018-09-03 Thread 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

[PATCH v4 03/12] t0000: update tests for SHA-256

2018-09-03 Thread brian m. carlson
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 --

[PATCH v4 09/12] t1405: make hash size independent

2018-09-03 Thread 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

[PATCH v4 00/12] Hash-independent tests (part 3)

2018-09-03 Thread brian m. carlson
): 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

[PATCH v4 05/12] t0027: make hash size independent

2018-09-03 Thread brian m. carlson
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

Re: [RFC PATCH 08/12] commit-graph: convert to using the_hash_algo

2018-09-03 Thread brian m. carlson
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

Re: [PATCH v3 05/11] t0027: make hash size independent

2018-09-01 Thread brian m. carlson
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

Re: [RFC PATCH 00/12] Base SHA-256 algorithm implementation

2018-08-29 Thread brian m. carlson
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

Re: [RFC PATCH 08/12] commit-graph: convert to using the_hash_algo

2018-08-29 Thread brian m. carlson
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

Re: [RFC PATCH 00/12] Base SHA-256 algorithm implementation

2018-08-29 Thread brian m. carlson
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

Re: [RFC PATCH 09/12] Add a base implementation of SHA-256 support

2018-08-29 Thread brian m. carlson
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. > > >

Re: [RFC PATCH 10/12] sha256: add an SHA-256 implementation using libgcrypt

2018-08-29 Thread brian m. carlson
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

Re: [PATCH v3 01/11] t: add tool to translate hash-related values

2018-08-29 Thread brian m. carlson
. 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

Re: [PATCH v3 01/11] t: add tool to translate hash-related values

2018-08-29 Thread brian m. carlson
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

[RFC PATCH 01/12] sha1-file: rename algorithm to "sha1"

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 02/12] sha1-file: provide functions to look up hash algorithms

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 10/12] sha256: add an SHA-256 implementation using libgcrypt

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 12/12] commit-graph: specify OID version for SHA-256

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 11/12] hash: add an SHA-256 implementation using OpenSSL

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 09/12] Add a base implementation of SHA-256 support

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 07/12] t/helper: add a test helper to compute hash speed

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 08/12] commit-graph: convert to using the_hash_algo

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 05/12] t: make the sha1 test-tool helper generic

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 06/12] sha1-file: add a constant for hash block size

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 03/12] hex: introduce functions to print arbitrary hashes

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 04/12] t: add basic tests for our SHA-1 implementation

2018-08-28 Thread brian m. carlson
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

[RFC PATCH 00/12] Base SHA-256 algorithm implementation

2018-08-28 Thread brian m. carlson
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

[PATCH v3 06/11] t0064: make hash size independent

2018-08-28 Thread brian m. carlson
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

[PATCH v3 02/11] t0000: use hash translation table

2018-08-28 Thread brian m. carlson
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

[PATCH v3 08/11] t1400: switch hard-coded object ID to variable

2018-08-28 Thread brian m. carlson
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

[PATCH v3 03/11] t0000: update tests for SHA-256

2018-08-28 Thread brian m. carlson
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 --

[PATCH v3 07/11] t1006: make hash size independent

2018-08-28 Thread 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

[PATCH v3 09/11] t1405: make hash size independent

2018-08-28 Thread 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

[PATCH v3 11/11] t1407: make hash size independent

2018-08-28 Thread 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/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

[PATCH v3 10/11] t1406: make hash-size independent

2018-08-28 Thread 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/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

[PATCH v3 04/11] t0002: abstract away SHA-1 specific constants

2018-08-28 Thread brian m. carlson
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

[PATCH v3 05/11] t0027: make hash size independent

2018-08-28 Thread brian m. carlson
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

[PATCH v3 01/11] t: add tool to translate hash-related values

2018-08-28 Thread brian m. carlson
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

[PATCH v3 00/11] Hash-independent tests (part 3)

2018-08-28 Thread brian m. carlson
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

Re: avoid "Set preference list" during make test?

2018-08-28 Thread brian m. carlson
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

Re: [PATCH 0/9] introducing oideq()

2018-08-28 Thread brian m. carlson
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&

Re: Git clean removing tracked files semi-regularly

2018-08-27 Thread brian m. carlson
.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

<    2   3   4   5   6   7   8   9   10   11   >