Closed Beniamin-Dolega closed 2 years ago
Given that you @mkondratek will soon switch to Windows for a moment, this might be a good occasion to check. It'll be mostly a matter of making sure that com.virtuslab.gitmachete.backend.impl.hooks.StatusBranchHookExecutor#executeHookFor
properly launches .git/hooks/machete-status/branch
as a Bash script... TBD how to ensure that on Windows.
Actually, would be good to check how e.g. JGit launches git hooks: org.eclipse.jgit.hooks.GitHook#doRun
seems a good place to start (org.eclipse.jgit.util.FS_Win32_Cygwin#runInShell
FTW) — maybe actually delegating execution of hooks to JGit (via GitCoreRepository
) would be the best solution here, to make both backendImpl:test
and hooks in the actual execution of the plugin work.
The problem with the hook on windows comes from subprocess creation. There we need to run bash script but we do not know if the user actually uses some git bash (or any other tool enabling that).
Not a solution but I improved code and error handling a bit: https://github.com/VirtusLab/git-machete-intellij-plugin/pull/822
testCommon/src/test/resources/common.sh:39
Make this four lines of code (40-43) work on windows.