On Wed, 4 Sep 2013 07:15:43 -0700 (PDT)
Ling <oylf1...@gmail.com> wrote:

> I think what we want to have a hook that on the server repository to 
> prevent the local pushes, so I think if we using git log on the
> server repo, this won't protect us

Why?  Using a pre-receive hook to check what has been pushed is the
right way to go: as I have written in my first mail to this thread, it
suffices to quit the hook with a non-zero exit code to make the push
operation abort; everything you'll write to the standard output stream
of a process executing as this hook will be delivered to the pushing
client (and supposedly shown there).

> since git log is only created after local pushes, right?

No.  "The git log" does not exist.  A Git repository is a directed
acyclic graph (DAG) of interliked commits; this graph has several named
entry points which are named "refs" -- these are branches and tags.
Each ref points to a commit object, and each commit object references
one or more parent commit objects -- thus forming a DAG.

The `git log` program takes a revision specification which tells it
which commits it should select from the whole DAG, it then traverses
this selection of commits (this process might be controlled by various
command-line options passed to `git log`) and outputs certain
information about each commit as it walks.

Let's reiterate: there's no such thing as "a log" -- it's a purely
synthetic thing which is produced by `git log` each time you call it,
and what it produces depends heavily on the command-line arguments used
to call `git log`.

> and also since when our developers clone
> the repo to theri locals, and hooks won't be cloned, so we need to
> have a way to check each developers push to protect our server repo
> to have the correct codes. So do you have any suggestion on how we
> can have this ? 

You're on the right track.
The problem is that you seem to just have bypassed all the text I've
written in my mail, without analysing it and possibly refining your
question, and asked the same questions again for the third time.

This is not at all constructive.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to