git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fredrik Kuivinen <frekui@gmail.com>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC][PATCH] grep: enable threading for context line printing
Date: Sun, 14 Mar 2010 21:03:04 +0100	[thread overview]
Message-ID: <4c8ef71003141303h474429aegc0a2eb2f97e7ff69@mail.gmail.com> (raw)
In-Reply-To: <4B9D2864.9090808@lsrfire.ath.cx>

On Sun, Mar 14, 2010 at 19:18, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:
> This patch makes work_done() in builtin/grep.c print hunk marks between
> files if threading is used, while show_line() in grep.c still does the
> same in the other case.  The latter is  controlled by the struct grep_opt
> member show_hunk_mark: 0 means show_line() prints no hunk marks between
> files, 1 means it prints them before the next file with matches and 2
> means it prints them before matches from the current file.
>
> Having two places for this is a bit ugly but it enables parallel grep
> for the common -ABC options.  Locking should be fine in add_work().
>
> Comments?

The implementation looks correct. As you say it is a bit ugly, but I
think it is worth it anyway. (The solutions I managed to come up with
when I wrote the original threaded grep patch were even uglier, that
is why I simply disabled the threading in that case.)

Symbolic constants for the magic values 0, 1, and 2 would make the
code more readable.

- Fredrik

  reply	other threads:[~2010-03-14 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 18:18 [RFC][PATCH] grep: enable threading for context line printing René Scharfe
2010-03-14 20:03 ` Fredrik Kuivinen [this message]
2010-03-15 16:21   ` René Scharfe
2010-03-15 17:14     ` Junio C Hamano
2010-03-20 11:21     ` Fredrik Kuivinen

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=4c8ef71003141303h474429aegc0a2eb2f97e7ff69@mail.gmail.com \
    --to=frekui@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).