Re: git, monorepos, and access control

2018-12-05 Thread brian m. carlson
you have much better access control opportunities, in general, smaller repositories are going to perform better and be easier to work with than monorepos. While VFS for Git is a great technology, using a set of smaller repositories is going to outperform it every time, both on developer machines, and

Re: [WIP RFC 2/5] Documentation: add Packfile URIs design doc

2018-12-03 Thread brian m. carlson
d fetching even the initial packfile at once might be a problem. (I've seen such questions on Stack Overflow, for example.) Having said that, I think overall this is a good idea and I'm glad to see a proposal for it. [0] For example, a naughty-word filter may corrupt or block certain byte s

Re: [PATCH] tests: avoid syntax triggering old dash bug

2018-11-27 Thread brian m. carlson
It might be better for us to encourage users to upgrade to an OS that has security support rather than work around bugs in obsolete OSes. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [RFC PATCH] Introduce "precious" file concept

2018-11-27 Thread brian m. carlson
y be the right way to go. I realize that may not provide all the benefits we want out of the box, but it lets people turn the option on once and forget about it. It also lets people who don't desire this new behavior explicitly turn it off. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: BUG: CR marker ^M doesn't show up in '-' lines of diffs when the ending of the removed line is CR+LF

2018-11-25 Thread brian m. carlson
ror-highlight or set diff.wsErrorHighlight. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: insteadOf and git-request-pull output

2018-11-16 Thread brian m. carlson
ts to GitHub. Performing the rewrite is definitely the right thing to do, since other users may not have my alias available. I agree that in your case, a rewrite seems less appropriate, but I think we should only skip the rewrite if the value already matches a valid URL. -- brian m. carlson: Houston,

[PATCH v6 11/12] sha256: add an SHA-256 implementation using libgcrypt

2018-11-13 Thread brian m. carlson
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| 13 +++-- hash.h | 4 sha256/gcrypt.h | 30 ++ 3 files changed, 45

[PATCH v6 09/12] commit-graph: convert to using the_hash_algo

2018-11-13 Thread brian m. carlson
. Signed-off-by: brian m. carlson --- commit-graph.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/commit-graph.c b/commit-graph.c index 40c855f185..6763d19288 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -23,16 +23,11 @@ #define

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

2018-11-13 Thread brian m. carlson
for 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

[PATCH v6 10/12] Add a base implementation of SHA-256 support

2018-11-13 Thread brian m. carlson
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. [1] https://public-inbox.org/git/20180609224913.gc38...@genre.crustytoothpaste.net/ Signed-off-by: brian m. carlson --- Makefile

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

2018-11-13 Thread brian m. carlson
MiB/s (16 KiB chunks) Signed-off-by: brian m. carlson --- Makefile | 7 +++ hash.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 6c99844aa8..6844deb92d 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,8 @@ all:: # # Define GCRYPT_SHA256 to use the SHA

[PATCH v6 08/12] t/helper: add a test helper to compute hash speed

2018-11-13 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

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

2018-11-13 Thread brian m. carlson
handle all of the variants in use. Note that we maintain these functions because there are hashes which must change based on the hash algorithm in use but are not object IDs (such as pack checksums). Signed-off-by: brian m. carlson --- cache.h | 15 +-- hex.c | 32 -

[PATCH v6 00/12] Base SHA-256 implementation

2018-11-13 Thread brian m. carlson
ster * Strip leading whitespace from commit message. * Improve commit-graph patch to cover new code added since v1. * Be more honest about the scope of work involved in porting the SHA-256 implementation out of libtomcrypt. * Revert change to limit hashcmp to 20 bytes. brian m. carlson (12):

[PATCH v6 06/12] t: make the sha1 test-tool helper generic

2018-11-13 Thread brian m. carlson
. 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 insertions(+),

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

2018-11-13 Thread brian m. carlson
testing additional algorithms to verify that their implementations are working as expected. Signed-off-by: brian m. carlson --- t/t0015-hash.sh | 29 + 1 file changed, 29 insertions(+) create mode 100755 t/t0015-hash.sh diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh new

[PATCH v6 04/12] cache: make hashcmp and hasheq work with larger hashes

2018-11-13 Thread brian m. carlson
GCC 8.2.0, making hasheq defer to hashcmp when there are two branches prevents the compiler from inlining the comparison, while the code in this patch is inlined properly. Add a comment to avoid an accidental performance regression from well-intentioned refactoring. Signed-off-by: brian

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

2018-11-13 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

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

2018-11-13 Thread brian m. carlson
his field in any configuration settings. 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 2daf7d9935..3b9c042691 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -97,7 +97,7 @@ const struct git_hash_a

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

2018-11-13 Thread brian m. carlson
On Wed, Nov 14, 2018 at 12:11:07AM +, Ramsay Jones wrote: > > > On 13/11/2018 18:42, Derrick Stolee wrote: > > On 11/4/2018 6:44 PM, brian m. carlson wrote: > >> +int hash_algo_by_name(const char *name) > >> +{ > >> +    int i; > >> + 

Re: [PATCH] git-compat-util: prefer poll.h to sys/poll.h

2018-11-13 Thread brian m. carlson
in UTF-16 mode. > - t1308.23 is failing because musl `fopen` is success when open directory > in readonly mode. POSIX allows this behavior: > http://pubs.opengroup.org/onlinepubs/7908799/xsh/fopen.html > [EISDIR] > The named file is a directory and mode requires write access. Does

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

2018-11-13 Thread brian m. carlson
On Tue, Nov 13, 2018 at 07:45:41PM +0100, Duy Nguyen wrote: > On Tue, Nov 13, 2018 at 7:42 PM Derrick Stolee wrote: > > > > On 11/4/2018 6:44 PM, brian m. carlson wrote: > > > +int hash_algo_by_name(const char *name) > > > +{ > > > + int i; > &g

Re: [RFC PATCH] Introduce "precious" file concept

2018-11-12 Thread brian m. carlson
I agree that your proposal would have been a better design originally, but breaking the way automated systems currently work is probably going to be a dealbreaker. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 04/10] fast-export: avoid dying when filtering by paths and old tags exist

2018-11-12 Thread brian m. carlson
deed be nice if we used $ZERO_OID. Also, we prefer to write "egrep", since some less capable systems don't have a grep with -E. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 0/1] http: add support selecting http version

2018-11-07 Thread brian m. carlson
bcurl to do this rather than putting it in Git. Users will automatically get the best supported protocol instead of having to configure it manually. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

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

2018-11-06 Thread brian m. carlson
On Mon, Nov 05, 2018 at 12:39:14PM +0100, Ævar Arnfjörð Bjarmason wrote: > On Sun, Nov 04 2018, brian m. carlson wrote: > > + { > > + "sha256", > > + /* "s256", big-endian */ > > The existing entry/comment for sha1 is: >

Re: Design of multiple hash support

2018-11-05 Thread brian m. carlson
On Mon, Nov 05, 2018 at 02:00:42PM -0800, Jonathan Nieder wrote: > Hi, > > Duy Nguyen wrote: > > On Mon, Nov 5, 2018 at 2:02 AM brian m. carlson > > wrote: > > >> There are basically two approaches I can take. The first is to provide > >> each comma

Re: Design of multiple hash support

2018-11-05 Thread brian m. carlson
On Mon, Nov 05, 2018 at 10:03:21AM -0800, Stefan Beller wrote: > On Sun, Nov 4, 2018 at 6:36 PM Junio C Hamano wrote: > > > > "brian m. carlson" writes: > > > > > I'm currently working on getting Git to support multiple hash algorithms > > >

Wildcard URL config matching

2018-11-05 Thread brian m. carlson
er to have things work correctly if we want to implement the current Git behavior to prevent combinatorial explosion. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Design of multiple hash support

2018-11-04 Thread brian m. carlson
I'm currently working on getting Git to support multiple hash algorithms in the same binary (SHA-1 and SHA-256). In order to have a fully functional binary, we'll need to have some way of indicating to certain commands (such as init and show-index) that they should assume a certain hash

[PATCH v5 09/12] commit-graph: convert to using the_hash_algo

2018-11-04 Thread brian m. carlson
. Signed-off-by: brian m. carlson --- commit-graph.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/commit-graph.c b/commit-graph.c index 40c855f185..6763d19288 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -23,16 +23,11 @@ #define

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

2018-11-04 Thread brian m. carlson
MiB/s (16 KiB chunks) Signed-off-by: brian m. carlson --- Makefile | 7 +++ hash.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 5a07e03100..36fd3a149b 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,8 @@ all:: # # Define GCRYPT_SHA256 to use the SHA

[PATCH v5 11/12] sha256: add an SHA-256 implementation using libgcrypt

2018-11-04 Thread brian m. carlson
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| 13 +++-- hash.h | 4 sha256/gcrypt.h | 30 ++ 3 files changed, 45

[PATCH v5 10/12] Add a base implementation of SHA-256 support

2018-11-04 Thread brian m. carlson
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. [1] https://public-inbox.org/git/20180609224913.gc38...@genre.crustytoothpaste.net/ Signed-off-by: brian m. carlson --- Makefile

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

2018-11-04 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

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

2018-11-04 Thread brian m. carlson
his field in any configuration settings. 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 dd0b6aa873..91311ebb3d 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -97,7 +97,7 @@ const struct git_hash_a

[PATCH v5 06/12] t: make the sha1 test-tool helper generic

2018-11-04 Thread brian m. carlson
. 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 insertions(+),

[PATCH v5 08/12] t/helper: add a test helper to compute hash speed

2018-11-04 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

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

2018-11-04 Thread brian m. carlson
testing additional algorithms to verify that their implementations are working as expected. Signed-off-by: brian m. carlson --- t/t0015-hash.sh | 29 + 1 file changed, 29 insertions(+) create mode 100755 t/t0015-hash.sh diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh new

[PATCH v5 04/12] cache: make hashcmp and hasheq work with larger hashes

2018-11-04 Thread brian m. carlson
GCC 8.2.0, making hasheq defer to hashcmp when there are two branches prevents the compiler from inlining the comparison, while the code in this patch is inlined properly. Add a comment to avoid an accidental performance regression from well-intentioned refactoring. Signed-off-by: brian

[PATCH v5 00/12] Base SHA-256 implementation

2018-11-04 Thread brian m. carlson
ibtomcrypt. * Revert change to limit hashcmp to 20 bytes. 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 cache: make hashcmp and hasheq work with larger hashes

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

2018-11-04 Thread brian m. carlson
handle all of the variants in use. Note that we maintain these functions because there are hashes which must change based on the hash algorithm in use but are not object IDs (such as pack checksums). Signed-off-by: brian m. carlson --- cache.h | 15 +-- hex.c | 32 -

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

2018-11-04 Thread brian m. carlson
for 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

Re: [PATCH/RFC v2] sequencer.c: record revert/cherry-pick commit with trailer lines

2018-11-04 Thread brian m. carlson
ot;--notate=trailer" mean this new format. Similarly, git revert could learn such an option as well. One final thought: since our trailers seem to act as if we wrote "this commit" (has been), I wonder if we should say "Reverts" instead of "Revert" for consistency. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [RFC v1] Add virtual file system settings and hook proc

2018-11-04 Thread brian m. carlson
alled "sparse-checkout" or "sparse-exclude"; better names are okay), and simply turn it on based on whether or not there's an appropriate hook file there and whether core.sparseCheckout is on (or possibly with hook.sparseExclude or something). With a design more like that, I don't

Re: git-rebase is ignoring working-tree-encoding

2018-11-04 Thread brian m. carlson
them to write that, even if Git won't be able to guarantee producing that, would be fine, as long as the data is what we expect. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: git-rebase is ignoring working-tree-encoding

2018-11-04 Thread brian m. carlson
t; is ambiguous: there are two endiannesses, and so as long as you get a BOM in the output, either one is an acceptable option. Which one you get is dependent on what the underlying code thinks is the default, and traditionally for Unix systems and Unix tools that's been big-endian. If you want

Re: [PATCH 2/2] t/t7510-signed-commit.sh: add signing subkey to Eris Discordia key

2018-11-04 Thread brian m. carlson
most recent subkey suitable for a particular purpose, and I think the test relies on that behavior. However, I'm not sure that's documented. Do we want to rely on that behavior or be more explicit? (This is a question, not an opinion.) -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: Git Slowness on Windows w/o Internet

2018-11-03 Thread brian m. carlson
orms this behavior, say, to check for updates. I'd recommend that you contact the distributor, which in this case might be Git for Windows, and see if they can tell you more about what's going on. The URL for that project is at https://github.com/git-for-windows/git. -- brian m. carlson: Houston,

Re: [PATCH] send-email: Avoid empty transfer encoding header

2018-11-01 Thread brian m. carlson
> my $to = shift; > > - return $message if ($from eq $to and $from ne '7bit'); > + return ($message, $to) if ($from eq $to and $from ne '7bit'); Thanks, this is obviously correct. Would you like to squash in the below patch to add a test? - >% - From 00000000

Re: using --force-with-lease after git rebase

2018-10-31 Thread brian m. carlson
--force when possible ensures that you are overwriting what you think you're overwriting, and not additional working changes that someone else has made, so it's a good practice. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [BUG?] protocol.version=2 sends HTTP "Expect" headers

2018-10-31 Thread brian m. carlson
or now. Between libcurl and better proxy support, I think this issue is mostly solved. If we need to fix it in the future, we can, and people can fall back to older protocols via config in the interim. [0] In some environments, people use SSH because the proxy breaks everything that looks like HTTP

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

2018-10-31 Thread brian m. carlson
On Mon, Oct 29, 2018 at 09:39:33AM +0900, Junio C Hamano wrote: > "brian m. carlson" writes: > > This may not strictly be needed, but removing it makes the header no > > longer self-contained, which blows up my (and others') in-editor > > linting. > > That so

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

2018-10-28 Thread brian m. carlson
On Wed, Oct 24, 2018 at 08:02:55PM -0700, Carlo Arenas wrote: > On Wed, Oct 24, 2018 at 7:41 PM brian m. carlson > wrote: > > diff --git a/sha256/block/sha256.h b/sha256/block/sha256.h > > new file mode 100644 > > index 00..38f02f7e6c > > --- /dev/null &

Re: [PATCH 0/3] some more hdr-check clean headers

2018-10-28 Thread brian m. carlson
it.h"' issue. > > These changes are on top of current master (@c670b1f876) and merge > without conflict to 'next' and with a 'minor' conflict on 'pu'. All three of these patches look sane to me. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: Git Test Coverage Report (Saturday, Oct 27)

2018-10-27 Thread brian m. carlson
diff A B' to > discover _new_lines of code that are not covered. This report ignores lines > including "BUG(". Thanks for producing this. > Commits introducing uncovered code: > brian m. carlson  2f90b9d9b: sha1-file: provide functions to look up > hash algorithms >

[PATCH v4 09/12] commit-graph: convert to using the_hash_algo

2018-10-24 Thread brian m. carlson
. Signed-off-by: brian m. carlson --- commit-graph.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/commit-graph.c b/commit-graph.c index 40c855f185..6763d19288 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -23,16 +23,11 @@ #define

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

2018-10-24 Thread brian m. carlson
his field in any configuration settings. 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 dd0b6aa873..91311ebb3d 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -97,7 +97,7 @@ const struct git_hash_a

[PATCH v4 11/12] sha256: add an SHA-256 implementation using libgcrypt

2018-10-24 Thread brian m. carlson
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| 13 +++-- hash.h | 4 sha256/gcrypt.h | 30 ++ 3 files changed, 45

[PATCH v4 08/12] t/helper: add a test helper to compute hash speed

2018-10-24 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

[PATCH v4 00/12] Base SHA-256 implementation

2018-10-24 Thread brian m. carlson
commit-graph patch to cover new code added since v1. * Be more honest about the scope of work involved in porting the SHA-256 implementation out of libtomcrypt. * Revert change to limit hashcmp to 20 bytes. brian m. carlson (12): sha1-file: rename algorithm to "sha1" sha1-file: provide

[PATCH v4 10/12] Add a base implementation of SHA-256 support

2018-10-24 Thread brian m. carlson
. Signed-off-by: brian m. carlson --- Makefile | 4 + cache.h| 12 ++- hash.h | 19 +++- sha1-file.c| 45 + sha256/block/sha256.c | 201 + sha256/block/sha256.h | 26 ++ t/helper/test

[PATCH v4 06/12] t: make the sha1 test-tool helper generic

2018-10-24 Thread brian m. carlson
. 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 insertions(+),

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

2018-10-24 Thread brian m. carlson
testing additional algorithms to verify that their implementations are working as expected. Signed-off-by: brian m. carlson --- t/t0015-hash.sh | 29 + 1 file changed, 29 insertions(+) create mode 100755 t/t0015-hash.sh diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh new

[PATCH v4 04/12] cache: make hashcmp and hasheq work with larger hashes

2018-10-24 Thread brian m. carlson
GCC 8.2.0, making hasheq defer to hashcmp when there are two branches prevents the compiler from inlining the comparison, while the code in this patch is inlined properly. Add a comment to avoid an accidental performance regression from well-intentioned refactoring. Signed-off-by: brian

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

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

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

2018-10-24 Thread brian m. carlson
handle all of the variants in use. Note that we maintain these functions because there are hashes which must change based on the hash algorithm in use but are not object IDs (such as pack checksums). Signed-off-by: brian m. carlson --- cache.h | 15 +-- hex.c | 32 -

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

2018-10-24 Thread brian m. carlson
MiB/s (16 KiB chunks) Signed-off-by: brian m. carlson --- Makefile | 7 +++ hash.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 5a07e03100..36fd3a149b 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,8 @@ all:: # # Define GCRYPT_SHA256 to use the SHA

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

2018-10-24 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

Re: [PATCH 2/3] mingw: replace MSVCRT's fstat() with a Win32-based implementation

2018-10-24 Thread brian m. carlson
On Wed, Oct 24, 2018 at 09:37:43AM +0200, Johannes Schindelin wrote: > Hi brian, > > On Wed, 24 Oct 2018, brian m. carlson wrote: > > These lines strike me as a bit odd. As far as I'm aware, Unix systems > > don't return anything useful in this field when ca

Re: Add config option to make "--keep-index" the default for "git stash push"

2018-10-23 Thread brian m. carlson
lets me have more control over the exact behavior I want. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 2/3] mingw: replace MSVCRT's fstat() with a Win32-based implementation

2018-10-23 Thread brian m. carlson
> + buf->st_size = avail; These lines strike me as a bit odd. As far as I'm aware, Unix systems don't return anything useful in this field when calling fstat on a pipe. Is there a reason we fill this in on Windows? If so, could the commit message explain wha

Re: git pull defaults for recursesubmodules

2018-10-23 Thread brian m. carlson
git -C parent submodule update --remote && > + git -C parent add sub && > + git -C parent commit -m "update submodule" && > + > + git -C super config fetch.recurseSubmodules true && > + git -C super pull --no-rebase && > + test_path_is_file super/sub/fetch_recurse_submodules.t > +' Can we have a test that --no-recurse-submodules overrides fetch.recurseSubmodules? -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 1/3] gpg-interface.c: use flags to determine key/signer info presence

2018-10-23 Thread brian m. carlson
uses without having to explicitly update the conditions. This series looks good to me. I was going to ask after patch 2 whether you were printing the subkey or primary key fingerprint, and then you answered my question in patch 3. Thanks for including both. -- brian m. carlson: Houston, Texas

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

2018-10-22 Thread brian m. carlson
if anyone has more comments, and then reroll with that change. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

[PATCH v3 09/12] commit-graph: convert to using the_hash_algo

2018-10-21 Thread brian m. carlson
. Signed-off-by: brian m. carlson --- commit-graph.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/commit-graph.c b/commit-graph.c index 40c855f185..6763d19288 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -23,16 +23,11 @@ #define

[PATCH v3 06/12] t: make the sha1 test-tool helper generic

2018-10-21 Thread brian m. carlson
. 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 insertions(+),

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

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

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

2018-10-21 Thread brian m. carlson
MiB/s (16 KiB chunks) Signed-off-by: brian m. carlson --- Makefile | 7 +++ hash.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 5a07e03100..36fd3a149b 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,8 @@ all:: # # Define GCRYPT_SHA256 to use the SHA

[PATCH v3 04/12] cache: make hashcmp and hasheq work with larger hashes

2018-10-21 Thread brian m. carlson
GCC 8.2.0, making hasheq defer to hashcmp when there are two branches prevents the compiler from inlining the comparison, while the code in this patch is inlined properly. Add a comment to avoid an accidental performance regression from well-intentioned refactoring. Signed-off-by: brian

[PATCH v3 08/12] t/helper: add a test helper to compute hash speed

2018-10-21 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

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

2018-10-21 Thread brian m. carlson
his field in any configuration settings. 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 dd0b6aa873..91311ebb3d 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -97,7 +97,7 @@ const struct git_hash_a

[PATCH v3 00/12] Base SHA-256 implementation

2018-10-21 Thread brian m. carlson
leading whitespace from commit message. * Improve commit-graph patch to cover new code added since v1. * Be more honest about the scope of work involved in porting the SHA-256 implementation out of libtomcrypt. * Revert change to limit hashcmp to 20 bytes. brian m. carlson (12): sha1-file: rename

[PATCH v3 11/12] sha256: add an SHA-256 implementation using libgcrypt

2018-10-21 Thread brian m. carlson
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| 13 +++-- hash.h | 4 sha256/gcrypt.h | 30 ++ 3 files changed, 45

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

2018-10-21 Thread brian m. carlson
testing additional algorithms to verify that their implementations are working as expected. Signed-off-by: brian m. carlson --- t/t0015-hash.sh | 29 + 1 file changed, 29 insertions(+) create mode 100755 t/t0015-hash.sh diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh new

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

2018-10-21 Thread brian m. carlson
handle all of the variants in use. Note that we maintain these functions because there are hashes which must change based on the hash algorithm in use but are not object IDs (such as pack checksums). Signed-off-by: brian m. carlson --- cache.h | 15 +-- hex.c | 32 -

[PATCH v3 10/12] Add a base implementation of SHA-256 support

2018-10-21 Thread brian m. carlson
. Signed-off-by: brian m. carlson --- Makefile | 4 + cache.h| 12 ++- hash.h | 19 - sha1-file.c| 45 ++ sha256/block/sha256.c | 186 + sha256/block/sha256.h | 26 ++ t/helper/test

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

2018-10-21 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

Re: Shouldn't git be able to apply diffs that it created with --ignore-whitespace?

2018-10-19 Thread brian m. carlson
l, but it won't in the general case. git apply --ignore-whitespace only modifies context lines, so it doesn't affect the actual content lines in the diff. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2 13/13] commit-graph: specify OID version for SHA-256

2018-10-19 Thread brian m. carlson
the patches, and we'll make sure that we serialize the format_version field in the file then. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2 13/13] commit-graph: specify OID version for SHA-256

2018-10-17 Thread brian m. carlson
On Wed, Oct 17, 2018 at 04:31:19PM +0200, Duy Nguyen wrote: > On Wed, Oct 17, 2018 at 12:44 AM brian m. carlson > wrote: > > Honestly, anything in the .git directory that is not the v3 pack indexes > > or the loose object file should be in exactly one hash algorithm. We >

Re: [PATCH v2 03/13] hex: introduce functions to print arbitrary hashes

2018-10-17 Thread brian m. carlson
hange, and we'll see if we like it better. If we don't, I can pull the old version out of history. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2 10/13] Add a base implementation of SHA-256 support

