-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: committer identity unknown; please configure user.name
and user.email
#407
Comments
Thanks for this issue report @char101. gitoxide uses the home crate, which has very specific policy regarding how the I think the docs for So I wonder how your I do not have a Windows environment on-hand, so I could use help with this additional triage. Thanks! |
Changing
I generally don't like storing config files in
It did. I can run stgit by symlinking The problem is that the
No, actually if I symlink |
Another problem with stgit on Windows is that it failed to launch the configured editor:
|
Thank you for the additional triage, @char101. Regarding how Regarding the editor not being launched as expected when running https://github.com/stacked-git/stgit/blob/master/src/patch/edit/interactive.rs#L97-L105 Which is trying to emulate how git runs an editor subprocess. Note specifically how it tries to run the command via https://github.com/git/git/blob/e02ecfcc534e2021aae29077a958dd11c3897e4c/run-command.c#L275-L300 So I don't know if the problem is with running your editor, or running |
Thanks for the links for the editor launch code. There are some points that I can make of it
If I add
|
From https://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows using
|
I think this is the key. It's not just So from where I'm sitting, it seems like StGit using |
|
As for git executables, it doesn't seem to be a problem
|
https://github.com/git-for-windows/MINGW-packages/blob/main/mingw-w64-git/git-wrapper.c |
…home directory. This will fix issues like the one described here: stacked-git/stgit#407
…home directory. This will fix issues like the one described here: stacked-git/stgit#407
From this comment:
Thanks for letting me know! For launching programs 'git-style', If I am not mistaken, For the problem of not picking up configuration from |
Thank you @Byron for your help with this! I will get the patched gix 0.58 merged into StGit soon. And thank you for the tip about |
Updated to gix 0.58 in 861d26a. This should fix the issue with finding the global |
gix-command emulate's git's behavior a little more closely w.r.t. when to execute the editor with a shell and split arguments. For example, using a shell script as the editor like this now works: GIT_EDITOR='printf "log: %s\n" "$1" >some.log && nvim -- "$1"' stg edit This may also help with running the editor in a Windows environment. Ref: #407
This emulates more of git's Windows-specific behavior for launching interactive editors. When GIT_WINDOWS_NATIVE is defined, git uses `mingw_spawnvpe()` to spawn the editor which, in turn, calls a `parse_interpreter()`. The proposed editor command is run as-is if it has a .exe extension. Otherwise, the command path is opened, read, and parsed to find a shebang line with an interpreter path. This plays out in run-command.c and compat/mingw.c in Git's source code. The Windows CI is updated to set SHELL_PATH to something suitable for the msys2 environment; `/bin/sh` is **not** a viable path in this environment. Refs: #407
Hi @char101. With these recent changes to StGit and gix, I believe the StGit behaviors on Windows relevant to this issue are going to be different, and possibly better. But not being a Windows user, I'm really flying blind here. It would be helpful if you might try out the latest msi build from this action run. @Byron, I'd like to call your attention to the last commit I made to affect this problem (9329c3f). After integrating gix-command the obvious way in 048f182, everything was great on non-Windows platforms, but the Windows CI broke. In StGit's test suites, there are certain places where shell scripts are dynamically generated and set as I took a look at what git does in this situation and found that it goes the extra mile to try to run the editor by reading the editor executable/script and parsing the first line for a shebang. For StGit, I emulate this behavior. I imagine that gix-command may eventually want/need to do this as well to be at parity with git on Windows. |
Hi @jpgrayson, thanks for the update. I have tried running |
Thanks for taking it for a spin @char101. Much appreciated. I'll be cutting a proper StGit release with these changes in the near future. |
Thanks so much for sharing!
Indeed, that is something that |
This version of gix-command gains the ability to parse shebang lines on Windows. This replaces StGit code that did the same, but with perhaps more robustness. Refs: #407
Hi,
I tested running
stg init
(OS: Windows 10) and although I haveuser.name
anduser.email
configured, I got this message: error: committer identity unknown; please configureuser.name
anduser.email
.Looking at the source it should have found the config file at
HOME
.https://docs.rs/gix-config/0.34.0/src/gix_config/source.rs.html#103
For it to work I have to make a symlink from
USERPROFILE
toHOME
, which is not a big deal but the behavior does not conform to git behaviorThe text was updated successfully, but these errors were encountered: