Skip to content
  • Aaron Schrab's avatar
    push: Add support for pre-push hooks · ec55559f
    Aaron Schrab authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Add support for a pre-push hook which can be used to determine if the
    set of refs to be pushed is suitable for the target repository.  The
    hook is run with two arguments specifying the name and location of the
    destination repository.
    
    Information about what is to be pushed is provided by sending lines of
    the following form to the hook's standard input:
    
      <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
    
    If the hook exits with a non-zero status, the push will be aborted.
    
    This will allow the script to determine if the push is acceptable based
    on the target repository and branch(es), the commits which are to be
    pushed, and even the source branches in some cases.
    
    Signed-off-by: default avatarAaron Schrab <aaron@schrab.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    ec55559f