gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Issue with commit on Windows

Open jdfa opened this issue 3 years ago • 9 comments

Describe the bug Trying to perform my first commit using gitui, getting such error:

Error
commit error:
io error:program not found

Line from log: [ERROR] hookspath error: config value 'core.hooksPath' was not found; class=Config (7); code=NotFound (-3)

To Reproduce Steps to reproduce the behavior:

  1. Stage some changes.
  2. C for commit command.
  3. Type commit message.
  4. Enter.
  5. Error.

Expected behavior Completed commit or more verbose error message.

Screenshots image

Context (please complete the following information):

  • Windows 10
  • GitUI 0.22.1

jdfa avatar Dec 06 '22 13:12 jdfa

do you use ny git commit hooks?

extrawurst avatar Dec 06 '22 14:12 extrawurst

Yes, I do. It is pre-commit hook which validates that I am not committing TODO comments. But it should pass that specific commit.

jdfa avatar Dec 06 '22 14:12 jdfa

Can you share the path of the hook and the content of the script? also tell me if you use core.hooksPath and if so how it is configured

extrawurst avatar Dec 06 '22 14:12 extrawurst

I am not using hooksPath setting. Hook itself is located inside .git folder, path: repoRoot/.git/hooks/pre-commit. Hook itself is redirecting to powershell script, located in common folder:

#!/bin/sh

echo
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File 'D:\ps\hook.ps1'
exit

Just to be complete, here is content of hook.ps1:

if((git diff --cached) -like "*TODO*"){
    Write-Output "TODO is present in pending changes, commit rejected"
    exit 1
}

It works fine with git command, also handled properly with VisualStudio Git integration.

jdfa avatar Dec 06 '22 14:12 jdfa

that is an interesting setup. that's likely to be the problem. I have no test for such thing

extrawurst avatar Dec 06 '22 15:12 extrawurst

@extrawurst I repro'd this using 0.22.1 but its fine in master head. I think it was fixed by https://github.com/extrawurst/gitui/pull/1532,

pm100 avatar May 15 '23 15:05 pm100

Let’s see after next release then

extrawurst avatar May 15 '23 15:05 extrawurst

@extrawurst - ignore that last message, bug seems to be back (I'm probably trying to do too many thigns at once!)

pm100 avatar May 15 '23 15:05 pm100

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 15 '23 06:12 stale[bot]