git-fresh icon indicating copy to clipboard operation
git-fresh copied to clipboard

Sometimes throws a strange error

Open raszi opened this issue 8 years ago • 8 comments

$ git fresh -f
Fetching origin
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), done.
From github.***:***/***
   b5a9630..36fb856  master     -> origin/master
Fetching ***
Fetching ***
Fetching ***
Deleted branch *** (was b01d5c1).
Deleted branch *** (was a9f8bb3).
[git-fresh] Error on line 263: fi

raszi avatar Jun 02 '17 14:06 raszi

interesting. it's not obvious what the problem is.

if you can reproduce it, let me know

imsky avatar Jun 06 '17 02:06 imsky

Happened again. A bit differently on a clean repo after just simply hitting git fresh -f:

$ git fresh -f
c96ce8f583d4f2cd0353d73571565c79609c6842
warning: ignoring broken ref refs/heads/master.
warning: ignoring broken ref refs/heads/master.
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[git-fresh] Error on line 146: fi

raszi avatar Aug 22 '17 10:08 raszi

I stopped using this script, since after this error I lost all my changes in the repository and the only thing I could do is to start from scratch and clone it out again.

raszi avatar Aug 22 '17 11:08 raszi

@raszi i've seen this happen where the ref is lost. can you provide details about your OS? i suspect it has something to do with file system conflicts.

your changes are not lost (git-fresh does not do anything destructive by default or with -f flag) - they should still be recoverable.

imsky avatar Aug 22 '17 15:08 imsky

From the reported issue above I could not get back my repository only by cloning it again unfortunately.

raszi avatar Sep 28 '17 12:09 raszi

ok @raszi sorry to hear that

can you provide any details about your system? OS, bash version, file system, whether you're the only contributor to the Git repo, etc.

imsky avatar Sep 28 '17 12:09 imsky

OS: macOS Sierra 10.12.6 (16G29) bash: GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16) fs: hfs

I had multiple remote repositories from multiple contributors.

raszi avatar Sep 28 '17 15:09 raszi

thanks. i wonder if the "missing master HEAD ref recovery" is causing this issue...i've only ever seen it happen due to file system problems (and fairly crufty Git checkouts), e.g. race conditions between Git and the file system.

without a repro case, this is difficult to diagnose, but i'll keep an eye on it.

imsky avatar Sep 28 '17 16:09 imsky