reg-viz/reg-suit

[reg-keygen-git-hash-plugin] Ambiguous short hash

kdnk opened this issue · 1 comments

kdnk commented

Describe the bug

I got an error while running npx reg-suit run like error: short object ID abcdefgh is ambiguous.
(I've modified it a bit not to show up personal information.)

❯ npx reg-suit run
[reg-suit] info version: 0.12.1
fatal: Not a valid object name +
error: short object ID abcdefgh is ambiguous
hint: The candidates are:
hint:   abcdefgh11 commit 2022-07-22 - sample commit message 1
hint:   abcdefgh22 commit 2022-07-12 - sample commit message 2
fatal: ambiguous argument 'abcdefgh': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[reg-keygen-git-hash-plugin] error Command failed: git log '--pretty=%ci' -n 1 abcdefgh
error: short object ID abcdefgh is ambiguous
hint: The candidates are:
hint:   abcdefgh11 commit 2022-07-22 - sample commit message 1
hint:   abcdefgh22 commit 2022-07-12 - sample commit message 2
fatal: ambiguous argument 'abcdefgh': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

[reg-suit] warn Failed to detect the previous snapshot key

Reproduced step

Not sure how to reproduce it. It might happen with large repos like having some commit hashes starting with the same 8 characters.

Expected behavior

No "ambiguous" errors.

Actual behavior

Got errors like error: short object ID ******** is ambiguous.
I suspect that this line causes this issue.
Can we change this to a bit more larger number or have an option to change the length of this hash?

Screenshots

-

kdnk commented

Instead of using reg-keygen-git-hash-plugin, I've decided to use reg-simple-keygen-plugin and it works.
https://github.com/reg-viz/reg-suit/blob/master/packages/reg-simple-keygen-plugin/README.md