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

Re: cherry-pick / pre-commit hook?

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 28, 2010, 22:38 UTC
Message-ID
<m3vd2djzhp.fsf@localhost.localdomain>
In-Reply-To
<7vy679wynd.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> I think the basic direction could be (I haven't thought things through,
> just a strawman):
> 
>  - Allow --verify/--no-verify to all commands that possibly create a new
>    commit, and run pre-commit hook where an updated index is about to be
>    made into a commit (for some commands this may not be very easy);
> 
>  - The guideline of picking the default would probably look like this:
> 
>    (1) for existing commands, keep the current behaviour;
> 
>    (2) for a new command, --verify should be the default if the command is
>        primarily about letting the user do what s/he would/could/should
>        have done as "git commit" in the first place (e.g. cherry-picking
>        one's own commit from a separate branch or rebasing one's own
>        unpublished branch on top of updated upstream), and --no-verify
>        otherwise (i.e. taking other's work and using it in a context
>        different from the original).

Does it mean that for now (and perhaps also for later) it means that "git commit" by default runs pre-commit hook, unless one use --no-verify, and that all comands that create a new commit (rebase, cherry-pick, revert, merge/pull) can request for pre-commit hook to be run (if they create commit) with --verify?

I think it is a very good idea, though I don't know how difficult it would be to make all commands that can create commit accept --verify..

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Dave Abrahams
Message 10 of 11 in “cherry-pick / pre-commit hook?”
  1. Dave AbrahamsDec 8, 2010
  2. Jonathan NiederDec 8, 2010
  3. Dave AbrahamsDec 8, 2010
  4. Jonathan NiederDec 8, 2010
  5. Dave AbrahamsDec 27, 2010
  6. Jonathan NiederDec 27, 2010
  7. Junio C HamanoDec 27, 2010
  8. Dave AbrahamsDec 27, 2010
  9. Junio C HamanoDec 28, 2010
  10. Jakub NarebskiDec 28, 2010
  11. Dave AbrahamsDec 29, 2010

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.