-
Notifications
You must be signed in to change notification settings - Fork 0
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
error in post-checkout hook when switching from master to develop branch #1
Comments
Yeah, git hooks on Windows are a bit fun. We delegate to each subhook in the script, and while this works fine on Linux, the half-Linux environment git on Windows runs in chokes on it. The best solution is probably to throw out the bash stuff and subprocesses, use Python for the hooks (which should be cross platform). Some of the hooks are easier to implement as bash scripts, but it's probably not worth the pain. Until then, we have some hacks in place to try and make this stuff work, where we parse out the hashbang line and try to run the right thing, which apparently is not working. If you are on Windows 10 - the best solution would probably be to use git with the new Linux subsystem for Windows, but I doubt SourceTree can hook into that. I'll take a look at pushing this to pure-python when I get the chance. |
Hi Gareth thanks! Yes we are running Windows 10. Whenever you can get to enhancements for 10 it will help!
Meanwhile I am making it work as is -- already saved me with .meta files a couple times I think.
Thanks,
Matt
…On Dec 1, 2016 8:22 AM, Gareth Latty ***@***.***> wrote:
Yeah, git hooks on Windows are a bit fun. We delegate to each subhook in the script, and while this works fine on Linux, the half-Linux environment git on Windows runs in chokes on it. The best solution is probably to throw out the bash stuff and subprocesses, use Python for the hooks (which should be cross platform). Some of the hooks are easier to implement as bash scripts, but it's probably not worth the pain.
Until then, we have some hacks in place to try and make this stuff work, where we parse out the hashbang line and try to run the right thing, which apparently is not working.
If you are on Windows 10 - the best solution would probably be to use git with the new Linux subsystem for Windows, but I doubt SourceTree can hook into that.
I'll take a look at pushing this to pure-python when I get the chance.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEgzzNHm5NOot1NWfrd_5q1WJwKBwWCqks5rDsoXgaJpZM4LAwJ1>.
|
Here is what I see in SourceTree when I attempt to switch from Master to Develop (at this time there are tons of new unstaged changes in my working dir., if that matters). This is on Windows 10 using System Git version 2.10.1, after having followed all instructions on your unity-hooks repo for Windows:
=========================================
git -c diff.mnemonicprefix=false -c core.quotepath=false checkout develop
Your branch is up-to-date with 'origin/develop'.
Switched to branch 'develop'
Post-checkout hooks
Remove empty asset directories. x FAIL
%1 is not a valid Win32 application
Traceback (most recent call last):
File "C:\Users\mbrandt\AppData\Local\Programs\Python\Python35-32\lib\site-packages\envoy\core.py", line 214, in run
out, err = cmd.run(data, timeout, kill_timeout, env, cwd)
File "C:\Users\mbrandt\AppData\Local\Programs\Python\Python35-32\lib\site-packages\envoy\core.py", line 93, in run
raise self.exc
File "C:\Users\mbrandt\AppData\Local\Programs\Python\Python35-32\lib\site-packages\envoy\core.py", line 75, in target
cwd=cwd,
File "C:\Users\mbrandt\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in init
restore_signals, start_new_session)
File "C:\Users\mbrandt\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child
startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application
The text was updated successfully, but these errors were encountered: