[PATCH 15/17] Convert object iteration callbacks to struct object_id

2017-01-01 Thread brian m. carlson
Convert each_loose_object_fn and each_packed_object_fn to take a pointer to struct object_id. Update the various callbacks. Convert several 40-based constants to use GIT_SHA1_HEXSZ. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/cat-file.c

[PATCH 14/17] sha1_file: introduce an nth_packed_object_oid function

2017-01-01 Thread brian m. carlson
if and when it is. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- cache.h | 1 + sha1_file.c | 12 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cache.h b/cache.h index a50a61a19..b1ed1c7ae 100644 --- a/cache.h +++ b/cache.h @@ -1540,6 +

[PATCH 16/17] builtin/merge-base: convert to struct object_id

2017-01-01 Thread brian m. carlson
Convert the remaining uses of unsigned char [20] to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/merge-base.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/builtin/merge-base.c b/builtin

[PATCH 10/17] Convert remaining callers of resolve_refdup to object_id

2017-01-01 Thread brian m. carlson
There are a few leaf functions in various files that call resolve_refdup. Convert these functions to use struct object_id internally to prepare for transitioning resolve_refdup itself. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/notes.c

[PATCH 05/17] builtin/fmt-merge-message: convert to struct object_id

2017-01-01 Thread brian m. carlson
Convert most of the code to use struct object_id, including struct origin_data and struct merge_parents. Convert several instances of hardcoded numbers into references to GIT_SHA1_HEXSZ. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fmt-merge-msg.

[PATCH 04/17] builtin/fast-export: convert to struct object_id

2017-01-01 Thread brian m. carlson
In addition to converting to struct object_id, write some hardcoded buffer sizes in terms of GIT_SHA1_RAWSZ. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fast-export.c | 58 +-- 1 file changed, 29 insertions(

[PATCH 01/17] builtin/commit: convert to struct object_id

2017-01-01 Thread brian m. carlson
Convert most leaf functions to use struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/commit.c | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c

[PATCH 17/17] wt-status: convert to struct object_id

2017-01-01 Thread brian m. carlson
Convert the remaining uses of unsigned char [20] to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- wt-status.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/wt-status.c b/wt-status.c

[PATCH 06/17] builtin/grep: convert to struct object_id

2017-01-01 Thread brian m. carlson
Convert several functions to use struct object_id, and rename them so that they no longer refer to SHA-1. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/grep.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/b

[PATCH 02/17] builtin/diff-tree: convert to struct object_id

2017-01-01 Thread brian m. carlson
Convert most leaf functions to struct object_id. Rewrite several hardcoded numbers in terms of GIT_SHA1_HEXSZ, using an intermediate variable where that makes sense. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/diff-tree.

Re: [PATCH v2 00/21] object_id part 7

2017-03-28 Thread brian m. carlson
can > go away). Let's leave it as it is, assuming Junio's okay with it. I can send in a few more patches to clean that up and use skip_prefix that we can drop on top and graduate separately. I think the justification is useful as it is, since it explains why we no longer want to check that particular value for

[PATCH v2 11/21] sha1_name: convert struct disambiguate_state to object_id

2017-03-26 Thread brian m. carlson
struct disambiguate_state E1; @@ - E1.candidate + E1.candidate.hash @@ struct disambiguate_state *E1; @@ - E1->candidate + E1->candidate.hash This conversion is needed so we can convert disambiguate_hint_fn later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> ---

[PATCH v2 03/21] Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ

2017-03-26 Thread brian m. carlson
between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/patch-id.c | 2 +- builtin/receive-pack.c | 2 +- cache.h| 2 +-

[PATCH v2 13/21] submodule: convert check_for_new_submodule_commits to object_id

2017-03-26 Thread brian m. carlson
All of the callers of this function have been converted, so convert this function and update the callers. This function also calls sha1_array_append, which we'll convert shortly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fetch.c | 6 +++--- submodule.c

[PATCH v2 20/21] Rename sha1_array to oid_array

2017-03-26 Thread brian m. carlson
sha1_array/struct oid_array/g' perl -pi -E 's/\bsha1_array_/oid_array_/g' perl -pi -E 's/SHA1_ARRAY_INIT/OID_ARRAY_INIT/g' Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 16 builtin/cat-file.c | 10 +- builtin/

[PATCH v2 04/21] builtin/diff: convert to struct object_id

2017-03-26 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/diff.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/builtin/diff.c b/builtin/diff.c index 3d64b85337..398eee00d5 100644 --- a/builtin/diff.c +++ b/builtin/

[PATCH v2 06/21] builtin/receive-pack: fix incorrect pointer arithmetic

2017-03-26 Thread brian m. carlson
to correct it. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/receive-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index feafb076a4..116f3177a1 100644 --- a/builtin/receive-pack.c +++ b/b

[PATCH v2 15/21] sha1-array: convert internal storage for struct sha1_array to object_id

2017-03-26 Thread brian m. carlson
Make the internal storage for struct sha1_array use an array of struct object_id internally. Update the users of this struct which inspect its internals. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 14 +++--- builtin/pull.c

[PATCH v2 14/21] builtin/pull: convert to struct object_id

2017-03-26 Thread brian m. carlson
Convert virtually all uses of unsigned char [20] to struct object_id. Leave all the arguments that come from struct sha1_array, as these will be converted in a later patch. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/pull.

[PATCH v2 01/21] Define new hash-size constants for allocating memory

2017-03-26 Thread brian m. carlson
-by: brian m. carlson <sand...@crustytoothpaste.net> --- cache.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index 2214d52f61..af4b2c78cf 100644 --- a/cache.h +++ b/cache.h @@ -66,8 +66,12 @@ unsigned long git_deflate_bound(git_zstream *, unsigned

[PATCH v2 02/21] Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ

2017-03-26 Thread brian m. carlson
by distinguishing between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 2 +- builtin/blame.c | 4 ++-- builtin/merge-index

[PATCH v2 00/21] object_id part 7

2017-03-26 Thread brian m. carlson
arithmetic. brian m. carlson (21): Define new hash-size constants for allocating memory Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ builtin/diff: convert to struct object_id builtin/pull: convert portions to struct

[PATCH v2 16/21] Make sha1_array_append take a struct object_id *

2017-03-26 Thread brian m. carlson
) + sha1_array_append(E1, ) @@ expression E1, E2; @@ - sha1_array_append(E1, E2->hash) + sha1_array_append(E1, E2) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 4 ++-- builtin/cat-file.c | 4 ++-- builtin/diff.c | 2 +-

[PATCH v2 18/21] Convert sha1_array_lookup to take struct object_id

2017-03-26 Thread brian m. carlson
(E1, E2) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 7 +++ builtin/pack-objects.c | 2 +- fsck.c | 2 +- ref-filter.c | 4 ++-- sha1-array.c | 4 ++-- sha1-array.h

[PATCH v2 08/21] fsck: convert init_skiplist to struct object_id

2017-03-26 Thread brian m. carlson
Convert a hardcoded constant buffer size to a use of GIT_MAX_HEXSZ, and use parse_oid_hex to reduce the dependency on the size of the hash. This function is a caller of sha1_array_append, which will be converted later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> ---

[PATCH v2 21/21] Documentation: update and rename api-sha1-array.txt

2017-03-26 Thread brian m. carlson
Since the structure and functions have changed names, update the code examples and the documentation. Rename the file to match the new name of the API. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- .../{api-sha1-array.txt => api-oid-array.txt}

[PATCH v2 10/21] test-sha1-array: convert most code to struct object_id

2017-03-26 Thread brian m. carlson
This helper is very small, so convert the entire thing. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- t/helper/test-sha1-array.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/helper/test-sha1-array.c b/t/helper/test-sha1-array.c

[PATCH v2 17/21] Convert remaining callers of sha1_array_lookup to object_id

2017-03-26 Thread brian m. carlson
There are a very small number of callers which don't already use struct object_id. Convert them. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 14 +++--- builtin/pack-objects.c | 16 ref-filter.c

[PATCH v2 05/21] builtin/pull: convert portions to struct object_id

2017-03-26 Thread brian m. carlson
Convert the caller of sha1_array_append to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/pull.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 3ecb881b0b..a9f7553f30

[PATCH v2 19/21] Convert sha1_array_for_each_unique and for_each_abbrev to object_id

