git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brandon Williams <bmwill@google.com>
To: Jeff King <peff@peff.net>
Cc: Jonathan Tan <jonathantanmy@google.com>,
	git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 1/7] grep: move thread initialization a little lower
Date: Tue, 14 Feb 2017 10:46:06 -0800	[thread overview]
Message-ID: <20170214184606.GA44208@google.com> (raw)
In-Reply-To: <20170214060237.gvzzbmjzerlqnzjv@sigill.intra.peff.net>

On 02/14, Jeff King wrote:
> Originally, we set up the threads for grep before parsing
> the non-option arguments. In 53b8d931b (grep: disable
> threading in non-worktree case, 2011-12-12), the thread code
> got bumped lower in the function because it now needed to
> know whether we got any revision arguments.
> 
> That put a big block of code in between the parsing of revs
> and the parsing of pathspecs, both of which share some loop
> variables. That makes it harder to read the code than the
> original, where the shared loops were right next to each
> other.
> 
> Let's bump the thread initialization until after all of the
> parsing is done.
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I double-checked to make sure no other code was relying on
> the thread setup having happened. I think we could actually
> bump it quite a bit lower (to right before we actually start
> grepping), but I doubt it matters much in practice.

Looks good.  And yes I don't believe anything needs the thread
initialization to happen earlier.

-- 
Brandon Williams

  reply	other threads:[~2017-02-14 18:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14  0:11 [PATCH for NEXT] grep: do not unnecessarily query repo for "--" Jonathan Tan
2017-02-14  1:20 ` Jeff King
2017-02-14  6:00   ` [PATCH 0/7] grep rev/path parsing fixes Jeff King
2017-02-14  6:02     ` [PATCH 1/7] grep: move thread initialization a little lower Jeff King
2017-02-14 18:46       ` Brandon Williams [this message]
2017-02-14  6:03     ` [PATCH 2/7] grep: do not unnecessarily query repo for "--" Jeff King
2017-02-14  6:03     ` [PATCH 3/7] t7810: make "--no-index --" test more robust Jeff King
2017-02-14  6:04     ` [PATCH 4/7] grep: re-order rev-parsing loop Jeff King
2017-02-14 18:48       ` Brandon Williams
2017-02-14  6:05     ` [PATCH 5/7] grep: fix "--" rev/pathspec disambiguation Jeff King
2017-02-14 18:56       ` Brandon Williams
2017-02-14 19:51         ` Jeff King
2017-02-14 19:18       ` Junio C Hamano
2017-02-14  6:07     ` [PATCH 6/7] grep: avoid resolving revision names in --no-index case Jeff King
2017-02-14 16:53       ` Jonathan Tan
2017-02-14 18:04         ` Jeff King
2017-02-14 18:19           ` Jonathan Tan
2017-02-14 21:54             ` [PATCH 8/7] grep: treat revs the same for --untracked as for --no-index Jeff King
2017-02-14 21:58               ` Junio C Hamano
2017-02-14  6:08     ` [PATCH 7/7] grep: do not diagnose misspelt revs with --no-index Jeff King
2017-02-14  6:10     ` [PATCH 0/7] grep rev/path parsing fixes Jeff King
2017-02-14 16:58     ` Jonathan Tan

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=20170214184606.GA44208@google.com \
    --to=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=peff@peff.net \
    /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 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 NNTP newsgroup(s).