From: Junio C Hamano <junkio@cox.net>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Marking abandoned branches
Date: Wed, 13 Sep 2006 13:45:02 -0700 [thread overview]
Message-ID: <7vhczb7ay9.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <ee9mff$qd1$1@sea.gmane.org> (Jakub Narebski's message of "Wed, 13 Sep 2006 21:34:24 +0200")
Jakub Narebski <jnareb@gmail.com> writes:
> Moreover, git currently reads appropriate ref directly in
> git_get_hash_by_ref, not supporting even symrefs, not to mention packed
> refs. One solution would be to add support for symrefs and packed refs
> directly in gitweb (Git.pm can help here), another to use git core command
> (git-rev-parse?) but that can make gitweb slower (additional fork).
The only use of that function is in git_get_refs_list to read
refs by hand, one-by-one. This calling function needs to be
updated to use the core more effectively to adjust to Linus's
refs/ anyway, so I think git_get_hash_by_ref is too low level
implementation detail to worry about. What we want is a core
support that git_get_refs_list can use to get the list of refs
and information associated with them efficiently.
Now git_get_refs_list is called from four places, three
functions. git_summary does two separate calls to refs/tags and
refs/heads. git_tags and git_heads do one call each for their
own hierarchy. What this suggests is that the core support we
will give needs a way to specify what subset of refs/* to
include. peek-remote allows you to do this and it is fairly
efficient for local case (although it could be made more
efficient by not using the general git_connect() framework if we
want a faster local-only command), but it gives back only the
object names. git_get_refs_list wants more than that. So what
does it want to know? [*1*]
Looking at parse_ref [*2*]:
- object name
- type
- for a 'tag':
- what is tagged (type and object name)
- the tag name
- the tagger information (name, time, and zone)
- comment but except PGP signature
- if it directly [*3*] tags a 'commit':
- its age based on the commit timestamp
- for a 'commit':
- the refname itself
- the first line of the log message
- commit timestamp
- the age based on the commit timestamp
- for others:
- the refname itself
The parse_ref implementation itself uses two helpers: parse_tag
and parse_commit, and are used to show a single tag or commit
from git_tag and git_commit request.
So it appears to me that show-ref needs to have at least:
(1) A way to specify what refs to show, via --tags, --heads,
--all, and explicit refname parameters.
(2) Output format specifier to give information of interest for
each object, which includes the header fields and body of a
tag and a commit object. For a tag object, the same for
the object the tag refers to needs to be availble.
The strawman man-page I sent out about a month ago satisfies the
above except the unpeeling of tag needed in the latter part of
(2).
I'll try to code the one specified by the original strawman up
sometime today; we can discuss enhancements after that.
> I hope that Linus work will be left to mature first in 'pu', then in 'next'
> branch...
That's the general idea. A new topic always starts out in their
own topic branch, and when I have enough time to look at it in
isolation and I feel confident enough that it is in testable
shape together with what are already in 'next', it is merged
into 'next'. I did not have enough concentration last night so
Linus's refs/ spent the night in 'pu'. Hopefully I'll have
energy to look at it enough today to decide if it can be merged
to 'next', or other fix-ups are needed.
It may break 'gitweb' and possibly others. I offhand do not
know what other things (including git Porcelainish) look at
refs/ directly; they obviously need fixing before the refs/ work
hits 'master', or maybe even 'next'.
> ... wouldn't refs cache (similar to current index for files) be
> better idea?
The ideal is to make a fast and easy way for Porcelains to
access what they want to know about the refs without knowing
their implementation. We already provide ways to do so except
that they may not be fast nor easy. And the "may not be fast"
part is what triggers 'cache would be better' reaction, but the
right thing to do is not to work it around with a clutch, but to
design what an appropriate core side support is and implement
it.
[*1*] Here, I am essentially designing what show-ref command
should look like. I was hoping that Porcelain people who are
users of the core to do this sort of "requirement design" and
present a proposal based on their actual needs. Unfortunately
it never happened. Let me set an example by showing how it
should be done here.
[*2*] This is called only once from git_get_refs, so we can get
rid of this function when we rewrite git_get_refs.
[*3*] If we rewrite this part using "foo^{}", gitweb would lose
the ability to distinguish a tag that points directly at a
commit and a tag that points at a tag that points at a commit.
I do not think anybody currently appreciates it right now but
later we might miss it if we did so.
There unfortunately is no way to use rev^{whatever} syntax to
say "peel the onion only one level".
next prev parent reply other threads:[~2006-09-13 20:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 15:17 Marking abandoned branches Jon Smirl
2006-09-13 15:24 ` Petr Baudis
2006-09-13 15:31 ` Johannes Schindelin
2006-09-13 15:45 ` Jakub Narebski
2006-09-13 18:40 ` Junio C Hamano
2006-09-13 18:51 ` Jakub Narebski
2006-09-13 19:00 ` Junio C Hamano
2006-09-13 19:34 ` Jakub Narebski
2006-09-13 20:43 ` Petr Baudis
2006-09-13 20:45 ` Junio C Hamano [this message]
2006-09-13 21:02 ` Jakub Narebski
2006-09-13 21:09 ` Jakub Narebski
2006-09-13 21:32 ` Jakub Narebski
2006-09-13 15:59 ` Jon Smirl
2006-09-13 16:05 ` Johannes Schindelin
2006-09-13 17:22 ` Jon Smirl
2006-09-13 17:32 ` Shawn Pearce
2006-09-13 17:46 ` Nicolas Pitre
2006-09-13 20:31 ` Martin Langhoff
2006-09-13 20:43 ` Jakub Narebski
2006-09-13 16:09 ` Shawn Pearce
2006-09-13 16:12 ` Jakub Narebski
2006-09-13 16:40 ` A Large Angry SCM
2006-09-13 16:49 ` Shawn Pearce
2006-09-13 18:58 ` Junio C Hamano
2006-09-13 16:55 ` Jakub Narebski
2006-09-13 17:24 ` Jon Smirl
2006-09-13 17:45 ` Jakub Narebski
2006-09-14 3:37 ` Sam Vilain
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=7vhczb7ay9.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=jnareb@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 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).