2017-03-26 Thread brian m. carlson
Make sha1_array_for_each_unique take a callback using struct object_id. Since one of these callbacks is an argument to for_each_abbrev, convert those as well. Rename various functions, replacing "sha1" with "oid". Signed-off-by: brian m. carlson <sand...@crustytoothpast

[PATCH v2 07/21] builtin/receive-pack: convert portions to struct object_id

2017-03-26 Thread brian m. carlson
-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/receive-pack.c | 98 +- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 116f3177a1..e3dc3e184d 100644 --- a/b

[PATCH v2 12/21] sha1_name: convert disambiguate_hint_fn to take object_id

2017-03-26 Thread brian m. carlson
Convert this function pointer type and the functions that implement it to take a struct object_id. Introduce a temporary in show_ambiguous_object to avoid having to convert for_each_abbrev at this point. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_name.

[PATCH v2 09/21] parse-options-cb: convert sha1_array_append caller to struct object_id

2017-03-26 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- parse-options-cb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parse-options-cb.c b/parse-options-cb.c index b7d8f7dcb2..40ece4d8c2 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@

Re: [PATCH v2 16/21] Make sha1_array_append take a struct object_id *

2017-03-28 Thread brian m. carlson
On Tue, Mar 28, 2017 at 10:27:41AM -0700, Junio C Hamano wrote: > "brian m. carlson" <sand...@crustytoothpaste.net> writes: > > > Convert the callers to pass struct object_id by changing the function > > declaration and definition and app

Re: [PATCH v2 16/21] Make sha1_array_append take a struct object_id *

2017-03-29 Thread brian m. carlson
tuation, so I'll reroll and fix the other issues mentioned. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH v2 07/21] builtin/receive-pack: convert portions to struct object_id

2017-03-29 Thread brian m. carlson
cert. We do use this value, in computing the reflen value, so I think it's better to keep it for now. I agree that a future refactor could convert it to be NUL-terminated, but I'd rather not make that change here. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 27

Re: [PATCH/RFC] parse-options: add facility to make options configurable

2017-03-25 Thread brian m. carlson
, which was my concern. The potential for removing a decent amount of likely duplicative code also makes me happy. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: Will OpenSSL's license change impact us?

2017-03-25 Thread brian m. carlson
n is using Nettle, which is LGPL 2.1. Considering that the current opinions for a new hash function are moving in the direction of SHA-3, which Nettle has, but OpenSSL does not, I think that might be a better decision overall. It was certainly the implementation I would use if I were to implement it. -- b

[PATCH v3 09/20] test-sha1-array: convert most code to struct object_id

2017-03-30 Thread brian m. carlson
This helper is very small, so convert the entire thing. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- t/helper/test-sha1-array.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/helper/test-sha1-array.c b/t/helper/test-sha1-array.c

[PATCH v3 04/20] builtin/diff: convert to struct object_id

2017-03-30 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/diff.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/builtin/diff.c b/builtin/diff.c index 3d64b85337..398eee00d5 100644 --- a/builtin/diff.c +++ b/builtin/

[PATCH v3 13/20] builtin/pull: convert to struct object_id

2017-03-30 Thread brian m. carlson
Convert virtually all uses of unsigned char [20] to struct object_id. Leave all the arguments that come from struct sha1_array, as these will be converted in a later patch. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/pull.

[PATCH v3 15/20] Make sha1_array_append take a struct object_id *

2017-03-30 Thread brian m. carlson
ash) + sha1_array_append(E1, E2) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 4 ++-- builtin/cat-file.c | 4 ++-- builtin/diff.c | 2 +- builtin/pack-objects.c | 4 ++-- builtin/pull.c | 2 +- builtin/receive-pack.

[PATCH v3 20/20] Documentation: update and rename api-sha1-array.txt

2017-03-30 Thread brian m. carlson
Since the structure and functions have changed names, update the code examples and the documentation. Rename the file to match the new name of the API. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- .../{api-sha1-array.txt => api-oid-array.txt}

[PATCH v3 12/20] submodule: convert check_for_new_submodule_commits to object_id

2017-03-30 Thread brian m. carlson
All of the callers of this function have been converted, so convert this function and update the callers. This function also calls sha1_array_append, which we'll convert shortly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fetch.c | 6 +++--- submodule.c

