You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fetchAll() fails unless a default signature is available #431
fetchAll() fails with [Error: Config value 'user.name' was not found] unless git global config 'user.name' is set to a non-empty string. If the string is empty the error is [Error: Failed to parse signature - Signature cannot have an empty name]. The fetchAll() function does not take a signature parameter, and ends up calling repo.defaultSignature().
To reproduce:
$ git config --global --unset user.name
or
$ git config --global user.name ''
Setting the system or local user.name makes no difference.
As far as I can tell there is no way to set the default user name other than via the command line.
We definitely don't want this to fail. Maybe it could take in an optional parameter if you don't have your git options set up correctly? Or default to "unknown"?
All of our config methods currently are experimental. That means that the ones we do have access to in JS haven't been tested so it's use at your own risk.
I'm thinking that it should default to "unknown". That seems more like what git CLI does. If you want to overwrite the default signature then don't call the convenience method and call the actual Remote.prototype.fetch method.
Strange. Runs fine on my local, but when I move to an azure vm I'm seeing this kind of behavior. Stepping through the code I definitely see the fix. So I will continue digging.
then this line (repository.js, line 542) throws an error '[Error: Config value 'user.name' was not found]'
var result = NodeGit.Signature.default(this);
Able to reproduce this on my local and I believe this is similar to what is happening when I deploy to a new clean environment (heroku and various bits of azure).
Activity
johnhaley81 commentedon Feb 27, 2015
We definitely don't want this to fail. Maybe it could take in an optional parameter if you don't have your git options set up correctly? Or default to "unknown"?
All of our config methods currently are experimental. That means that the ones we do have access to in JS haven't been tested so it's use at your own risk.
alexmcarthur commentedon Mar 2, 2015
I think either option is reasonable.
johnhaley81 commentedon Mar 2, 2015
I'm thinking that it should default to "unknown". That seems more like what git CLI does. If you want to overwrite the default signature then don't call the convenience method and call the actual
Remote.prototype.fetchmethod.Default signature always returns valid signature
JediMindtrick commentedon Mar 27, 2015
Has this fix been published to npm? I just encountered basically same error, except that it also needed email to be set.
johnhaley81 commentedon Mar 27, 2015
Yeah, we even have a test for it: https://github.com/nodegit/nodegit/blob/master/test/tests/signature.js#L48-L95
JediMindtrick commentedon Mar 28, 2015
Strange. Runs fine on my local, but when I move to an azure vm I'm seeing this kind of behavior. Stepping through the code I definitely see the fix. So I will continue digging.
JediMindtrick commentedon Mar 28, 2015
Alright...so if I
then this line (repository.js, line 542) throws an error '[Error: Config value 'user.name' was not found]'
Able to reproduce this on my local and I believe this is similar to what is happening when I deploy to a new clean environment (heroku and various bits of azure).
jhansen-tt commentedon Apr 23, 2015
Still seeing this in my env as well. +1
adrianpike commentedon Apr 30, 2015
I'm seeing this behavior too - what versions of libgit2 are you guys seeing this work and not work with?
jamesyoung commentedon May 7, 2015
I'm seeing this issue as well using Heroku.