[PATCH v3 33/36] sha1_file: convert read_sha1_file to struct object_id

2018-03-11 Thread brian m. carlson
E1, E2, E3, E4) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- apply.c | 4 ++-- archive.c| 2 +- bisect.c | 3 ++- blame.c | 8 builtin/cat-file.c | 14 -- builtin/difftool.

[PATCH v3 24/36] packfile: convert unpack_entry to struct object_id

2018-03-11 Thread brian m. carlson
Convert unpack_entry and read_object to use struct object_id. --- packfile.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packfile.c b/packfile.c index 5f08aa0a14..3e31ad7a0c 100644 --- a/packfile.c +++ b/packfile.c @@ -1452,7 +1452,7 @@ struct

[PATCH v3 35/36] sha1_file: introduce a constant for max header length

2018-03-11 Thread brian m. carlson
(7 for "commit", 1 for a space, 20 for a 63-bit length in decimal, and 1 for the NUL). However, the overallocation should not cause any problems, so leave it as it is. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_file.c | 17 ++--- 1

[PATCH v3 22/36] sha1_file: convert assert_sha1_type to object_id

2018-03-11 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it to assert_oid_type. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/commit-tree.c | 2 +- cache.h | 2 +- commit.c | 2 +- sha1_file.c | 8 4

[PATCH v3 07/36] ref-filter: convert grab_objectname to struct object_id

2018-03-11 Thread brian m. carlson
This is necessary in order to convert find_unique_abbrev. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- ref-filter.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 45fc56216a..dbe554dffa 100644 ---

[PATCH v3 23/36] sha1_file: convert retry_bad_packed_offset to struct object_id

2018-03-11 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- packfile.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packfile.c b/packfile.c index 7c1a2519fc..5f08aa0a14 100644 --- a/packfile.c +++ b/packfile.c @@ -1095,13 +1095,13 @@ stat

[PATCH v3 08/36] strbuf: convert strbuf_add_unique_abbrev to use struct object_id

2018-03-11 Thread brian m. carlson
rev(E1, E2, E3); Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/checkout.c | 2 +- builtin/fetch.c| 8 builtin/tag.c | 2 +- merge-recursive.c | 2 +- pretty.c | 8 strbuf.c | 4 ++-- strbuf.h

[PATCH v3 30/36] streaming: convert istream internals to struct object_id

2018-03-11 Thread brian m. carlson
Convert the various open_istream variants to take a pointer to struct object_id. Introduce a temporary, which will be removed later, to work around the fact that lookup_replace_object still returns a pointer to unsigned char. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.

[PATCH v3 36/36] convert: convert to struct object_id

2018-03-11 Thread brian m. carlson
-visible hash algorithms differed, as anticipated by the hash function transition plan. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- convert.c | 12 ++-- convert.h | 2 +- entry.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conve

[PATCH v3 29/36] tree-walk: convert get_tree_entry_follow_symlinks internals to object_id

2018-03-11 Thread brian m. carlson
Convert the internals of this function to use struct object_id. This is one of the last remaining callers of read_sha1_file_extended that has not been converted yet. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- tree-walk.c | 22 +++--- 1 file chang

[PATCH v3 26/36] sha1_file: convert sha1_object_info* to object_id

2018-03-11 Thread brian m. carlson
Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2;

[PATCH v3 34/36] Convert lookup_replace_object to struct object_id

2018-03-11 Thread brian m. carlson
Convert both the argument and the return value to be pointers to struct object_id. Update the callers and their internals to deal with the new type. Remove several temporaries which are no longer needed. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/mktag.c

[PATCH v3 13/36] replace_object: convert struct replace_object to object_id

2018-03-11 Thread brian m. carlson
Convert the two members of this struct to be instances of struct object_id. Adjust the various functions in this file accordingly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- replace_object.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

[PATCH v3 25/36] Convert remaining callers of sha1_object_info_extended to object_id

2018-03-11 Thread brian m. carlson
instead of all at once. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_file.c | 14 +++--- streaming.c | 5 - 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index a307037e88..eafb0733e5 100644 --- a/sha1_file.c

[PATCH v3 27/36] builtin/fmt-merge-msg: convert remaining code to object_id

2018-03-11 Thread brian m. carlson
this to struct object_id, simply change the pointer we're using. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fmt-merge-msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 8e8a

