From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Mike Coleman <tutufan@gmail.com>, junkio@cox.net
Subject: Re: [PATCH 2/2] Teach name-rev to identify revisions containing a certain blob
Date: Sun, 18 Feb 2007 00:34:15 -0800 [thread overview]
Message-ID: <7vmz3bj248.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: Pine.LNX.4.63.0702171838510.22628@wbgn013.biozentrum.uni-wuerzburg.de
Having said what I said in the comments on [PATCH 1/2], I think
you are either solving a wrong problem, or even if you are
solving the right problem, you are solving in a wrong way in
this patch.
I do not think Mike wants a way to deal with what he gets in his
mailbox from an end user who did this:
$ cat a-file-whose-name-was-not-told-to-mike >junk
$ mailx mike.coleman <junk
It's more like he learns the contents _and_ the path from an
end-user who is having trouble with a tarball of unknown
vintage, and wants to identify which snapshot had that contents
at that path [*1*].
So I do not think it is solving the right problem to run around
all over the tree without knowing the path, looking for a
particular object name. It certainly makes the solution much
more expensive.
Even if that were Mike's problem, there is a problem that the
same object can appear at different places in different trees.
Keeping a single pathname registered in object_hash would mean
the answer is "whatever happens to be found first", regardless
of the path.
To make "whatever happens to be found first" semantics useful, I
think you would need to make the traversal more controllable by
the user of name-rev. For example, Mike may know what he gave
the end user was from maintenance series of 1.4.4 software, in
which case you would want to let him say "traverse from the tip
of 1.4.4 maintenance branch down, do not worry about other
branches such as 1.5.0 series or 1.4.3 maintenance series".
Your earlier --ref-filter patch would certainly help it, but a
solution based on grep over "rev-list | ls-tree --stdin" (which
currently does not exist) might be more appropriate and
flexible? I dunno.
[Footnote]
*1* To find a revision that had a particular object at a known
path, you should be able to do:
git rev-list <starting refs> |
git diff-tree --stdin --raw -r -Z |
grep -z that-object-name
but an earlier commit abd4e222 needs to be further enhanced to
add -Z option that means "output fields are not NUL terminated,
output records are", which did not happen.
next prev parent reply other threads:[~2007-02-18 8:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-17 17:39 [PATCH 2/2] Teach name-rev to identify revisions containing a certain blob Johannes Schindelin
2007-02-17 18:24 ` Junio C Hamano
2007-02-17 23:52 ` Johannes Schindelin
2007-02-18 0:04 ` Johannes Schindelin
2007-02-17 18:30 ` Junio C Hamano
2007-02-17 23:31 ` Johannes Schindelin
2007-02-18 8:34 ` Junio C Hamano [this message]
2007-02-18 8:48 ` Junio C Hamano
2007-02-18 15:41 ` Johannes Schindelin
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=7vmz3bj248.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=tutufan@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