[PATCH v3 16/20] Convert remaining callers of sha1_array_lookup to object_id

2017-03-30 Thread brian m. carlson
There are a very small number of callers which don't already use struct object_id. Convert them. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 14 +++--- builtin/pack-objects.c | 16 ref-filter.c

[PATCH v3 14/20] sha1-array: convert internal storage for struct sha1_array to object_id

2017-03-30 Thread brian m. carlson
Make the internal storage for struct sha1_array use an array of struct object_id internally. Update the users of this struct which inspect its internals. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 14 +++--- builtin/pull.c

[PATCH v3 00/20] object_id part 7

2017-03-30 Thread brian m. carlson
separately. * Change one struct object_id * parameter from "sha1" to "oid". * Convert E2[E3].hash to E2[E3] instead of E2 + E3. Changes from v1: * Rebase on current master (no changes). * Remove check for empty line in queue_command. * Add patch 6 to fix invalid pointer arithmeti

[PATCH v3 17/20] Convert sha1_array_lookup to take struct object_id

2017-03-30 Thread brian m. carlson
(E1, E2) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 7 +++ builtin/pack-objects.c | 2 +- fsck.c | 2 +- ref-filter.c | 4 ++-- sha1-array.c | 4 ++-- sha1-array.h

[PATCH v3 07/20] fsck: convert init_skiplist to struct object_id

2017-03-30 Thread brian m. carlson
Convert a hardcoded constant buffer size to a use of GIT_MAX_HEXSZ, and use parse_oid_hex to reduce the dependency on the size of the hash. This function is a caller of sha1_array_append, which will be converted later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> ---

Re: Add configuration options for some commonly used command-line options

2017-03-19 Thread brian m. carlson
of things such as fugitive would dislike such a feature as well. I get the impression our existing config file options already make life difficult enough. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

[PATCH 04/20] builtin/diff: convert to struct object_id

2017-03-18 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/diff.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/builtin/diff.c b/builtin/diff.c index 3d64b85337..398eee00d5 100644 --- a/builtin/diff.c +++ b/builtin/

[PATCH 06/20] builtin/receive-pack: convert portions to struct object_id

2017-03-18 Thread brian m. carlson
Convert some hardcoded constants into uses of parse_oid_hex. Additionally, convert all uses of struct command, and miscellaneous other functions necessary for that. This work is necessary to be able to convert sha1_array_append later on. Signed-off-by: brian m. carlson <s

[PATCH 14/20] sha1-array: convert internal storage for struct sha1_array to object_id

2017-03-18 Thread brian m. carlson
Make the internal storage for struct sha1_array use an array of struct object_id internally. Update the users of this struct which inspect its internals. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 14 +++--- builtin/pull.c

[PATCH 13/20] builtin/pull: convert to struct object_id

2017-03-18 Thread brian m. carlson
Convert virtually all uses of unsigned char [20] to struct object_id. Leave all the arguments that come from struct sha1_array, as these will be converted in a later patch. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/pull.

[PATCH 02/20] Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ

2017-03-18 Thread brian m. carlson
by distinguishing between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 2 +- builtin/blame.c | 4 ++-- builtin/merge-index

[PATCH 10/20] sha1_name: convert struct disambiguate_state to object_id

2017-03-18 Thread brian m. carlson
struct disambiguate_state E1; @@ - E1.candidate + E1.candidate.hash @@ struct disambiguate_state *E1; @@ - E1->candidate + E1->candidate.hash This conversion is needed so we can convert disambiguate_hint_fn later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> ---

[PATCH 03/20] Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ

2017-03-18 Thread brian m. carlson
between places where we need to allocate memory suitable for the largest hash from those where we need to handle the current hash. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/patch-id.c | 2 +- builtin/receive-pack.c | 2 +- cache.h| 2 +-

[PATCH 07/20] fsck: convert init_skiplist to struct object_id

2017-03-18 Thread brian m. carlson
Convert a hardcoded constant buffer size to a use of GIT_MAX_HEXSZ, and use parse_oid_hex to reduce the dependency on the size of the hash. This function is a caller of sha1_array_append, which will be converted later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> ---

[PATCH 08/20] parse-options-cb: convert sha1_array_append caller to struct object_id

