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 the
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 impedan
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 tw
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
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 someth
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 m
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.
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 queue
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
Thanks, will take a look.
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.
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:
>
> @@
> expr
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 ha
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 furth
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.
Si
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
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
---
co
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,
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 testing
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,
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.
Whil
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. carl
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
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
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
+++ b/Makefi
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 restructu
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 f
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 i
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 are
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
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;
@@
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 n
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 +++
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
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 eas
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
---
builti
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
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
--- a/ap
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
index
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 styl
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 b/pac
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 62a1000f44..
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 a/builtin/m
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 +
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
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 b/refs/packed-backend.
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 Standa
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 obje
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
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, whi
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
> "**/",
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 m
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 7ef8c4
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 de6cab1fe7..3114c7bc4c
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 ar
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
i
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
`get_untracked_files()
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 Teichr
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
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
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
@@
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 stas
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 mes
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 i
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 d2365ada2e..651d05c82
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
---
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 af7586
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 ++
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 insertions(+
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 whe
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 +
sha1-n
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 a/b
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
---
t/t3903-
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 header
---
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 check_typ
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 @@ s
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) \
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 em
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)
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 s
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 tree)
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
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 in
83 matches
Mail list logo