git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fetch, reflogs, and bare repositories
@ 2014-11-04 13:10 Jeff King
  2014-11-04 13:11 ` [PATCH 1/2] fetch: load all default config at startup Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeff King @ 2014-11-04 13:10 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-04 19:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-04 13:10 [PATCH 0/2] fetch, reflogs, and bare repositories Jeff King
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

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).