[ofiwg] linux coding style question, or what is the libfabric interpretation of "resembles"

Blocksome, Michael michael.blocksome at intel.com
Wed Mar 11 07:47:56 PDT 2015


> 
> On Mar 10, 2015, at 4:08 PM, Patrick MacArthur <pmacarth at iol.unh.edu>
> wrote:
> 
> > +1 the use of pre-commit hook and a similar automated check on all pull
> > requests
> >
> > On 03/10/2015 04:51 PM, Dave Goodell (dgoodell) wrote:
> >> If you really mean "pre-commit hooks" in the Git sense (local hook
> >> scripts that run during "git commit" and don't let it succeed if the
> >> script fails), then I don't think there's a way to have one of those
> >> installed automatically for someone just by cloning the repository.
> >> We could stick it in a "contrib" directory and ask developers to
> >> copy/link the script into their ".git/" directories whenever they
> >> clone a new repository, but that's far from a robust solution.  You
> >> could use a "template" (see http://git-scm.com/docs/git-init) to make
> >> it a little easier, but there will still be a manual step.
> >
> > FWIW in UNH EXS, I added code to the autogen.sh script which copies the
> > pre-commit hook script into place (which itself lives in the UNH EXS git
> > repository).  This isn't foolproof, but means that most users will get
> > the hook automatically when they first attempt to build a fresh clone.
> 
> What do you do if the user already has a pre-commit hook in place?  Do you
> fail, complain loudly, install the script in such a way that it chains, or
> something else?  Clobbering an existing user script wouldn't be very friendly.
> 
> -Dave

And what if there are multiple remotes in the git repository .. does the pre-commit hook run for all of them? And if someone clones your clone of the top level ofi git repository? How about a git repository created with git-init and then later the ofi remote is added with git-remote?

These pre-commit hooks are inherently out of your control as they are specific to each distributed git repository. We could offer help in setting up the pre-commit hooks for the convenience of the developer, but eventually all of the heavy lifting has to be done on the server - either as a pre-receive hook or some other kind of check on pull requests.

I agree that clobbering existing local hooks is not very nice. And, IMHO, a manual step to set up this convenience isn't unreasonable.

--mike



More information about the ofiwg mailing list