7

I have a simple backup system where a git clone created using --bare (it might have been --mirror) run git fetch every hour. The idea is that if something happens to my working copies that I have a backup of my work in the clone.

This system works great, but I'm getting an error when I run git fetch:

$ git fetch
remote: Total 0 (delta 0), reused 0 (delta 0)
error: unable to find 2a8c978c41c362c3f0c42775c9124780a0e71e08
fatal: object 2a8c978c41c362c3f0c42775c9124780a0e71e08 not found

When I look in the original repository for the object, it's a stash:

$ git show 2a8c978c41
commit 2a8c978c41c362c3f0c42775c9124780a0e71e08
Merge: 808f6e4 ddc28da
Author: Russell Silva <russell.silva@blahblah.com>
Date:   Wed Feb 29 10:19:26 2012
    WIP on experimental: 808f6e4 blah blah blah

It looks like the fetch is mostly successful; git log <branch> shows up-to-date branches. But the errors are pesky. How do I get rid of them? How do I keep them from recurring?

Note that this question is different from this one where someone actually wants to fetch a stash. I don't care if my git fetch commands fetch stashes; it's fine if they don't.

EDIT: the full output of git fetch --verbose was requested:

$ git fetch --verbose
remote: Total 0 (delta 0), reused 0 (delta 0)
From /home/russell/work/russells-project
 = [up to date]      some-branch -> some-branch
error: unable to find 2a8c978c41c362c3f0c42775c9124780a0e71e08
fatal: object 2a8c978c41c362c3f0c42775c9124780a0e71e08 not found

I have changed names in the output to conceal private information and eliminated all but one of the "[up to date]" lines -- there's dozens of them, one for each branch in the repository.

Also, my remote is on the local filesystem; it's not being accessed over the network.

$ git remote --verbose
origin  /home/russell/work/russells-project (fetch)
origin  /home/russell/work/russells-project (push)
Community
  • 1
  • 1
Russell Silva
  • 2,772
  • 3
  • 26
  • 36
  • does it *always* fail when there's a stash? maybe a verbose output of `git fetch` would help, cause it's weird – CharlesB Apr 03 '12 at 15:29
  • @CharlesB: I'm not sure if it always fails with a stash; I'd have to do some more extensive testing. The supplied `git fetch` output is the total output of the command. – Russell Silva Apr 03 '12 at 16:49
  • you can have more verbose output with `git fetch --verbose` – CharlesB Apr 04 '12 at 09:04
  • Also, what is the protocol? is it "raw file", or git://, or http://? – CharlesB Apr 04 '12 at 09:04
  • Something must somehow reference the stash. Have you tried a brute-force search for the stash's SHA1 in git's files or at least in .git/refs? Maybe that reveals the missing link. – bjhend Apr 17 '12 at 21:57
  • How can we reproduce the error you're seeing without having access to your repo? Do you have steps we can follow to induce the problem? – Greg Bacon Apr 24 '12 at 18:22

1 Answers1

0

Try using some 'cache_fu' http://github.com/defunkt/cache_fu.git

Lloyd Moore
  • 3,117
  • 1
  • 32
  • 32