jupyterlab / jupyterlab-git

A Git extension for JupyterLab
BSD 3-Clause "New" or "Revised" License
1.45k stars 313 forks source link

Unable to set user name and email #1323

Closed Zsailer closed 4 months ago

Zsailer commented 4 months ago

Description

(Huge thanks to @jzhang20133 for finding the root cause of this issue—I'm merely reporting her findings :))

We noticed a regression from previous versions of this package.

When initializing a repo, if the user name and email is not set, the extension no longer raises a modal prompting a user for name/email. Instead, it raises an error dialog to the user:

image

The root of the issue appears related to related to: https://github.com/jupyterlab/jupyterlab-git/issues/1294

There is one more place where we should explicitly check if path == null: https://github.com/jupyterlab/jupyterlab-git/blob/b878c0b28376e7d847a095d6e5205596508421a5/src/components/GitPanel.tsx#L845

When we make this change, the prompt appears:

image

Reproduce

The easiest way to trigger this issue is to remove any git config that sets the user's email or name. Then, turn off git's "auto-detection" for user details/email.

git config --unset user.name
git config --unset user.email

git config --local user.useConfigOnly true

After adding these settings, use jupyterlab-git to make an commit and you'll see the error mentioned above.

Expected behavior

Prompt the user for a user name and email if not set.

welcome[bot] commented 4 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: