All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: "Marco Costalba" <mcostalba@gmail.com>
Cc: "Junio C Hamano" <junkio@cox.net>, git@vger.kernel.org
Subject: Re: Gitk feature - show nearby tags
Date: Sun, 04 Jun 2006 23:20:06 -0700	[thread overview]
Message-ID: <7vhd305dk9.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: e5bfff550606040657p5c1a3dceq3eef254ab64f0e3a@mail.gmail.com

"Marco Costalba" <mcostalba@gmail.com> writes:

> What I understand is that git-rev-list lists _first_ the given commit,
> then his parents, then his grandparents and so on _until_ a commit
> which is stated with a preceding '{caret}'  is found.
> So everything that is between the given commit and HEAD is never found
> and ignored.

As you now know, the way it works is that it takes an unordered
set of committishes, and performs a set operation that says
"include everybody reachable from positive ones while excluding
everybody reachable from negative ones".  --topo-order tells it
to topologically (instead of doing the commit date-order which
it does by default) sort the resulting list.  The resulting list
is then written out.

> Is it a problem to change the git-rev-list behaviour to reflect (my
> understanding of) documentation or it breaks something?

I suspect it would break quite many things.  Existing users use
the command knowing it is a set operation on an unordered set of
committishes, and expect the command to behave that way.  Also
the most typical use A..B translates to ^B A (either internally
or by rev-parse) so "the first" would typically be a negative
one.

I think your "start from positive ones, traverse one by one and
stop traversal that hits the negative one" logic requires the
negative one to be directly on the traversal paths starting from
positive ones to have _any_ effect.  We often ask "what's the
ones that are still not merged to the master from the side
branch" while dealing with topic branches:

         c-------d---e master         time flows from
        /       /                     left to right
 --a---b---x---y---z side

and the way to ask that question is "rev-list master..side"
(which is "rev-list side ^master").  It should list z and not
show y nor x nor b nor a.

In order for it to be able to notice that y should not be
listed, it needs to perform traversals from negative ones as
well in order to learn that y is reachable from master.  

How would you ask the same question to the modified rev-list
that does "start from positive ones, traverse one by one and
stop traversal that hits the negative one" logic?

I think one useful thing we can do is to generalize what
"describe", "nave-rev", and "merge-base" do to have a command
that takes a committish X and a set of other committish T1..Tn,
and examines if Ti (1<=i<=n) is reachable from X and if X is
reachable from Ti (1<=i<=n), and give a short-hand to specify
the set of T for common patterns like --heads --tags and --all.

But that would not be rev-list; I suspect you would end up doing
something quite similar to what show-branch does.

  reply	other threads:[~2006-06-05  6:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-03  9:38 Gitk feature - show nearby tags Paul Mackerras
2006-06-03 10:29 ` Junio C Hamano
2006-06-03 11:16   ` Marco Costalba
2006-06-04  1:59     ` Paul Mackerras
2006-06-04  7:08       ` Marco Costalba
2006-06-04  9:25         ` Junio C Hamano
2006-06-04  9:40           ` Marco Costalba
2006-06-04  9:21     ` Junio C Hamano
2006-06-04  9:54       ` Marco Costalba
2006-06-04 10:06         ` Junio C Hamano
2006-06-04 10:10           ` Junio C Hamano
2006-06-04 10:33           ` Marco Costalba
2006-06-04 10:42             ` Marco Costalba
2006-06-04 10:42             ` Junio C Hamano
2006-06-04 13:57               ` Marco Costalba
2006-06-05  6:20                 ` Junio C Hamano [this message]
2006-06-05 11:54                   ` Marco Costalba
2006-06-03 12:23   ` Paul Mackerras
2006-06-03 16:50     ` Junio C Hamano
2006-06-04  1:51       ` Paul Mackerras
2006-06-03 15:12   ` Jonas Fonseca
2006-06-03 15:33     ` Jakub Narebski
2006-06-03 16:19       ` Jonas Fonseca
2006-06-04 20:58     ` Junio C Hamano
2006-06-05  0:04       ` Jonas Fonseca
2006-06-05  1:37         ` Junio C Hamano
2006-06-05 20:08           ` Junio C Hamano
2006-06-05 20:19           ` Jonas Fonseca
2006-06-05 21:11       ` Jonas Fonseca

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=7vhd305dk9.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=mcostalba@gmail.com \
    /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.