git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add a 'pre-push' hook

From
しらいしななこ <nanako3@lavabit.com>
Date
Aug 19, 2008, 21:26 UTC
Message-ID
<20080820062636.6117@nanako3.lavabit.com>
In-Reply-To
<d411cc4a0808191326s35a56c1i2e20d82e3885298@mail.gmail.com>
Quoting Scott Chacon <schacon@gmail.com>:
Show 27 quoted lines
> On Tue, Aug 19, 2008 at 12:59 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
>> Jeff King <peff@peff.net> wrote:
>>>
>>> One other argument I have seen is that, to prevent the proliferation of
>>> hooks, the rule is not to add a hook that could just as easily be done
>>> as a sequence of commands. IOW, what's wrong with
>>>
>>>   run_my_automated_tests && git push
>>
>> Yup, I agree completely.
>>
>> Why not just setup an alias:
>>
>>        git config alias.send '! run_my_tests && git push "$@"'
>>
>> and retrain your fingers to use "git send ..."?
>
> Sorry, but couldn't this argument be made about any of the hooks run
> after manual operations?  ie: pre-commit, pre-applypatch, commit-msg,
> post-commit, post-applypatch?  I mean, couldn't you do :
>
> git config alias.docommit '! do_pre_commit && git commit ...' ?
>
> I thought the point of these kind of hooks was to make stuff like this
> automatic and easy to standardize for a project, so people working on
> a dozen git repos don't have to remember all the aliases they set up
> in each one.
This topic seems to come up every once in a while.
 http://thread.gmane.org/gmane.comp.version-control.git/70781/focus=71069
 http://thread.gmane.org/gmane.comp.version-control.git/79306/focus=79321
Somebody needs to describe the general rules in SubmittingPatches, perhaps?
I do not understand why Junio said he thinks this pre-push hook is a good idea.  This clearly is "you always would want to do before running a git command" case.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Scott ChaconNext: Scott Chacon
Message 7 of 15 in “add a 'pre-push' hook”
  1. add a 'pre-push' hookScott Chacon, Aug 19, 2008
  2. Jeff KingAug 19, 2008
  3. Scott ChaconAug 19, 2008
  4. Jeff KingAug 19, 2008
  5. Shawn O. PearceAug 19, 2008
  6. Scott ChaconAug 19, 2008
  7. しらいしななこAug 19, 2008
  8. Scott ChaconAug 19, 2008
  9. Junio C HamanoAug 19, 2008
  10. Sam VilainAug 19, 2008
  11. Jeff KingAug 20, 2008
  12. Junio C HamanoAug 19, 2008
  13. Scott ChaconAug 19, 2008
  14. Junio C HamanoAug 19, 2008
  15. Shawn O. PearceAug 19, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.