From: Junio C Hamano <junkio@cox.net>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: Martin Langhoff <martin@catalyst.net.nz>, git@vger.kernel.org
Subject: Re: [PATCH] cg-fetch will now retrieve commits related to tags if missing.
Date: Wed, 19 Oct 2005 21:44:47 -0700 [thread overview]
Message-ID: <7virvsu79c.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <46a038f90510192118s31c52fe7m73d88a9779653f4c@mail.gmail.com> (Martin Langhoff's message of "Thu, 20 Oct 2005 17:18:51 +1300")
Martin Langhoff <martin.langhoff@gmail.com> writes:
>> GIT_DIR=../.. git-rev-parse --verify "$tagid^0" >/dev/null 2>&1 && continue
>
> Note however that git-rev-parse is lazy and won't check that the
> commit is there. I have to call git-cat-file and check whether it
> succeeds to know if we have the object.
Are you sure?
What "rev^0" does is:
1. parse "rev"; make sure it can deref to commit and read
it (otherwise give up and say the whole thing is not an
SHA1 expression);
2. grab the nth parent SHA1. If N>0, it is lazy and does
not check if the parent object exists, but still 0th
parent is the commit object itself and if we came this
far you know that commit is available already.
Together with --verify, it barfs if the above does not say "rev^0"
is a valid SHA1 expression. So this should work without
cat-file. No?
BTW, I just got a SEGV while pulling Cogito repository over
git-fetch-pack after interrupting rsync transfer (I wanted to
switch to git transfer). I am running with Johaness patch from
today so the cause may be different from yours, but now I have
something to look at, which is better than before.
Fetching with rsync (and interrupting in the middle) is a good
way to simulate a broken repository ;-).
next prev parent reply other threads:[~2005-10-20 4:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-20 0:55 [PATCH] cg-fetch will now retrieve commits related to tags if missing Martin Langhoff
2005-10-20 1:25 ` Junio C Hamano
2005-10-20 4:15 ` Martin Langhoff
2005-10-20 4:18 ` Martin Langhoff
2005-10-20 4:44 ` Junio C Hamano [this message]
2005-10-20 4:59 ` Martin Langhoff
2005-10-20 5:23 ` Junio C Hamano
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=7virvsu79c.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=martin.langhoff@gmail.com \
--cc=martin@catalyst.net.nz \
/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.