From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 0/2] fetch, reflogs, and bare repositories
Date: Tue, 4 Nov 2014 08:10:07 -0500 [thread overview]
Message-ID: <20141104131006.GA1077@peff.net> (raw)
I ran into a rather confusing case of fetching into a bare repository
with reflogs turned on:
# make a repo with a two-component branch name
git init -q &&
git commit -q --allow-empty -m one &&
git branch foo/bar &&
# now fetch it all into a bare repo with reflogs
git init -q --bare parent.git &&
cd parent.git &&
git config core.logallrefupdates true &&
git fetch --prune .. +refs/*:refs/* &&
# now replace the branch with one that has a d/f conflict
cd .. &&
git branch -d foo/bar &&
git branch foo &&
# and fetch again
cd parent.git &&
git fetch --prune .. +refs/*:refs/*
The final fetch fails and produces this output:
From ..
x [deleted] (none) -> foo/bar
error: Unable to append to ./logs/refs/heads/foo: Is a directory
! [new branch] foo -> foo (unable to update local ref)
This turns out to be caused by two subtle bugs: one that makes "git
fetch" use reflogs inconsistently, and the other that causes some ref
updates to fail when reflogs are turned on and off. Details are in the
fixes themselves.
[1/2]: fetch: load all default config at startup
[2/2]: ignore stale directories when checking reflog existence
-Peff
next reply other threads:[~2014-11-04 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 13:10 Jeff King [this message]
2014-11-04 13:11 ` [PATCH 1/2] fetch: load all default config at startup Jeff King
2014-11-04 13:24 ` [PATCH 2/2] ignore stale directories when checking reflog existence Jeff King
2014-11-04 19:40 ` [PATCH 0/2] fetch, reflogs, and bare repositories 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=20141104131006.GA1077@peff.net \
--to=peff@peff.net \
--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 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).