git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH 3/3] sequencer: run post-commit hook
Date: Fri, 11 Oct 2019 13:27:09 +0900	[thread overview]
Message-ID: <xmqqftjzj49u.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1910102324140.46@tvgsbejvaqbjf.bet> (Johannes Schindelin's message of "Thu, 10 Oct 2019 23:31:38 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> diff --git a/builtin/commit.c b/builtin/commit.c
>> index d898a57f5d..adb8c89c60 100644
>> --- a/builtin/commit.c
>> +++ b/builtin/commit.c
>> @@ -1653,7 +1653,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>>
>>  	repo_rerere(the_repository, 0);
>>  	run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
>> -	run_commit_hook(use_editor, get_index_file(), "post-commit", NULL);
>> +	run_post_commit_hook(use_editor, get_index_file());
>
> Does it really make sense to abstract the hook name away? It adds a lot
> of churn for just two callers...

After looking at the three patches, I do not think so.

>> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
>> index d2f1d5bd23..d9217235b6 100755
>> --- a/t/t3404-rebase-interactive.sh
>> +++ b/t/t3404-rebase-interactive.sh
>> @@ -1467,4 +1467,21 @@ test_expect_success 'valid author header when author contains single quote' '
>>  	test_cmp expected actual
>>  '
>>
>> +test_expect_success 'post-commit hook is called' '
>> +	test_when_finished "rm -f .git/hooks/post-commit commits" &&
>> +	mkdir -p .git/hooks &&
>> +	write_script .git/hooks/post-commit <<-\EOS &&
>> +	git rev-parse HEAD >>commits
>
> Should `commits` be initialized before this script is written, e.g.
> using
>
> 	>commits &&

Yes.

>> +	git rev-list --no-walk=unsorted HEAD@{5} HEAD@{4} HEAD@{3} HEAD@{2} \
>> +		HEAD@{1} HEAD >expected &&
>
> Wouldn't this be better as:
>
> 	git rev-parse HEAD@{5} HEAD@{4} HEAD@{3} HEAD@{2} HEAD@{1} HEAD \
> 		>expect &&
>

Yes.

>> +	test_cmp expected commits
>
> We usually use the name `expect` instead of `expected` in the test
> suite.

And the actual output file is called 'actual'.

Thanks.

  reply	other threads:[~2019-10-11  4:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 18:36 [PATCH 0/3] sequencer: start running post-commit hook again Phillip Wood via GitGitGadget
2019-10-10 18:36 ` [PATCH 1/3] sequencer.h fix placement of #endif Phillip Wood via GitGitGadget
2019-10-10 18:36 ` [PATCH 2/3] sequencer: use run_commit_hook() Phillip Wood via GitGitGadget
2019-10-10 21:15   ` Johannes Schindelin
2019-10-11  4:24     ` Junio C Hamano
2019-10-14 13:26       ` Phillip Wood
2019-10-14 22:14         ` Johannes Schindelin
2019-10-10 18:36 ` [PATCH 3/3] sequencer: run post-commit hook Phillip Wood via GitGitGadget
2019-10-10 21:31   ` Johannes Schindelin
2019-10-11  4:27     ` Junio C Hamano [this message]
2019-10-11 15:39     ` Phillip Wood
2019-10-15 10:25 ` [PATCH v2 0/6] sequencer: start running post-commit hook again Phillip Wood via GitGitGadget
2019-10-15 10:25   ` [PATCH v2 1/6] t3404: remove unnecessary subshell Phillip Wood via GitGitGadget
2019-10-15 10:25   ` [PATCH v2 2/6] t3404: set $EDITOR in subshell Phillip Wood via GitGitGadget
2019-10-15 10:25   ` [PATCH v2 3/6] t3404: remove uneeded calls to set_fake_editor Phillip Wood via GitGitGadget
2019-10-15 10:25   ` [PATCH v2 4/6] sequencer.h fix placement of #endif Phillip Wood via GitGitGadget
2019-10-15 10:25   ` [PATCH v2 5/6] move run_commit_hook() to libgit and use it there Phillip Wood via GitGitGadget
2019-10-15 10:25   ` [PATCH v2 6/6] sequencer: run post-commit hook Phillip Wood via GitGitGadget
2019-10-15 14:26   ` [PATCH v2 0/6] sequencer: start running post-commit hook again Johannes Schindelin
2019-10-16  1:32     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqftjzj49u.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).