User post receive hook is not firing when committing to SVN

I have a remote SVN repository synchronizing to GIT using SubGit 3.3.16. Everything seems to be working except the user-post-receive hook does not trigger when committing to SVN. It does work when committing to Git.

The “triggerSvnPostReceive” configuration option is enabled in the SubGit configuration file.

The Daemon log file indicates the following:

[2023-02-09 15:13:50.409][daemon][19] fetched: hash = c89f0e1673b31d2f655217332615bb8182b14ebc, branch = refs/svn/root/Trunk, revision = 22173
[2023-02-09 15:13:50.413][daemon][19] Updating latest fetched revision for svn-remote "svn" to r22173
[2023-02-09 15:13:50.451][daemon][19] Restoring refs to reflect SVN state.
[2023-02-09 15:13:50.474][daemon][19] Refs were successfully updated
[2023-02-09 15:13:50.474][daemon][19] Location 'D:\Gitea\data\gitea-repositories\test\test.git' fetch completed, fetch took 721 ms.
[2023-02-09 15:13:50.476][daemon][19] Unable to trigger the hook: D:\Gitea\data\gitea-repositories\test\test.git\hooks\user-post-receive; file is missing
[2023-02-09 15:13:50.476][daemon][19] Triggered user-post-receive hook with no output
[2023-02-09 15:13:50.476][daemon][19] Repository fetch completed, fetch took 723 ms.

According to the log, the user-post-receive hook file doesn’t exist. According to Windows File Explorer, it does. It also executes correctly when committing directly to the Git repository.

I have confirmed the daemon is running under the correct user account and that user has access to that file.

Hello!

On Windows SubGit expects to find *.bat hook scripts, so the issue probably is that the user-post-receiveis present, but expected user-post-receive.batis not, could it be the case?

My previous comments were inaccurate after doing some testing.

SubGit installed a bash script for both the pre-receive and post-receive hooks. It seems odd to me that SubGit would install bash scripts, but then expect to find .bat files when doing translating.

Regardless, I attempted to work around the issue by creating a user-pre-receive.bat and user-post-receive.bat file. These batch files simply pipe the input into bash.exe and execute the equivalent bash hook. For example, user-pre-receive.bat contains the following:

@findstr "^" | bash.exe .\hooks\user-pre-receive

I can now see the hook firing. It’s still failing, but due to issues with Gitea itself.

IMO if the user hooks are bash scripts and SubGit can find bash.exe, SubGit should execute it. Especially if it’s going to install bash scripts itself.

Thank you for your assistance.