title: Git rebase and push during pre-push hook
body: <p>During a <code>git push</code>, I know it's possible to cancel the push using the <code>pre-push</code> hook and exiting the script with a non-zero exit code.</p>
  
  <p>Using a <code>pre-push</code> hook, I would like to intercept the current push, conditionally rebase, and then push the rebased tree (or the original if no rebase was needed). Is that possible?</p>