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

Re: [PATCH 0/2] pre-commit hook updates

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 26, 2014, 01:32 UTC
Message-ID
<CAPig+cS76GWES3hXF4Bdjg5G7QFcTKhzLyjM55LPMSD0zEinPQ@mail.gmail.com>
In-Reply-To
<cover.1416953772.git.oystwa@gmail.com>
On Tue, Nov 25, 2014 at 5:51 PM, Øystein Walle <oystwa@gmail.com> wrote:
Show 11 quoted lines
> The first patch changes t/t7503-pre-commit-hook.sh to use write_script
> everywhere, as was suggested by Jeff King in the discussion of the
> previous patch.
>
> The second patch is v2 of the patch I sent earlier. I've incorporated
> Eric Sunshine's suggestions. I didn't do enough digging; I found
> test_expect_failure and assumed this was test_expect_success's twin
> brother, but it marked stuff as known breakages so I went with the '!'.
> I also found it a bit strange that test_must_fail has a different
> signature (to the extent a shell function has one at all). Is my use of
> test_must_fail correct?
Your use is not correct (as I'll explain when responding to the patch).
> I agree with Junio Hamano that it's better to provide no argument at all
> rather than an empty one. I also agree with Jeff King that "noamend" is
> better than an empty argument. I went with the second one since Jeff
> seemed to get the last word :)
For what it's worth (probably not much), I agree with Junio.
Show 14 quoted lines
> I'm not sure I like the ternary inside the function call like that, but
> I went with it because it gave the smallest footprint (which is probably
> not a good argument). I suppose I could have done:
>
> if (amend)
>         hook_arg1 = "amend"
> else
>         hook_arg1 = "noamend"
> ...
> ... run_commit_hook(use_editor, index_file, "pre-commit", hook_arg1, NULL);
>
> or create a hook_amend variable.
>
> I'm happy to send a v3.
Previous: Eric SunshineNext: Jeff King
Message 10 of 13 in “pre-commit hook updates”
  1. 0/2 pre-commit hook updatesØystein Walle, Nov 25, 2014
  2. 1/2 t7503: use write_script to generate hook scriptsØystein Walle, Nov 25, 2014
  3. Eric SunshineNov 26, 2014
  4. Jeff KingNov 26, 2014
  5. Junio C HamanoNov 26, 2014
  6. Jeff KingNov 26, 2014
  7. Junio C HamanoNov 26, 2014
  8. 2/2 commit: inform pre-commit that --amend was usedØystein Walle, Nov 25, 2014
  9. Eric SunshineNov 26, 2014
  10. Eric SunshineNov 26, 2014
  11. Jeff KingNov 26, 2014
  12. Junio C HamanoNov 26, 2014
  13. Jeff KingNov 26, 2014

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.