git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, pclouds@gmail.com,
	Derrick Stolee <derrickstolee@github.com>
Subject: Re: [PATCH 00/12] Remove more index compatibility macros
Date: Wed, 6 Jan 2021 06:35:53 -0500	[thread overview]
Message-ID: <a93359c3-66bf-80bc-f053-4742563163d0@gmail.com> (raw)
In-Reply-To: <xmqqczyiwwgl.fsf@gitster.c.googlers.com>

On 1/5/2021 10:55 PM, Junio C Hamano wrote:
> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> My strategy for update-index was to create static globals "repo" and
>> "istate" that point to the_repository and the_index, respectively. Then, I
>> was able to remove macros one-by-one without changing method prototypes
>> within the file.
> 
> Knee-jerk reaction: swapping one pair of global with another?  Would
> that give us enough upside?  It may allow some codepaths involved to
> work on an in-core index instance that is different from the_index,
> but does not make them reentrant.

My intention was to reduce the use of globals in libgit.a while keeping
with existing patterns of static globals in the builtin code. While
this can be thought of "module variables" instead of true globals, they
aren't exactly desirable. In v2, these static globals are temporary to
the series and are completely removed by the end.

The new patch sequence can hopefully be seen as "this preprocessor
macro was expanded" and then "static globals are replaced with
method parameters" which are pretty straightforward.

> Do we now have callers that actually pass an in-core index instance
> that is different from the_index, and more importantly, that fail
> loudly if the codepaths involved in this conversion forgets to
> update some accesses to the_index not to the specified one?
> 
> If not, ... 
> 
>> In total, this allows us to remove four of the compatibility macros because
>> they are no longer used.
> 
> ... a conversion like this, removing the use of the compatibility
> macros for the sake of removing them, invites future headaches by
> leaving untested code churn behind with potential bugs that will
> only get discovered after somebody actually starts making calls
> with the non-default in-core index instances.

Perhaps I had misunderstood the state of the conversion project. I
thought that the full conversion was just paused because Duy moved
on to other things. I thought it might be valuable to pick up the
baton while also thinking about the space.

If this is _not_ a valuable project to continue, then I can hold
off for now.

Unfortunately, we'll never know if everything is safe from assuming
the_index until the macro itself is gone. It helps that libgit.a
doesn't use it at 

> I've come to know the competence of you well enough to trust your
> patches like patches from other proficient, prolific and prominent
> contributors (I won't name names, but you know who you are), but we
> are all human and are prone to introduce bugs.

That means a lot, thanks. And yes, I'm well aware that bugs can be
introduced. I've added my share.

> That's all my knee-jerk impression before actually reading the
> series through, though.  I'll certainloy know more after reading
> them.

I look forward to your thoughts.

Thanks,
-Stolee

  reply	other threads:[~2021-01-06 11:38 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-01 13:06 [PATCH 00/12] Remove more index compatibility macros Derrick Stolee via GitGitGadget
2021-01-01 13:06 ` [PATCH 01/12] merge-index: drop " Derrick Stolee via GitGitGadget
2021-01-03 23:31   ` Alban Gruin
2021-01-04 11:08     ` Derrick Stolee
2021-01-01 13:06 ` [PATCH 02/12] mv: remove " Derrick Stolee via GitGitGadget
2021-01-01 13:06 ` [PATCH 03/12] rm: remove compatilibity macros Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 04/12] update-index: drop the_index, the_repository Derrick Stolee via GitGitGadget
2021-01-01 21:05   ` Elijah Newren
2021-01-04  0:56     ` Derrick Stolee
2021-01-01 13:07 ` [PATCH 05/12] update-index: use istate->cache over active_cache Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 06/12] update-index: use index->cache_nr over active_nr Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 07/12] update-index: use istate->cache_changed Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 08/12] update-index: use index_name_pos() over cache_name_pos() Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 09/12] update-index: use remove_file_from_index() Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 10/12] update-index: use add_index_entry() Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 11/12] update-index: replace several compatibility macros Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 12/12] update-index: remove ce_match_stat(), all macros Derrick Stolee via GitGitGadget
2021-01-01 21:12   ` Elijah Newren
2021-01-01 21:16 ` [PATCH 00/12] Remove more index compatibility macros Elijah Newren
2021-01-02  6:12 ` Eric Sunshine
2021-01-04  1:01   ` Derrick Stolee
2021-01-04  6:22     ` Eric Sunshine
2021-01-05  4:41       ` Derrick Stolee
2021-01-05  4:42 ` [PATCH v2 00/14] " Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 01/14] mv: remove " Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 02/14] rm: remove compatilibity macros Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 03/14] update-index: drop the_index, the_repository Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 04/14] update-index: use istate->cache over active_cache Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 05/14] update-index: use index->cache_nr over active_nr Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 06/14] update-index: use istate->cache_changed Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 07/14] update-index: use index_name_pos() over cache_name_pos() Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 08/14] update-index: use remove_file_from_index() Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 09/14] update-index: use add_index_entry() Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 10/14] update-index: replace several compatibility macros Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 11/14] update-index: remove ce_match_stat(), all macros Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 12/14] update-index: reduce static globals, part 1 Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 13/14] update-index: reduce static globals, part 2 Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 14/14] update-index: remove static globals from callbacks Derrick Stolee via GitGitGadget
2021-01-07  5:09     ` Eric Sunshine
2021-01-07 11:19       ` Derrick Stolee
2021-01-07 18:53         ` Eric Sunshine
2021-01-07 19:57           ` Junio C Hamano
2021-01-08  1:52             ` Derrick Stolee
2021-01-08 20:02   ` [PATCH v3 00/14] Remove more index compatibility macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 01/14] mv: remove " Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 02/14] rm: remove compatilibity macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 03/14] update-index: drop the_index, the_repository Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 04/14] update-index: use istate->cache over active_cache Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 05/14] update-index: use istate->cache_nr over active_nr Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 06/14] update-index: use istate->cache_changed Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 07/14] update-index: use index_name_pos() over cache_name_pos() Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 08/14] update-index: use remove_file_from_index() Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 09/14] update-index: use add_index_entry() Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 10/14] update-index: replace several compatibility macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 11/14] update-index: remove ce_match_stat(), all macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 12/14] update-index: reduce static globals, part 1 Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 13/14] update-index: reduce static globals, part 2 Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 14/14] update-index: remove static globals from callbacks Derrick Stolee via GitGitGadget
2021-01-10  7:03     ` [PATCH v3 00/14] Remove more index compatibility macros Junio C Hamano
2021-01-10  7:32       ` Eric Sunshine
2021-01-10 11:57       ` Derrick Stolee
2021-01-25 13:04       ` Derrick Stolee
2021-01-06  3:55 ` [PATCH 00/12] " Junio C Hamano
2021-01-06 11:35   ` Derrick Stolee [this message]
2021-01-06 20:52     ` Junio C Hamano

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=a93359c3-66bf-80bc-f053-4742563163d0@gmail.com \
    --to=stolee@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=pclouds@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.
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).