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

Re: [PATCH] Enable git rev-list to parse --quiet

From
Nick Andrew <nick@nick-andrew.net>
Date
Jul 20, 2008, 12:04 UTC
Message-ID
<20080720120437.GC15586@mail.local.tull.net>
In-Reply-To
<7vwsjhc7kj.fsf@gitster.siamese.dyndns.org>
On Sun, Jul 20, 2008 at 12:56:28AM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> Nick Andrew <nick@nick-andrew.net> writes:
> 
> > ...Without
> > a working "--quiet" nor exit code I can pipe the output to "wc -l"
> > but is there a more efficient/reliable way to implement the requirement?
> 
> Did you read the whole thread before asking the above question?

I took your answer to mean that I shouldn't be using git-rev-list for this purpose, so I asked whether there's a better way to do it. Johannes Schindelin gave a good answer to that.

> IOW, does this answer the above question?
> 
>     http://mid.gmane.org/7vy73zd8ok.fsf@gitster.siamese.dyndns.org
I'm not happy with that patch due to this:
 static void finish_commit(struct commit *commit)
 {
+       if (check_empty)
+               exit(0);

Exiting a process from within a callback function seems to me to violate the principle of least surprise. If the return code should be zero then the cmd_rev_list function should return zero, and run_command will return zero and handle_internal_command will exit zero. There must be a better way to avoid redundant processing for the empty set case.

Nick.
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “Enable git rev-list to parse --quiet”
  1. Enable git rev-list to parse --quietNick Andrew, Jul 18, 2008
  2. Junio C HamanoJul 18, 2008
  3. Junio C HamanoJul 18, 2008
  4. Nick AndrewJul 18, 2008
  5. Johannes SchindelinJul 18, 2008
  6. Junio C HamanoJul 20, 2008
  7. Nick AndrewJul 20, 2008
  8. Junio C HamanoJul 20, 2008

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.