4 releases (2 breaking)

0.3.1 Dec 15, 2023
0.3.0 Dec 8, 2023
0.2.0 Dec 7, 2023
0.1.0 Dec 7, 2023

#1124 in Development tools

Download history 7/week @ 2023-12-29 5/week @ 2024-01-05 36/week @ 2024-01-12 13/week @ 2024-01-19 9/week @ 2024-02-02 156/week @ 2024-02-09 507/week @ 2024-02-16 593/week @ 2024-02-23 382/week @ 2024-03-01 323/week @ 2024-03-08 361/week @ 2024-03-15 350/week @ 2024-03-22 301/week @ 2024-03-29 223/week @ 2024-04-05

1,277 downloads per month
Used in 2 crates (via asyncgit)

MIT license

20KB
596 lines

git2-hooks

adds git hook functionality on top of git2-rs

todo

  • unittest coverage symlinks from .git/hooks/<hook> -> X
  • unittest coverage ~ expansion inside core.hooksPath

lib.rs:

git2-rs addon supporting git hooks

we look for hooks in the following locations:

  • whatever config.hooksPath points to
  • .git/hooks/
  • whatever list of paths provided as other_paths (in order)

most basic hook is: hooks_pre_commit. see also other hooks_* functions.

create_hook is useful to create git hooks from code (unittest make heavy usage of it)

Dependencies

~13MB
~296K SLoC