Re: [PATCH v2 1/1] zlib.c: use size_t for size

2018-10-14 Thread Torsten Bögershausen
On 15.10.18 06:22, Junio C Hamano wrote: > Ramsay Jones writes: > >>> >>> For the record, I am not opposed to including the comment _and_ using >>> xsize_t() to do the cast, giving us an assertion that the comment is >>> correct. >> >> Heh, I haven't found any enthusiasm tonight. Let's see if

Re: [PATCH 4/4] merge-recursive: Avoid showing conflicts with merge branch before HEAD

2018-10-14 Thread Junio C Hamano
Elijah Newren writes: > The correct order usually comes naturally and for free, but with renames > we often have data in the form {rename_branch, other_branch}, and > working relative to the rename first (e.g. for rename/add) is more > convenient elsewhere in the code. Address the slight

Re: [PATCH 3/4] merge-recursive: improve auto-merging messages with path collisions

2018-10-14 Thread Junio C Hamano
Elijah Newren writes: > Each individual file involved in a rename could have also been modified > on both sides of history, meaning it may need to have content merges. > If two such files are renamed into the same location, then on top of the > two natural auto-merging messages we also have to

Re: [PATCH 2/4] merge-recursive: increase marker length with depth of recursion

2018-10-14 Thread Junio C Hamano
Elijah Newren writes: > When using merge.conflictstyle=diff3 to have the "base version" be shown > in conflicts, there is the possibility that the base version itself has > conflicts in it. This comes about when there are more than one merge > base, and the merging of those merge bases produces

Re: [PATCH] object_id.cocci: match only expressions of type 'struct object_id'

2018-10-14 Thread Junio C Hamano
Junio C Hamano writes: > SZEDER Gábor writes: > >> Most of our semantic patches in 'contrib/coccinelle/object_id.cocci' >> turn calls of SHA1-specific functions into calls of their >> corresponding object_id counterparts, e.g. sha1_to_hex() to >> oid_to_hex(). These semantic patches look

Re: [PATCH v2 1/1] zlib.c: use size_t for size

2018-10-14 Thread Junio C Hamano
Ramsay Jones writes: >> >> For the record, I am not opposed to including the comment _and_ using >> xsize_t() to do the cast, giving us an assertion that the comment is >> correct. > > Heh, I haven't found any enthusiasm tonight. Let's see if there > are any more comments/opinions. OK, in the

Re: [RFC/PATCH] headers: normalize the spelling of some header guards

2018-10-14 Thread Junio C Hamano
Jeff King writes: > I'm in favor of normalizing even the ones that aren't illegal, though > I'm OK either way on the vcs-svn bits if they're going away anyway. I'm in favour of normalizing even the ones that aren't illegal, too.

Re: [PATCH v12 0/8] filter: support for excluding all trees and blobs

2018-10-14 Thread Junio C Hamano
Junio C Hamano writes: > Matthew DeVore writes: > >> Here is a re-roll-up since I haven't received any additional corrections for >> almost a week. > > Sorry, but doesn't this topic already sit in 'next'? If so, please make > these small clean-ups as incremental patches. Here is what I'd

Re: [PATCH v3] gpg-interface.c: detect and reject multiple signatures on commits

2018-10-14 Thread Junio C Hamano
Michał Górny writes: > GnuPG supports creating signatures consisting of multiple signature > packets. If such a signature is verified, it outputs all the status > messages for each signature separately. However, git currently does not > account for such scenario and gets terribly confused over

Re: [PATCH v3] gpg-interface.c: detect and reject multiple signatures on commits

2018-10-14 Thread Junio C Hamano
Thanks, will take a look.

Re: [PATCH v12 0/8] filter: support for excluding all trees and blobs

2018-10-14 Thread Junio C Hamano
Matthew DeVore writes: > Here is a re-roll-up since I haven't received any additional corrections for > almost a week. Sorry, but doesn't this topic already in 'next'? If so, please make these small clean-ups as incremental patches. Thansk.

Re: [PATCH] object_id.cocci: match only expressions of type 'struct object_id'

2018-10-14 Thread Junio C Hamano
SZEDER Gábor writes: > Most of our semantic patches in 'contrib/coccinelle/object_id.cocci' > turn calls of SHA1-specific functions into calls of their > corresponding object_id counterparts, e.g. sha1_to_hex() to > oid_to_hex(). These semantic patches look something like this: > > @@ >

