[petsc-dev] [petsc-users] MatMPIBAIJSetPreallocationCSR i and j indices

Jed Brown jedbrown at mcs.anl.gov
Mon Sep 30 13:17:29 CDT 2013


"Andrs, David" <david.andrs at inl.gov> writes:

>> ​If you put this little "script" into .git/hooks/pre-commit, it will do it:
>>
>
> ​Sorry, too fast​. Here is the script:
>
> branch_name=$(git symbolic-ref -q HEAD)
> if [ "$branch_name" == "refs/heads/maint" ] || [ "$branch_name" ==
> "refs/heads/next" ]
> then
>   echo "Trying to commit to into " $branch_name ". This is normally not
> desireable."
>   exit 1
> fi
>
> exit 0

Good call.  The error message can provide instructions for moving the
changes into a branch.

> ​Not quite sure how to prevent that branching off of next.

Just refuse non-merge commits if "git log HEAD..next" is empty, and give
instructions to

  $ git stash
  $ git checkout -b user/new-feature master
  $ git stash pop

Presumably merge commits can be identified by the presence of
MERGE_HEAD.

> The rest of the checks can probably go into pre-commit hook as well.
>
> The only problem is that it is a client side script, so it will not get
> cloned from the central repo (AFAIK).​

My inclination would be to put it in an orphan branch within the
repository and have a bin/maint/update-petsc-hooks that installs/updates
the hooks.  That way we can maintain the hooks without putting them in a
totally separate repository.  The hooks themselves could check the
'origin/hooks' branch to check whether it is out of date.  Since a
normal "git fetch" updates all branches, we'll know about updates
without having to ping a remote server.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130930/9fad0e4b/attachment.sig>


More information about the petsc-dev mailing list