Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: thoughts on a possible "pre-upload" hook

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:47:26

merlyn@stonehenge.com (Randal L. Schwartz) writes:
quoted
quoted
quoted
quoted
quoted
"Sitaram" == Sitaram Chamarty [off-list ref] writes:
Sitaram> Hello,
Sitaram> As git is used more and more in corporate-type environments, at some
Sitaram> point it becomes convenient to have *branches* (or more accurately,
Sitaram> refs) that are not readable.  The simplest way to do this (from git's
Sitaram> point of view) is to allow a "pre-upload" hook, rather like the
Sitaram> "pre-receive" hook or "update" hook.

It would seem that you would need to do this even before the commit.  So
you're looking for the pre-commit hook.  Otherwise, the commit is invalid,
because it doesn't accurately represent everything it references.  And the
commit is the unit of transfer between repos.
I don't get the point. The OP's question is not about commiting, but
about preventing a branch from being fetched. So, right before sending
the commits in a branch, the server would execute a hook, and fail if
it's not allowed.

But that alone would make it rather painfull for the user : "git
clone" would fail if any branch in the repository is not readable, for
example.

Also, don't forget that branches are just references, which means that
if you prevent reference A from being uploaded, then another reference
B may point to the same commits as A, and then you can bypass the
safety hook on A by using B.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help