<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/7/19 9:23 AM, Thomas De
Schampheleire wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAXf6LWQ0O+=k1nzzO+K53P9RDTQppi3Vyfu=uCZiTSB+_38yA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<blockquote type="cite">
<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"> Can we
somehow make it show a more useful error
message in this case? I <br>
guess not - none of our code is executed ...<br>
</blockquote>
<div><br>
</div>
<div>Actually, there is some of our code
executed: SimpleGit. But, at that point you
don't know that the git hook call is going to
fail.<br>
</div>
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>First: Since we install Git hooks in the file system,
they will also be invoked if someone push directly.
That may or may not be a feature, but we have to
handle it.</p>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">I don't think this is a valid argument: for
mercurial repos the hooks are not installed on the file
system. Direct pushing is not supported.</div>
</div>
</blockquote>
<p><br>
</p>
<p>I would say that direct pushing for Mercurial repos is supported,
in the sense that Kallithea doesn't modify repos at all and
doesn't prevent it. After direct pushes, you might want to run
repo-update-metadata to let Kallithea know about it.<br>
</p>
<p>With Git hooks installed into the repos, I think we kind of have
a responsibility to make sure they work in all cases, without
error messages. If not, users might get the impression that
Kallithea "destroyed" their repositories. I don't know if I would
prefer that the hook did nothing if not invoked from Kallithea, or
if it would be fine if it did logging etc, even though we don't
have that with Mercurial.<br>
</p>
<p>We could perhaps just decide that it is no big deal and ignore
that aspect.</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAAXf6LWQ0O+=k1nzzO+K53P9RDTQppi3Vyfu=uCZiTSB+_38yA@mail.gmail.com">
<div dir="auto">
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p> </p>
<p>We kind of *have* to run something inside the hook.
That is the only way to know exactly what is pushed
(or pulled). If we want branch access control, it
will(!?) also have to run inside hooks.<br>
</p>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Knowing what was pushed and what not is a more
convincing argument. But how do we know this in mercurial?
Does mercurial tell us, or do we find out? Is it
impossible/fragile to do the same in git?</div>
</div>
</blockquote>
<p><br>
</p>
<p>Yes, the Mercurial hook tells us when the log_push_action hook is
invoked.</p>
<p>Git does the same, but it is a bit more work, both because the
data model and hooks are different, and because it is a separate
process. Thus we have the git hook which calls into
handle_git_post_receive .</p>
<p>(I think it will be more readable in the future as <br>
<a class="moz-txt-link-freetext" href="https://kallithea-scm.org/repos/kallithea-incoming/files/d9c3498964118a7fe6e484572d8c88f85118398f/kallithea/lib/hooks.py#L102">https://kallithea-scm.org/repos/kallithea-incoming/files/d9c3498964118a7fe6e484572d8c88f85118398f/kallithea/lib/hooks.py#L102</a><br>
<a class="moz-txt-link-freetext" href="https://kallithea-scm.org/repos/kallithea-incoming/files/d9c3498964118a7fe6e484572d8c88f85118398f/kallithea/lib/hooks.py#L344">https://kallithea-scm.org/repos/kallithea-incoming/files/d9c3498964118a7fe6e484572d8c88f85118398f/kallithea/lib/hooks.py#L344</a>
)</p>
<br>
<blockquote type="cite"
cite="mid:CAAXf6LWQ0O+=k1nzzO+K53P9RDTQppi3Vyfu=uCZiTSB+_38yA@mail.gmail.com">
<div dir="auto">
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p> </p>
<p>Summarizing: I don't think that is feasible. But if
it is, it will not be simple. Not suitable for the
stable branch.</p>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Ok. But when deciding what to do on the stable
branch, I think it makes sense to have an idea what we'll do
for default. I think we should avoid introducing user visible
changes like ini settings if they will not apply on default.</div>
</div>
</blockquote>
<p><br>
</p>
<p>Agreed. But I don't think it is feasible to stop using hooks, so
in either case, we have to make sure they work. This fix is thus
important and sound: We have to make sure the Git hooks use the
right interpreter. <br>
</p>
<p>/Mads<br>
</p>
</body>
</html>