From: Junio C Hamano <gitster@pobox.com>
To: sxenos@google.com
Cc: git@vger.kernel.org, Stefan Xenos <sxenos@gmail.com>
Subject: Re: [PATCH v3 2/8] sha1-array: Implement oid_array_readonly_contains
Date: Sun, 27 Jan 2019 18:05:12 -0800 [thread overview]
Message-ID: <xmqqlg35czaf.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: 20190127194415.171035-2-sxenos@google.com
sxenos@google.com writes:
> Subject: Re: [PATCH v3 2/8] sha1-array: Implement oid_array_readonly_contains
Style: s/: Implement/: implement/
> From: Stefan Xenos <sxenos@gmail.com>
This line wants to say "Stefan Xenos <sxenos@google.com>" to match
S-o-b below (I am assuming that you are following your employer's
open source recommendation to contribute under your corp address).
Perhaps you would want user.email set to the corp address? I am
taking the above as an indication that the commits we are seeing
here have been made under your @gmail.com address and that is why
git-send-email is adding the in-body header.
> diff --git a/sha1-array.c b/sha1-array.c
> index b94e0ec0f5..071fce7e90 100644
> --- a/sha1-array.c
> +++ b/sha1-array.c
> @@ -26,6 +26,21 @@ static const unsigned char *sha1_access(size_t index, void *table)
> return array[index].hash;
> }
>
> +int oid_array_readonly_contains(const struct oid_array* array,
> + const struct object_id* oid)
> +{
> + int i;
Style: blank between decl and first stmt, perhaps?
> + if (array->sorted) {
> + return sha1_pos(oid->hash, array->oid, array->nr, sha1_access) >= 0;
No need for {} around a single statement.
> + }
> + for (i = 0; i < array->nr; i++) {
> + if (hashcmp(array->oid[i].hash, oid->hash) == 0) {
> + return 1;
Likewise.
> + }
> + }
> + return 0;
> +}
> ...
> diff --git a/t/t0064-sha1-array.sh b/t/t0064-sha1-array.sh
> index 5dda570b9a..c1bac6fcdd 100755
> --- a/t/t0064-sha1-array.sh
> +++ b/t/t0064-sha1-array.sh
> @@ -32,6 +32,28 @@ test_expect_success 'ordered enumeration with duplicate suppression' '
> test_cmp expect actual
> '
>
> +test_expect_success 'readonly_contains finds existing' '
> + echo 1 > expect &&
Style: no SP between redirection operator and its target, i.e.
echo 1 >expect &&
> + echoid "" 88 44 aa 55 >> expect &&
Likewise.
echoid "" 88 44 aa 55 >>expect &&
next prev parent reply other threads:[~2019-01-28 2:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-27 19:44 [PATCH v3 1/8] technical doc: add a design doc for the evolve command sxenos
2019-01-27 19:44 ` [PATCH v3 2/8] sha1-array: Implement oid_array_readonly_contains sxenos
2019-01-28 2:05 ` Junio C Hamano [this message]
2019-01-27 19:44 ` [PATCH v3 3/8] ref-filter: Add the metas namespace to ref-filter sxenos
2019-01-27 19:44 ` [PATCH v3 4/8] evolve: Add support for parsing metacommits sxenos
2019-01-28 2:05 ` Junio C Hamano
2019-01-27 19:44 ` [PATCH v3 5/8] evolve: Add the change-table structure sxenos
2019-01-28 8:01 ` Johannes Schindelin
2019-01-28 23:08 ` Johannes Schindelin
2019-01-28 23:24 ` Stefan Xenos
2019-01-29 18:02 ` Junio C Hamano
2019-01-29 18:09 ` Stefan Xenos
2019-01-27 19:44 ` [PATCH v3 6/8] evolve: Add support for writing metacommits sxenos
2019-01-27 19:44 ` [PATCH v3 7/8] evolve: Implement the git change command sxenos
2019-01-27 19:44 ` [PATCH v3 8/8] evolve: Add the git change list command sxenos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqlg35czaf.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sxenos@gmail.com \
--cc=sxenos@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).