[PATCH v2 13/35] builtin/name-rev: make hash-size independent

2019-02-18 Thread brian m. carlson
Use the_hash_algo when parsing instead of GIT_SHA1_HEXSZ so that this function works with any size hash. Rename the variable forty to counter, as this is a better name and is independent of the hash size. Signed-off-by: brian m. carlson --- builtin/name-rev.c | 14 -- 1 file

[PATCH v2 34/35] Git.pm: make hash size independent

2019-02-18 Thread brian m. carlson
actly 64 hex characters. Signed-off-by: brian m. carlson --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index d856930b2e..62c472e0ce 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -980,7 +980,7 @@ sub cat_blob { retu

[PATCH v2 04/35] pack-bitmap: convert struct stored_bitmap to object_id

2019-02-18 Thread brian m. carlson
Convert struct stored_bitmap to use struct object_id. Signed-off-by: brian m. carlson --- pack-bitmap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pack-bitmap.c b/pack-bitmap.c index b53f37243c..c760913cea 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -18,7

[PATCH v2 05/35] pack-bitmap: replace sha1_to_hex

2019-02-18 Thread brian m. carlson
Replace the uses of sha1_to_hex in the pack bitmap code with hash_to_hex to allow the use of SHA-256 as well. Rename a few variables since they are no longer limited to SHA-1. Signed-off-by: brian m. carlson --- pack-bitmap-write.c | 6 +++--- pack-bitmap.c | 8 2 files changed

[PATCH v2 01/35] t/lib-submodule-update: use appropriate length constant

2019-02-18 Thread brian m. carlson
Instead of using a specific invalid hard-coded object ID, produce one of the appropriate length by using test_oid. Signed-off-by: brian m. carlson --- t/lib-submodule-update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/lib-submodule-update.sh b/t/lib-submodule

[PATCH v2 15/35] fast-import: replace sha1_to_hex

2019-02-18 Thread brian m. carlson
Replace the uses of sha1_to_hex in this function with hash_to_hex to allow the use of SHA-256 as well. Rename a variable since it is no longer limited to SHA-1. Signed-off-by: brian m. carlson --- fast-import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fast

[PATCH v2 26/35] hash: add a function to lookup hash algorithm by length

2019-02-18 Thread brian m. carlson
There are some cases, such as the dumb HTTP transport and bundles, where we can only determine the hash algorithm in use by the length of the object IDs. Provide a function that looks up the algorithm by length. Signed-off-by: brian m. carlson --- hash.h | 2 ++ sha1-file.c | 8 2

[PATCH v2 28/35] builtin/get-tar-commit-id: make hash size independent

2019-02-18 Thread brian m. carlson
To make this code independent of the hash size, verify that the length of the comment is equal to that of any supported hash algorithm. Signed-off-by: brian m. carlson --- builtin/get-tar-commit-id.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/get-tar-commit

[PATCH v2 25/35] remote-curl: make hash size independent

2019-02-18 Thread brian m. carlson
Change one hard-coded use of the constant 40 to a reference to the_hash_algo. In addition, switch a use of get_oid_hex to parse_oid_hex to avoid the need to use a constant. Signed-off-by: brian m. carlson --- remote-curl.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff

[PATCH v2 23/35] http: compute hash of downloaded objects using the_hash_algo

2019-02-18 Thread brian m. carlson
Signed-off-by: brian m. carlson --- http.c | 10 +- http.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 993ddc956a..458d07fabb 100644 --- a/http.c +++ b/http.c @@ -2337,8 +2337,8 @@ static size_t fwrite_sha1_file(char *ptr, size_t eltsize

[PATCH v2 30/35] refspec: make hash size independent

2019-02-18 Thread brian m. carlson
Switch a use of GIT_SHA1_HEXSZ to use the_hash_algo. Signed-off-by: brian m. carlson --- refspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refspec.c b/refspec.c index f529092fd6..9a9bf21934 100644 --- a/refspec.c +++ b/refspec.c @@ -72,7 +72,7 @@ static int

[PATCH v2 06/35] pack-bitmap: switch hard-coded constants to the_hash_algo

2019-02-18 Thread brian m. carlson
Switch two hard-coded uses of 20 to references to the_hash_algo. Signed-off-by: brian m. carlson --- pack-bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pack-bitmap.c b/pack-bitmap.c index 6d6fa68563..603492c237 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c

[PATCH v2 29/35] archive: convert struct archiver_args to object_id

2019-02-18 Thread brian m. carlson
Change the commit_sha1 member to be called "commit_oid" and change it to be a pointer to struct object_id. Additionally, update some uses of GIT_SHA1_HEXSZ and hard-coded values to use the_hash_algo instead. Signed-off-by: brian m. carlson --- archive-tar.c | 7 --- archive-

[PATCH v2 24/35] http: replace sha1_to_hex

2019-02-18 Thread brian m. carlson
Since sha1_to_hex is limited to SHA-1, replace it with hash_to_hex. Signed-off-by: brian m. carlson --- http.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 458d07fabb..8ab07458e4 100644 --- a/http.c +++ b/http.c @@ -2079,19 +2079,19

[PATCH v2 12/35] object-store: rename and expand packed_git's sha1 member

2019-02-18 Thread brian m. carlson
e following semantic patch: @@ struct packed_git *E1; @@ - E1->sha1 + E1->hash @@ struct packed_git E1; @@ - E1.sha1 + E1.hash Signed-off-by: brian m. carlson --- builtin/pack-redundant.c | 2 +- fast-import.c| 17 + http-push.c | 3 ++- htt

[PATCH v2 14/35] fast-import: make hash-size independent

2019-02-18 Thread brian m. carlson
Replace several uses of GIT_SHA1_HEXSZ and 40-based constants with references to the_hash_algo. Update the note handling code here to compute path sizes based on GIT_MAX_RAWSZ as well. Signed-off-by: brian m. carlson --- fast-import.c | 45 + 1 file

[PATCH v2 27/35] get-tar-commit-id: parse comment record

2019-02-18 Thread brian m. carlson
From: Rene Scharfe Parse pax comment records properly and get rid of magic numbers for acceptable comment length. This simplifies a later change to handle longer hashes. Signed-off-by: Rene Scharfe Signed-off-by: brian m. carlson --- builtin/get-tar-commit-id.c | 13 +++-- 1 file

[PATCH v2 17/35] builtin/pull: make hash-size independent

2019-02-18 Thread brian m. carlson
Instead of using get_oid_hex and GIT_SHA1_HEXSZ, use parse_oid_hex to avoid the need for a constant and simplify the code. Additionally, fix some comments to refer to object IDs instead of SHA-1 and update a constant used to provide an allocation hint. Signed-off-by: brian m. carlson

[PATCH v2 20/35] http-push: remove remaining uses of sha1_to_hex

2019-02-18 Thread brian m. carlson
Since sha1_to_hex is limited to SHA-1, switch all remaining uses of it in this file to hash_to_hex or oid_to_hex. Modify update_remote to take a pointer to struct object_id, and since we don't modify that parameter in the function, set it to be const as well. Signed-off-by: brian m. ca

[PATCH v2 31/35] builtin/difftool: use parse_oid_hex

2019-02-18 Thread brian m. carlson
beginning of the object ID before we get to printing the error message. Signed-off-by: brian m. carlson --- builtin/difftool.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/builtin/difftool.c b/builtin/difftool.c index a3ea60ea71..5fa83f481e 100644 --- a/builtin

[PATCH v2 16/35] builtin/am: make hash size independent

2019-02-18 Thread brian m. carlson
Instead of using GIT_SHA1_HEXSZ, switch to using the_hash_algo and parse_oid_hex to parse the lines involved in rebasing notes. Signed-off-by: brian m. carlson --- builtin/am.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index

[PATCH v2 22/35] http: replace hard-coded constant with the_hash_algo

2019-02-18 Thread brian m. carlson
Replace a hard-coded 40 with a reference to the_hash_algo. Signed-off-by: brian m. carlson --- http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.c b/http.c index a09adc518f..993ddc956a 100644 --- a/http.c +++ b/http.c @@ -2065,7 +2065,7 @@ int http_fetch_ref(const

[PATCH v2 33/35] read-cache: read data in a hash-independent way

2019-02-18 Thread brian m. carlson
t the structure to hold the maximum amount of data that may be needed using a member called "data" and read and write this field independently in the various places that need to read and write the structure. Signed-off-by: brian m. carlson --- re

[PATCH v2 32/35] dir: make untracked cache extension hash size independent

2019-02-18 Thread brian m. carlson
Instead of using a struct with a flex array member to read and write the untracked cache extension, use a shorter, fixed-length struct and add the name and hash data explicitly. Signed-off-by: brian m. carlson --- dir.c | 28 ++-- 1 file changed, 14 insertions(+), 14

[PATCH v2 19/35] http-backend: allow 64-character hex names

2019-02-18 Thread brian m. carlson
: brian m. carlson --- http-backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/http-backend.c b/http-backend.c index 29e68e38b5..ec3144b444 100644 --- a/http-backend.c +++ b/http-backend.c @@ -711,8 +711,11 @@ static struct service_cmd { {"GET", "/objects/info/

[PATCH v2 21/35] http-walker: replace sha1_to_hex

2019-02-18 Thread brian m. carlson
Since sha1_to_hex is limited to SHA-1, replace the uses of it in this file with hash_to_hex. Rename several variables accordingly to reflect that they are no longer limited to SHA-1. Signed-off-by: brian m. carlson --- http-walker.c | 18 +- 1 file changed, 9 insertions(+), 9

[PATCH v2 35/35] gitweb: make hash size independent

2019-02-18 Thread brian m. carlson
ction. Finally, when formatting a log line, allow an abbreviated describe output to contain up to 64 characters. Helped-by: Ævar Arnfjörð Bjarmason Signed-off-by: brian m. carlson --- gitweb/gitweb.perl | 97 -- 1 file changed, 67 insertions(+

[PATCH v2 03/35] pack-bitmap: make bitmap header handling hash agnostic

2019-02-18 Thread brian m. carlson
Increase the checksum field in struct bitmap_disk_header to be GIT_MAX_RAWSZ bytes in length and ensure that we hash the proper number of bytes out when computing the bitmap checksum. Signed-off-by: brian m. carlson --- pack-bitmap-write.c | 2 +- pack-bitmap.c | 2 +- pack-bitmap.h

[PATCH v2 00/35] Hash function transition part 16

2019-02-18 Thread brian m. carlson
ed changes to Gitweb. René Scharfe (1): get-tar-commit-id: parse comment record brian m. carlson (34): t/lib-submodule-update: use appropriate length constant khash: move oid hash table definition pack-bitmap: make bitmap header handling hash agnostic pack-bitmap: convert struct stored

[PATCH v2 02/35] khash: move oid hash table definition

2019-02-18 Thread brian m. carlson
Move the oid khash table definition to khash.h and define a typedef for it, similar to the one we have for unsigned char pointers. Define variants that are maps as well. Signed-off-by: brian m. carlson --- khash.h | 18 ++ oidset.h | 12 2 files changed, 18

[PATCH v2 11/35] notes: replace sha1_to_hex

2019-02-18 Thread brian m. carlson
Replace the uses of sha1_to_hex in this function with hash_to_hex to allow the use of SHA-256 as well. Rename some variables since this code is no longer limited to SHA-1. Signed-off-by: brian m. carlson --- notes.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v2 18/35] http-push: convert to use the_hash_algo

2019-02-18 Thread brian m. carlson
Switch the lock token code to use the_hash_algo and increase its buffers to be allocated using GIT_MAX_* constants. Update the parsing of object paths to use the_hash_algo as well. Signed-off-by: brian m. carlson --- http-push.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[PATCH v2 08/35] submodule: avoid hard-coded constants

2019-02-18 Thread brian m. carlson
Instead of using hard-coded 40-based constants, express these values in terms of the_hash_algo and GIT_MAX_HEXSZ. Signed-off-by: brian m. carlson --- merge-recursive.c | 2 +- submodule.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/merge-recursive.c b/merge

[PATCH v2 07/35] pack-bitmap: switch hash tables to use struct object_id

2019-02-18 Thread brian m. carlson
Instead of storing unsigned char pointers in the hash tables, switch to storing instances of struct object_id. Update several internal functions and one external function to take pointers to struct object_id. Signed-off-by: brian m. carlson --- builtin/pack-objects.c | 6 ++--- pack-bitmap.c

Re: default gpg signing key

2019-02-18 Thread brian m. carlson
ut it. Also, without specifying -u, we'd pick whatever key was the default in the keyring, even if the email address for that key was wrong for the commit. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 30/31] Git.pm: make hash size independent

2019-02-18 Thread brian m. carlson
mail and not gitweb, and they're packaged independently. I'm not opposed to seeing a patch to do that, but it probably belongs in its own series. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 10/31] object-store: rename and expand packed_git's sha1 member

2019-02-13 Thread brian m. carlson
On Mon, Feb 11, 2019 at 10:32:15PM -0500, Eric Sunshine wrote: > On Mon, Feb 11, 2019 at 8:23 PM brian m. carlson > wrote: > > This member is used to represent the pack checksum of the pack in > > question. Expand this member to be GIT_MAX_RAWSZ bytes in length so it > >

Re: [PATCH] git-gui: Handle Ctrl+BS & Ctrl+Del in the commit msg

2019-02-12 Thread brian m. carlson
(and future us) in understanding what's going on. This isn't me trying to be difficult, but rather to help you get your patch in a state that's most likely to be accepted. It's common here to do a couple of revisions of a patch, incorporating reviewers' comments and polish

Re: [PATCH 28/31] dir: make untracked cache extension hash size independent

2019-02-12 Thread brian m. carlson
the user in whatever algorithms we support, translate them into the default algorithm, and then use them. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 24/31] archive-tar: make hash size independent

2019-02-12 Thread brian m. carlson
different patch for this in a later series, but I like this style better. I'm going to squash my existing patches together and then rework them such that they're based off yours. My technique iterated over the entire header, comparing the entire header, which is much less elegant than this solution. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 04/31] pack-bitmap: replace sha1_to_hex

2019-02-12 Thread brian m. carlson
On Tue, Feb 12, 2019 at 01:37:49AM -0500, Jeff King wrote: > On Tue, Feb 12, 2019 at 01:22:29AM +0000, brian m. carlson wrote: > > -static uint32_t find_object_pos(const unsigned char *sha1) > > +static uint32_t find_object_pos(const unsigned char *hash) > > Isn't

Re: [PATCH 12/31] fast-import: make hash-size independent

2019-02-12 Thread brian m. carlson
On Mon, Feb 11, 2019 at 10:44:12PM -0500, Eric Sunshine wrote: > On Mon, Feb 11, 2019 at 8:23 PM brian m. carlson > wrote: > > Replace several uses of GIT_SHA1_HEXSZ and 40-based constants with > > references to the_hash_algo. Update the note handling code here to > > com

Re: [PATCH 08/31] notes: make hash size independent

2019-02-11 Thread brian m. carlson
On Mon, Feb 11, 2019 at 08:37:49PM -0500, Eric Sunshine wrote: > On Mon, Feb 11, 2019 at 8:23 PM brian m. carlson > wrote: > > diff --git a/notes.c b/notes.c > > @@ -527,15 +529,15 @@ static unsigned char determine_fanout(struct int_node > > *tree, unsigned char

[PATCH 29/31] read-cache: read data in a hash-independent way

2019-02-11 Thread brian m. carlson
t the structure to hold the maximum amount of data that may be needed using a member called "data" and read and write this field independently in the various places that need to read and write the structure. Signed-off-by: brian m. carlson --- re

[PATCH 30/31] Git.pm: make hash size independent

2019-02-11 Thread brian m. carlson
actly 64 hex characters. Signed-off-by: brian m. carlson --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index d856930b2e..62c472e0ce 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -980,7 +980,7 @@ sub cat_blob { retu

[PATCH 22/31] http: replace sha1_to_hex

2019-02-11 Thread brian m. carlson
Since sha1_to_hex is limited to SHA-1, replace it with hash_to_hex. Signed-off-by: brian m. carlson --- http.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 458d07fabb..8ab07458e4 100644 --- a/http.c +++ b/http.c @@ -2079,19 +2079,19

[PATCH 19/31] http-walker: replace sha1_to_hex

2019-02-11 Thread brian m. carlson
Since sha1_to_hex is limited to SHA-1, replace the uses of it in this file with hasH_to_hex. Rename several variables accordingly to reflect that they are no longer limited to SHA-1. Signed-off-by: brian m. carlson --- http-walker.c | 18 +- 1 file changed, 9 insertions(+), 9

[PATCH 26/31] refspec: make hash size independent

2019-02-11 Thread brian m. carlson
Switch a use of GIT_SHA1_HEXSZ to use the_hash_algo. Signed-off-by: brian m. carlson --- refspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refspec.c b/refspec.c index f529092fd6..9a9bf21934 100644 --- a/refspec.c +++ b/refspec.c @@ -72,7 +72,7 @@ static int

[PATCH 23/31] remote-curl: make hash size independent

2019-02-11 Thread brian m. carlson
Change one hard-coded use of the constant 40 to a reference to the_hash_algo. In addition, switch a use of get_oid_hex to parse_oid_hex to avoid the need to use a constant. Signed-off-by: brian m. carlson --- remote-curl.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff

[PATCH 25/31] archive: convert struct archiver_args to object_id

2019-02-11 Thread brian m. carlson
Change the commit_sha1 member to be called "commit_oid" and change it to be a pointer to struct object_id. Additionally, update two uses of GIT_SHA1_HEXSZ to use the_hash_algo instead. Signed-off-by: brian m. carlson --- archive-tar.c | 6 +++--- archive-zip.c | 10 +-

[PATCH 17/31] http-backend: allow 64-character hex names

2019-02-11 Thread brian m. carlson
: brian m. carlson --- http-backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/http-backend.c b/http-backend.c index 29e68e38b5..ec3144b444 100644 --- a/http-backend.c +++ b/http-backend.c @@ -711,8 +711,11 @@ static struct service_cmd { {"GET", "/objects/info/

[PATCH 13/31] fast-import: replace sha1_to_hex

2019-02-11 Thread brian m. carlson
Replace the uses of sha1_to_hex in this function with hash_to_hex to allow the use of SHA-256 as well. Rename a variable since it is no longer limited to SHA-1. Signed-off-by: brian m. carlson --- fast-import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fast

[PATCH 28/31] dir: make untracked cache extension hash size independent

2019-02-11 Thread brian m. carlson
Instead of using a struct with a flex array member to read and write the untracked cache extension, use a shorter, fixed-length struct and add the name and hash data explicitly. Signed-off-by: brian m. carlson --- dir.c | 28 ++-- 1 file changed, 14 insertions(+), 14

[PATCH 04/31] pack-bitmap: replace sha1_to_hex

2019-02-11 Thread brian m. carlson
Replace the uses of sha1_to_hex in the pack bitmap code with hash_to_hex to allow the use of SHA-256 as well. Rename a few variables since they are no longer limited to SHA-1. Signed-off-by: brian m. carlson --- pack-bitmap-write.c | 6 +++--- pack-bitmap.c | 8 2 files changed

[PATCH 18/31] http-push: remove remaining uses of sha1_to_hex

2019-02-11 Thread brian m. carlson
Since sha1_to_hex is limited to SHA-1, switch all remaining uses of it in this file to hash_to_hex or oid_to_hex. Modify update_remote to take a pointer to struct object_id, and since we don't modify that parameter in the function, set it to be const as well. Signed-off-by: brian m. ca

[PATCH 31/31] gitweb: make hash size independent

2019-02-11 Thread brian m. carlson
in a regex. Similarly, switch the code that looks for deleted diffinfo information to look for either 40 or 64 zeros, and update one piece of code to use this function. Finally, when formatting a log line, allow an abbreviated describe output to contain up to 64 characters. Signed-off-by: brian m

[PATCH 21/31] http: compute hash of downloaded objects using the_hash_algo

2019-02-11 Thread brian m. carlson
Signed-off-by: brian m. carlson --- http.c | 10 +- http.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 993ddc956a..458d07fabb 100644 --- a/http.c +++ b/http.c @@ -2337,8 +2337,8 @@ static size_t fwrite_sha1_file(char *ptr, size_t eltsize

[PATCH 24/31] archive-tar: make hash size independent

2019-02-11 Thread brian m. carlson
Make the tar generation code hash size independent by using the_hash_algo. Make the tar parsing code compute the header value based on the hash algorithm in use. Update a variable name and switch to hash_to_hex. Signed-off-by: brian m. carlson --- archive-tar.c | 7

[PATCH 12/31] fast-import: make hash-size independent

2019-02-11 Thread brian m. carlson
Replace several uses of GIT_SHA1_HEXSZ and 40-based constants with references to the_hash_algo. Update the note handling code here to compute path sizes based on GIT_MAX_RAWSZ as well. Signed-off-by: brian m. carlson --- fast-import.c | 27 +++ 1 file changed, 15

[PATCH 08/31] notes: make hash size independent

2019-02-11 Thread brian m. carlson
Switch out various uses of the GIT_SHA1_* constants with GIT_MAX_* constants for allocations and the_hash_algo for general parsing. Update a comment to no longer be SHA-1 specific. Signed-off-by: brian m. carlson --- notes.c | 32 +--- 1 file changed, 17 insertions

[PATCH 20/31] http: replace hard-coded constant with the_hash_algo

2019-02-11 Thread brian m. carlson
Replace a hard-coded 40 with a reference to the_hash_algo. Signed-off-by: brian m. carlson --- http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.c b/http.c index a09adc518f..993ddc956a 100644 --- a/http.c +++ b/http.c @@ -2065,7 +2065,7 @@ int http_fetch_ref(const

[PATCH 06/31] submodule: avoid hard-coded constants

2019-02-11 Thread brian m. carlson
Instead of using hard-coded 40-based constants, express these values in terms of the_hash_algo and GIT_MAX_HEXSZ. Signed-off-by: brian m. carlson --- merge-recursive.c | 2 +- submodule.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/merge-recursive.c b/merge

[PATCH 05/31] pack-bitmap: switch hard-coded constants to the_hash_algo

2019-02-11 Thread brian m. carlson
Switch two hard-coded uses of 20 to references to the_hash_algo. Signed-off-by: brian m. carlson --- pack-bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pack-bitmap.c b/pack-bitmap.c index 6d6fa68563..603492c237 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c

[PATCH 16/31] http-push: convert to use the_hash_algo

2019-02-11 Thread brian m. carlson
Switch the lock token code to use the_hash_algo and increase its buffers to be allocated using GIT_MAX_* constants. Update the parsing of object paths to use the_hash_algo as well. Signed-off-by: brian m. carlson --- http-push.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[PATCH 27/31] builtin/difftool: use parse_oid_hex

2019-02-11 Thread brian m. carlson
Instead of using get_oid_hex and adding constants to the result, use parse_oid_hex to make this code independent of the hash size. Signed-off-by: brian m. carlson --- builtin/difftool.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builtin/difftool.c b/builtin

[PATCH 07/31] notes-merge: switch to use the_hash_algo

2019-02-11 Thread brian m. carlson
Switch from using GIT_SHA1_HEXSZ to GIT_MAX_HEXSZ and the_hash_algo so that the code works with any hash algorithm. Signed-off-by: brian m. carlson --- notes-merge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notes-merge.c b/notes-merge.c index 280aa8e6c1

[PATCH 03/31] pack-bitmap: convert struct stored_bitmap to object_id

2019-02-11 Thread brian m. carlson
Convert struct stored_bitmap to use struct object_id. Signed-off-by: brian m. carlson --- pack-bitmap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pack-bitmap.c b/pack-bitmap.c index b53f37243c..c760913cea 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -18,7

[PATCH 15/31] builtin/pull: make hash-size independent

2019-02-11 Thread brian m. carlson
Instead of using get_oid_hex and GIT_SHA1_HEXSZ, use parse_oid_hex to avoid the need for a constant and simplify the code. Signed-off-by: brian m. carlson --- builtin/pull.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 701d1473dc

[PATCH 14/31] builtin/am: make hash size independent

2019-02-11 Thread brian m. carlson
Instead of using GIT_SHA1_HEXSZ, switch to using the_hash_algo and parse_oid_hex to parse the lines involved in rebasing notes. Signed-off-by: brian m. carlson --- builtin/am.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index

[PATCH 11/31] builtin/name-rev: make hash-size independent

2019-02-11 Thread brian m. carlson
Use the_hash_algo when parsing instead of GIT_SHA1_HEXSZ so that this function works with any size hash. Rename the variable forty to counter, as this is a better name and is independent of the hash size. Signed-off-by: brian m. carlson --- builtin/name-rev.c | 14 -- 1 file

[PATCH 09/31] notes: replace sha1_to_hex

2019-02-11 Thread brian m. carlson
Replace the uses of sha1_to_hex in this function with hash_to_hex to allow the use of SHA-256 as well. Rename some variables since this code is no longer limited to SHA-1. Signed-off-by: brian m. carlson --- notes.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 10/31] object-store: rename and expand packed_git's sha1 member

2019-02-11 Thread brian m. carlson
e following semantic patch: @@ struct packed_git *E1; @@ - E1->sha1 + E1->hash @@ struct packed_git E1; @@ - E1.sha1 + E1.hash Signed-off-by: brian m. carlson --- builtin/pack-redundant.c | 2 +- fast-import.c| 17 + http-push.c | 3 ++- htt

[PATCH 02/31] pack-bitmap: make bitmap header handling hash agnostic

2019-02-11 Thread brian m. carlson
Increase the checksum field in struct bitmap_disk_header to be GIT_MAX_RAWSZ bytes in length and ensure that we hash the proper number of bytes out when computing the bitmap checksum. Signed-off-by: brian m. carlson --- pack-bitmap-write.c | 2 +- pack-bitmap.c | 2 +- pack-bitmap.h

[PATCH 00/31] Hash function transition part 16

2019-02-11 Thread brian m. carlson
ns.objectFormat and makes it so that it works (transition-stage-4). brian m. carlson (31): t/lib-submodule-update: use appropriate length constant pack-bitmap: make bitmap header handling hash agnostic pack-bitmap: convert struct stored_bitmap to object_id pack-bitmap: replace sha1_to_he

[PATCH 01/31] t/lib-submodule-update: use appropriate length constant

2019-02-11 Thread brian m. carlson
Instead of using a specific invalid hard-coded object ID, produce one of the appropriate length by using test_oid. Signed-off-by: brian m. carlson --- t/lib-submodule-update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/lib-submodule-update.sh b/t/lib-submodule

Re: [PATCH v3] utf8: handle systems that don't write BOM for UTF-16

2019-02-11 Thread brian m. carlson
On Mon, Feb 11, 2019 at 04:31:00PM -0800, Junio C Hamano wrote: > "brian m. carlson" writes: > > >> - cat lf.utf8.raw | iconv -f UTF-8 -t UTF-${i} >lf.utf${i}.raw && > >> - cat crlf.utf8.raw | iconv -f UTF-8 -t UTF-${i} >crlf.ut

[PATCH v4] utf8: handle systems that don't write BOM for UTF-16

2019-02-11 Thread brian m. carlson
lization according to the Unicode standard. Preserve the existing behavior for systems which do not have this knob enabled, since they may use optimized implementations, including defaulting to the native endianness, which may improve performance. Signed-off-by: brian m. carlson --- Makefile

Re: [PATCH] git-gui: Handle Ctrl+BS & Ctrl+Del in the commit msg

2019-02-11 Thread brian m. carlson
e keys instead of others? Perhaps you could send a v2 with a more comprehensive commit message that provides some of these answers. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v3] utf8: handle systems that don't write BOM for UTF-16

2019-02-11 Thread brian m. carlson
i}.raw && > + cat crlf.utf8.raw | eval "write_utf${i}" >crlf.utf${i}.raw && > cp crlf.utf${i}.raw eol.utf${i} && > > cat >expectIndexLF <<-EOF && I'll squash in this fix, thanks. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

[PATCH v3] utf8: handle systems that don't write BOM for UTF-16

2019-02-10 Thread brian m. carlson
lization according to the Unicode standard. Preserve the existing behavior for systems which do not have this knob enabled, since they may use optimized implementations, including defaulting to the native endianness, which may improve performance. Signed-off-by: brian m. carlson --- Makefile

Re: [PATCH v2] utf8: handle systems that don't write BOM for UTF-16

2019-02-10 Thread brian m. carlson
On Sun, Feb 10, 2019 at 08:16:26PM -0500, Eric Sunshine wrote: > On Sun, Feb 10, 2019 at 7:23 PM brian m. carlson > wrote: > > When serializing UTF-16 (and UTF-32), there are three possible ways to > > write the stream. One can write the data with a BOM in either big-endian &g

[PATCH v2] utf8: handle systems that don't write BOM for UTF-16

2019-02-10 Thread brian m. carlson
lization according to the Unicode standard. Preserve the existing behavior for systems which do not have this knob enabled, since they may use optimized implementations, including defaulting to the native endianness, which may improve performance. Signed-off-by: brian m. carlson --- Makefile

Re: [PATCH] utf8: handle systems that don't write BOM for UTF-16

2019-02-10 Thread brian m. carlson
On Sun, Feb 10, 2019 at 08:04:13AM +, Torsten Bögershausen wrote: > On Sat, Feb 09, 2019 at 08:08:01PM +0000, brian m. carlson wrote: > > Preserve the existing behavior for systems which do not have this knob > > enabled, since they may use optimized implementations, including

Re: [PATCH] utf8: handle systems that don't write BOM for UTF-16

2019-02-10 Thread brian m. carlson
On Sat, Feb 09, 2019 at 08:45:16PM -0500, Eric Sunshine wrote: > On Sat, Feb 9, 2019 at 3:08 PM brian m. carlson > wrote: > > [...] > > Add a Makefile and #define knob, ICONV_NEEDS_BOM, that can be set if the > > iconv implementation has this behavior. When set, Git will

[PATCH] utf8: handle systems that don't write BOM for UTF-16

2019-02-09 Thread brian m. carlson
lization according to the Unicode standard. Preserve the existing behavior for systems which do not have this knob enabled, since they may use optimized implementations, including defaulting to the native endianness, to gain improved performance, which can be significant with large checkouts. Signed

Re: t0028-working-tree-encoding.sh failing on musl based systems (Alpine Linux)

2019-02-08 Thread brian m. carlson
On Fri, Feb 08, 2019 at 03:12:22PM -0800, Junio C Hamano wrote: > "brian m. carlson" writes: > > > +test_lazy_prereq NO_BOM ' > > + printf abc | iconv -f UTF-8 -t UTF-16 && > > + test $(wc -c) = 6 > > +' > > This must be &q

Re: [PATCH v1 1/3] read-cache: add post-indexchanged hook

2019-02-08 Thread brian m. carlson
pose one argument is fine. Otherwise, it might be better to expose key-value pairs on stdin instead, or something like that. Finally, I have questions about performance. What's the overhead of determining whether the hook exists in this code path when there isn't one? Since the index is frequently used, and can be written out as an optimization by some commands, it would be nice to keep overhead low if the hook isn't present. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [Breakage] Git v2.21.0-rc0 - t5318 (NonStop)

2019-02-08 Thread brian m. carlson
't matter to me one way or another, as > long as I can get the dependency to /dev/zero removed so tests will run here. My preference is that we wrap the yes/tr invocation into a function (maybe "infinite_nul") and use that where we currently require /dev/zero. -- brian m. c

Re: [Breakage] Git v2.21.0-rc0 - t5318 (NonStop)

2019-02-08 Thread brian m. carlson
dn't think the > command-line tool was. If it really is available everywhere, then yeah, > I'd be fine with it. It's not. POSIX doesn't specify the command, and macOS lacks it, I believe. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: t0028-working-tree-encoding.sh failing on musl based systems (Alpine Linux)

2019-02-08 Thread brian m. carlson
through, but test 3 then fails, because git itself output the file > without BOM, presumably because it's passed through iconv. > > So I'm not sure if it's a matter of just fixing the tests. I think something like the following will likely work in this scenario: --

Re: t0028-working-tree-encoding.sh failing on musl based systems (Alpine Linux)

2019-02-08 Thread brian m. carlson
On Fri, Feb 08, 2019 at 12:55:11PM +0100, Kevin Daudt wrote: > On Fri, Feb 08, 2019 at 11:45:02AM +0000, brian m. carlson wrote: > > On Fri, Feb 08, 2019 at 01:04:03AM -0500, Rich Felker wrote: > > [..] > > > In any case, this test seems mainly relevant to Windows user

Re: t0028-working-tree-encoding.sh failing on musl based systems (Alpine Linux)

2019-02-08 Thread brian m. carlson
e with the fact that the test (and the corresponding functionality) won't work as expected with UTF-16, then I agree that no action is needed. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: t0028-working-tree-encoding.sh failing on musl based systems (Alpine Linux)

2019-02-07 Thread brian m. carlson
6 (with a proper BOM) with musl and Git will have their data corrupted, according to my reading of the musl website. In other words, I believe this test is failing legitimately. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2] fetch-pack: clear alternate shallow when complete

2019-02-06 Thread brian m. carlson
nstead. That's fine with me. Sorry about the delay getting the reroll in. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

[PATCH v2] fetch-pack: clear alternate shallow when complete

2019-02-06 Thread brian m. carlson
using freed memory. git index-pack will read the repository's shallow file, which will have been updated with the correct information. Signed-off-by: brian m. carlson --- fetch-pack.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fetch-pack.c b/fetch-pack.c index 577faa6229..a9262

Re: [PATCH] fetch-pack: clear alternate shallow when complete

2019-02-06 Thread brian m. carlson
sounds like a good idea to me. I'll reroll with that change and a commit message update. I think it's important that we get this issue fixed for the release, and then we can choose to implement a more comprehensive solution later. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: hook to get info on commit, and include that in a file that is part of the commit

2019-02-04 Thread brian m. carlson
On Mon, Feb 04, 2019 at 09:18:14PM -0500, Larry Martell wrote: > On Mon, Feb 4, 2019 at 9:15 PM brian m. carlson > wrote: > > If you want to generate a file, you can certainly do that in the > > post-commit hook or using a Makefile target. You just can't check it >

Re: hook to get info on commit, and include that in a file that is part of the commit

2019-02-04 Thread brian m. carlson
you could do is "git log --pretty='tformat:%H%n%B' HEAD". That will print the commit hash and commit message to standard output for each commit. If you want just one commit, you can use "-1". -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: hook to get info on commit, and include that in a file that is part of the commit

2019-02-04 Thread brian m. carlson
signed for checking and notification, not for editing the commit, with the exception of the commit message hooks, which are designed only for editing the commit message, not the contents. The pre-receive hook runs on the server side, so if you aren't running it there, then it won't get ca

Re: What is “unable to open object pack directory: .git/objects/pack: Not a directory” error?

2019-02-04 Thread brian m. carlson
nk there if there is one, and run "git init", and things should be fixed. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

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