Re: [PATCH 2/2] submodule: Add --dissociate option to add/update commands

2018-05-01 Thread Eric Sunshine
On Tue, May 1, 2018 at 2:09 PM, Casey Fitzpatrick wrote: > submodule: Add --dissociate option to add/update commands s/Add/add/ > Add --dissociate option to add and update commands, both clone helper commands > that already have the --reference option --dissociate pairs with.

[PATCH 2/2] submodule: Add --dissociate option to add/update commands

2018-05-01 Thread Casey Fitzpatrick
Add --dissociate option to add and update commands, both clone helper commands that already have the --reference option --dissociate pairs with. Add documentation. Add tests. Signed-off-by: Casey Fitzpatrick --- Documentation/git-submodule.txt | 10 +-

[PATCH 1/2] submodule: Add --progress option to add command

2018-05-01 Thread Casey Fitzpatrick
--progress was missing from add command, was only in update. Add --progress where it makes sense (both clone helper commands). Add missing documentation entry. Add test. Signed-off-by: Casey Fitzpatrick --- Documentation/git-submodule.txt | 7 +++ git-submodule.sh

[PATCH 0/2] Add --progress and --dissociate to git submodule

2018-05-01 Thread Casey Fitzpatrick
These patches add --progress and --dissociate options to git submodule. The --progress option existed beforehand, but only for the update command and it was left undocumented. Both add and update submodule commands supported --reference, but not its pair option --dissociate which allows for

[PATCH v3 06/12] get_short_oid: sort ambiguous objects by type, then SHA-1

2018-05-01 Thread Ævar Arnfjörð Bjarmason
Change the output emitted when an ambiguous object is encountered so that we show tags first, then commits, followed by trees, and finally blobs. Within each type we show objects in hashcmp() order. Before this change the objects were only ordered by hashcmp(). The reason for doing this is that

Re: [PATCH 1/2] submodule: Add --progress option to add command

2018-05-01 Thread Stefan Beller
On Tue, May 1, 2018 at 11:09 AM, Casey Fitzpatrick wrote: > --progress was missing from add command, was only in update. > Add --progress where it makes sense (both clone helper commands). > Add missing documentation entry. > Add test. Maybe: The '--progress' was introduced

[PATCH v3 07/12] get_short_oid: learn to disambiguate by ^{tag}

2018-05-01 Thread Ævar Arnfjörð Bjarmason
Add support for ^{tag} to the disambiguation logic. Before this ^{tag} would simply be ignored: $ git rev-parse e8f2^{tag} error: short SHA1 e8f2 is ambiguous hint: The candidates are: hint: e8f2650052 tag v2.17.0 hint: e8f21caf94 commit 2013-06-24 - bash prompt: print

Re: [RFC PATCH v4 0/3] Optional sub hierarchy for remote tags

2018-05-01 Thread Ævar Arnfjörð Bjarmason
On Tue, May 01 2018, Wink Saville wrote: > As discussed on the git email list [1] with the subject > "Fetching tags overwrites existing tags" there is a bug > where fetching tags can overwrite existing tags. > > Ævar Arnfjörð Bjarmasono, has created a patch series [2] > which requires a

Re: [PATCH 0/2] Add --progress and --dissociate to git submodule

2018-05-01 Thread Stefan Beller
Hi Casey, thanks for sending those patches and improving submodules! On Tue, May 1, 2018 at 11:09 AM, Casey Fitzpatrick wrote: > These patches add --progress and --dissociate options to git submodule. > > The --progress option existed beforehand, but only for the update

Re: js/no-pager-shorthand [was: What's cooking in git.git (Apr 2018, #04; Mon, 30)]

2018-05-01 Thread Ævar Arnfjörð Bjarmason
On Tue, May 01 2018, Johannes Schindelin wrote: > I wonder whether `-!p` would be better/feasible? In *nix shells `git -!p ...` unquoted will turn that !p into whatever command you last ran that started with a "p", in my case `git -ping 8.8.8.8`. So there's a reason that's not the idiom in any

Re: [RFC PATCH v4 0/3] Optional sub hierarchy for remote tags

2018-05-01 Thread Jacob Keller
On Tue, May 1, 2018 at 12:24 PM, Ævar Arnfjörð Bjarmason wrote: > Thanks a lot for working on this, it's great to have something the > direction of getting rid of this discrepancy between the 1=1 mapping for > branches, but the 1=many mapping for tags. My recent patch series and

Re: [PATCH 2/2] submodule: Add --dissociate option to add/update commands

2018-05-01 Thread Stefan Beller
On Tue, May 1, 2018 at 11:09 AM, Casey Fitzpatrick wrote: > > +test_expect_success 'submodule add --reference with --dissociate doesnt use > alternates' ' > + ( > + cd super && > + git submodule add --reference ../B --dissociate >

Re: js/no-pager-shorthand [was: What's cooking in git.git (Apr 2018, #04; Mon, 30)]

2018-05-01 Thread Eric Sunshine
On Tue, May 1, 2018 at 10:58 AM, Johannes Sixt wrote: > Am 01.05.2018 um 13:57 schrieb Johannes Schindelin: >> On Mon, 30 Apr 2018, Johannes Sixt wrote: >>> Am 30.04.2018 um 05:25 schrieb Junio C Hamano: * js/no-pager-shorthand (2018-04-25) 1 commit - git: add -N as a

[PATCH v3 11/12] config doc: document core.disambiguate

2018-05-01 Thread Ævar Arnfjörð Bjarmason
The core.disambiguate variable was added in 5b33cb1fd7 ("get_short_sha1: make default disambiguation configurable", 2016-09-27) but never documented. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/config.txt | 13 + 1 file changed, 13 insertions(+) diff

[PATCH v3 08/12] get_short_oid: learn to disambiguate by ^{blob}

2018-05-01 Thread Ævar Arnfjörð Bjarmason
The disambiguation logic had all the pieces necessary to only print out those blobs that were ambiguous, but they hadn't been connected. The initial logic was added in daba53aeaf ("sha1_name.c: add support for disambiguating other types", 2012-07-02), and when the flags were propagated in

[PATCH v3 05/12] sha1-name.c: move around the collect_ambiguous() function

2018-05-01 Thread Ævar Arnfjörð Bjarmason
A subsequent change will make use of this static function in the get_short_oid() function, which is defined above where the collect_ambiguous() function is now. Without this we'd then have a compilation error due to a forward declaration. Signed-off-by: Ævar Arnfjörð Bjarmason

[PATCH v3 10/12] get_short_oid / peel_onion: ^{commit} should be commit, not committish

2018-05-01 Thread Ævar Arnfjörð Bjarmason
Change the ^{commit} syntax to mean just commits instead of committish for the purpose of disambiguation. Before this e8f2^{commit} would show the v2.17.0 tag as a disambiguation candidate, but now it'll just show ambiguous commits: $ git rev-parse e8f2^{commit} error: short SHA1 e8f2 is

[PATCH v3 00/12] get_short_oid UI improvements

2018-05-01 Thread Ævar Arnfjörð Bjarmason
Comments inline: Ævar Arnfjörð Bjarmason (12): sha1-name.c: remove stray newline No changes. sha1-array.h: align function arguments Mention the correct commit to blame for disalignment in the commit message, and also fix it in the *.c file. git-p4: change "commitish" typo to

[PATCH v3 01/12] sha1-name.c: remove stray newline

2018-05-01 Thread Ævar Arnfjörð Bjarmason
This stray newline was accidentally introduced in d2b7d9c7ed ("sha1_name: convert disambiguate_hint_fn to take object_id", 2017-03-26). Signed-off-by: Ævar Arnfjörð Bjarmason --- sha1-name.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sha1-name.c b/sha1-name.c index

[PATCH v3 09/12] get_short_oid / peel_onion: ^{tree} should be tree, not treeish

2018-05-01 Thread Ævar Arnfjörð Bjarmason
After the recent series of patches ^{tag} and ^{blob} now work to get just the tags and blobs, but ^{tree} will still list any tree-ish (commits, tags and trees). The previous behavior was added in ed1ca6025f ("peel_onion: disambiguate to favor tree-ish when we know we want a tree-ish",

[PATCH v3 12/12] get_short_oid: document & warn if we ignore the type selector

2018-05-01 Thread Ævar Arnfjörð Bjarmason
The SHA1 prefix 06fa currently matches no blobs in git.git. When disambiguating short SHA1s we've been quietly ignoring the user's type selector as a fallback mechanism, this was intentionally added in 1ffa26c461 ("get_short_sha1: list ambiguous objects on error", 2016-09-26). I think that

[PATCH v3 03/12] git-p4: change "commitish" typo to "committish"

2018-05-01 Thread Ævar Arnfjörð Bjarmason
This was the only occurrence of "commitish" in the tree, but as the log will reveal we've had others in the past. Fixes up code added in 00ad6e3182 ("git-p4: work with a detached head", 2015-11-21). Signed-off-by: Ævar Arnfjörð Bjarmason --- git-p4.py | 6 +++--- 1 file

[PATCH v3 04/12] cache.h: add comment explaining the order in object_type

2018-05-01 Thread Ævar Arnfjörð Bjarmason
The order in the enum might seem arbitrary, and isn't explained by 72518e9c26 ("more lightweight revalidation while reusing deflated stream in packing", 2006-09-03) which added it. Derrick Stolee suggested that it's ordered topologically in 5f8b1ec1-258d-1acc-133e-a7c248b40...@gmail.com. Makes

[PATCH v3 02/12] sha1-array.h: align function arguments

2018-05-01 Thread Ævar Arnfjörð Bjarmason
The arguments weren't lined up with the opening parenthesis. Fixes up code added in aae0caf19e ("sha1-array.h: align function arguments", 2018-04-30). Signed-off-by: Ævar Arnfjörð Bjarmason --- sha1-array.c | 4 ++-- sha1-array.h | 4 ++-- 2 files changed, 4 insertions(+), 4

Re: [RFC PATCH v4 0/3] Optional sub hierarchy for remote tags

2018-05-01 Thread Wink Saville
Jake & Ævar, Thanks for the great feed back. As I mentioned previously, I'm going to be on vacation until May 17th, but will be following along on email as connedtivity allows. I'm all for moving in the "perfect" direction so hopefully you guys can decide on a solution and start moving in that

Re: [PATCH 1/2] submodule: Add --progress option to add command

2018-05-01 Thread Casey Fitzpatrick
Thanks, I'll clean it up based on your comments. I based the tests from t5606-clone-options.sh; I'm not sure why now but I thought I needed that clone -o thing from there, but it appears useless. On Tue, May 1, 2018 at 2:41 PM, Stefan Beller wrote: > On Tue, May 1, 2018 at

[PATCH 00/13] object store: alloc

2018-05-01 Thread Stefan Beller
This applies on top of sb/oid-object-info and is the logical continuum of the series that it builds on; this brings the object store into more of Gits code, removing global state, such that reasoning about the state of the in-memory representation of the repository is easier. My original plan was

[PATCH 01/13] repository: introduce object parser field

2018-05-01 Thread Stefan Beller
Git's object access code can be thought of as containing two layers: the raw object store provides access to raw object content, while the higher level obj_hash code parses raw objects and keeps track of parenthood and other object relationships using 'struct object'. Keeping these layers separate

[PATCH 2/2] {fetch,upload}-pack: support filter in protocol v2

2018-05-01 Thread Jonathan Tan
The fetch-pack/upload-pack protocol v2 was developed independently of the filter parameter (used in partial fetches), thus it did not include support for it. Add support for the filter parameter. Like in the legacy protocol, the server advertises and supports "filter" only if

[PATCH 0/2] Supporting partial clones in protocol v2

2018-05-01 Thread Jonathan Tan
This patch set is built on "next". (I had to build it on "next" because bw/protocol-v2 is built on v2.16, which does not have support for partial clones.) Partial clones and protocol v2 were built independently, so here is a patch to support partial clones in protocol v2. One thing I am a little

[PATCH 1/2] upload-pack: fix error message typo

2018-05-01 Thread Jonathan Tan
Fix a typo in an error message. Also, this line was introduced in 3145ea957d2c ("upload-pack: introduce fetch server command", 2018-03-15), which did not contain a test for the case which causes this error to be printed, so introduce a test. Signed-off-by: Jonathan Tan

Re: [RFC PATCH v4 0/3] Optional sub hierarchy for remote tags

2018-05-01 Thread Junio C Hamano
Jacob Keller writes: > I also agree, I'd prefer if we aim for the mapping to be something > which works for all refs in the future, even if such support isn't > added now, which is why i've proposed using "refs/remote//" so > that a tag would go from > > refs/tags/v1.7 >

Re: [PATCH 08/41] packfile: abstract away hash constant values

2018-05-01 Thread brian m. carlson
On Tue, May 01, 2018 at 12:22:43PM +0200, Duy Nguyen wrote: > On Mon, Apr 23, 2018 at 11:39:18PM +, brian m. carlson wrote: > > There are several instances of the constant 20 and 20-based values in > > the packfile code. Abstract away dependence on SHA-1 by using the > > values from

[PATCH v2 40/42] Update shell scripts to compute empty tree object ID

2018-05-01 Thread brian m. carlson
Several of our shell scripts hard-code the object ID of the empty tree. To avoid any problems when changing hashes, compute this value on startup of the script. For performance, store the value in a variable and reuse it throughout the life of the script. Signed-off-by: brian m. carlson

[PATCH v2 28/42] builtin/merge: switch tree functions to use object_id

2018-05-01 Thread brian m. carlson
The read_empty and reset_hard functions are static and their callers have already changed to use struct object_id, so convert them as well. To avoid dependency on the hash algorithm in use, switch from using EMPTY_TREE_SHA1_HEX to using empty_tree_oid_hex. Signed-off-by: brian m. carlson

[PATCH v2 41/42] add--interactive: compute the empty tree value

2018-05-01 Thread brian m. carlson
The interactive add script hard-codes the object ID of the empty tree. To avoid any problems when changing hashes, compute this value when used and cache it for any future uses. Signed-off-by: brian m. carlson --- git-add--interactive.perl | 11 +-- 1 file

[PATCH v2 20/42] dir: convert struct untracked_cache_dir to object_id

2018-05-01 Thread brian m. carlson
Convert the exclude_sha1 member of struct untracked_cache_dir and rename it to exclude_oid. Eliminate several hard-coded integral constants, and update a function name that referred to SHA-1. Signed-off-by: brian m. carlson --- dir.c

[PATCH v2 16/42] Update struct index_state to use struct object_id

2018-05-01 Thread brian m. carlson
Adjust struct index_state to use struct object_id instead of unsigned char [20]. Signed-off-by: brian m. carlson --- cache.h | 2 +- read-cache.c | 16 t/helper/test-dump-split-index.c | 2 +-

[PATCH v2 04/42] packfile: remove unused member from struct pack_entry

2018-05-01 Thread brian m. carlson
The sha1 member in struct pack_entry is unused except for one instance in which we store a value in it. Since nobody ever reads this value, don't bother to compute it and remove the member from struct pack_entry. Signed-off-by: brian m. carlson --- cache.h| 1

[PATCH v2 23/42] upload-pack: replace use of several hard-coded constants

2018-05-01 Thread brian m. carlson
Update several uses of hard-coded 40-based constants to use either the_hash_algo or GIT_MAX_HEXSZ, as appropriate. Replace a combined use of oid_to_hex and memcpy with oid_to_hex_r, which not only avoids the need for a constant, but is more efficient. Make use of parse_oid_hex to eliminate the

[PATCH v2 29/42] merge: convert empty tree constant to the_hash_algo

2018-05-01 Thread brian m. carlson
To avoid dependency on a particular hash algorithm, convert a use of EMPTY_TREE_SHA1_HEX to use the_hash_algo->empty_tree instead. Since both branches now use oid_to_hex, condense the if statement into a ternary. Signed-off-by: brian m. carlson --- merge.c | 5

[PATCH v2 38/42] dir: use the_hash_algo for empty blob object ID

2018-05-01 Thread brian m. carlson
To ensure that we are hash algorithm agnostic, use the_hash_algo to look up the object ID for the empty blob instead of using the empty_tree_oid variable. Signed-off-by: brian m. carlson --- dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 30/42] sequencer: convert one use of EMPTY_TREE_SHA1_HEX

2018-05-01 Thread brian m. carlson
Convert one use of EMPTY_TREE_SHA1_HEX to use empty_tree_oid_hex to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index

[PATCH v2 24/42] diff: specify abbreviation size in terms of the_hash_algo

2018-05-01 Thread brian m. carlson
Instead of using hard-coded 40 constants, refer to the_hash_algo for the current hash size. Signed-off-by: brian m. carlson --- diff.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index

[PATCH v2 08/42] packfile: abstract away hash constant values

2018-05-01 Thread brian m. carlson
There are several instances of the constant 20 and 20-based values in the packfile code. Abstract away dependence on SHA-1 by using the values from the_hash_algo instead. Use unsigned values for temporary constants to provide the compiler with more information about what kinds of values it

[PATCH v2 21/42] http: eliminate hard-coded constants

2018-05-01 Thread brian m. carlson
Use the_hash_algo to find the right size for parsing pack names. Signed-off-by: brian m. carlson --- http.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 3034d10b68..312a5e1833 100644 --- a/http.c +++

[PATCH v2 19/42] commit: convert uses of get_sha1_hex to get_oid_hex

2018-05-01 Thread brian m. carlson
Signed-off-by: brian m. carlson --- commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commit.c b/commit.c index ca474a7c11..9617f85caa 100644 --- a/commit.c +++ b/commit.c @@ -331,7 +331,7 @@ int parse_commit_buffer(struct commit

[PATCH v2 03/42] Remove unused member in struct object_context

2018-05-01 Thread brian m. carlson
The tree member of struct object_context is unused except in one place where we write to it. Since there are no users of this member, remove it. Signed-off-by: brian m. carlson --- cache.h | 1 - sha1-name.c | 1 - 2 files changed, 2 deletions(-) diff --git

[PATCH 04/13] alloc: add repository argument to alloc_blob_node

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 2 +- blob.c | 2 +- cache.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/alloc.c b/alloc.c index 12afadfacdd..6c5c376a25a 100644 --- a/alloc.c +++ b/alloc.c @@ -49,7 +49,7 @@ static inline void

[PATCH 08/13] alloc: add repository argument to alloc_object_node

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 2 +- cache.h | 3 ++- object.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/alloc.c b/alloc.c index 290250e3595..f031ce422d9 100644 --- a/alloc.c +++ b/alloc.c @@ -73,7 +73,7 @@ void

[PATCH 09/13] alloc: add repository argument to alloc_report

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 2 +- cache.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/alloc.c b/alloc.c index f031ce422d9..28b85b22144 100644 --- a/alloc.c +++ b/alloc.c @@ -105,7 +105,7 @@ static void report(const char *name,

[PATCH 13/13] alloc: allow arbitrary repositories for alloc functions

2018-05-01 Thread Stefan Beller
We have to convert all of the alloc functions at once, because alloc_report uses a funky macro for reporting. It is better for the sake of mechanical conversion to convert multiple functions at once rather than changing the structure of the reporting function. We record all memory allocation in

[PATCH 02/13] object: add repository argument to create_object

2018-05-01 Thread Stefan Beller
Add a repository argument to allow the callers of create_object to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch

[PATCH 07/13] alloc: add repository argument to alloc_tag_node

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 2 +- cache.h | 3 ++- tag.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/alloc.c b/alloc.c index 9e2b897ec1d..290250e3595 100644 --- a/alloc.c +++ b/alloc.c @@ -65,7 +65,7 @@ void

[PATCH 03/13] object: add repository argument to grow_object_hash

2018-05-01 Thread Stefan Beller
From: Jonathan Nieder Add a repository argument to allow the caller of grow_object_hash to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with

[PATCH 11/13] object: allow grow_object_hash to handle arbitrary repositories

2018-05-01 Thread Stefan Beller
Signed-off-by: Jonathan Nieder Signed-off-by: Stefan Beller --- object.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/object.c b/object.c index ddf4b7b196e..43954fadf93 100644 --- a/object.c +++ b/object.c @@

[PATCH 06/13] alloc: add repository argument to alloc_commit_node

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 2 +- blame.c | 2 +- cache.h | 3 ++- commit.c | 2 +- merge-recursive.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/alloc.c b/alloc.c index 2c8d1430758..9e2b897ec1d

[PATCH 05/13] alloc: add repository argument to alloc_tree_node

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 2 +- cache.h | 3 ++- tree.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/alloc.c b/alloc.c index 6c5c376a25a..2c8d1430758 100644 --- a/alloc.c +++ b/alloc.c @@ -57,7 +57,7 @@ void

[PATCH 10/13] alloc: add repository argument to alloc_commit_index

2018-05-01 Thread Stefan Beller
Signed-off-by: Stefan Beller --- alloc.c | 4 ++-- cache.h | 3 ++- object.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/alloc.c b/alloc.c index 28b85b22144..277dadd221b 100644 --- a/alloc.c +++ b/alloc.c @@ -82,7 +82,7 @@ void

[PATCH 12/13] object: allow create_object to handle arbitrary repositories

2018-05-01 Thread Stefan Beller
Signed-off-by: Jonathan Nieder Signed-off-by: Stefan Beller --- object.c | 12 ++-- object.h | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/object.c b/object.c index 43954fadf93..fd27cf54faa 100644 --- a/object.c +++

Re: [PATCH 2/2] {fetch,upload}-pack: support filter in protocol v2

2018-05-01 Thread Brandon Williams
On 05/01, Jonathan Tan wrote: > The fetch-pack/upload-pack protocol v2 was developed independently of > the filter parameter (used in partial fetches), thus it did not include > support for it. Add support for the filter parameter. > > Like in the legacy protocol, the server advertises and

Re: [PATCH v2] wt-status: use rename settings from init_diff_ui_defaults

2018-05-01 Thread Junio C Hamano
Elijah Newren writes: > I'm not certain what the default should be, but I do believe that it > should be consistent between these commands. I lean towards > considering break detection being on by default a good thing, but > there are some interesting issues to address: > -

Re: [PATCH] format-patch: make cover letters always text/plain

2018-05-01 Thread brian m. carlson
On Mon, Apr 30, 2018 at 09:53:33PM -0400, Eric Sunshine wrote: > On Mon, Apr 30, 2018 at 8:02 PM, brian m. carlson > wrote: > > When formatting a series of patches using --attach and --cover-letter, > > the cover letter lacks the closing MIME boundary, violating RFC

[PATCH v2 14/42] submodule-config: convert structures to object_id

2018-05-01 Thread brian m. carlson
Convert struct submodule and struct parse_config_parameter to use struct object_id. Adjust the functions which take members of these structures as arguments to also use struct object_id. Include cache.h into submodule-config.h to make struct object_id visible. Signed-off-by: brian m. carlson

[PATCH v2 18/42] index-pack: abstract away hash function constant

2018-05-01 Thread brian m. carlson
The code for reading certain pack v2 offsets had a hard-coded 5 representing the number of uint32_t words that we needed to skip over. Specify this value in terms of a value from the_hash_algo. Signed-off-by: brian m. carlson --- builtin/index-pack.c | 3 ++- 1

[PATCH v2 00/42] object_id part 13

2018-05-01 Thread brian m. carlson
This is the thirteenth series of patches to convert to struct object_id and the_hash_algo. The series adds an oidread function to read object IDs from a buffer, removes unused structure members (which therefore don't require conversion), converts various functions to struct object_id, and

[PATCH v2 12/42] tree-walk: convert get_tree_entry_follow_symlinks to object_id

2018-05-01 Thread brian m. carlson
Since the only caller of this function already uses struct object_id, update get_tree_entry_follow_symlinks to use it in parameters and internally. Signed-off-by: brian m. carlson --- sha1-name.c | 4 ++-- tree-walk.c | 16 tree-walk.h | 2 +- 3

[PATCH v2 15/42] split-index: convert struct split_index to object_id

2018-05-01 Thread brian m. carlson
Convert the base_sha1 member of struct split_index to use struct object_id and rename it base_oid. Include cache.h to make the structure visible. Signed-off-by: brian m. carlson --- builtin/rev-parse.c | 4 ++-- read-cache.c | 22

[PATCH v2 05/42] packfile: convert has_sha1_pack to object_id

2018-05-01 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it has_object_pack for consistency with has_object_file. Signed-off-by: brian m. carlson --- builtin/count-objects.c | 2 +- builtin/fsck.c | 2 +- builtin/prune-packed.c | 2 +-

[PATCH v2 13/42] fsck: convert static functions to struct object_id

2018-05-01 Thread brian m. carlson
Convert two static functions to use struct object_id and parse_oid_hex, instead of relying on harcoded 20 and 40-based constants. Signed-off-by: brian m. carlson --- fsck.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git

[PATCH v2 06/42] sha1-file: convert freshen functions to object_id

2018-05-01 Thread brian m. carlson
Convert the various functions for freshening objects and has_loose_object_nonlocal to use struct object_id. Signed-off-by: brian m. carlson --- builtin/pack-objects.c | 2 +- cache.h| 2 +- sha1-file.c| 36

[PATCH v2 36/42] cache-tree: use is_empty_tree_oid

2018-05-01 Thread brian m. carlson
When comparing an object ID against that of the empty tree, use the is_empty_tree_oid function to ensure that we abstract over the hash algorithm properly. In addition, this is more readable than a plain oidcmp. Signed-off-by: brian m. carlson --- cache-tree.c | 2

[PATCH v2 07/42] packfile: convert find_pack_entry to object_id

2018-05-01 Thread brian m. carlson
Convert find_pack_entry and the static function fill_pack_entry to take pointers to struct object_id. Signed-off-by: brian m. carlson --- packfile.c | 12 ++-- packfile.h | 2 +- sha1-file.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-)

[PATCH v2 02/42] server-info: remove unused members from struct pack_info

2018-05-01 Thread brian m. carlson
The head member of struct pack_info is completely unused and the nr_heads member is used only in one place, which is an assignment. This member was last usefully used in 3e15c67c90 (server-info: throw away T computation as well, 2005-12-04). Since this structure member is not useful, remove it.

[PATCH v2 17/42] pack-redundant: convert linked lists to use struct object_id

2018-05-01 Thread brian m. carlson
Convert struct llist_item and the rest of the linked list code to use struct object_id. Add a use of GIT_MAX_HEXSZ to avoid a dependency on a hard-coded constant. Signed-off-by: brian m. carlson --- builtin/pack-redundant.c | 50

[PATCH v2 10/42] pack-redundant: abstract away hash algorithm

2018-05-01 Thread brian m. carlson
Instead of using hard-coded instances of the constant 20, use the_hash_algo to look up the correct constant. Signed-off-by: brian m. carlson --- builtin/pack-redundant.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git

[PATCH v2 34/42] builtin/reset: convert use of EMPTY_TREE_SHA1_BIN

2018-05-01 Thread brian m. carlson
Convert the last use of EMPTY_TREE_SHA1_BIN to use a direct copy from the_hash_algo->empty_tree to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- builtin/reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 31/42] submodule: convert several uses of EMPTY_TREE_SHA1_HEX

2018-05-01 Thread brian m. carlson
Convert several uses of EMPTY_TREE_SHA1_HEX to use empty_tree_oid_hex to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- submodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/submodule.c

[PATCH v2 35/42] sha1_file: convert cached object code to struct object_id

2018-05-01 Thread brian m. carlson
Convert the code that looks up cached objects to use struct object_id. Adjust the lookup for empty trees to use the_hash_algo. Note that we don't need to be concerned about the hard-coded object ID in the empty_tree object since we never use it. Signed-off-by: brian m. carlson

[PATCH v2 33/42] builtin/receive-pack: convert one use of EMPTY_TREE_SHA1_HEX

2018-05-01 Thread brian m. carlson
Convert one use of EMPTY_TREE_SHA1_HEX to use empty_tree_oid_hex to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- builtin/receive-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/receive-pack.c

[PATCH v2 42/42] merge-one-file: compute empty blob object ID

2018-05-01 Thread brian m. carlson
This script hard-codes the object ID of the empty blob. To avoid any problems when changing hashes, compute this value by calling git hash-object. Signed-off-by: brian m. carlson --- git-merge-one-file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 39/42] sha1_file: only expose empty object constants through git_hash_algo

2018-05-01 Thread brian m. carlson
There really isn't any case in which we want to expose the constants for empty trees and blobs outside of using the hash algorithm abstraction. Make these constants static and stop exposing the defines in cache.h. Remove the constants which are no longer in use. Signed-off-by: brian m. carlson

[PATCH v2 37/42] sequencer: use the_hash_algo for empty tree object ID

2018-05-01 Thread brian m. carlson
To ensure that we are hash algorithm agnostic, use the_hash_algo to look up the object ID for the empty tree instead of using the empty_tree_oid variable. Signed-off-by: brian m. carlson --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 32/42] wt-status: convert two uses of EMPTY_TREE_SHA1_HEX

2018-05-01 Thread brian m. carlson
Convert two uses of EMPTY_TREE_SHA1_HEX to use empty_tree_oid_hex to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson --- wt-status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wt-status.c b/wt-status.c

[PATCH v2 22/42] revision: replace use of hard-coded constants

2018-05-01 Thread brian m. carlson
Replace two uses of the hard-coded constant 40 with references to the_hash_algo. Signed-off-by: brian m. carlson --- revision.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/revision.c b/revision.c index ce0e7b71f2..daf7fe6ff4 100644 ---

[PATCH v2 25/42] builtin/receive-pack: avoid hard-coded constants for push certs

2018-05-01 Thread brian m. carlson
Use the GIT_SHA1_RAWSZ and GIT_SHA1_HEXSZ macros instead of hard-coding the constants 20 and 40. Switch one use of 20 with a format specifier for a hex value to use the hex constant instead, as the original appears to have been a typo. At this point, avoid converting the hard-coded use of SHA-1

[PATCH v2 26/42] sha1-file: add functions for hex empty tree and blob OIDs

2018-05-01 Thread brian m. carlson
Oftentimes, we'll want to refer to an empty tree or empty blob by its hex name without having to call oid_to_hex or explicitly refer to the_hash_algo. Add helper functions that format these values into static buffers and return them for easy use. Signed-off-by: brian m. carlson

[PATCH v2 09/42] pack-objects: abstract away hash algorithm

2018-05-01 Thread brian m. carlson
Instead of using hard-coded instances of the constant 20, use the_hash_algo to look up the correct constant. Signed-off-by: brian m. carlson --- builtin/pack-objects.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff

[PATCH v2 27/42] builtin/am: convert uses of EMPTY_TREE_SHA1_BIN to the_hash_algo

2018-05-01 Thread brian m. carlson
Convert several uses of EMPTY_TREE_SHA1_BIN to use the_hash_algo and struct object_id instead. Signed-off-by: brian m. carlson --- builtin/am.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index

Re: [PATCH 2/2] submodule: Add --dissociate option to add/update commands

2018-05-01 Thread Casey Fitzpatrick
Thanks, I will clean up the braces and commit message. I have to disagree with the 's/reference/dissociate/' comments. It appears this section of option descriptions mostly copies from the descriptions given by 'git clone -h', which outputs: --reference reference repository

Re: [PATCH 02/13] object: add repository argument to create_object

2018-05-01 Thread Eric Sunshine
On Tue, May 1, 2018 at 5:33 PM, Stefan Beller wrote: > Add a repository argument to allow the callers of create_object > to be more specific about which repository to act on. This is a small > mechanical change; it doesn't change the implementation to handle > repositories

Re: [PATCH 1/2] upload-pack: fix error message typo

2018-05-01 Thread Jonathan Tan
On Tue, 1 May 2018 15:22:20 -0700 Jonathan Tan wrote: > +test_expect_success 'unexpected lines are not allowed in fetch request' ' > + git init server && > + > + # Custom request that tries to filter even though it is not advertised. Oops...I saw this

Re: [RFC PATCH v4 0/3] Optional sub hierarchy for remote tags

2018-05-01 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > As a workaround for that maybe we'll need something like: > > [remote "gbenchmark"] > url = g...@github.com:google/benchmark > fetch = +refs/heads/*:refs/remotes/gbenchmark/* > fetch = +refs/tags/*:refs/remote-tags/gbenchmark/* >

[PATCH v2 11/42] tree-walk: avoid hard-coded 20 constant

2018-05-01 Thread brian m. carlson
Use the_hash_algo to look up the length of our current hash instead of hard-coding the value 20. Signed-off-by: brian m. carlson --- tree-walk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-walk.c b/tree-walk.c index

[PATCH v2 01/42] cache: add a function to read an object ID from a buffer

2018-05-01 Thread brian m. carlson
In various places throughout the codebase, we need to read data into a struct object_id from a pack or other unsigned char buffer. Add an inline function that does this based on the current hash algorithm in use, and use it in several places. Signed-off-by: brian m. carlson

Re: [PATCH 01/41] cache: add a function to read an object ID from a buffer

2018-05-01 Thread brian m. carlson
On Tue, May 01, 2018 at 11:36:03AM +0200, Duy Nguyen wrote: > On Mon, Apr 23, 2018 at 11:39:11PM +, brian m. carlson wrote: > > diff --git a/cache.h b/cache.h > > index bbaf5c349a..4bca177cf3 100644 > > --- a/cache.h > > +++ b/cache.h > > @@ -1008,6 +1008,11 @@ static inline void oidclr(struct

Re: [PATCH v2] wt-status: use rename settings from init_diff_ui_defaults

2018-05-01 Thread Elijah Newren
On Tue, May 1, 2018 at 4:11 PM, Junio C Hamano wrote: > Elijah Newren writes: > >> I'm not certain what the default should be, but I do believe that it >> should be consistent between these commands. I lean towards >> considering break detection being on by

Re: [RFC PATCH v4 0/3] Optional sub hierarchy for remote tags

2018-05-01 Thread Jacob Keller
On Tue, May 1, 2018 at 4:24 PM, Junio C Hamano wrote: > Jacob Keller writes: > >> I also agree, I'd prefer if we aim for the mapping to be something >> which works for all refs in the future, even if such support isn't >> added now, which is why i've

[PATCH 2/3] submodule: add --progress option to add command

2018-05-01 Thread Casey Fitzpatrick
The '--progress' was introduced in 72c5f88311d (clone: pass --progress decision to recursive submodules, 2016-09-22) to fix the progress reporting of the clone command. Also add the progress option to the 'submodule add' command. The update command already supports the progress flag, but it is not

[PATCH 3/3] submodule: add --dissociate option to add/update commands

2018-05-01 Thread Casey Fitzpatrick
Add --dissociate option to add and update commands, both clone helper commands that already have the --reference option --dissociate pairs with. Signed-off-by: Casey Fitzpatrick --- Documentation/git-submodule.txt | 10 +- builtin/submodule--helper.c | 16

  1   2   3   >