All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonas Gehring <jonas.gehring@boolsoft.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC] Implemented return value for rev-list --quiet
Date: Tue, 26 Apr 2011 16:02:05 -0700	[thread overview]
Message-ID: <7vwrigbor6.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4DB748F5.4050300@boolsoft.org> (Jonas Gehring's message of "Wed, 27 Apr 2011 00:36:37 +0200")

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.

  reply	other threads:[~2011-04-26 23:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 22:36 [PATCH/RFC] Implemented return value for rev-list --quiet Jonas Gehring
2011-04-26 23:02 ` Junio C Hamano [this message]
2011-04-26 23:31   ` Jonas Gehring
2011-04-26 23:47     ` Junio C Hamano

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=7vwrigbor6.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jonas.gehring@boolsoft.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.