git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: git@vger.kernel.org
Subject: Re: Bug when git rev-list options "--first-parent" and "--ancestry-path" are used together?
Date: Thu, 23 May 2013 10:20:13 -0700	[thread overview]
Message-ID: <7vtxltfwaa.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <519DEA48.10108@alum.mit.edu> (Michael Haggerty's message of "Thu, 23 May 2013 12:07:04 +0200")

Michael Haggerty <mhagger@alum.mit.edu> writes:

> It seems to me that
>
>      git rev-list --first-parent --ancestry-path A..B
>
> is well-defined and should list the commits in the intersection between
>
>      git rev-list --first-parent                 A..B
>
> and
>
>      git rev-list                --ancestry-path A..B
>
> But in many cases the first command doesn't provide any output even
> though there are commits common to the output of the last two commands.
>
> For example, take as an example the DAG from test t6019:
>
> #          D---E-------F
> #         /     \       \
> #    B---C---G---H---I---J
> #   /                     \
> #  A-------K---------------L--M
>
> (The merges are always downwards; e.g., the first parent of commit L is
> K.)  The command
>
>     git rev-list --first-parent --ancestry-path D..J
>
> doesn't generate any output, whereas I would expect it to output "H I
> J".

As I do not see how "only show first-parent chains from near the tip
but stop immediately when the chain deviates from the ancestry path"
could be a sensible operation (in other words, I do not offhand
think of examples of what useful things you can do with that
information), I actually expect that "-f-p -a-p D..J" should error
out, instead of giving no output.

You are correct to point out that sometimes -f-p and -a-p _could_ be
compatible, e.g. "-f-p -a-p A..M", or "-f-p -a-p B..M".  But I think
the only case that they are compatible is when "-f-p" output is a
strict subset of what "-a-p" without "-f-p" would give.

  reply	other threads:[~2013-05-23 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 10:07 Bug when git rev-list options "--first-parent" and "--ancestry-path" are used together? Michael Haggerty
2013-05-23 17:20 ` Junio C Hamano [this message]
2013-05-25 18:40   ` Michael Haggerty
     [not found]   ` <519F0B2F.3090701@alum.mit.edu>
     [not found]     ` <7v4nds9rhh.fsf@alter.siamese.dyndns.org>
2013-05-25 19:54       ` Michael Haggerty

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vtxltfwaa.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).