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

[CLI] No recovery from a file not found

Open mhogerheijde opened this issue 6 years ago • 6 comments

When showing the history of a file, going to a commit where that file didn't exist (yet), shows a "file not found", but no other interfacing to get back to where you came from.

screenshot from 2019-02-22 15-28-24

It is accompanied with the following error message:

Server error { Error: Command failed: git show cfb86c85:./Helper.scala
fatal: Path 'generator-maven-plugin/src/main/scala/nl/ebpi/husky/mavenplugin/Helper.scala' exists on disk, but not in 'cfb86c85'.

    at makeError (/home/mhogerheijde/.nvm/versions/node/v8.4.0/lib/node_modules/git-file-history/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/home/mhogerheijde/.nvm/versions/node/v8.4.0/lib/node_modules/git-file-history/node_modules/execa/index.js:278:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  code: 128,
  stdout: '',
  stderr: 'fatal: Path \'generator-maven-plugin/src/main/scala/nl/ebpi/husky/mavenplugin/Helper.scala\' exists on disk, but not in \'cfb86c85\'.\n',
  failed: true,
  signal: null,
  cmd: 'git show cfb86c85:./Helper.scala',
  timedOut: false,
  killed: false }
Let us know of the error at https://github.com/pomber/git-history/issues

mhogerheijde avatar Feb 22 '19 14:02 mhogerheijde

Hey, thanks for reporting. What version of the CLI are you using? In the last version it shouldn't show commits where the file didn't exist. Or maybe is a commit where the file was deleted?

pomber avatar Feb 22 '19 17:02 pomber

I installed today using npm install -g. I'm not at my (work) pc until Monday, so can't check it right now.

The file got added from a certain point in time and it has not been deleted since.

mhogerheijde avatar Feb 22 '19 21:02 mhogerheijde

I'm using 0.1.0 on node 8.4.0, but I also have the same on node 10.15.2 with [email protected]. It seems to be the latest version on npm currently.

mhogerheijde avatar Feb 28 '19 15:02 mhogerheijde

I'm having the same problem on node 11.9.0

raviprakashgiri avatar Mar 11 '19 23:03 raviprakashgiri

I think this bug because you changed the target file name before. I'm facing this right now. Is there anyone know how to fix this?

vntrungld avatar Mar 14 '19 04:03 vntrungld

Anyone has a public repo I can clone to reproduce this?

pomber avatar Mar 14 '19 17:03 pomber