[PATCH v3 20/36] streaming: convert open_istream to use struct object_id

2018-03-11 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 2 +- archive-zip.c | 2 +- builtin/index-pack.c | 2 +- builtin/pack-objects.c | 2 +- sha1_file.c| 2 +- streaming.c| 6 +++--- streaming.h| 2 +- 7

[PATCH v3 32/36] sha1_file: convert read_object_with_reference to object_id

2018-03-11 Thread brian m. carlson
Convert read_object_with_reference to take pointers to struct object_id. Update the internals of the function accordingly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/cat-file.c | 2 +- builtin/grep.c | 4 ++-- builtin/pack-objects.c | 2 +- c

[PATCH v3 16/36] archive: convert sha1_file_to_archive to struct object_id

2018-03-11 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it object_file_to_archive. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 2 +- archive-zip.c | 4 ++-- archive.c | 10 +- archive.h | 8 4 files chang

[PATCH v3 28/36] builtin/notes: convert static functions to object_id

2018-03-11 Thread brian m. carlson
Convert the remaining static functions to take pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/notes.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index 3930

[PATCH v3 06/36] tree: convert read_tree_recursive to struct object_id

2018-03-11 Thread brian m. carlson
Convert the callback functions for read_tree_recursive to take a pointer to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive.c | 8 builtin/checkout.c | 4 ++-- builtin/log.c | 2 +- builtin/ls-tree.c | 8

[PATCH v3 04/36] cache-tree: convert remnants to struct object_id

2018-03-11 Thread brian m. carlson
Convert the remaining portions of cache-tree.c to use struct object_id. Convert several instances of 20 to use the_hash_algo instead. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- cache-tree.c | 29 +++-- 1 file changed, 15 insertions(+), 14 del

[PATCH v3 01/36] bulk-checkin: convert index_bulk_checkin to struct object_id

2018-03-11 Thread brian m. carlson
Convert the index_bulk_checkin function, and the static functions it calls, to use pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bulk-checkin.c | 18 +- bulk-checkin.h | 2 +- sha1_file.c| 2 +- 3 files chang

[PATCH v3 03/36] cache-tree: convert write_*_as_tree to object_id

2018-03-11 Thread brian m. carlson
Convert write_index_as_tree and write_cache_as_tree to use struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/am.c | 8 builtin/merge.c | 2 +- builtin/write-tree.c | 2 +- cache-tree.c | 10 +- cache-

Re: [Feature request] Add config option to gpgsign IFF key is present

2018-03-11 Thread brian m. carlson
sign due to transient failures even when the key is present on the system. I usually handle this by storing my main configuration in ~/.gitconfig and on machines where I have a key, additionally having a ~/.config/git/config file that contains the commit.gpgsign entry. -- brian m. carls

Re: [RFC PATCH] color: respect the $NO_COLOR convention

2018-03-04 Thread brian m. carlson
teranomaly and virtually all colored text at the terminal poses readability problems. It would be beneficial if he could just set NO_COLOR=1 in his environment and have everything just work. For this reason, I'm in favor of taking this patch, assuming it comes with tests. --

Re: [PATCH v2 05/36] resolve-undo: convert struct resolve_undo_info to object_id

2018-02-26 Thread brian m. carlson
On Mon, Feb 26, 2018 at 06:25:24PM +0700, Duy Nguyen wrote: > On Mon, Feb 26, 2018 at 4:11 AM, brian m. carlson > <sand...@crustytoothpaste.net> wrote: > > @@ -44,7 +44,7 @@ void resolve_undo_write(struct strbuf *sb, struct > > string_list *resolve_undo) > >

[PATCH v2 33/36] sha1_file: convert read_sha1_file to struct object_id

2018-02-25 Thread brian m. carlson
E1, E2, E3, E4) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- apply.c | 4 ++-- archive.c| 2 +- bisect.c | 3 ++- blame.c | 8 builtin/cat-file.c | 14 -- builtin/difftool.

[PATCH v2 31/36] tree-walk: convert tree entry functions to object_id

2018-02-25 Thread brian m. carlson
Convert get_tree_entry and find_tree_entry to take pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive.c | 4 ++-- blame.c| 6 ++ builtin/rm.c | 2 +- builtin/update-index.c | 2 +- line

[PATCH v2 25/36] Convert remaining callers of sha1_object_info_extended to object_id

2018-02-25 Thread brian m. carlson
instead of all at once. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_file.c | 14 +++--- streaming.c | 5 - 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index fa69d86309..19995766b6 100644 --- a/sha1_file.c

[PATCH v2 21/36] builtin/mktree: convert to struct object_id

2018-02-25 Thread brian m. carlson
Convert this file to use struct object_id. Modify one use of get_sha1_hex into parse_oid_hex; this is safe since we get the data from a strbuf. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/mktree.c | 24 1 file changed, 12 insertions(

[PATCH v2 05/36] resolve-undo: convert struct resolve_undo_info to object_id

2018-02-25 Thread brian m. carlson
Convert the sha1 member of this struct to be an array of struct object_id instead. This change is needed to convert find_unique_abbrev. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/ls-files.c | 2 +- resolve-undo.c | 8 resolve-undo.h | 2

[PATCH v2 28/36] builtin/notes: convert static functions to object_id

2018-02-25 Thread brian m. carlson
Convert the remaining static functions to take pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/notes.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index 3930

[PATCH v2 19/36] sha1_file: convert check_sha1_signature to struct object_id

2018-02-25 Thread brian m. carlson
lookup_replace_object, open_istream needs to be converted, and open_istream needs check_sha1_signature to be converted, causing a loop of dependencies. The temporaries will be removed in a future patch. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fast-export.

[PATCH v2 20/36] streaming: convert open_istream to use struct object_id

2018-02-25 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 2 +- archive-zip.c | 2 +- builtin/index-pack.c | 2 +- builtin/pack-objects.c | 2 +- sha1_file.c| 2 +- streaming.c| 6 +++--- streaming.h| 2 +- 7

[PATCH v2 07/36] ref-filter: convert grab_objectname to struct object_id

2018-02-25 Thread brian m. carlson
This is necessary in order to convert find_unique_abbrev. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- ref-filter.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index f9e25aea7a..9cbd92611c 100644 ---

[PATCH v2 26/36] sha1_file: convert sha1_object_info* to object_id

2018-02-25 Thread brian m. carlson
Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2;

[PATCH v2 16/36] archive: convert sha1_file_to_archive to struct object_id

2018-02-25 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it object_file_to_archive. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 2 +- archive-zip.c | 4 ++-- archive.c | 10 +- archive.h | 8 4 files chang

[PATCH v2 27/36] builtin/fmt-merge-msg: convert remaining code to object_id

2018-02-25 Thread brian m. carlson
this to struct object_id, simply change the pointer we're using. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fmt-merge-msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 8e8a

[PATCH v2 09/36] wt-status: convert struct wt_status_state to object_id

2018-02-25 Thread brian m. carlson
Convert the various *_sha1 members to use struct object_id instead. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- wt-status.c | 12 ++-- wt-status.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wt-status.c b/wt-status.c index 98e5

[PATCH v2 11/36] http-walker: convert struct object_request to use struct object_id

2018-02-25 Thread brian m. carlson
ed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- http-walker.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/http-walker.c b/http-walker.c index 07c2b1af82..f506f394ac 100644 --- a/http-walker.c +++ b/http-walker.c @@ -22,7 +22,7 @@ enum object_r

[PATCH v2 36/36] convert: convert to struct object_id

2018-02-25 Thread brian m. carlson
-visible hash algorithms differed, as anticipated by the hash function transition plan. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- convert.c | 12 ++-- convert.h | 2 +- entry.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conve

[PATCH v2 08/36] strbuf: convert strbuf_add_unique_abbrev to use struct object_id

2018-02-25 Thread brian m. carlson
rev(E1, E2, E3); Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/checkout.c | 2 +- builtin/fetch.c| 8 builtin/tag.c | 2 +- merge-recursive.c | 2 +- pretty.c | 8 strbuf.c | 4 ++-- strbuf.h

[PATCH v2 10/36] Convert find_unique_abbrev* to struct object_id

2018-02-25 Thread brian m. carlson
Convert find_unique_abbrev and find_unique_abbrev_r to each take a pointer to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/blame.c| 2 +- builtin/branch.c | 2 +- builtin/checkout.c | 6 +++--- builtin/describe.c

[PATCH v2 24/36] packfile: convert unpack_entry to struct object_id

2018-02-25 Thread brian m. carlson
Convert unpack_entry and read_object to use struct object_id. --- packfile.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packfile.c b/packfile.c index 954e1fca11..e3b1db7dd5 100644 --- a/packfile.c +++ b/packfile.c @@ -1452,7 +1452,7 @@ struct

[PATCH v2 30/36] streaming: convert istream internals to struct object_id

2018-02-25 Thread brian m. carlson
Convert the various open_istream variants to take a pointer to struct object_id. Introduce a temporary, which will be removed later, to work around the fact that lookup_replace_object still returns a pointer to unsigned char. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.

[PATCH v2 32/36] sha1_file: convert read_object_with_reference to object_id

2018-02-25 Thread brian m. carlson
Convert read_object_with_reference to take pointers to struct object_id. Update the internals of the function accordingly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/cat-file.c | 2 +- builtin/grep.c | 4 ++-- builtin/pack-objects.c | 2 +- c

[PATCH v2 29/36] tree-walk: convert get_tree_entry_follow_symlinks internals to object_id

2018-02-25 Thread brian m. carlson
Convert the internals of this function to use struct object_id. This is one of the last remaining callers of read_sha1_file_extended that has not been converted yet. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- tree-walk.c | 22 +++--- 1 file chang

[PATCH v2 15/36] archive: convert write_archive_entry_fn_t to object_id

2018-02-25 Thread brian m. carlson
Convert the write_archive_entry_fn_t type to use a pointer to struct object_id. Convert various static functions in the tar and zip archivers also. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 28 ++-- archive-zip.

[PATCH v2 18/36] sha1_file: convert read_loose_object to use struct object_id

2018-02-25 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fsck.c | 2 +- cache.h| 4 ++-- sha1_file.c| 10 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/fsck.c b/builtin/fsck.c index 9981db2263..57509a4eac 100644 --- a/b

[PATCH v2 17/36] builtin/index-pack: convert struct ref_delta_entry to object_id

2018-02-25 Thread brian m. carlson
Convert this struct to use a member of type object_id. Convert various static functions as well. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/index-pack.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff

[PATCH v2 14/36] builtin/mktag: convert to struct object_id

2018-02-25 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/mktag.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/builtin/mktag.c b/builtin/mktag.c index beb552847b..65bb41e3cd 100644 --- a/builtin/mktag.c +++ b/builtin/mktag.c @@

[PATCH v2 23/36] sha1_file: convert retry_bad_packed_offset to struct object_id

2018-02-25 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- packfile.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packfile.c b/packfile.c index 7dbe8739d1..954e1fca11 100644 --- a/packfile.c +++ b/packfile.c @@ -1095,13 +1095,13 @@ stat

[PATCH v2 22/36] sha1_file: convert assert_sha1_type to object_id

2018-02-25 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it to assert_oid_type. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/commit-tree.c | 2 +- cache.h | 2 +- commit.c | 2 +- sha1_file.c | 8 4

[PATCH v2 13/36] replace_object: convert struct replace_object to object_id

2018-02-25 Thread brian m. carlson
Convert the two members of this struct to be instances of struct object_id. Adjust the various functions in this file accordingly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- replace_object.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

[PATCH v2 00/36] object_id part 12

2018-02-25 Thread brian m. carlson
of hard-coded constants in the code. After this series, there are only 172 instances of the constant "20" in the code (for any purpose) and 98 instances of "40". Changes from v1: * Rebase onto master. brian m. carlson (36): bulk-checkin: convert index_bulk_checkin to struct

[PATCH v2 06/36] tree: convert read_tree_recursive to struct object_id

2018-02-25 Thread brian m. carlson
Convert the callback functions for read_tree_recursive to take a pointer to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive.c | 8 builtin/checkout.c | 4 ++-- builtin/log.c | 2 +- builtin/ls-tree.c | 8

[PATCH v2 02/36] builtin/write-tree: convert to struct object_id

2018-02-25 Thread brian m. carlson
This is needed to convert parts of the cache-tree code. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/write-tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/write-tree.c b/builtin/write-tree.c index bd0a78aa3c..299a

[PATCH v2 04/36] cache-tree: convert remnants to struct object_id

2018-02-25 Thread brian m. carlson
Convert the remaining portions of cache-tree.c to use struct object_id. Convert several instances of 20 to use the_hash_algo instead. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- cache-tree.c | 26 +- 1 file changed, 13 insertions(+), 13 del

[PATCH v2 12/36] send-pack: convert remaining functions to struct object_id

2018-02-25 Thread brian m. carlson
Convert the remaining function, feed_object, to use struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- send-pack.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/send-pack.c b/send-pack.c index 2112d3b27a..7350af8883

[PATCH v2 35/36] sha1_file: introduce a constant for max header length

2018-02-25 Thread brian m. carlson
(7 for "commit", 1 for a space, 20 for a 63-bit length in decimal, and 1 for the NUL). However, the overallocation should not cause any problems, so leave it as it is. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_file.c | 17 ++--- 1

[PATCH v2 01/36] bulk-checkin: convert index_bulk_checkin to struct object_id

2018-02-25 Thread brian m. carlson
Convert the index_bulk_checkin function, and the static functions it calls, to use pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- bulk-checkin.c | 18 +- bulk-checkin.h | 2 +- sha1_file.c| 2 +- 3 files chang

[PATCH v2 34/36] Convert lookup_replace_object to struct object_id

2018-02-25 Thread brian m. carlson
Convert both the argument and the return value to be pointers to struct object_id. Update the callers and their internals to deal with the new type. Remove several temporaries which are no longer needed. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/mktag.c

[PATCH v2 03/36] cache-tree: convert write_*_as_tree to object_id

2018-02-25 Thread brian m. carlson
Convert write_index_as_tree and write_cache_as_tree to use struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/am.c | 8 builtin/merge.c | 2 +- builtin/write-tree.c | 2 +- cache-tree.c | 10 +- cache-

Re: [PATCH v3 0/6] Fix initializing the_hash_algo

2018-02-25 Thread brian m. carlson
hash algo, report nicely and suggest GIT_HASH_FIXUP > > The last point makes me much happier about keeping this workaround > around until we are confident we can live without it. Interdiff This looks sane to me. Reviewed-by: brian m. carlson <sand...@crustytoothpaste.net> -- bria

Re: [PATCH v2 5/5] Revert "repository: pre-initialize hash algo pointer"

2018-02-25 Thread brian m. carlson
gt; if we prefer nice messages over segmentation faults, we can't avoid it > completely anyway (empty_tree and empty_blob are still NULL in unknown > hash algo and will cause segfaults). Might as well make things > consistent and always segfault. That makes sense. Thanks for the ex

Re: [PATCH v2 5/5] Revert "repository: pre-initialize hash algo pointer"

2018-02-24 Thread brian m. carlson
static struct repository the_repo = { > - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, _index, > _algos[GIT_HASH_SHA1], 0, 0 > + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, _index, NULL, > 0, 0 I'm wondering, now that you have the name f

Re: [PATCH v2 3/5] index-pack: check (and optionally set) hash algo based on input file

2018-02-24 Thread brian m. carlson
algorithm, " > + "configured for %s but the pack file needs %s"), > + the_hash_algo->name, pack_algo->name); I like this. It's a nice improvement and it should be easy for us to pass additional information into the function when our pack for

Re: [PATCH v2 2/5] sha1_file.c: keep a good name for "unknown" hash_algos[UNKNOWN]

2018-02-24 Thread brian m. carlson
mplementations > do not check for NULL pointer) This is a good change. Using a NULL pointer with %s on the BSDs definitely did cause a crash, last I checked. I looked at the comment I wrote in hash.h, and based on that, it is indeed very likely that someone would accidentally write code this way

Re: [PATCH v2 4/5] diff.c: initialize hash algo when running in --no-index mode

2018-02-24 Thread brian m. carlson
read-only, maybe I should convert > that macro to an inline function to prevent people from accidentally > reassigning it? You could if you want to, although I don't really see a need to, since we can just catch it in review. If you wanted to, I'd make it an inline function for performance re

Re: [PATCH 0/2] Fix initializing the_hash_algo

2018-02-23 Thread brian m. carlson
ver my previous patch. My major concern is alarming users (or breaking scripts) with the warning message. I wonder if deferring the use of the warning until we have multiple hash algorithms might be a better idea. At that point, the warning would become something people could act upon. -- brian

Re: [PATCH 2/2] Revert "repository: pre-initialize hash algo pointer"

2018-02-23 Thread brian m. carlson
s to standard error. I'm not opposed to making this more visible, but I wonder if maybe it should only be visible to developers or such. The only way I can think of doing is that is with an advice options, but maybe there's a better way. -- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 signature.asc Description: PGP signature

Re: [PATCH 1/2] setup.c: initialize the_repository correctly in all cases

2018-02-23 Thread brian m. carlson
chive) to do the heavy lifting. These programs already > use setup_git_dir..() You have "..()" here. Did you want to say "()." instead? -- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https:

