From: "Marco Costalba" <mcostalba@gmail.com>
To: "Paul Mackerras" <paulus@samba.org>
Cc: "Junio C Hamano" <junkio@cox.net>,
git@vger.kernel.org, "Jonas Fonseca" <fonseca@diku.dk>
Subject: Re: Gitk feature - show nearby tags
Date: Sun, 4 Jun 2006 09:08:24 +0200 [thread overview]
Message-ID: <e5bfff550606040008m4dbf02bdga4f4e6bc2d2fe9d@mail.gmail.com> (raw)
In-Reply-To: <17538.16015.53244.876090@cargo.ozlabs.ibm.com>
On 6/4/06, Paul Mackerras <paulus@samba.org> wrote:
> Marco Costalba writes:
>
> > If I have understood correctly the patch runs a 'git rev-list --all
> > --topo-order --parents'
> > and then does a tree walking.
>
> Yes, that's right. It means that gitk can show the nearest tags even
> if they aren't included in the current view.
>
> > I am wandering if there exist any native git way to found the previous tag.
>
> I don't know of any. Doing the tree walking in Tcl turned out to be
> not too much of an overhead, though; it does the whole kernel
> repository in 1.5 seconds on my G5.
>
> > As example given a selected revision with id <sha> is it possible to
> > do something like this to fond the ancestor?
> >
> > 1) get the tag list with git-peek-remote or something similar if tags
> > are not already loaded
> >
> > 2) given the tagList vector with n elements run
> >
> > git-rev-list --topo-order <sha> ^tagList[0] ^tagList[1] ....
> > ^tagList[n-1]
> >
> > 3) take the last sha spit out by git-rev-list, be it <lastSha>.
> >
> > 4) Previous nearest tag is the parent of lastSha
> >
> > I've missed something?
>
> I'm not sure exactly what that would do, but gitk can show more than
> one tag (the term "nearest tag" is only a shorthand approximation for
> what it does). For example, if you have two tagged commits where
> neither is an ancestor of the other, and do a merge of the two, gitk
> will show both tags when you select the merge.
What you suggest we need it's a kind of history of tags.
Currently we can run
git-rev-list --top-order --parents HEAD -- foo.c
and we get an history of file foo.c *with modified parents*
Junio, could be possible have something like
git-rev-list --top-order --parents --tags
with the history of tags ?
And, according to Paul suggestions, not only tags, but merge revisions
between tags.
A more general and IMHO very powerful tool could be something like
git-rev-list --top-order --parents --selected-only HEAD -- <sha 1>
<sha 2> ..... <sha n>
Where git rev list gives the history, with modified parents, of the
given revisions _only_ plus the merging revisions among them.
This could be used for tags (got from git-peek-remote), for branches
and in general for a given set of interesting revisions.
Once we have the history of tags, perhaps requested once at startup,
we can get the previous tags of a given revision, our original
problem, with
git-rev-list --topo-order <sha> ^tagList[0] ^tagList[1] ....
^tagList[n-1] ^merge[0] ... ^merge[k]
And have one or more tags according if results is a rev in tagList or
mergeList. Having the tag history it's easy to look up _all_ the tag
ancestors.
Marco
P.S: another use of
git-rev-list --top-order --parents --selected-only HEAD -- <sha 1>
<sha 2> ..... <sha n>
could be this:
Currently both qgit and gitk can filter revisions with a given set of
filter rules, but the results are shown together with the other
revisions or as a list of matching revisions with no useful graph
information.
We could feed git-rev-list --top-order --parents --selected-only with
the list of matching revisions and have a pretty and sensible graph
too.
next prev parent reply other threads:[~2006-06-04 7:08 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 [this message]
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
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=e5bfff550606040008m4dbf02bdga4f4e6bc2d2fe9d@mail.gmail.com \
--to=mcostalba@gmail.com \
--cc=fonseca@diku.dk \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=paulus@samba.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 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 NNTP newsgroup(s).