Subject: guix pull: error: Git error: unable to parse OID - contains invalid characters when COMMIT-ID is shortened

From: Björn Höfling <[email-masked]>
Date: Mon, 5 Mar 2018 21:29:12 +0100

Guix pull has the wrong error message when the commit-id for the
"--commit" parameter is too short:

$>guix pull --commit=d20647722ad36024a3a0b6e1e75c1ba49b9f61d
Updating from Git repository at
'https://git.savannah.gnu.org/git/guix.git'... guix pull: error: Git
error: unable to parse OID - contains invalid characters

Instead of that error-message it should complain that the OID is too
short.

Even better, it should just accept a shortened OID and use it, as long
as it is unique.

Note: When there really is a wrong character used, this error message
is also correctly shown:

$>guix pull --commit=d20647722ad36024a3a0b6e1e75c1ba49b9f61dz
Updating from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
guix pull: error: Git error: unable to parse OID - contains invalid characters

Note: If the OID is long enough and well-formed, but just non-existent,
the error message is adequately correct:

$> guix pull --commit=d20647722ad36024a3a0b6e1e75c1ba49b9f61dd 
Updating from Git repository at 
'https://git.savannah.gnu.org/git/guix.git'... guix pull: error: Git
error: object not found - no match for id
(d20647722ad36024a3a0b6e1e75c1ba49b9f61dd)

Björn