2018-10-17 Thread brian m. carlson
e time to put on my language lawyer > hat. > > Perhaps an old compiler bug? Clang in general, newer GCC versions, or > gcc-4.8 with -Wall -Werror but without -O2 don't seem to be affected. ...or this code path. Presumably GCC 4.8 and macOS are happy with the code that we already have in block-sha1. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2 01/13] sha1-file: rename algorithm to "sha1"

2018-10-17 Thread brian m. carlson
On Tue, Oct 16, 2018 at 05:17:53PM +0200, Duy Nguyen wrote: > On Mon, Oct 15, 2018 at 4:21 AM brian m. carlson > wrote: > > > > The transition plan anticipates us using a syntax such as "^{sha1}" for > > disambiguation. Since this is a syntax some people will b

Re: [PATCH v2 13/13] commit-graph: specify OID version for SHA-256

2018-10-17 Thread brian m. carlson
On Wed, Oct 17, 2018 at 08:21:42AM -0400, Derrick Stolee wrote: > On 10/14/2018 10:19 PM, brian m. carlson wrote: > > Since the commit-graph code wants to serialize the hash algorithm into > > the data store, specify a version number for each supported algorithm. > > N

Re: problem with not being able to enforce git content filters

2018-10-16 Thread brian m. carlson
hes because often I want to customize my hooks, but your project will decide what works best for it. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 2/3] pack-objects (mingw): demonstrate a segmentation fault with large deltas

