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

Re: [PATCH/RFC] Implemented return value for rev-list --quiet

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2011, 23:02 UTC
Message-ID
<7vwrigbor6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4DB748F5.4050300@boolsoft.org>
Jonas Gehring <jonas.gehring@boolsoft.org> writes:
> If --quiet is given, the program will return non-zero if the traversed
> commit set was empty. This way, rev-list can be used to check commit
> ancestry as described by the documentation for --quiet.

Given two commits A and X, "rev-list --objects A..X" is a way to make sure that everything between A and X exists. When your ref is at A, you are trying to fetch from a remote that wants to update you to X, and when you happen to have X already, you run that command and see if it dies due to disconnect in the history. If it doesn't, you know you do not actually have to transfer anything (this is called quickfetch test). For the purpose of this test, the caller is not interested in the output, so it is perfectly OK to give --quiet to the command.

In reality, you would feed all the refs you locally have on the negative side (i.e. "rev-list --objects --quiet X --not A B C D ...") to check if X is connected to something you know you have a connected history behind it. Returning non-zero to a quickfetch test when X is reachable from some of your refs will break existing scripts.

Previous: Jonas GehringNext: Jonas Gehring
Message 2 of 4 in “Implemented return value for rev-list --quiet”
  1. Implemented return value for rev-list --quietJonas Gehring, Apr 26, 2011
  2. Junio C HamanoApr 26, 2011
  3. Jonas GehringApr 26, 2011
  4. Junio C HamanoApr 26, 2011

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.