From: Jonathan Nieder <jrnieder@gmail.com>
To: Stephen Bash <bash@genarts.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
git@vger.kernel.org, Nicolas Pitre <nico@fluxnic.net>,
"Shawn O. Pearce" <spearce@spearce.org>,
Sverre Rabbelier <srabbelier@gmail.com>
Subject: Re: refs/original breaks git-clone for tags
Date: Tue, 7 Sep 2010 18:14:00 -0500 [thread overview]
Message-ID: <20100907231400.GA2024@capella.cs.uchicago.edu> (raw)
In-Reply-To: <32751199.117741.1282331329553.JavaMail.root@mail.hq.genarts.com>
Hi Stephen,
Stephen Bash wrote:
> After a lot of guess and check, it appears the issue is somehow
> related to the refs/original directory created by filter-branch. If
> that directory is moved out of refs/ or deleted the clone succeeds.
> Digging further, a simple rename of refs/original/refs/tags/tagFoo
> to anything else also fixes the problem.
Thanks for a clear report. I backported your test case:
-- 8< --
#!/bin/sh
mkdir foo &&
(
cd foo &&
git init &&
echo A >foo.txt &&
git add foo.txt &&
git commit -m "Created foo" &&
git tag -am "Tagging foo" tagFoo &&
git filter-branch --env-filter 'export GIT_AUTHOR_NAME=xyz123' \
--tag-name-filter cat -- --all &&
git show-ref
) &&
git clone file:///`pwd`/foo newFoo &&
(
cd newFoo &&
git show-ref
)
-- >8 --
which produces the result:
...
07fa3d4c3aba83b293e24a12a87faca363ad34e6 refs/heads/master
90a32c29df06b4f6e4218c1b82b35a3e49aed9f2 refs/original/refs/heads/master
90a32c29df06b4f6e4218c1b82b35a3e49aed9f2 refs/original/refs/tags/tagfoo
ef92777a31663135426a9648d0abb0c06b448fbe refs/tags/tagfoo
...
Resolving deltas: 100% (1/1), done.
error: refs/tags/tagfoo does not point to a valid object!
07fa3d4c3aba83b293e24a12a87faca363ad34e6 refs/heads/master
07fa3d4c3aba83b293e24a12a87faca363ad34e6 refs/remotes/origin/HEAD
07fa3d4c3aba83b293e24a12a87faca363ad34e6 refs/remotes/origin/master
$
The error message bisects to:
commit 5bdc32d3e50d8335c65e136e6b5234c5dd92a7a9 (tags/v1.6.5-rc3~20)
Author: Nicolas Pitre <nico@fluxnic.net>
Date: Fri Sep 25 23:54:42 2009 -0400
make 'git clone' ask the remote only for objects it cares about
Current behavior of 'git clone' when not using --mirror is to fetch
everything from the peer, and then filter out unwanted refs just before
writing them out to the cloned repository. This may become highly
inefficient if the peer has an unusual ref namespace, or if it simply
has "remotes" refs of its own, and those locally unwanted refs are
connecting to a large set of objects which becomes unreferenced as soon
as they are fetched.
Let's filter out those unwanted refs from the peer _before_ asking it
what refs we want to fetch instead, which is the most logical thing to
do anyway.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
That is not too surprising. Before then, "git clone" fetched
all objects.
The error message is from refs.c::do_one_ref(), which notices the
missing object ef92777a31663135426a9648d0abb0c06b448fbe (i.e., ye
old tag object).
Call chain:
cmd_clone() ->
write_remote_refs() ->
pack_refs() ->
do_for_each_ref() ->
do_one_ref()
The transport is done afaict by then.
Nico, Shawn: ideas?
prev parent reply other threads:[~2010-09-07 23:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <29380346.117285.1282264933599.JavaMail.root@mail.hq.genarts.com>
2010-08-20 0:54 ` Tags, Grafts, and Clones, oh my! Stephen Bash
2010-08-20 6:15 ` Ramkumar Ramachandra
2010-08-20 13:00 ` Stephen Bash
2010-08-20 13:39 ` Ramkumar Ramachandra
2010-08-20 14:40 ` Stephen Bash
2010-08-20 19:08 ` refs/original breaks git-clone for tags (was Re: Tags, Grafts, and Clones, oh my!) Stephen Bash
2010-09-07 23:14 ` Jonathan Nieder [this message]
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=20100907231400.GA2024@capella.cs.uchicago.edu \
--to=jrnieder@gmail.com \
--cc=artagnon@gmail.com \
--cc=bash@genarts.com \
--cc=git@vger.kernel.org \
--cc=nico@fluxnic.net \
--cc=spearce@spearce.org \
--cc=srabbelier@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).