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

Re: [PATCH] checkout: add 'pre-checkout' hook

From
Sam Vilain <sam.vilain@catalyst.net.nz>
Date
Oct 14, 2009, 05:22 UTC
Message-ID
<4AD5601A.8090503@catalyst.net.nz>
In-Reply-To
<7vr5t6lfr0.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 28 quoted lines
> Sam Vilain <sam.vilain@catalyst.net.nz> writes:
> 
>> Add a simple hook that will run before checkouts.
>>
>> Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
>> ---
>>  Documentation/githooks.txt |   20 +++++++++++++++-----
>>  builtin-checkout.c         |   25 ++++++++++++++++++++++---
>>  2 files changed, 37 insertions(+), 8 deletions(-)
>>
>> diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
>> index 06e0f31..8dc3fbf 100644
>> --- a/Documentation/githooks.txt
>> +++ b/Documentation/githooks.txt
>> @@ -143,21 +143,31 @@ pre-rebase
>>  This hook is called by 'git-rebase' and can be used to prevent a branch
>>  from getting rebased.
>>  
>> +pre-checkout
>> +-----------
>>  
>> -post-checkout
>> -~~~~~~~~~~~~~
>> -
>> -This hook is invoked when a 'git-checkout' is run after having updated the
>> +This hook is invoked when a 'git-checkout' is run after before updating the
> 
> "after before"?
*ahem* whoops :).  I think I got the heading style wrong too...
> This is not about your patch, but the patch text shows that our diff
> algorithm seems to have a room for improvement.  I expected to see a
> straight insersion of block of text, not touching anything in the original
> section on post-checkout hook.

Correct. This is because the paragraph explaining when the hook runs has been moved to the pre-checkout paragraph, which appears before the post-checkout section. I just compared the output to 'diff -du' and it seems to be the same, so I wouldn't worry too much.

-- 
Sam Vilain, Perl Hacker, Catalyst IT (NZ) Ltd.
phone: +64 4 499 2267        PGP ID: 0x66B25843
Previous: Junio C HamanoNext: Jeff King
Message 5 of 9 in “checkout: add 'pre-checkout' hook”
  1. checkout: add 'pre-checkout' hookSam Vilain, Oct 14, 2009
  2. Jeff KingOct 14, 2009
  3. Sam VilainOct 14, 2009
  4. Junio C HamanoOct 14, 2009
  5. Sam VilainOct 14, 2009
  6. Jeff KingOct 14, 2009
  7. Bert WesargOct 14, 2009
  8. Sam VilainOct 14, 2009
  9. Bert WesargOct 14, 2009

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.