coopermaruyama / atom-git-wip

Automatic WIP saving for Atom
MIT License
3 stars 0 forks source link

Uncaught Error: error: Ref refs/wip/master is at cd86c70bf3bdaae39624b0613b771c140bd3f560 but exp... #10

Closed SlimeQ closed 8 years ago

SlimeQ commented 9 years ago

[Enter steps to reproduce below:]

  1. project-wide regex find and replace
  2. hit enter

Atom Version: 1.0.11 System: elementary OS Thrown From: git-wip package, v0.1.3

Stack Trace

Uncaught Error: error: Ref refs/wip/master is at cd86c70bf3bdaae39624b0613b771c140bd3f560 but expected 251811d27c40c2a99daf2b11f9b76fd54aed2c31 fatal: Cannot lock the ref 'refs/wip/master'.

At /home/quincy/.atom/packages/git-wip/lib/git-wip.coffee:93

Error: error: Ref refs/wip/master is at cd86c70bf3bdaae39624b0613b771c140bd3f560 but expected 251811d27c40c2a99daf2b11f9b76fd54aed2c31
fatal: Cannot lock the ref 'refs/wip/master'.

  at /home/quincy/.atom/packages/git-wip/lib/git-wip.coffee:93:23
  at /home/quincy/.atom/packages/git-wip/node_modules/shelljs/src/exec.js:142:7
  at ChildProcess.exithandler (child_process.js:720:7)
  at emitTwo (events.js:87:13)
  at ChildProcess.emit (events.js:169:7)
  at maybeClose (child_process.js:997:16)
  at Socket.<anonymous> (child_process.js:1166:11)
  at emitOne (events.js:77:13)
  at Socket.emit (events.js:166:7)
  at Pipe.close (net.js:464:12)

Commands

     -1:23.9.0 core:redo (atom-text-editor.editor.is-focused)
  2x -1:23.4.0 core:undo (atom-text-editor.editor.is-focused)
     -1:21 core:redo (atom-text-editor.editor.is-focused)
  3x -1:19.9.0 core:undo (atom-text-editor.editor.is-focused)
  3x -1:17.7.0 core:redo (atom-text-editor.editor.is-focused)
  3x -1:16.9.0 core:undo (atom-text-editor.editor.is-focused)
     -1:14.9.0 core:redo (atom-text-editor.editor.is-focused)
     -1:14.2.0 core:save (atom-text-editor.editor.is-focused)
     -0:55.7.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  2x -0:25 core:delete (atom-text-editor.editor.mini.is-focused)
     -0:21 find-and-replace:focus-next (atom-text-editor.editor.mini.is-focused)
     -0:20.5.0 core:move-left (atom-text-editor.editor.mini.is-focused)
     -0:19.6.0 editor:select-to-end-of-word (atom-text-editor.editor.mini.is-focused)
     -0:18 core:backspace (atom-text-editor.editor.mini.is-focused)
  2x -0:14.5.0 find-and-replace:focus-next (atom-text-editor.editor.mini.is-focused)
     -0:13.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "markdown-preview",
      "nuclide-file-tree",
      "hyperclick",
      "nuclide-arcanist",
      "nuclide-code-format",
      "nuclide-diagnostics-store",
      "nuclide-diagnostics-ui",
      "nuclide-diff-view",
      "nuclide-file-watcher",
      "nuclide-find-references",
      "nuclide-flow",
      "nuclide-hack",
      "nuclide-hg-repository",
      "nuclide-installer",
      "nuclide-language-hack",
      "nuclide-ocaml",
      "nuclide-quick-open",
      "nuclide-remote-projects",
      "nuclide-type-hint",
      "tree-view-git-modified",
      "tree-view-git-status",
      "browser-plus",
      "linter-coffeescript",
      "Remote-FTP",
      "android",
      "atom-debugger",
      "coffeescript-check",
      "debugger",
      "git-log",
      "jshint",
      "git-gutter",
      "tree-view-git-branch",
      "imdone-atom"
    ],
    "packagesWithKeymapsDisabled": [
      "nuclide-file-tree"
    ],
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ]
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.3.0
atom-material-syntax, v0.2.3
atom-material-ui, v0.6.0
chary-tree-view, v0.2.3
editor-stats, v0.17.0
git-diff-details, v0.20.0
git-plus, v5.4.7
git-wip, v0.1.3
java-importer, v1.4.0
language-ejs, v0.2.0
language-gradle, v0.0.3
language-salesforce, v0.6.0
linter, v1.5.1
linter-javac, v1.2.0
markdown-preview-plus, v2.1.0
minimap, v4.13.3
project-manager, v2.5.1
set-syntax, v0.3.0
tabs-to-spaces, v0.11.1
tidy-tabs, v0.2.0
tree-view-git-projects, v0.5.0

# Dev
No dev packages
coopermaruyama commented 8 years ago

Hi, I've been seeing this too sometimes, that output is straight from shelljs so it looks to be a bug in the shell script which this package depends on.

At the moment I'm not sure what's causing it as I'm not too familiar with how the script works. However, you can manually fix this from your terminal by running git update-ref -d refs/wip/master.

This isn't really a huge issue, it can be caused by something as simple as your local branch having an uppercase letter which is lowercase on the remote. This error states that the reference name is different, but the underlying data is fine so don't worry about losing any of your work.

I'll keep this open until I can figure out what's going on. I pushed a few fixes today, so if the new changes help, let me know.

Also, you mentioned it happens when you run a project-wide regex.. can you check if you have the same keyboard shortcut for creating a WIP checkpoint and something related to find/replace? That could be a source of this issue as well, I can imagine that if your 'active' window is find/replace, git-wip will try to create a checkpoint for it (since its the 'active' editor) but the find/replace view has no file associated with it in your repo so I could definitely see that confusing the tool.

coopermaruyama commented 8 years ago

Closing this due to inactivity