-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
Unable to parse git version on windows - git version 2.42.0.windows.2 #2686
Comments
At first sight this looks like two separate issues. But both should be fixed. |
See gopasspw#2686 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* [bugfix] Improve git version parsing See #2686 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix lint issues Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> --------- Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
I wonder if this is really fixed in the linked PR @dominikschulz :
This isn't a Windows path at all. Should we look elsewhere for system config on Windows? |
That is correct. This path does certainly not exist on Windows. |
The gitconfig package was incorrectly using gopass specific locations when trying to load global (per user) git configs. This change makes it use the correct locations. Fixes gopasspw#2686 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* [bugfix] Fix loading of git configs The gitconfig package was incorrectly using gopass specific locations when trying to load global (per user) git configs. This change makes it use the correct locations. Fixes #2686 Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix typo Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix linter issues Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> * Fix failing tests Those started to fail because we are now correctly reading global git configs. Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> --------- Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Summary
The git version ( installed git portable, git version 2.42.0.windows.2 ) is not recognized by go pass, probably due to this - global gitconfig isn't read, in particular - user.email and user.name from gitconfig are not evaluated
Steps To Reproduce
set GOPASS_DEBUG=Y
gopass init --store pass_test
Output:
🍭 Initializing a new password store ...
2023/11/05 23:12:22.421286 gitconfig/configs.go:67 gitconfig.(*Configs).LoadAll Loading gitconfigs for &{Preset: system:0xc000e52940 global:0xc000e52980 local:0xc000e529c0 worktree:0xc000e52a00 env:0xc000e52a40 workdir: SystemConfig:/etc/gitconfig GlobalConfig:.gitconfig LocalConfig:config WorktreeConfig:config.worktree EnvPrefix:GIT_CONFIG NoWrites:false} ...
2023/11/05 23:12:22.421286 gitconfig/configs.go:73 gitconfig.(*Configs).LoadAll failed to load system config: open /etc/gitconfig: Das System kann den angegebenen Pfad nicht finden.
2023/11/05 23:12:22.421837 gitconfig/configs.go:156 gitconfig.(*Configs).loadGlobalConfigs loaded global config from C:\Users<username>\AppData\Roaming\gopass\config
2023/11/05 23:12:22.421837 gitconfig/configs.go:196 gitconfig.(*Configs).Get no value for user.name found
2023/11/05 23:12:22.421837 gitconfig/configs.go:67 gitconfig.(*Configs).LoadAll Loading gitconfigs for &{Preset: system:0xc000e52b40 global:0xc000e52b80 local:0xc000e52bc0 worktree:0xc000e52c00 env:0xc000e52c40 workdir: SystemConfig:/etc/gitconfig GlobalConfig:.gitconfig LocalConfig:config WorktreeConfig:config.worktree EnvPrefix:GIT_CONFIG NoWrites:false} ...
2023/11/05 23:12:22.422389 gitconfig/configs.go:73 gitconfig.(*Configs).LoadAll failed to load system config: open /etc/gitconfig: Das System kann den angegebenen Pfad nicht finden.
2023/11/05 23:12:22.422932 gitconfig/configs.go:156 gitconfig.(*Configs).loadGlobalConfigs loaded global config from C:\Users<username>\AppData\Roaming\gopass\config
2023/11/05 23:12:22.422932 gitconfig/configs.go:196 gitconfig.(*Configs).Get no value for user.email found
2023/11/05 23:12:22.422932 root/init.go:18 root.(*Store).IsInitialized initializing store and possible sub-stores
2023/11/05 23:12:22.423477 root/init.go:79 root.(*Store).initialize initialize - C:\Users<username>\AppData\Local\gopass\stores\root
2023/11/05 23:12:22.423527 leaf/store.go:52 leaf.New Instantiating "" at "C:\Users\\AppData\Local\gopass\stores\root"
2023/11/05 23:12:22.423527 backend/storage.go:59 backend.DetectStorage Trying requested gitfs for C:\Users<username>\AppData\Local\gopass\stores\root
2023/11/05 23:12:22.423527 fsutil/fsutil.go:36 fsutil.ExpandHomedir No tilde found in C:\Users<username>\AppData\Local\gopass\stores\root
2023/11/05 23:12:22.424626 fsutil/fsutil.go:36 fsutil.ExpandHomedir No tilde found in C:\Users<username>\AppData\Local\gopass\stores\root
2023/11/05 23:12:22.425170 gitconfig/configs.go:67 gitconfig.(*Configs).LoadAll Loading gitconfigs for &{Preset: system:0xc000e52d80 global:0xc000e52dc0 local:0xc000e52e00 worktree:0xc000e52e40 env:0xc000e52e80 workdir:C:\Users<username>\AppData\Local\gopass\stores\root.git SystemConfig:/etc/gitconfig GlobalConfig:.gitconfig LocalConfig:config WorktreeConfig:config.worktree EnvPrefix:GIT_CONFIG NoWrites:false} ...
2023/11/05 23:12:22.425170 gitconfig/configs.go:73 gitconfig.(*Configs).LoadAll failed to load system config: open /etc/gitconfig: Das System kann den angegebenen Pfad nicht finden.
2023/11/05 23:12:22.425793 gitconfig/configs.go:156 gitconfig.(*Configs).loadGlobalConfigs loaded global config from C:\Users<username>\AppData\Roaming\gopass\config
2023/11/05 23:12:22.435192 gitconfig/configs.go:98 gitconfig.(*Configs).LoadAll loaded local config from C:\Users<username>\AppData\Local\gopass\stores\root.git\config
2023/11/05 23:12:22.435780 gitconfig/configs.go:109 gitconfig.(*Configs).LoadAll failed to load worktree config from C:\Users<username>\AppData\Local\gopass\stores\root.git\config.worktree: open C:\Users<username>\AppData\Local\gopass\stores\root.git\config.worktree: Das System kann die angegebene Datei nicht finden.
2023/11/05 23:12:22.436290 backend/storage.go:62 backend.DetectStorage Using requested gitfs for C:\Users<username>\AppData\Local\gopass\stores\root
2023/11/05 23:12:22.583478 gitfs/git.go:185 gitfs.(*Git).Version Failed to parse "2.42.0.windows.2" as semver: Invalid character(s) found in patch number "0.windows.2"
2023/11/05 23:12:22.584080 leaf/store.go:64 leaf.New Storage for => C:\Users<username>\AppData\Local\gopass\stores\root initialized as gitfs(0.0.0,path:C:\Users<username>\AppData\Local\gopass\stores\root)
Expected behavior
global gitconfig is read and gopass init don't ask for git.username and git.email (by setting respective environment variables - it works as expected though)
Environment
os version: windows 11 22H2 build 22621.2506
gopass 1.15.8 go1.20.7 windows amd64 (installed via scoop install gopass)
Additional context
probably related to the issue #214
The text was updated successfully, but these errors were encountered: