git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Adam" <thomas.adam22@gmail.com>
To: "Ping Yin" <pkufranky@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: git and peer review
Date: Sat, 3 May 2008 14:54:12 +0100	[thread overview]
Message-ID: <18071eea0805030654j42c21212wd1ccf4df42662000@mail.gmail.com> (raw)
In-Reply-To: <46dff0320805021802i1a29becflcae901315035a77d@mail.gmail.com>

On 03/05/2008, Ping Yin <pkufranky@gmail.com> wrote:
>  I am in a company environment and i want to enforce a policy that
>  every commit must be reviewed before pushed to central repository. I
>  think i can use hooks to enforce such kind of policy.

This sounds likely, yes.

>  One way i want to try is to check in the hook whether every pushed
>  commit has a "Reviewed-by " line .  Any suggestion?

Assuming this is enforced either through a template (see:
commit.template in git-config(1)), or as part of being added by the
committer, then in GIT 1.5.4 onwards there's a commit-msg hook which
will do this for you.  Something like:

test "" = "$(grep '^Reviewed-by: ')" || {
    echo >&2 "Message must have a Reviewed-by line present."
    exit
}

>  And one question, how to add a "Reviewed-by" line automatically?

There's an example of that by way of a SOB in the commit-msg hook.

-- Thomas Adam

  reply	other threads:[~2008-05-03 13:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03  1:02 git and peer review Ping Yin
2008-05-03 13:54 ` Thomas Adam [this message]
2008-05-03 14:03   ` Ping Yin
2008-05-03 14:22     ` Frodo Baggins
2008-05-03 14:27       ` Ping Yin
2008-05-04 20:21 ` Toby Allsopp
2008-05-05  0:52   ` Ping Yin
2008-05-05 13:48   ` Karl Hasselström
2008-05-17 21:30   ` Seth Falcon
2008-05-19  3:37     ` Shawn O. Pearce
2008-05-19 14:10       ` Seth Falcon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18071eea0805030654j42c21212wd1ccf4df42662000@mail.gmail.com \
    --to=thomas.adam22@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pkufranky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).