From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Hannu Koivisto <azure@iki.fi>
Subject: Re: Errors when updating an old git.git repository
Date: Tue, 26 Dec 2006 16:22:35 -0800 [thread overview]
Message-ID: <7v1wmmchmc.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.63.0612262350070.19693@wbgn013.biozentrum.uni-wuerzburg.de> (Johannes Schindelin's message of "Tue, 26 Dec 2006 23:54:19 +0100 (CET)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Git works quite as expected here, so there is nothing to fix.
>
>> error: no such remote ref refs/heads/jc/bind
>> error: no such remote ref refs/heads/jc/bind-2
>> error: no such remote ref refs/heads/gb/diffdelta
>
> Since you said it is an older git repository, I guess that in your
> .git/remotes/origin are some lines like this:
>
> Pull: refs/heads/jc/bind:refs/heads/jc/bind
>
> So, you _asked_ git to fetch these three branches!
I think it only half explains the problem. Maybe my memory is
failing, but I do not recall pushing out any of these topic
branches, perhaps except jc/bind long time ago.
How did Hannu end up with these branches, both under his
$GIT_DIR/refs/heads/ and in $GIT_DIR/remotes/origin or
remote.origin.fetch in $GIT_DIR/config?
I see identical failure report from ancient time
http://article.gmane.org/gmane.comp.version-control.git/21629
Maybe I did push them out earlier.
How about doing something like this? In explain_fetch_failure
I think we could look at $ls_remote_result and automagically fix
remotes/$remote_nick or remote.$remote_nick.fetch, but I am lazy
;-)
-- >8 --
diff --git a/git-fetch.sh b/git-fetch.sh
index ffbd44f..361dfa3 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -81,6 +81,7 @@ case "$#" in
esac
remote_nick="$1"
+datasrc=$(get_data_source "$1")
remote=$(get_remote_url "$@")
refs=
rref=
@@ -272,6 +273,21 @@ then
fi
fi
+explain_fetch_failure () {
+ where=
+ case "$datasrc" in
+ '') ;;
+ config) where="remotes.$remote_nick.fetch configuration" ;;
+ branch) where=".git/branches/$remote_nick file" ;;
+ remotes) where=".git/remotes/$remote_nick file" ;;
+ esac
+ if test "z$where" != z
+ then
+ echo >&2 "You may have stale remote branches in $where"
+ echo >&2 "Remove them if they do not exist anymore."
+ fi
+}
+
fetch_main () {
reflist="$1"
refs=
@@ -325,8 +341,10 @@ fetch_main () {
break
done
)
- expr "z$head" : "z$_x40\$" >/dev/null ||
+ expr "z$head" : "z$_x40\$" >/dev/null || {
+ explain_fetch_failure
die "No such ref $remote_name at $remote"
+ }
echo >&2 "Fetching $remote_name from $remote using $proto"
git-http-fetch -v -a "$head" "$remote/" || exit
;;
@@ -385,6 +403,7 @@ fetch_main () {
case "$sha1" in
failed)
echo >&2 "Fetch failure: $remote"
+ explain_fetch_failure
exit 1 ;;
# special line coming from index-pack with the pack name
pack)
next prev parent reply other threads:[~2006-12-27 0:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-26 14:49 Errors when updating an old git.git repository Hannu Koivisto
2006-12-26 15:37 ` Lars Hjemli
2006-12-26 19:22 ` Hannu Koivisto
2006-12-26 22:54 ` Johannes Schindelin
2006-12-27 0:22 ` Junio C Hamano [this message]
2006-12-27 0:45 ` Hannu Koivisto
2006-12-27 0:58 ` 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=7v1wmmchmc.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=azure@iki.fi \
--cc=git@vger.kernel.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 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.