2017-03-18 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- parse-options-cb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parse-options-cb.c b/parse-options-cb.c index b7d8f7dcb2..40ece4d8c2 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@

[PATCH 00/20] object_id part 7

2017-03-18 Thread brian m. carlson
be rebased. Future series are available in various states as the object-id-part8, object-id-part9, and object-id-part10 series. brian m. carlson (20): Define new hash-size constants for allocating memory Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ Convert GIT_SHA1_RAWSZ used

[PATCH 01/20] Define new hash-size constants for allocating memory

2017-03-18 Thread brian m. carlson
-by: brian m. carlson <sand...@crustytoothpaste.net> --- cache.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index 9b2157f591..cb301d8d7d 100644 --- a/cache.h +++ b/cache.h @@ -66,8 +66,12 @@ unsigned long git_deflate_bound(git_zstream *, unsigned

[PATCH 11/20] sha1_name: convert disambiguate_hint_fn to take object_id

2017-03-18 Thread brian m. carlson
Convert this function pointer type and the functions that implement it to take a struct object_id. Introduce a temporary in show_ambiguous_object to avoid having to convert for_each_abbrev at this point. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_name.

[PATCH 09/20] test-sha1-array: convert most code to struct object_id

2017-03-18 Thread brian m. carlson
This helper is very small, so convert the entire thing. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- t/helper/test-sha1-array.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/helper/test-sha1-array.c b/t/helper/test-sha1-array.c

[PATCH 12/20] submodule: convert check_for_new_submodule_commits to object_id

2017-03-18 Thread brian m. carlson
All of the callers of this function have been converted, so convert this function and update the callers. This function also calls sha1_array_append, which we'll convert shortly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fetch.c | 6 +++--- submodule.c

[PATCH 05/20] builtin/pull: convert portions to struct object_id

2017-03-18 Thread brian m. carlson
Convert the caller of sha1_array_append to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/pull.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 3ecb881b0b..a9f7553f30

[PATCH 16/20] Convert remaining callers of sha1_array_lookup to object_id

2017-03-18 Thread brian m. carlson
There are a very small number of callers which don't already use struct object_id. Convert them. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 14 +++--- builtin/pack-objects.c | 16 ref-filter.c

[PATCH 18/20] Convert sha1_array_for_each_unique and for_each_abbrev to object_id

2017-03-18 Thread brian m. carlson
Make sha1_array_for_each_unique take a callback using struct object_id. Since one of these callbacks is an argument to for_each_abbrev, convert those as well. Rename various functions, replacing "sha1" with "oid". Signed-off-by: brian m. carlson <sand...@crustytoothpast

[PATCH 19/20] Rename sha1_array to oid_array

2017-03-18 Thread brian m. carlson
sha1_array/struct oid_array/g' perl -pi -E 's/\bsha1_array_/oid_array_/g' perl -pi -E 's/SHA1_ARRAY_INIT/OID_ARRAY_INIT/g' Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 16 builtin/cat-file.c | 10 +- builtin/

[PATCH 17/20] Convert sha1_array_lookup to take struct object_id

2017-03-18 Thread brian m. carlson
(E1, E2) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 7 +++ builtin/pack-objects.c | 2 +- fsck.c | 2 +- ref-filter.c | 4 ++-- sha1-array.c | 4 ++-- sha1-array.h

[PATCH 20/20] Documentation: update and rename api-sha1-array.txt

2017-03-18 Thread brian m. carlson
Since the structure and functions have changed names, update the code examples and the documentation. Rename the file to match the new name of the API. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- .../{api-sha1-array.txt => api-oid-array.txt}

[PATCH 15/20] Make sha1_array_append take a struct object_id *

2017-03-18 Thread brian m. carlson
) + sha1_array_append(E1, ) @@ expression E1, E2; @@ - sha1_array_append(E1, E2->hash) + sha1_array_append(E1, E2) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bisect.c | 4 ++-- builtin/cat-file.c | 4 ++-- builtin/diff.c | 2 +-

Re: [PATCH 10/20] sha1_name: convert struct disambiguate_state to object_id

2017-03-20 Thread brian m. carlson
On Mon, Mar 20, 2017 at 08:07:09PM +0700, Duy Nguyen wrote: > On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson > <sand...@crustytoothpaste.net> wrote: > > @@ -332,7 +332,7 @@ static int init_object_disambiguation(const char *name, > > int len, > >

Re: Safe to use stdatomic.h?

2017-03-20 Thread brian m. carlson
ditching RHEL/CentOS 5 support, but I expect other people might disagree. After all, we're still targeting C89. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 06/20] builtin/receive-pack: convert portions to struct object_id

2017-03-20 Thread brian m. carlson
On Mon, Mar 20, 2017 at 07:56:17PM +0700, Duy Nguyen wrote: > On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson > <sand...@crustytoothpaste.net> wrote: > > @@ -1489,23 +1489,24 @@ static struct command **queue_command(struct > > command **tail, > >

Re: [PATCH] Correct compile errors when DEBUG_BISECT=1 after supporting other hash algorithms

2017-03-20 Thread brian m. carlson
>item->object.sha1)); > > + sha1_to_hex(pp->item->object.oid.hash)); And here, as well. > > > > subject_len = find_commit_subject(buf, _start); > > if (subject_len) Otherwise, I think this looks good. I'm sorry I didn't catch this earlier, but I didn't even realize we had this option, or I would have tested it. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 00/20] object_id part 7

2017-03-20 Thread brian m. carlson
On Mon, Mar 20, 2017 at 08:14:20PM +0700, Duy Nguyen wrote: > On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson > <sand...@crustytoothpaste.net> wrote: > > This is part 7 in the continuing transition to use struct object_id. > > It feels very nice to see many ".hash&q

Re: [PATCH 19/20] Rename sha1_array to oid_array

2017-03-20 Thread brian m. carlson
On Mon, Mar 20, 2017 at 07:25:25PM +0700, Duy Nguyen wrote: > On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson > <sand...@crustytoothpaste.net> wrote: > > Since this structure handles an array of object IDs, rename it to struct > > oid_array. Also renam

Re: [RFC PATCH] Move SHA-1 implementation selection into a header file

2017-03-14 Thread brian m. carlson
to that standard. I know there have been reasonably standards-conforming compilers that have rejected it in the past, but I can't remember which ones (I think they were for proprietary Unices). Junio, do you want to amend the commit message before you merge it? -- brian m. carlson / brian with

Re: [PATCH] status: show in-progress info for short status

2017-04-01 Thread brian m. carlson
h other options, we'd probably want to write this as --in-progress (with an extra dash). -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

[PATCH] Documentation: make 3-way merge warning more generic

2017-04-01 Thread brian m. carlson
the general rule (which applies to many scenarios), and only then providing a specific example. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- I ran into this scenario with a co-worker who is a fairly advanced Git user. He created a series of five commits that modified a file

Re: [RFC] dropping support for ancient versions of curl

2017-04-05 Thread brian m. carlson
indirectly connected to the Internet is a very bad thing, and we shouldn't make it easier for people who want to do that. CentOS 6 and 7 are still in use and security supported, and I think we should support them. CentOS 5 is EOL, although RHEL 5 is still supported in some cases. RHEL 4 and earlie

Re: "up-to-date" vs. "up to date"

2017-04-14 Thread brian m. carlson
on the list is that unless the change is very large or wide ranging, you'll find people are more likely to give you feedback on a concrete patch (including whether the idea is desirable) than on an idea in general. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [bug?] docs in Documentation/technical/ do not seem to be distributed

2017-04-19 Thread brian m. carlson
including it in the main package would bloat the archive substantially by including a copy of identical data for each architecture. Doing it this way also allows people to not install documentation that they don't need, say, on a server. -- brian m. carlson / brian with sandals: Houston, Texas, U

[PATCH 10/53] fast-import: convert internal structs to struct object_id

2017-04-23 Thread brian m. carlson
@ struct hash_list *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- fast-import.c | 182 +++--- 1 file changed, 96 insertions(+), 86 deletions(-) diff --git a/fast-import.c b

[PATCH 08/53] builtin/blame: convert static function to struct object_id

2017-04-23 Thread brian m. carlson
This function is a caller of lookup_commit_reference_gently, which we will convert later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/blame.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index 075

[PATCH 15/53] reflog_expire: convert to struct object_id

