Skip to content

fetchAll() fails unless a default signature is available #431

Closed

Description

@alexmcarthur

version 0.2.7

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.

Activity

  1. johnhaley81 commented on Feb 27, 2015

    @johnhaley81
    Collaborator

    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.

  2. alexmcarthur commented on Mar 2, 2015

    @alexmcarthur
    Author

    I think either option is reasonable.

  3. johnhaley81 commented on Mar 2, 2015

    @johnhaley81
    Collaborator

    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.

  4. added a commit that references this issue on Mar 2, 2015
    bd9e893
  5. JediMindtrick commented on Mar 27, 2015

    @JediMindtrick

    Has this fix been published to npm? I just encountered basically same error, except that it also needed email to be set.

  6. johnhaley81 commented on Mar 27, 2015

    @johnhaley81
    Collaborator
  7. JediMindtrick commented on Mar 28, 2015

    @JediMindtrick

    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.

  8. JediMindtrick commented on Mar 28, 2015

    @JediMindtrick

    Alright...so if I

    $ git config --global --unset user.name & git config --global --unset user.email
    

    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).

  9. jhansen-tt commented on Apr 23, 2015

    @jhansen-tt

    Still seeing this in my env as well. +1

  10. adrianpike commented on Apr 30, 2015

    @adrianpike

    I'm seeing this behavior too - what versions of libgit2 are you guys seeing this work and not work with?

  11. jamesyoung commented on May 7, 2015

    @jamesyoung

    I'm seeing this issue as well using Heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions