git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC][PATCH] grep: enable threading for context line printing

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 15, 2010, 17:14 UTC
Message-ID
<7vpr35se1x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4B9E5E76.9000702@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
Show 6 quoted lines
>> Symbolic constants for the magic values 0, 1, and 2 would make the
>> code more readable.
>
> Yes, that was a bit too complicated.  I shuffled the code around a bit,
> so the patch is now a bit smaller and avoids introducing value 2 for
> show_hunk_mark.  Better?
I guess.

I still cannot shake off this nagging feeling that the complication mainly comes from the way threaded support was written as if the control flow is the same as that of the single-threaded implementation (e.g. grep_object() and friends are called from a one-path-at-a-time loop and pretend as if they have returned some meaningful results indicating they have found a match), and the logic may become more clear if the flow was restructured.

But I haven't tried, so I dunno. Your patch does not make the situation worse, and looks like the right thing to do at the moment.

Previous: René ScharfeNext: Fredrik Kuivinen
Message 4 of 5 in “grep: enable threading for context line printing”
  1. René ScharfeMar 14, 2010
  2. Fredrik KuivinenMar 14, 2010
  3. René ScharfeMar 15, 2010
  4. Junio C HamanoMar 15, 2010
  5. Fredrik KuivinenMar 20, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.