Re: [PATCH 00/36] object_id part 12

2018-02-21 Thread brian m. carlson
On Wed, Feb 21, 2018 at 10:47:19AM -0800, Junio C Hamano wrote: > "brian m. carlson" <sand...@crustytoothpaste.net> writes: > > > This is the twelfth in a series of patches to convert from unsigned char > > [20] to struct object_id. This series is based on nex

Re: [PATCH] Fix misconversion of gitsubmodule.txt

2018-02-20 Thread brian m. carlson
utput? I think AsciiDoc (and Asciidoctor) produce the non-ASCII format for output, so this should be a no-op for all known output formats. -- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 sign

[PATCH 08/36] strbuf: convert strbuf_add_unique_abbrev to use struct object_id

2018-02-19 Thread brian m. carlson
rev(E1, E2, E3); Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/checkout.c | 2 +- builtin/fetch.c| 8 builtin/tag.c | 2 +- merge-recursive.c | 2 +- pretty.c | 8 strbuf.c | 4 ++-- strbuf.h

[PATCH 12/36] send-pack: convert remaining functions to struct object_id

2018-02-19 Thread brian m. carlson
Convert the remaining function, feed_object, to use struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- send-pack.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/send-pack.c b/send-pack.c index 8d9190f5e7..19025a7aca

[PATCH 10/36] Convert find_unique_abbrev* to struct object_id

2018-02-19 Thread brian m. carlson
Convert find_unique_abbrev and find_unique_abbrev_r to each take a pointer to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/blame.c| 2 +- builtin/branch.c | 2 +- builtin/checkout.c | 6 +++--- builtin/describe.c

[PATCH 06/36] tree: convert read_tree_recursive to struct object_id

2018-02-19 Thread brian m. carlson
Convert the callback functions for read_tree_recursive to take a pointer to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive.c | 8 builtin/checkout.c | 4 ++-- builtin/log.c | 2 +- builtin/ls-tree.c | 8

[PATCH 19/36] sha1_file: convert check_sha1_signature to struct object_id

2018-02-19 Thread brian m. carlson
lookup_replace_object, open_istream needs to be converted, and open_istream needs check_sha1_signature to be converted, causing a loop of dependencies. The temporaries will be removed in a future patch. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fast-export.

[PATCH 11/36] http-walker: convert struct object_request to use struct object_id

2018-02-19 Thread brian m. carlson
ed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- http-walker.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/http-walker.c b/http-walker.c index 07c2b1af82..f506f394ac 100644 --- a/http-walker.c +++ b/http-walker.c @@ -22,7 +22,7 @@ enum object_r

[PATCH 04/36] cache-tree: convert remnants to struct object_id

2018-02-19 Thread brian m. carlson
Convert the remaining portions of cache-tree.c to use struct object_id. Convert several instances of 20 to use the_hash_algo instead. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- cache-tree.c | 26 +- 1 file changed, 13 insertions(+), 13 del

[PATCH 09/36] wt-status: convert struct wt_status_state to object_id

2018-02-19 Thread brian m. carlson
Convert the various *_sha1 members to use struct object_id instead. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- wt-status.c | 12 ++-- wt-status.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wt-status.c b/wt-status.c index 98e5

[PATCH 15/36] archive: convert write_archive_entry_fn_t to object_id

2018-02-19 Thread brian m. carlson
Convert the write_archive_entry_fn_t type to use a pointer to struct object_id. Convert various static functions in the tar and zip archivers also. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 28 ++-- archive-zip.

[PATCH 05/36] resolve-undo: convert struct resolve_undo_info to object_id

2018-02-19 Thread brian m. carlson
Convert the sha1 member of this struct to be an array of struct object_id instead. This change is needed to convert find_unique_abbrev. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/ls-files.c | 2 +- resolve-undo.c | 8 resolve-undo.h | 2

[PATCH 16/36] archive: convert sha1_file_to_archive to struct object_id

2018-02-19 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it object_file_to_archive. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive-tar.c | 2 +- archive-zip.c | 4 ++-- archive.c | 10 +- archive.h | 8 4 files chang

