All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Francis Moreau <francis.moro@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Advices to imlement update hook
Date: Wed, 09 Feb 2011 17:38:18 +0100	[thread overview]
Message-ID: <4D52C2FA.2030103@viscovery.net> (raw)
In-Reply-To: <AANLkTimdsCgNBAnJmnzGj3M3Q4RPb==fiWu1+ZQhWenO@mail.gmail.com>

Am 2/9/2011 17:27, schrieb Francis Moreau:
> Hi !
> 
> I'd like to restrict access to one of my repos: the project tracked by
> it has several directories: a/ b/ c/ and I'd like to allow only
> modifications happen in b/ directory.
> 
> I'm planning to use git hooks, not sure which one I should use: if the
> check should happen at the commit or push time or both.
> 
> For now I'm going to use the update hook, so it will happen when pushing.
> 
> Now the question is: what is the best way to do this ?
> 
> I'm planning to use something equivalent to "git-diff-tree oldref
> newref | { grep -v b || exit 1; }" but doesn't look like the best git
> way.
> 
> BTW, from the git-diff-tree manpage:
> 
> 	<path>...
> 	    If provided, the results are limited to a subset of
> 	    files matching one of these prefix strings. i.e., file
> 	    matches /^<pattern1>|<pattern2>|.../ Note that this
> 	    parameter does not provide any wildcard or regexp
> 	    features.
> 
> What does it mean exactly ? what does 'pattern' word mean if wildcard
> or regexp is not supported ?
> I also tried:
> 
>    git diff-tree <oldref> <newref> -- ^b || exit 1
> 
> but it doesn't work.

  git diff-tree --quiet <oldref> <newref> -- b

  reply	other threads:[~2011-02-09 16:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 16:27 Advices to imlement update hook Francis Moreau
2011-02-09 16:38 ` Johannes Sixt [this message]
2011-02-09 16:42   ` Johannes Sixt
2011-02-09 16:51     ` Francis Moreau
2011-02-09 17:05       ` Jeff King
2011-02-10 13:24         ` Francis Moreau

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=4D52C2FA.2030103@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=francis.moro@gmail.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.