2017-04-23 Thread brian m. carlson
indirectly from get_sha1. Without the temporary, it would require much more refactoring to be able to convert this function. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/reflog.c | 22 +++--- refs.h | 6 +++--- refs/files-backend.

[PATCH 07/53] branch: convert to struct object_id

2017-04-23 Thread brian m. carlson
This change is required to convert lookup_commit_reference later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- branch.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/branch.c b/branch.c index ad5a2299b..1758c9708 100644 --- a/br

[PATCH 20/53] revision: convert prepare_show_merge to struct object_id

2017-04-23 Thread brian m. carlson
This is a caller of lookup_commit_or_die, which we will convert later on. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- revision.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/revision.c b/revision.c index 2b56c3baf..945367034

[PATCH 12/53] submodule: convert merge_submodule to use struct object_id

2017-04-23 Thread brian m. carlson
This is a caller of lookup_commit_reference, which we will convert later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- merge-recursive.c | 8 submodule.c | 24 submodule.h | 8 3 files changed, 20 insertions(

[PATCH 16/53] builtin/verify-commit: convert to struct object_id

2017-04-23 Thread brian m. carlson
This is a prerequisite to convert to lookup_commit, which we will convert later. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/verify-commit.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/verify-commit.c b/builtin/

[PATCH 26/53] pack: convert struct pack_idx_entry to struct object_id

2017-04-23 Thread brian m. carlson
ed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/index-pack.c | 33 +++--- builtin/pack-objects.c | 63 +- bulk-checkin.c | 4 ++-- fast-import.c | 30 pack-bi

[PATCH 11/53] fast-import: convert to struct object_id

2017-04-23 Thread brian m. carlson
against a fixed string. Note that the odd computation with GIT_MAX_HEXSZ is due to the insertion of a slash between every two hex digits in the path, plus one for the terminating NUL. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- fast-import.c

[PATCH 28/53] Convert remaining callers of lookup_blob to object_id

2017-04-23 Thread brian m. carlson
All but a few callers of lookup_blob have been converted to struct object_id. Introduce a temporary, which will be removed later, into parse_object to ease the transition, and convert the remaining callers so that we can update lookup_blob to take struct object_id *. Signed-off-by: brian m

[PATCH 25/53] Convert lookup_commit* to struct object_id

2017-04-23 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive.c | 2 +- bisect.c| 2 +- branch.c| 2 +- builtin/am.c| 4 ++-- builtin/blame.c | 4 ++-- builtin/branch.c| 6 +++--- builtin/ch

[PATCH 06/53] bundle: convert to struct object_id

2017-04-23 Thread brian m. carlson
m. carlson <sand...@crustytoothpaste.net> --- bundle.c| 33 + bundle.h| 4 +++- transport.c | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/bundle.c b/bundle.c index bbf4efa0a..6e181bb3d 100644 --- a/bundle.c +++ b/bu

[PATCH 18/53] http-push: convert some static functions to struct object_id

2017-04-23 Thread brian m. carlson
Among the functions converted is a caller of lookup_commit_or_die, which we will convert later on. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- http-push.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/http-push.c

[PATCH 22/53] sequencer: convert some functions to struct object_id

2017-04-23 Thread brian m. carlson
Convert update_squash_messages and is_index_unchanged to struct object_id. These are callers of lookup_commit and lookup_commit_reference, which we want to convert. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sequencer.c | 12 ++-- 1 file changed, 6 inse

[PATCH 24/53] Convert remaining callers of lookup_commit_reference* to object_id

2017-04-23 Thread brian m. carlson
There are a small number of remaining callers of lookup_commit_reference and lookup_commit_reference_gently that still need to be converted to struct object_id. Convert these. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- notes-merge.c | 26 +

[PATCH 17/53] tag: convert parse_tag_buffer to struct object_id

2017-04-23 Thread brian m. carlson
Specify some constants in terms of GIT_SHA1_HEXSZ, and convert a get_sha1_hex into parse_oid_hex to avoid needing to specify additional constants. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- tag.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-)

[PATCH 23/53] builtin/tag: convert to struct object_id

2017-04-23 Thread brian m. carlson
Parts of this module call lookup_commit_reference, which we want to convert. The module is small and mostly self-contained, so convert the rest of it while we're at it. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/tag.

<    5   6   7   8   9   10   11   12   13   14   >