Re: [PATCH v2 1/2] commit: fix --short and --porcelain options

2018-05-01 Thread Junio C Hamano
Samuel Lijin writes: > Mark the commitable flag in the wt_status object in the call to > `wt_status_collect()`, instead of in `wt_longstatus_print_updated()`, > and simplify the logic in the latter function to take advantage of the > logic shifted to the former. This means

subscription (was: (no subject))

2018-05-01 Thread Eric Wong
Daniel Villeneuve wrote: > subscribe That line should be "subscribe git" and it needs to be sent to majord...@vger.kernel.org , not this list.

Re: [PATCH] revisions.txt: expand tabs to spaces in diagram

2018-05-01 Thread Junio C Hamano
Martin Ågren writes: > The diagram renders fine in AsciiDoc before and after this patch. > Asciidoctor, on the other hand, ignores the tabs entirely, which results > in different indentation for different lines. The graph illustration > earlier in the document already

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

2018-05-01 Thread Junio C Hamano
Casey Fitzpatrick writes: > 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,

Re: git-submodule is missing --dissociate option

2018-05-01 Thread Junio C Hamano
Stefan Beller writes: >> As far as I am aware this can be worked around with 'git repack -a' >> and manual removal of the objects/info/alternates file afterward. >> Though I don't know if this results in a less speedy clone than >> dissociate would. > > That is an interesting

Re: git-submodule is missing --dissociate option

2018-05-01 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > On Mon, Apr 30, 2018 at 1:30 PM, Casey Fitzpatrick wrote: >> It also seems to be missing "--progress", and I imagine others. >> Perhaps submodule add/update should be reworked to automatically >> accept all the options that

Re: What's cooking in git.git (Apr 2018, #04; Mon, 30)

2018-05-01 Thread Junio C Hamano
Johannes Schindelin writes: > So the problem you found is not a problem with *my* branch, of course, as > I did not fork off of ... Correct; there is no blame on you with the choice of the base. It was my mistake that I didn't check if the series could be queueable

Re: [PATCH 2/6] t1406: prepare for the refs code to fail with BUG()

2018-05-01 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, Apr 30, 2018 at 12:17 AM, Johannes Schindelin > wrote: >> t1406 specifically verifies that certain code paths fail with a BUG: ... >> message. >> >> In the upcoming commit, we will convert that message to be generated

[GSoC] Info: new blog series of my work on Git GSoC '18

2018-05-01 Thread Pratik Karki
Hello mentors, As promised in my proposal, I've started to write a blog series of GSoC '18 with Git. The initial blog is up. You can find it here[1]. The initial one is just to get started and from next iterations, I'll start detailing of my work towards converting rebase to builtin. [1]:

Re: [PATCH v4 1/2] blame: prevent error if range ends past end of file

2018-05-01 Thread Junio C Hamano
Isabella Stephens writes: > This is the existing behaviour. -L10,-20 for example will blame the > first 10 lines of a file, it will not fail. My patch doesn't change > this. The case I am discussing is -L,-20 which at the moment blames > the first line of the file.

[no subject]

2018-05-01 Thread Daniel Villeneuve
subscribe

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

2018-05-01 Thread brian m. carlson
When formatting a series of patches using --attach and --cover-letter, the cover letter lacks the closing MIME boundary, violating RFC 2046. Certain clients, such as Thunderbird, discard the message body in such a case. Since the cover letter is just one part and sending it as multipart/mixed is

Re: js/no-pager-shorthand [

2018-05-01 Thread Junio C Hamano
Eric Sunshine writes: > Although paged output is generally nice, I frequently find myself > typing --no-pager numerous times during the day, so I, for one, > welcome having a short option (and would be sad to see this patch > retracted). As with Hannes, I too find -P a

Re: What's cooking in git.git (Apr 2018, #04; Mon, 30)

2018-05-01 Thread Junio C Hamano
SZEDER Gábor writes: > On Mon, Apr 30, 2018 at 5:25 AM, Junio C Hamano wrote: >> * js/rebase-i-clean-msg-after-fixup-continue (2018-04-30) 4 commits >> - rebase --skip: clean up commit message after a failed fixup/squash >> - sequencer: always commit

[PATCH 1/3] submodule: clean up subsititions in script

2018-05-01 Thread Casey Fitzpatrick
'recommend_shallow' and 'jobs' variables do not need quotes (they never contain spaces) and do not require any additional prefix, therefore remove the unnecessary subsitition. 'progress' is a boolean value. Treat it like the other boolean values in the script by using a substitution.

[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

[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 0/3] 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

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

2018-05-01 Thread Casey Fitzpatrick
Just noticed I missed the other 'test_must_fail'. Resubmitting in a few moments. On Tue, May 1, 2018 at 8:27 PM, Casey Fitzpatrick wrote: > Add --dissociate option to add and update commands, both clone helper commands > that already have the --reference option --dissociate

[PATCH v2 3/3] {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 v2 0/3] Supporting partial clones in protocol v2

2018-05-01 Thread Jonathan Tan
> This is a bit difficult to read and there is no reason why we would need > to read the entire upload_pack_config to determine if we need to filter > things (we will need to read the config if cmd "fetch" is requested > though). Instead it may be better to do the following: > > if (value) { >

[PATCH v2 2/3] upload-pack: read config when serving protocol v2

2018-05-01 Thread Jonathan Tan
The upload-pack code paths never call git_config() with upload_pack_config() when protocol v2 is used, causing options like uploadpack.packobjectshook to not take effect. Ensure that this function is called. Signed-off-by: Jonathan Tan --- t/t5702-protocol-v2.sh | 14

[PATCH v2 1/3] 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

[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

[PATCH 1/3] submodule: clean up subsititions in script

2018-05-01 Thread Casey Fitzpatrick
'recommend_shallow' and 'jobs' variables do not need quotes (they never contain spaces) and do not require any additional prefix, therefore remove the unnecessary subsitition. 'progress' is a boolean value. Treat it like the other boolean values in the script by using a substitution. ---

[PATCH 0/3] 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

[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 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 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 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] 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

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

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

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: [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: [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/* >

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 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 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 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

[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: [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

[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 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 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 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 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 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 +++

[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 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 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

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 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

  1   2   3   >