[PATCH for comments] configure: install a whitespace checking pre-commit hook for developers

Martin Schwenke martin at meltin.net
Tue Apr 17 23:14:07 UTC 2018


On Wed, 11 Apr 2018 11:59:45 +0200, Ralph Böhme via samba-technical
<samba-technical at lists.samba.org> wrote:

> On Wed, Apr 11, 2018 at 10:04:32AM +0200, Stefan Metzmacher wrote:
> > Am 11.04.2018 um 08:24 schrieb Ralph Böhme via samba-technical:  
> > > On Wed, Apr 11, 2018 at 07:48:43AM +0200, Ralph Böhme wrote:  
>  [...]  
> > > 
> > > just noticed that this version will fail if you git rebase to a version of the
> > > tree that doesn't have the patchset but the git-hook is in place.
> > > 
> > > Attached patchset has an additional check in the hook:
> > > 
> > > +if [ ! -f ${gitdir}/script/git-hooks/pre-commit-script ] ; then                                     
> > > +    exit 0                                       
> > > +fi                                               
> > > +   
> > 
> > Why is unset GIT_LITERAL_PATHSPECS not needed in 'pre-commit-script',  
> 
> ??? I guess you meant "why is it needed in 'pre-commit-script'" ? It's needed
> there because we want to remove it from the environment that later gets passed
> to any other shell script.
> 
> > but not in 'pre-commit-hook'?  
> 
> Because git rev-parse doesn't suffer from the issue described in the issue
> tracker.
> 
> Being in the script and not in the installed hook, we can later revisit this
> workaroung for the magit issue.
> 
> > I'd also prefer to have 'set -e' and 'set -u' in (at least)
> > pre-commit-hook, before it gets install widely.  
> 
> Added to both hook and script.
> 
> Updated patch attached, please push if happy. Thanks!

I notice this hasn't gone in yet.  Metze, are you happy with it?

Thanks...

peace & happiness,
martin



More information about the samba-technical mailing list