Re: [RFC PATCH 3/3] list-objects-filter: teach tree:# how to handle >0

2018-10-14 Thread Junio C Hamano
Matthew DeVore writes: > The long-term goal at the end of this is to allow a partial clone to > eagerly fetch an entire directory of files by fetching a tree and > specifying =1. This, for instance, would make a build operation > fast and convenient This would reduce round-trip, as you do not

[PATCH v2 04/13] cache: make hashcmp and hasheq work with larger hashes

2018-10-14 Thread brian m. carlson
In 183a638b7d ("hashcmp: assert constant hash size", 2018-08-23), we modified hashcmp to assert that the hash size was always 20 to help it optimize and inline calls to memcmp. In a future series, we replaced many calls to hashcmp and oidcmp with calls to hasheq and oideq to improve inlining

[PATCH v2 06/13] t: make the sha1 test-tool helper generic

2018-10-14 Thread brian m. carlson
Since we're going to have multiple hash algorithms to test, it makes sense to share as much of the test code as possible. Convert the sha1 helper for the test-tool to be generic and move it out into its own module. This will allow us to share most of this code with our NewHash implementation.

[PATCH v2 07/13] sha1-file: add a constant for hash block size

2018-10-14 Thread brian m. carlson
There is one place we need the hash algorithm block size: the HMAC code for push certs. Expose this constant in struct git_hash_algo and expose values for SHA-1 and for the largest value of any hash. Signed-off-by: brian m. carlson --- cache.h | 4 hash.h | 3 +++ sha1-file.c | 2

[PATCH v2 13/13] commit-graph: specify OID version for SHA-256

2018-10-14 Thread brian m. carlson
Since the commit-graph code wants to serialize the hash algorithm into the data store, specify a version number for each supported algorithm. Note that we don't use the values of the constants themselves, as they are internal and could change in the future. Signed-off-by: brian m. carlson ---

[PATCH v2 02/13] sha1-file: provide functions to look up hash algorithms

2018-10-14 Thread brian m. carlson
There are several ways we might refer to a hash algorithm: by name, such as in the config file; by format ID, such as in a pack; or internally, by a pointer to the hash_algos array. Provide functions to look up hash algorithms based on these various forms and return the internal constant used for

[PATCH v2 11/13] sha256: add an SHA-256 implementation using libgcrypt

2018-10-14 Thread brian m. carlson
Generally, one gets better performance out of cryptographic routines written in assembly than C, and this is also true for SHA-256. In addition, most Linux distributions cannot distribute Git linked against OpenSSL for licensing reasons. Most systems with GnuPG will also have libgcrypt, since it

[PATCH v2 12/13] hash: add an SHA-256 implementation using OpenSSL

2018-10-14 Thread brian m. carlson
We already have OpenSSL routines available for SHA-1, so add routines for SHA-256 as well. Signed-off-by: brian m. carlson --- Makefile | 7 +++ hash.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 3d91555a81..3164e2aeee 100644 --- a/Makefile +++

[PATCH v2 10/13] Add a base implementation of SHA-256 support

2018-10-14 Thread brian m. carlson
SHA-1 is weak and we need to transition to a new hash function. For some time, we have referred to this new function as NewHash. Recently, we decided to pick SHA-256 as NewHash. Add a basic implementation of SHA-256 based off libtomcrypt, which is in the public domain. Optimize it and

[PATCH v2 09/13] commit-graph: convert to using the_hash_algo

2018-10-14 Thread brian m. carlson
Instead of using hard-coded constants for object sizes, use the_hash_algo to look them up. In addition, use a function call to look up the object ID version and produce the correct value. Signed-off-by: brian m. carlson --- commit-graph.c | 33 + 1 file changed,

[PATCH v2 05/13] t: add basic tests for our SHA-1 implementation

2018-10-14 Thread brian m. carlson
We have in the past had some unfortunate endianness issues with some SHA-1 implementations we ship, especially on big-endian machines. Add an explicit test using the test helper to catch these issues and point them out prominently. This test can also be used as a staging ground for people

[PATCH v2 01/13] sha1-file: rename algorithm to "sha1"