2018-10-16 Thread brian m. carlson
utex, but on amd64 Linux the default initializer is all zeros, so since we use a static variable, it happens to coincidentally have the right value, so we don't notice. Thanks for fixing this. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: problem with not being able to enforce git content filters

2018-10-16 Thread brian m. carlson
to be prompted for such a thing, so even if that were a feature, people would turn if off, and you'd be no better off than you were before. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2 00/13] Base SHA-256 implementation

2018-10-16 Thread brian m. carlson
On Tue, Oct 16, 2018 at 01:01:07PM +0900, Junio C Hamano wrote: > "brian m. carlson" writes: > > > t/t0014-hash.sh | 54 > > create mode 100755 t/t0014-hash.sh > > If I am not mistaken, 0014 is already used by another topic in

Re: [PATCH v2 13/13] commit-graph: specify OID version for SHA-256

2018-10-16 Thread brian m. carlson
On Tue, Oct 16, 2018 at 06:09:41PM +0200, Duy Nguyen wrote: > On Tue, Oct 16, 2018 at 6:01 PM Derrick Stolee wrote: > > > > On 10/16/2018 11:35 AM, Duy Nguyen wrote: > > > On Mon, Oct 15, 2018 at 4:23 AM brian m. carlson > > > wrote: > > >> Since the

  1   2   3   4   5   6   7   8   9   10   >