Skip to content

git-upgrade fails if email is not set global for git #18020

@voxspox

Description

@voxspox

Is this a bug report?

yes

Have you read the Contributing Guidelines?

no

Environment

Environment:
OS: Linux 4.13
Node: 9.5.0
Yarn: Not Found
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: ^0.53.2 => 0.53.2

Steps to Reproduce

  1. Do not setup your email for git globally
  2. But do setup your git email for the local project
  3. run react-native-git-upgrade

Expected Behavior

no errors

Actual Behavior

$ git commit -m "Project snapshot"
On branch master
nothing to commit, working directory clean
$ react-native-git-upgrade 
git-upgrade info Check for updates 
...
git-upgrade info Add all files to commit 
git-upgrade info Commit current project sources 

*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'locus@cobalt.(none)')
git-upgrade ERR! An error occurred during upgrade: 
git-upgrade ERR! Error: Command 'git commit -m "Project snapshot"' exited with code 128:
stderr: undefined
...

If I setup my email per git config --global user.email ... there are no errors.

It seems that git runs within react-native-git-upgrade differently compared to in the shell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions