All of lore.kernel.org
 help / color / mirror / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: "Jeff King" <peff@peff.net>, "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@vger.kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH 3/9] convert "oidcmp() == 0" to oideq()
Date: Mon, 27 Aug 2018 08:31:46 -0400	[thread overview]
Message-ID: <62172db4-15b2-eac3-8591-246300db3948@gmail.com> (raw)
In-Reply-To: <20180825083602.GA2251@sigill.intra.peff.net>

On 8/25/2018 4:36 AM, Jeff King wrote:
> On Sat, Aug 25, 2018 at 04:07:15AM -0400, Jeff King wrote:
>
>> diff --git a/contrib/coccinelle/object_id.cocci b/contrib/coccinelle/object_id.cocci
>> index 5869979be7..548c02336d 100644
>> --- a/contrib/coccinelle/object_id.cocci
>> +++ b/contrib/coccinelle/object_id.cocci
>> @@ -108,3 +108,9 @@ expression E1, E2;
>>   @@
>>   - hashcpy(E1.hash, E2->hash)
>>   + oidcpy(&E1, E2)

Is this change intended? It doesn't seem to match the intention of the 
rest of the patch.

>> +
>> +@@
>> +expression E1, E2;
>> +@@
>> +- oidcmp(E1, E2) == 0
>> ++ oideq(E1, E2)
>>
>> [...]
>>
>> diff --git a/cache.h b/cache.h
>> index f6d227fac7..d090f71706 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -1100,7 +1100,7 @@ static inline int is_empty_blob_sha1(const unsigned char *sha1)
>>   
>>   static inline int is_empty_blob_oid(const struct object_id *oid)
>>   {
>> -	return !oidcmp(oid, the_hash_algo->empty_blob);
>> +	return oideq(oid, the_hash_algo->empty_blob);
>>   }
> By the way, one interesting thing I noticed is that coccinelle generates
> the hunk for cache.h for _every_ file that includes it, and the
> resulting patch is annoying to apply. I think this is related to the
> discussion we were having in:
>
>    https://public-inbox.org/git/20180802115522.16107-1-szeder.dev@gmail.com/
>
> Namely that we might do better to invoke one big spatch (and let it
> parallelize internally) instead of one perfile. Presumably that would
> also avoid looking at the headers repeatedly (which would be both faster
> and produce better output).
>
> I'm not planning to pursue that immediately, so just food for thought at
> this point.

The more we use Coccinelle, the more we will learn how to improve the 
workflow.

Thanks,

-Stolee


  reply	other threads:[~2018-08-27 12:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-25  8:00 [PATCH 0/9] introducing oideq() Jeff King
2018-08-25  8:03 ` [PATCH 1/9] coccinelle: use <...> for function exclusion Jeff King
2018-08-25  8:05 ` [PATCH 2/9] introduce hasheq() and oideq() Jeff King
2018-08-25 10:58   ` Andrei Rybak
2018-08-25  8:07 ` [PATCH 3/9] convert "oidcmp() == 0" to oideq() Jeff King
2018-08-25  8:36   ` Jeff King
2018-08-27 12:31     ` Derrick Stolee [this message]
2018-08-27 12:33       ` Derrick Stolee
2018-08-25  8:08 ` [PATCH 4/9] convert "hashcmp() == 0" to hasheq() Jeff King
2018-08-25  8:09 ` [PATCH 5/9] convert "oidcmp() != 0" to "!oideq()" Jeff King
2018-08-25  8:10 ` [PATCH 6/9] convert "hashcmp() != 0" to "!hasheq()" Jeff King
2018-08-25  8:14 ` [PATCH 7/9] convert hashmap comparison functions to oideq() Jeff King
2018-08-25  8:15 ` [PATCH 8/9] read-cache: use oideq() in ce_compare functions Jeff King
2018-08-25  8:17 ` [PATCH 9/9] show_dirstat: simplify same-content check Jeff King
2018-08-25  8:20   ` Eric Sunshine
2018-08-25  8:23     ` Jeff King
2018-08-26 20:56 ` [PATCH 0/9] introducing oideq() brian m. carlson
2018-08-27 12:41   ` Derrick Stolee
2018-08-28 21:21   ` Jeff King
2018-08-28 21:22     ` [PATCH v2 1/9] coccinelle: use <...> for function exclusion Jeff King
2018-08-28 21:22     ` [PATCH v2 2/9] introduce hasheq() and oideq() Jeff King
2018-08-28 21:22     ` [PATCH v2 3/9] convert "oidcmp() == 0" to oideq() Jeff King
2018-08-28 21:22     ` [PATCH v2 4/9] convert "hashcmp() == 0" to hasheq() Jeff King
2018-08-28 21:22     ` [PATCH v2 5/9] convert "oidcmp() != 0" to "!oideq()" Jeff King
2018-08-28 21:22     ` [PATCH v2 6/9] convert "hashcmp() != 0" to "!hasheq()" Jeff King
2018-08-28 21:22     ` [PATCH v2 7/9] convert hashmap comparison functions to oideq() Jeff King
2018-08-28 21:22     ` [PATCH v2 8/9] read-cache: use oideq() in ce_compare functions Jeff King
2018-08-28 21:23     ` [PATCH v2 9/9] show_dirstat: simplify same-content check Jeff King
2018-08-28 21:36     ` [PATCH 0/9] introducing oideq() Derrick Stolee
2018-08-29  0:08     ` brian m. carlson

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62172db4-15b2-eac3-8591-246300db3948@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    --cc=szeder.dev@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.