<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 4/6/19 8:25 PM, Thomas De
Schampheleire wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAXf6LWUbSN4kaPxvvMnroUcMNgqetR_y4DeoG6ppcUX88cEMA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr"><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El jue., 4 abr. 2019 a las
0:41, Mads Kiilerich (<<a
href="mailto:mads@kiilerich.com" moz-do-not-send="true">mads@kiilerich.com</a>>)
escribió:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">> @@ -734,11 +738,11
@@ class ScmModel(object):<br>
> if not os.path.isdir(loc):<br>
> os.makedirs(loc)<br>
> <br>
> - tmpl_post = "#!/usr/bin/env %s\n" %
sys.executable or 'python2'<br>
> + tmpl_post = "#!/usr/bin/env %s\n" %
self._get_python_executable()<br>
<br>
<br>
Also, can you remind me (and perhaps clarify in code): #!
paths are only <br>
used on posix. How does this work on Windows? Or is that
covered by <br>
tribal "Don't use Git on Windows" knowledge? Especially:
With git having <br>
one hardcoded executable name for each hook, how does it
generally work <br>
finding the right hook script interpreter when Windows
doesn't use #! paths?<br>
</blockquote>
<div><br>
</div>
<div>After some searching, it seems that git hooks on
windows magically work with #!/bin/bash, and that to get
python hooks working you should create a shell wrapper
script.</div>
<div>See <a
href="https://stackoverflow.com/questions/9308119/git-cannot-execute-python-script-as-hook"
moz-do-not-send="true">https://stackoverflow.com/questions/9308119/git-cannot-execute-python-script-as-hook</a></div>
<div>So if this is correct (I was too lazy to test it now)
then git hooks don't work yet on windows anyway. We could
treat it as a future feature to implement, but as there is
no-one that requested it yet, I guess it's not a very high
priority.<br>
</div>
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>Does that mean we have to differentiate different kinds of Git -
msysgit and others?<br>
</p>
<p>Or should we for now realize that we don't really
support/recommend virtualenv if hosting Git on Windows? Or perhaps
ignore Git hosting on Windows for now? If we make that clear, some
things might be simpler.</p>
<p><br>
<blockquote type="cite">
<div class="gmail_quote">
<div>Hm, I now realize that it's actually dulwich and not git
that is invoked, but as far as I can see it is just invoking
the hook via subprocess, so I think the conclusion remains.<br>
</div>
</div>
</blockquote>
</p>
<p><br>
</p>
<p>The odd pygrack also plays an odd role in this. <br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAAXf6LWUbSN4kaPxvvMnroUcMNgqetR_y4DeoG6ppcUX88cEMA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
(Also, AFAIK, /usr/bin/env is really mainly for searching
in PATH so we <br>
don't have to specify full path. If we specify full paths,
it thus seems <br>
a bit wrong to use env? That is an old thing that we don't
have to care <br>
about now, but perhaps keep it in mind if it pops up now.)<br>
</blockquote>
<div><br>
</div>
<div>Yes, but if we fallback to 'python2' then we actually
need 'env'. So, maybe we should do something like
self.get_python_executable() or sys.executable or
'/usr/bin/env python2'.<br>
</div>
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>Yes, perhaps ideally something like that. But perhaps not
necessarily now.<br>
</p>
<p>/Mads<br>
</p>
</body>
</html>