{"thread":{"id":"62214","subject":"Bug in git-gui","startedAt":"2024-09-29T17:05:35Z","lastAt":"2024-09-29T18:35:41Z","messageCount":4,"participants":["Clemens Haffner","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"503656","messageId":"69e3564e-3314-4a6e-b489-11a96022e08c@gmail.com","threadId":"62214","inReplyTo":null,"subject":"Bug in git-gui","fromName":"Clemens Haffner","fromEmail":"c.f.haffner@gmail.com","sentAt":"2024-09-29T17:05:32Z","receivedAt":"2024-09-29T17:05:35Z","isPatch":false,"sender":{"key":"c.f.haffner@gmail.com","avatar":null},"body":"Hi,\n\nI think I found a bug in git-gui on Windows (Windows 10 64 bit)\n\ngit-gui Version 0.21.GITGUI\ngit Version: 2.44.0.windows.1\n\nTo reproduce: (I have not tested it with rsa keys)\n\n- Create an ed25519 key with a passphrase (--> .ssh/id_ed25519). \nHelp->Show ssh key detects that key perfectly and shows the Public key \nto copy\n- Push something to a repository:\n--> it will fail.\n\n >  Pushing to xxx.xxx:clemens/test_repo.git\n >  CreateProcessW failed error:193\n >  ssh_askpass: posix_spawnp: Unknown error\n >  git@git.xxx.xxx: Permission denied (publickey).\n >  fatal: Could not read from remote repository.\n >\n >  Please make sure you have the correct access rights\n >  and the repository exists.\n\n- When using a key without a passphrase, it works perfectly well.\n- When using ssh-agent with a key that uses a passphrase, it also works \nwell.\n\n >  Pushing to git.xxx.xxx:clemens/test_repo.git\n >  To git.xxx.xxx:clemens/test_repo.git\n >   = [up to date]      rev1 -> rev1\n >  updating local tracking ref 'refs/remotes/origin/rev1'\n >  Everything up-to-date\n\nthis bug must be in git gui, as it works perfectly fine via git bash.\n\n\"git push\" spawns a new window, which asks for the passphrase. After \nentering the phrase git works as intended.\n\nIt seems to me that the git gui cant spawn that window where it asks for \nthe key.\n\nIf that helps:\nI'm using Microsofts OpenSSH implementation:\n\n >  $ ssh -V\n >  OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2\n\nGreetings,\nClemens Haffner\n\n\n\n\n"},{"id":"503657","messageId":"67cf0658-f0ee-f141-534c-3081b818545a@gmx.de","threadId":"62214","inReplyTo":"69e3564e-3314-4a6e-b489-11a96022e08c@gmail.com","subject":"Re: Bug in git-gui","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2024-09-29T17:43:07Z","receivedAt":"2024-09-29T17:43:10Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Clemens,\n\nOn Sun, 29 Sep 2024, Clemens Haffner wrote:\n\n> Hi,\n>\n> I think I found a bug in git-gui on Windows (Windows 10 64 bit)\n>\n> git-gui Version 0.21.GITGUI\n> git Version: 2.44.0.windows.1\n>\n> To reproduce: (I have not tested it with rsa keys)\n>\n> - Create an ed25519 key with a passphrase (--> .ssh/id_ed25519). Help->Show\n> ssh key detects that key perfectly and shows the Public key to copy\n> - Push something to a repository:\n> --> it will fail.\n>\n> >  Pushing to xxx.xxx:clemens/test_repo.git\n> >  CreateProcessW failed error:193\n> >  ssh_askpass: posix_spawnp: Unknown error\n> >  git@git.xxx.xxx: Permission denied (publickey).\n\nThis might be due to the `SSH_ASKPASS` environment variable pointing to a\nUnix-style path, but your SSH not being Unix-path-aware.\n\nCan you verify that your `SSH_ASKPASS` environment variable is set to\n`/mingw64/bin/git-askpass.exe`? If so, can you set it to `/c/Program\nFiles/Git/mingw64/bin/git-askpass.exe` instead and try again?\n\nCiao,\nJohannes\n\n> >  fatal: Could not read from remote repository.\n> >\n> >  Please make sure you have the correct access rights\n> >  and the repository exists.\n>\n> - When using a key without a passphrase, it works perfectly well.\n> - When using ssh-agent with a key that uses a passphrase, it also works well.\n>\n> >  Pushing to git.xxx.xxx:clemens/test_repo.git\n> >  To git.xxx.xxx:clemens/test_repo.git\n> >   = [up to date]      rev1 -> rev1\n> >  updating local tracking ref 'refs/remotes/origin/rev1'\n> >  Everything up-to-date\n>\n> this bug must be in git gui, as it works perfectly fine via git bash.\n>\n> \"git push\" spawns a new window, which asks for the passphrase. After entering\n> the phrase git works as intended.\n>\n> It seems to me that the git gui cant spawn that window where it asks for the\n> key.\n>\n> If that helps:\n> I'm using Microsofts OpenSSH implementation:\n>\n> >  $ ssh -V\n> >  OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2\n>\n> Greetings,\n> Clemens Haffner\n>\n>\n>\n>\n>\n>\n"},{"id":"503658","messageId":"d0c95c24-232f-196c-bf19-5f8ee89e246c@gmx.de","threadId":"62214","inReplyTo":"67cf0658-f0ee-f141-534c-3081b818545a@gmx.de","subject":"Re: Bug in git-gui","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2024-09-29T17:44:14Z","receivedAt":"2024-09-29T17:44:17Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Clements,\n\nOn Sun, 29 Sep 2024, Johannes Schindelin wrote:\n\n> On Sun, 29 Sep 2024, Clemens Haffner wrote:\n>\n> > I think I found a bug in git-gui on Windows (Windows 10 64 bit)\n> >\n> > git-gui Version 0.21.GITGUI\n> > git Version: 2.44.0.windows.1\n> >\n> > To reproduce: (I have not tested it with rsa keys)\n> >\n> > - Create an ed25519 key with a passphrase (--> .ssh/id_ed25519). Help->Show\n> > ssh key detects that key perfectly and shows the Public key to copy\n> > - Push something to a repository:\n> > --> it will fail.\n> >\n> > >  Pushing to xxx.xxx:clemens/test_repo.git\n> > >  CreateProcessW failed error:193\n> > >  ssh_askpass: posix_spawnp: Unknown error\n> > >  git@git.xxx.xxx: Permission denied (publickey).\n>\n> This might be due to the `SSH_ASKPASS` environment variable pointing to a\n> Unix-style path, but your SSH not being Unix-path-aware.\n>\n> Can you verify that your `SSH_ASKPASS` environment variable is set to\n> `/mingw64/bin/git-askpass.exe`? If so, can you set it to `/c/Program\n> Files/Git/mingw64/bin/git-askpass.exe` instead and try again?\n\nOh, make that `c:/Program Files/Git/mingw64/bin/git-askpass.exe`, i.e. a\nWindows-style path but with forward slashes as directory separators.\n\nCiao,\nJohannes\n\n> > >  fatal: Could not read from remote repository.\n> > >\n> > >  Please make sure you have the correct access rights\n> > >  and the repository exists.\n> >\n> > - When using a key without a passphrase, it works perfectly well.\n> > - When using ssh-agent with a key that uses a passphrase, it also works well.\n> >\n> > >  Pushing to git.xxx.xxx:clemens/test_repo.git\n> > >  To git.xxx.xxx:clemens/test_repo.git\n> > >   = [up to date]      rev1 -> rev1\n> > >  updating local tracking ref 'refs/remotes/origin/rev1'\n> > >  Everything up-to-date\n> >\n> > this bug must be in git gui, as it works perfectly fine via git bash.\n> >\n> > \"git push\" spawns a new window, which asks for the passphrase. After entering\n> > the phrase git works as intended.\n> >\n> > It seems to me that the git gui cant spawn that window where it asks for the\n> > key.\n> >\n> > If that helps:\n> > I'm using Microsofts OpenSSH implementation:\n> >\n> > >  $ ssh -V\n> > >  OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2\n> >\n> > Greetings,\n> > Clemens Haffner\n> >\n> >\n> >\n> >\n> >\n> >\n"},{"id":"503663","messageId":"f72b003b-a3fa-4750-82f2-96402053f56e@gmail.com","threadId":"62214","inReplyTo":"d0c95c24-232f-196c-bf19-5f8ee89e246c@gmx.de","subject":"Re: Bug in git-gui","fromName":"Clemens Haffner","fromEmail":"c.f.haffner@gmail.com","sentAt":"2024-09-29T18:35:18Z","receivedAt":"2024-09-29T18:35:41Z","isPatch":false,"sender":{"key":"c.f.haffner@gmail.com","avatar":null},"body":"Hi Johannes,\n\nyou were on the right track:\n\n- if I set the env variable (as a normal Windows Enviroinment variable) to\n\nc:/Program Files/Git/mingw64/bin/git-askpass.exe\n\nthe GUI does indeed (almost) work as intended.\nAlmost, because while git-askpass is running, a console window is open \nin the background. ssh works though.\n\n- however, with the variable set to this, git bash does not work anymore \n(waits infinitely on commands like \"git push\").\nIt doesnt even work when set to mingw-style\n\n/c/Program Files/Git/mingw64/bin/git-askpass.exe\n\n- If I start git-gui from within the mingw bash, it does even work \nwithout the variable set. (The console window still appears though).\n\nSo, to fix this git-gui needs to be aware of the enviroinment variable \nwhen launched through the start menu.\n\nI'm not familiar with the source code, but I guess\n\ngit-gui/windows/git-gui.sh\n\nwould be the file that is responsible for that.\n\nGreetings,\n\nClemens\n\nAm 29.09.2024 um 19:44 schrieb Johannes Schindelin:\n> Hi Clements,\n>\n> On Sun, 29 Sep 2024, Johannes Schindelin wrote:\n>\n>> On Sun, 29 Sep 2024, Clemens Haffner wrote:\n>>\n>>> I think I found a bug in git-gui on Windows (Windows 10 64 bit)\n>>>\n>>> git-gui Version 0.21.GITGUI\n>>> git Version: 2.44.0.windows.1\n>>>\n>>> To reproduce: (I have not tested it with rsa keys)\n>>>\n>>> - Create an ed25519 key with a passphrase (--> .ssh/id_ed25519). Help->Show\n>>> ssh key detects that key perfectly and shows the Public key to copy\n>>> - Push something to a repository:\n>>> --> it will fail.\n>>>\n>>>>    Pushing to xxx.xxx:clemens/test_repo.git\n>>>>    CreateProcessW failed error:193\n>>>>    ssh_askpass: posix_spawnp: Unknown error\n>>>>    git@git.xxx.xxx: Permission denied (publickey).\n>> This might be due to the `SSH_ASKPASS` environment variable pointing to a\n>> Unix-style path, but your SSH not being Unix-path-aware.\n>>\n>> Can you verify that your `SSH_ASKPASS` environment variable is set to\n>> `/mingw64/bin/git-askpass.exe`? If so, can you set it to `/c/Program\n>> Files/Git/mingw64/bin/git-askpass.exe` instead and try again?\n> Oh, make that `c:/Program Files/Git/mingw64/bin/git-askpass.exe`, i.e. a\n> Windows-style path but with forward slashes as directory separators.\n>\n> Ciao,\n> Johannes\n>\n>>>>    fatal: Could not read from remote repository.\n>>>>\n>>>>    Please make sure you have the correct access rights\n>>>>    and the repository exists.\n>>> - When using a key without a passphrase, it works perfectly well.\n>>> - When using ssh-agent with a key that uses a passphrase, it also works well.\n>>>\n>>>>    Pushing to git.xxx.xxx:clemens/test_repo.git\n>>>>    To git.xxx.xxx:clemens/test_repo.git\n>>>>     = [up to date]      rev1 -> rev1\n>>>>    updating local tracking ref 'refs/remotes/origin/rev1'\n>>>>    Everything up-to-date\n>>> this bug must be in git gui, as it works perfectly fine via git bash.\n>>>\n>>> \"git push\" spawns a new window, which asks for the passphrase. After entering\n>>> the phrase git works as intended.\n>>>\n>>> It seems to me that the git gui cant spawn that window where it asks for the\n>>> key.\n>>>\n>>> If that helps:\n>>> I'm using Microsofts OpenSSH implementation:\n>>>\n>>>>    $ ssh -V\n>>>>    OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2\n>>> Greetings,\n>>> Clemens Haffner\n>>>\n>>>\n>>>\n>>>\n>>>\n>>>\n"}]}