2018-10-14 Thread brian m. carlson
The transition plan anticipates us using a syntax such as "^{sha1}" for disambiguation. Since this is a syntax some people will be typing a lot, it makes sense to provide a short, easy-to-type syntax. Omitting the dash doesn't create any ambiguity, but it does make it shorter and easier to type,

[PATCH v2 03/13] hex: introduce functions to print arbitrary hashes

2018-10-14 Thread brian m. carlson
Currently, we have functions that turn an arbitrary SHA-1 value or an object ID into hex format, either using a static buffer or with a user-provided buffer. Add variants of these functions that can handle an arbitrary hash algorithm, specified by constant. Update the documentation as well.

[PATCH v2 08/13] t/helper: add a test helper to compute hash speed

2018-10-14 Thread brian m. carlson
Add a utility (which is less for the testsuite and more for developers) that can compute hash speeds for whatever hash algorithms are implemented. This allows developers to test their personal systems to determine the performance characteristics of various algorithms. Signed-off-by: brian m.

[PATCH v2 00/13] Base SHA-256 implementation

2018-10-14 Thread brian m. carlson
This series provides an actual SHA-256 implementation and wires it up, along with some housekeeping patches to make it suitable for testing. New in this version is a patch which reverts the change to limit hashcmp to 20 bytes. I've taken care to permit the compiler to inline as much as possible

Re: [PATCH v2 1/1] zlib.c: use size_t for size

2018-10-14 Thread Ramsay Jones
On 15/10/18 01:01, Jeff King wrote: > On Sun, Oct 14, 2018 at 04:03:48PM +0100, Ramsay Jones wrote: > >>> So I kind of wonder if a comment would be better than xsize_t here. >>> Something like: >>> >>> if (avail > len) { >>> /* >>> * This can never truncate because we know that len

Re: [RFC/PATCH] headers: normalize the spelling of some header guards

2018-10-14 Thread Ramsay Jones
On 15/10/18 00:59, Jeff King wrote: > On Sun, Oct 14, 2018 at 09:13:09PM +0100, Ramsay Jones wrote: > >> This patch is marked RFC because I am not aware of any policy with >> regard to header guard spelling. Having said that, apart from the >> fetch-negotiator.h header, all of these headers

[PATCH v2 13/15] apply: rename new_sha1_prefix and old_sha1_prefix

2018-10-14 Thread brian m. carlson
Rename these structure members to "new_oid_prefix" and "old_oid_prefix". Signed-off-by: brian m. carlson --- apply.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/apply.c b/apply.c index 792ecea36a..b9eb02ec12 100644 --- a/apply.c

[PATCH v2 01/15] object_id.cocci: match only expressions of type 'struct object_id'

2018-10-14 Thread brian m. carlson
From: SZEDER Gábor Most of our semantic patches in 'contrib/coccinelle/object_id.cocci' turn calls of SHA1-specific functions into calls of their corresponding object_id counterparts, e.g. sha1_to_hex() to oid_to_hex(). These semantic patches look something like this: @@ expression E1;

[PATCH v2 15/15] rerere: convert to use the_hash_algo

2018-10-14 Thread brian m. carlson
Since this data is stored in the .git directory, it makes sense for us to use the same hash algorithm for it as for everything else. Convert the remaining uses of SHA-1 to use the_hash_algo. Use GIT_MAX_RAWSZ for allocations. Rename various struct members, local variables, and a function to be

[PATCH v2 14/15] submodule: make zero-oid comparison hash function agnostic

2018-10-14 Thread brian m. carlson
With SHA-256, the length of the all-zeros object ID is longer. Add a function to git-submodule.sh to check if a full hex object ID is the all-zeros value, and use it to check the output we're parsing from git diff-files or diff-index. Signed-off-by: brian m. carlson --- git-submodule.sh | 7

[PATCH v2 02/15] pack-bitmap-write: use GIT_MAX_RAWSZ for allocation

2018-10-14 Thread brian m. carlson
Reviewed-by: Stefan Beller Signed-off-by: brian m. carlson --- pack-bitmap-write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c index fc82f37a02..6f0c78d6aa 100644 --- a/pack-bitmap-write.c +++ b/pack-bitmap-write.c @@ -37,7 +37,7

[PATCH v2 07/15] packfile: express constants in terms of the_hash_algo

2018-10-14 Thread brian m. carlson
Replace uses of GIT_SHA1_RAWSZ with references to the_hash_algo to avoid dependence on a particular hash length. It's likely that in the future, we'll update the pack format to indicate what hash algorithm it uses, and then this code will change. However, at least on an interim basis, make it

[PATCH v2 05/15] builtin/fetch-pack: remove constants with parse_oid_hex

2018-10-14 Thread brian m. carlson
Instead of using GIT_SHA1_HEXSZ, use parse_oid_hex to compute a pointer and use that in comparisons. This is both simpler to read and works independent of the hash length. Update references to SHA-1 in the same function to refer to object IDs instead. Signed-off-by: brian m. carlson ---

[PATCH v2 11/15] tag: express constant in terms of the_hash_algo

2018-10-14 Thread brian m. carlson
Signed-off-by: brian m. carlson --- tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag.c b/tag.c index 1db663d716..7445b8f6ea 100644 --- a/tag.c +++ b/tag.c @@ -144,7 +144,7 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u

[PATCH v2 12/15] apply: replace hard-coded constants

2018-10-14 Thread brian m. carlson
Replace several 40-based constants with references to GIT_MAX_HEXSZ or the_hash_algo, as appropriate. Signed-off-by: brian m. carlson --- apply.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apply.c b/apply.c index e485fbc6bc..792ecea36a 100644 ---

[PATCH v2 10/15] transport: use parse_oid_hex instead of a constant

2018-10-14 Thread brian m. carlson
Use parse_oid_hex to compute a pointer instead of using GIT_SHA1_HEXSZ. This simplifies the code and makes it independent of the hash length. Signed-off-by: brian m. carlson --- transport.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/transport.c b/transport.c

[PATCH v2 00/15] Hash function transition part 15

2018-10-14 Thread brian m. carlson
This is the fifteenth series in the ongoing hash function transition. This series includes several conversions to use the_hash_algo, combined with some use of parse_oid_hex and GIT_MAX_RAWSZ. Changes from v1: * Fix several other substantially similar issues in builtin/repack. * Fix a comment

[PATCH v2 06/15] pack-revindex: express constants in terms of the_hash_algo

2018-10-14 Thread brian m. carlson
Express the various constants used in terms of the_hash_algo. While we're at it, fix a comment style issue as well. Reviewed-by: Stefan Beller Signed-off-by: brian m. carlson --- pack-revindex.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pack-revindex.c

[PATCH v2 09/15] upload-pack: express constants in terms of the_hash_algo

2018-10-14 Thread brian m. carlson
Convert all uses of the GIT_SHA1_HEXSZ to use the_hash_algo so that they are appropriate for any given hash length. Signed-off-by: brian m. carlson --- upload-pack.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index

[PATCH v2 04/15] builtin/mktree: remove hard-coded constant

2018-10-14 Thread brian m. carlson
Instead of using a hard-coded constant for the size of a hex object ID, switch to use the computed pointer from parse_oid_hex that points after the parsed object ID. Signed-off-by: brian m. carlson --- builtin/mktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 03/15] builtin/repack: replace hard-coded constants

2018-10-14 Thread brian m. carlson
Note that while the error messages here are not translated, the end user should never see them. We invoke git pack-objects shortly before both invocations, so we can be fairly certain that the data we're receiving is in fact valid. Signed-off-by: brian m. carlson --- builtin/repack.c | 13

Re: [PATCH v2 1/1] zlib.c: use size_t for size

2018-10-14 Thread Jeff King
On Sun, Oct 14, 2018 at 04:03:48PM +0100, Ramsay Jones wrote: > > So I kind of wonder if a comment would be better than xsize_t here. > > Something like: > > > > if (avail > len) { > > /* > > * This can never truncate because we know that len is smaller > > * than avail, which is

[PATCH v2 08/15] refs/packed-backend: express constants using the_hash_algo

2018-10-14 Thread brian m. carlson
Switch uses of GIT_SHA1_HEXSZ to use the_hash_algo so that they are appropriate for the any given hash length. Signed-off-by: brian m. carlson --- refs/packed-backend.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/refs/packed-backend.c

Re: [RFC/PATCH] headers: normalize the spelling of some header guards

2018-10-14 Thread Jeff King
On Sun, Oct 14, 2018 at 09:13:09PM +0100, Ramsay Jones wrote: > This patch is marked RFC because I am not aware of any policy with > regard to header guard spelling. Having said that, apart from the > fetch-negotiator.h header, all of these headers are using a reserved > identifier (see C99

Re: [RFC PATCH 2/3] Documentation/git-rev-list: s///

2018-10-14 Thread Junio C Hamano
Matthew DeVore writes: > -List commits that are reachable by following the `parent` links from the > -given commit(s), but exclude commits that are reachable from the one(s) > -given with a '{caret}' in front of them. The output is given in reverse > -chronological order by default. > +List

Re: [RFC/PATCH] headers: normalize the spelling of some header guards

2018-10-14 Thread brian m. carlson
On Sun, Oct 14, 2018 at 09:13:09PM +0100, Ramsay Jones wrote: > > Signed-off-by: Ramsay Jones > --- > > Hi Junio, > > This patch is marked RFC because I am not aware of any policy with > regard to header guard spelling. Having said that, apart from the > fetch-negotiator.h header, all of these

Re: [RFC PATCH 1/3] list-objects: support for skipping tree traversal

2018-10-14 Thread Junio C Hamano
Matthew DeVore writes: > The tree:0 filter does not need to traverse the trees that it has > filtered out, so optimize list-objects and list-objects-filter to skip > traversing the trees entirely. Before this patch, we iterated over all > children of the tree, and did nothing for all of them,

Re: [BUG] gitignore documentation inconsistent with actual behaviour

2018-10-14 Thread Junio C Hamano
Duy Nguyen writes: >> Our matching function comes from rsync originally, whose manpage says: >> >> use ’**’ to match anything, including slashes. >> >> I believe this is accurate as far as the implementation goes. > > No. "**" semantics is not the same as from rsync. The three cases > "**/",

[PATCH v10 18/21] stash: convert save to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash save to the helper and delete functions which are no longer needed (`show_help()`, `save_stash()`, `push_stash()`, `create_stash()`, `clear_stash()`, `untracked_files()` and `no_changes()`). The `-m` option is no longer supported as it might not make sense to have two ways of passing a

[PATCH v10 07/21] stash: mention options in `show` synopsis

2018-10-14 Thread Paul-Sebastian Ungureanu
Mention in the documentation, that `show` accepts any option known to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu --- Documentation/git-stash.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index

[PATCH v10 05/21] stash: rename test cases to be more descriptive

2018-10-14 Thread Paul-Sebastian Ungureanu
Rename some test cases' labels to be more descriptive and under 80 characters per line. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index

[PATCH v10 09/21] stash: convert drop and clear to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add the drop and clear commands to the builtin helper. These two are each simple, but are being added together as they are quite related. We have to unfortunately keep the drop and clear functions in the shell script as functions are called with parameters internally that

[PATCH v10 16/21] stash: convert push to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash push to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 241 +++- git-stash.sh| 6 +- 2 files changed, 241 insertions(+), 6 deletions(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v10 20/21] stash: optimize `get_untracked_files()` and `check_changes()`

2018-10-14 Thread Paul-Sebastian Ungureanu
This commits introduces a optimization by avoiding calling the same functions again. For example, `git stash push -u` would call at some points the following functions: * `check_changes()` (inside `do_push_stash()`) * `do_create_stash()`, which calls: `check_changes()` and

[PATCH v10 10/21] stash: convert branch to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash branch to the helper and delete the apply_to_branch function from the shell script. Checkout does not currently provide a function for checking out a branch as cmd_checkout does a large amount of sanity checks first that we require here. Signed-off-by: Joel

[PATCH v10 13/21] stash: convert show to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash show to the helper and delete the show_stash, have_stash, assert_stash_like, is_stash_like and parse_flags_and_rev functions from the shell script now that they are no longer needed. In shell version, although `git stash show` accepts `--index` and `--quiet` options, it ignores them. In

[PATCH v10 15/21] stash: convert create to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash create to the helper. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 458 git-stash.sh| 2 +- 2 files changed, 459 insertions(+), 1 deletion(-) diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c

[PATCH v10 02/21] strbuf.c: add `strbuf_join_argv()`

2018-10-14 Thread Paul-Sebastian Ungureanu
Implement `strbuf_join_argv()` to join arguments into a strbuf. Signed-off-by: Paul-Sebastian Ungureanu --- strbuf.c | 13 + strbuf.h | 7 +++ 2 files changed, 20 insertions(+) diff --git a/strbuf.c b/strbuf.c index 64041c3c24..c8a104099a 100644 --- a/strbuf.c +++ b/strbuf.c

[PATCH v10 19/21] stash: convert `stash--helper.c` into `stash.c`

2018-10-14 Thread Paul-Sebastian Ungureanu
The old shell script `git-stash.sh` was removed and replaced entirely by `builtin/stash.c`. In order to do that, `create` and `push` were adapted to work without `stash.sh`. For example, before this commit, `git stash create` called `git stash--helper create --message "$*"`. If it called `git

[PATCH v10 00/21] Convert "git stash" to C builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Hello, This is a new iteration of `git stash`, based on the last review. This iteration fixes some code styling issues, bring some changes to `do_push_stash()` and `do_create_stash()` to be closer to API by following Thomas Gummerer's review of last iteration [1]. Also, there were some missing

[PATCH v10 06/21] stash: add tests for `git stash show` config

2018-10-14 Thread Paul-Sebastian Ungureanu
This commit introduces tests for `git stash show` config. It tests all the cases where `stash.showStat` and `stash.showPatch` are unset or set to true / false. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3907-stash-show-config.sh | 83 1 file changed, 83

[PATCH v10 21/21] stash: replace all `write-tree` child processes with API calls

2018-10-14 Thread Paul-Sebastian Ungureanu
This commit replaces spawning `git write-tree` with API calls. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash.c | 41 - 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/builtin/stash.c b/builtin/stash.c index

[PATCH v10 17/21] stash: make push -q quiet

2018-10-14 Thread Paul-Sebastian Ungureanu
There is a change in behaviour with this commit. When there was no initial commit, the shell version of stash would still display a message. This commit makes `push` to not display any message if `--quiet` or `-q` is specified. Add tests for `--quiet`. Signed-off-by: Paul-Sebastian Ungureanu ---

[PATCH v10 04/21] t3903: modernize style

2018-10-14 Thread Paul-Sebastian Ungureanu
Remove whitespaces after redirection operators and wrap long lines. Signed-off-by: Paul-Sebastian Ungureanu --- t/t3903-stash.sh | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index

[PATCH v10 11/21] stash: convert pop to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash pop to the helper and delete the pop_stash, drop_stash, assert_stash_ref functions from the shell script now that they are no longer needed. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 39

[PATCH v10 14/21] stash: convert store to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash store to the helper and delete the store_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 62 + git-stash.sh| 43 ++-- 2 files changed, 64

[PATCH v10 08/21] stash: convert apply to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add a builtin helper for performing stash commands. Converting all at once proved hard to review, so starting with just apply lets conversion get started without the other commands being finished. The helper is being implemented as a drop in replacement for stash so that

[PATCH v10 01/21] sha1-name.c: add `get_oidf()` which acts like `get_oid()`

2018-10-14 Thread Paul-Sebastian Ungureanu
Compared to `get_oid()`, `get_oidf()` has as parameters a pointer to `object_id`, a printf format string and additional arguments. This will help simplify the code in subsequent commits. Original-idea-by: Johannes Schindelin Signed-off-by: Paul-Sebastian Ungureanu --- cache.h | 1 +

[PATCH v10 12/21] stash: convert list to builtin

2018-10-14 Thread Paul-Sebastian Ungureanu
Add stash list to the helper and delete the list_stash function from the shell script. Signed-off-by: Paul-Sebastian Ungureanu --- builtin/stash--helper.c | 31 +++ git-stash.sh| 7 +-- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git

[PATCH v10 03/21] stash: improve option parsing test coverage

2018-10-14 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb In preparation for converting the stash command incrementally to a builtin command, this patch improves test coverage of the option parsing. Both for having too many parameters, or too few. Signed-off-by: Joel Teichroeb Signed-off-by: Paul-Sebastian Ungureanu ---

[RFC/PATCH] headers: normalize the spelling of some header guards

2018-10-14 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Junio, This patch is marked RFC because I am not aware of any policy with regard to header guard spelling. Having said that, apart from the fetch-negotiator.h header, all of these headers are using a reserved identifier (see C99 Standard 7.1.3). These

[PATCH] Typo `dashes ?` -> `dashes?`

2018-10-14 Thread Jacques Bodin-Hullin
--- parse-options.c | 4 ++-- t/t0040-parse-options.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parse-options.c b/parse-options.c index 3b874a83a0c89..88512212392ae 100644 --- a/parse-options.c +++ b/parse-options.c @@ -352,7 +352,7 @@ static void

Re: [PATCH v2 1/1] zlib.c: use size_t for size

2018-10-14 Thread Ramsay Jones
On 14/10/18 03:52, Jeff King wrote: > On Sun, Oct 14, 2018 at 03:16:36AM +0100, Ramsay Jones wrote: > >> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c >> index b059b86aee..3b5f2c38b3 100644 >> --- a/builtin/pack-objects.c >> +++ b/builtin/pack-objects.c >> @@ -269,12 +269,12 @@

Re: [PATCH 15/16] commit-reach: make can_all_from_reach... linear

2018-10-14 Thread René Scharfe
Am 05.10.2018 um 21:42 schrieb Jeff King: > On Fri, Oct 05, 2018 at 09:36:28PM +0200, René Scharfe wrote: > >> Am 05.10.2018 um 21:08 schrieb Jeff King: >>> On Fri, Oct 05, 2018 at 08:48:27PM +0200, René Scharfe wrote: +#define DEFINE_SORT(name, type, compare) \

Re: [PATCH v5 17/23] userdiff.c: remove implicit dependency on the_index

2018-10-14 Thread Duy Nguyen
On Wed, Oct 10, 2018 at 4:51 PM Jeff King wrote: > > On Fri, Sep 21, 2018 at 05:57:33PM +0200, Nguyễn Thái Ngọc Duy wrote: > > > diff --git a/diff.c b/diff.c > > index 140d0e86df..5256b9eabc 100644 > > --- a/diff.c > > +++ b/diff.c > > @@ -2093,23 +2093,25 @@ static void diff_words_flush(struct

Re: [PATCH v8 0/7] speed up index load through parallelization

2018-10-14 Thread Duy Nguyen
On Wed, Oct 10, 2018 at 5:59 PM Ben Peart wrote: > @@ -3460,14 +3479,18 @@ static struct index_entry_offset_table > *read_ieot_extension(const char *mmap, si > > /* validate the version is IEOT_VERSION */ > ext_version = get_be32(index); > - if (ext_version != IEOT_VERSION)

Re: What's cooking in git.git (Oct 2018, #01; Wed, 10)

2018-10-14 Thread Duy Nguyen
On Wed, Oct 10, 2018 at 7:43 AM Junio C Hamano wrote: > * nd/per-worktree-ref-iteration (2018-10-07) 9 commits > - SQUASH??? > - reflog expire: cover reflog from all worktrees > - fsck: check HEAD and reflog from other worktrees > - fsck: Move fsck_head_link() to get_default_heads() to avoid

Re: [BUG] gitignore documentation inconsistent with actual behaviour

2018-10-14 Thread Duy Nguyen
On Thu, Oct 11, 2018 at 2:41 PM Ævar Arnfjörð Bjarmason wrote: > > > On Thu, Oct 11 2018, dana wrote: > > > Hello, > > > > I'm a contributor to ripgrep, which is a grep-like tool that supports using > > gitignore files to control which files are searched in a repo (or any other > > directory

Re: [Question] builtin/branch.c

2018-10-14 Thread Ævar Arnfjörð Bjarmason
On Sat, Oct 13, 2018 at 10:12 AM Tao Qingyun wrote: > Hi, I am learning `builtin/branch.c`. I find that it will call `branch_get` > before create and [un]set upstream, and die with "no such branch" if failed. > but `branch_get` seems never fail, it is a get_or_create. Also, it was > confused that

Re: Does git load index file into memory?

2018-10-14 Thread Thomas Gummerer
On 10/12, Farhan Khan wrote: > Hi all, > > Does git load the entire index file into memory when it wants to > edit/view it? I ask because I wonder if this can become a problem with > the index file becomes arbitrarily large, like for the Linux kernel. Yes, currently git always loads the entire