[PATCH 17/36] builtin/index-pack: convert struct ref_delta_entry to object_id

2018-02-19 Thread brian m. carlson
Convert this struct to use a member of type object_id. Convert various static functions as well. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/index-pack.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff

[PATCH 25/36] Convert remaining callers of sha1_object_info_extended to object_id

2018-02-19 Thread brian m. carlson
instead of all at once. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_file.c | 14 +++--- streaming.c | 5 - 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index fa69d86309..19995766b6 100644 --- a/sha1_file.c

[PATCH 27/36] builtin/fmt-merge-msg: convert remaining code to object_id

2018-02-19 Thread brian m. carlson
this to struct object_id, simply change the pointer we're using. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/fmt-merge-msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 8e8a

[PATCH 26/36] sha1_file: convert sha1_object_info* to object_id

2018-02-19 Thread brian m. carlson
Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2;

[PATCH 30/36] streaming: convert istream internals to struct object_id

2018-02-19 Thread brian m. carlson
Convert the various open_istream variants to take a pointer to struct object_id. Introduce a temporary, which will be removed later, to work around the fact that lookup_replace_object still returns a pointer to unsigned char. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.

[PATCH 35/36] sha1_file: introduce a constant for max header length

2018-02-19 Thread brian m. carlson
(7 for "commit", 1 for a space, 20 for a 63-bit length in decimal, and 1 for the NUL). However, the overallocation should not cause any problems, so leave it as it is. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- sha1_file.c | 17 ++--- 1

[PATCH 33/36] sha1_file: convert read_sha1_file to struct object_id

2018-02-19 Thread brian m. carlson
E1, E2, E3, E4) Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- apply.c | 4 ++-- archive.c| 2 +- bisect.c | 3 ++- blame.c | 8 builtin/cat-file.c | 14 -- builtin/difftool.

[PATCH 36/36] convert: convert to struct object_id

2018-02-19 Thread brian m. carlson
-visible hash algorithms differed, as anticipated by the hash function transition plan. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- convert.c | 12 ++-- convert.h | 2 +- entry.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conve

[PATCH 32/36] sha1_file: convert read_object_with_reference to object_id

2018-02-19 Thread brian m. carlson
Convert read_object_with_reference to take pointers to struct object_id. Update the internals of the function accordingly. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/cat-file.c | 2 +- builtin/grep.c | 4 ++-- builtin/pack-objects.c | 2 +- c

[PATCH 28/36] builtin/notes: convert static functions to object_id

2018-02-19 Thread brian m. carlson
Convert the remaining static functions to take pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/notes.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index 3930

[PATCH 23/36] sha1_file: convert retry_bad_packed_offset to struct object_id

2018-02-19 Thread brian m. carlson
Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- packfile.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packfile.c b/packfile.c index 5d07f330c8..bfa6438b4e 100644 --- a/packfile.c +++ b/packfile.c @@ -1095,13 +1095,13 @@ stat

[PATCH 34/36] Convert lookup_replace_object to struct object_id

2018-02-19 Thread brian m. carlson
Convert both the argument and the return value to be pointers to struct object_id. Update the callers and their internals to deal with the new type. Remove several temporaries which are no longer needed. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- builtin/mktag.c

[PATCH 29/36] tree-walk: convert get_tree_entry_follow_symlinks internals to object_id

2018-02-19 Thread brian m. carlson
Convert the internals of this function to use struct object_id. This is one of the last remaining callers of read_sha1_file_extended that has not been converted yet. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- tree-walk.c | 22 +++--- 1 file chang

[PATCH 31/36] tree-walk: convert tree entry functions to object_id

2018-02-19 Thread brian m. carlson
Convert get_tree_entry and find_tree_entry to take pointers to struct object_id. Signed-off-by: brian m. carlson <sand...@crustytoothpaste.net> --- archive.c | 4 ++-- blame.c| 6 ++ builtin/rm.c | 2 +- builtin/update-index.c | 2 +- line

[PATCH 24/36] packfile: convert unpack_entry to struct object_id

2018-02-19 Thread brian m. carlson
Convert unpack_entry and read_object to use struct object_id. --- packfile.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packfile.c b/packfile.c index bfa6438b4e..ed7b342ebf 100644 --- a/packfile.c +++ b/packfile.c @@ -1452,7 +1452,7 @@ struct

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