git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] fetch, reflogs, and bare repositories

From
Jeff King <peff@peff.net>
Date
Nov 4, 2014, 13:10 UTC
Message-ID
<20141104131006.GA1077@peff.net>

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: Jeff King
Message 1 of 4 in “fetch, reflogs, and bare repositories”
  1. 0/2 fetch, reflogs, and bare repositoriesJeff King, Nov 4, 2014
  2. 1/2 fetch: load all default config at startupJeff King, Nov 4, 2014
  3. 2/2 ignore stale directories when checking reflog existenceJeff King, Nov 4, 2014
  4. Junio C HamanoNov 4, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.