-
Notifications
You must be signed in to change notification settings - Fork 17
/
Changes
2037 lines (1328 loc) · 67.5 KB
/
Changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Revision history for perl module Git-Hooks. -*- text -*-
{{$NEXT}}
4.0.0 2024-06-16 17:55:55-03:00 America/Sao_Paulo
This new major version removes support for Perl 5.16 and requires Perl 5.30
instead. It also removes support for Git 1.8.3 and requires at least Git 2.25.1
instead.
This was motivated by the CentOS release policy changes which essentially
stopped it from producing new releases. Also, by the EOL of Ubuntu 18.04.
We take advantage of this incompatible change to also remove several
configuration options which were deprecated more than two years ago.
[Incompatible changes]
- Require Perl 5.30 and Git 2.25.1, which are used by Ubuntu 20.04. A few
simplifications and improvements were made on the code.
- Remove the following deprecated options. Check their documentation on the
previous version to know how to replace them with newer options.
* githooks.disable
* githooks.checkfile.deny-token
3.6.0 2023-11-16 10:57:01-03:00 America/Sao_Paulo
[New features]
- CheckFile: implement the lock directive
The CheckFile.lock directive implements a poor man's version of the
Subversion locking mechanism, rejecting pushes that modify locked files.
3.5.0 2023-02-07 22:09:06-03:00 America/Sao_Paulo
[New features]
- Configuration options can take a list of values, which are set from higher
to lower levels of configuration. Sometimes one wants to reset in a lower
level (e.g. local repository) all values set in higher levels (e.g. system
or global). Now there is a general way to do it. You only need to set the
option to the string 'undef', which is taken as a special mark meaning to
reset the option configuration, as if it hadn't been configured previously.
3.4.0 2022-12-18 20:35:59-03:00 America/Sao_Paulo
[New features]
- Install the githooks-docker.sh script which makes it easier to use
Git::Hooks in a Docker container so that you don't have to install it in
your system. Also, add a section in the tutorial explaing how to use it.
3.3.1 2022-11-27 19:23:46-03:00 America/Sao_Paulo
[Improvements]
- Add support for GitLab servers.
- Groks the authenticated user name from Bitbucket's environment variables.
- Extends the githooks.plugin option with the ability to disable a plugin by
prefixing its name with an exclamation point. This allows one to disable a
plugin and re-enable it later, which wasn't possible before.
- Add POD spelling tests and fix some typos.
- Document the version after which deprecated options were deprecated.
[Deprecations]
- The githooks.disable option is being deprecated in favor of the extended
githooks.plugin option.
3.3.0 2022-06-11 16:43:20-03:00 America/Sao_Paulo
[New features]
- The new githooks.timeout configuration option adds timeout support. It sets
a time limit to how log the hooks can run. If it runs longer than the
specified time, in seconds, it aborts.
- The new githooks.error-length-limit configuration option specifies a limit
to the length of the error messages in characters. If the errors are bigger
than the limit the message is truncated and a special mark is appended to
the end.
[Fixes]
- CheckLog: The checklog.spelling tests weren't being skipped correctly which
made them fail on FreeBSD systems.
3.2.2 2022-06-04 17:20:26-03:00 America/Sao_Paulo
[Fixes]
- CheckCommit: Fix calls to the check_post_commit and check_patchset which
were being passed SHA1 hashes intead of commit objects.
- Avoid showing some expected Git error messages.
- CheckWhiteSpace: Fix "Exiting subroutine via next" errors.
- CheckLog: Fix spellcheck test.
- Now we grok Bitbucket's repository name from the newer BB_REPO_SLUG
environment variable instead of the old STASH_REPO_NAME environment
variable.
3.2.1 2022-01-02 21:08:19-03:00 America/Sao_Paulo
[Fixes]
- CheckLog: The check_ref routine was returning a boolean instead of the
number of errors found. This was inverting its result.
- CheckCommit: The 'signature' configuration option wasn't working.
- The Git::Hooks::Test module wasn't isolating Git from the user's
environment, which led it to fail strangely in situations where the test
code interacted destructively with the user's global configuration or the
system's configuration.
[Thanks]
Mikko Koivunalho provided all three fixes.
3.2.0 2021-09-14 18:39:20-03:00 America/Sao_Paulo
[New feature]
- CheckFile: Add a new option called 'max-path' which checks if the paths of
added files aren't bigger than a limit, which is useful to avoid problems
with Window's maximum path length limitation of 260 characters.
3.1.1 2021-08-24 23:44:49-03:00 America/Sao_Paulo
[Fix]
- CheckFile: pathnames with "unusual" characters weren't being correctly
decoded from the output of git-log. They are quoted as explained for the
configuration variable core.quotePath (see git-config(1)).
- Fix several Perl::Critic complaints in the test suite scripts.
3.1.0 2021-04-24 22:19:07-03:00 America/Sao_Paulo
[New feature]
- CheckJira: Add a new option called 'check-code-ref' which is an extension of
the 'check-code' option. The new option passes the affected reference name
as an extra option to the specified checking code routine.
[Fix]
- The test suite now explicitly sets the default initial branch name of the
repositories created for testing to avoid potential conflicts with the
init.defaultBranch git configuration option.
3.0.0 2020-11-19 21:49:04-03:00 America/Sao_Paulo (TRIAL RELEASE)
This new major version removes support for Perl 5.10 and requires Perl 5.16
instead. It also removes support for Git 1.7.1 and requires at least Git 1.8.3
instead.
This was motivated by the end of support of CentOS 6, which still used the old
Perl and Git. We take advantage of this incompatible change to also remove
several configuration options which were deprecated more than two years ago.
[New features]
- New HOOK DRIVERS make it easier to implement plugins which associate
themselves to several hooks in a consistent way. Several standard plugins
now use them, which made their code simpler and more general. Read about
them on the main Git::Hooks documentation.
[Incompatible changes]
- Require Perl 5.16 and Git 1.8.3, which are used by CentOS 7. A few
simplifications and improvements were made on the code.
- Remove the following deprecated options from several plugins. Check their
documentation on the previous version to know how to replace them with newer options.
* githooks.checkfile.basename.allow
* githooks.checkfile.basename.deny
* githooks.checkfile.path.allow
* githooks.checkfile.path.deny
* githooks.checkjira.issuetype
* githooks.checkjira.noref
* githooks.checkjira.project
* githooks.checkjira.ref
* githooks.checkjira.status
* githooks.checklog.noref
* githooks.checklog.ref
* githooks.checkreference.allow
* githooks.checkreference.deny
- CheckAcls: remove this deprecated plugin. It can be replaced by the
CheckReference plugin.
- Git::Repository::Plugin::GitHooks: remove the following deprecated
methods. check their documentation on the previous version to know how to
replace them with newer methods, if you use them on your plugins.
* error
* get_error
* is_ref_enabled
2.14.0 2020-11-01 22:06:09-03:00 America/Sao_Paulo
[New features]
- CheckDiff: Add new option 'deny-token' which was previously implemented in
the CheckFile plugin. Also, the option now can look for tokens on specific
files and directories instead of in the whole repository.
- The GITHOOKS_AUTHENTICATED_USER environment variable is set to the
authenticated user's username, being available for all hooks and plugins. It
may be used wherever environment variables can be expanded, such as in
CheckReference's acl refspecs.
[Deprecations]
- CheckFile: Deprecate the 'deny-token' option which was moved to the
CheckDiff plugin.
[Fixes]
- CheckLog: Fix the revert_errors function which crashed when the SHA1
mentioned in the revert message didn't refer to an existing commit.
2.13.0 2020-10-21 21:06:44-03:00 America/Sao_Paulo
[New features]
- CheckJira: The new option 'and-jql' conjuncts a new JQL with the one
previously set, making it easier to implement restrictions on a global JQL
per repository.
- CheckJira: Now one can reset the value of the 'jql' option by assigning it
the special value 'undef'.
[Fix]
- CheckCommit: The 'signature' option wasn't working at all.
2.12.0 2020-07-05 14:49:44-03:00 America/Sao_Paulo
[New features]
- New configuration option githooks.error-prefix makes it easier to integrate
Git::Hooks with GitLab:
https://docs.gitlab.com/ee/administration/server_hooks.html#custom-error-messages
2.11.1 2020-04-05 00:05:19-03:00 America/Sao_Paulo
[Fix]
- The files in the scripts/ directory weren't being installed. Now, they're
installed as executables during the module installation.
2.11.0 2020-04-04 23:36:17-03:00 America/Sao_Paulo
[New features]
- CheckDiff: This is a new plugin which makes it easy to check the output of a
git-diff showing the differences introduced by a new local commit or by a
sequence of commits being pushed to a branch. It comes with a sample script
which can be used to detect secret leakage in your code.
- Group names now can have dashes in them. Courtesy of Bartosz
Oudekerk. Thanks!
2.10.1 2018-12-20 21:33:27-02:00 America/Sao_Paulo
[Fix]
- The hook-specific help-on-error config wasn't being used.
2.10.0 2018-11-06 12:05:34-02:00 America/Sao_Paulo
[New features]
- The Log::Any logging framework can be used to produce strucutured log
messages.
- Notify: The notification rule configuration syntax now allows one to
restrict notifications per branch.
- Notify: The notification rule configuration syntax now allows one to
restrict notifications by specifying git-log "commit limiting" options, such
as --no-merge and --grep.
- PrepareLog: Commit messages produced with git-commit's options -m and t are
prepared too. Previously, they were not.
- Gerrit: Add support to the new Gerrit synchronous hooks: commit-received and
submit.
- Gerrit: Reviews are now tagged as 'autogenerated:git-hooks' so that they can
be filtered out in the UI.
[Fix]
- CheckRebase: The check_rebase routine only worked when the branch being
rebased was at most one commit ahead of the upstream.
- Fix pre-receive hooks when invoked by Bitbucket's pull request server.
2.9.10 2018-10-16 07:38:48-03:00 America/Sao_Paulo
[Fix]
- Notify: Show changed files in merge commits.
- Fix yet another split usage.
2.9.9 2018-10-11 13:37:12-03:00 America/Sao_Paulo
[Fix]
- Fix several usages of the split builtin Perl function to split strings on
sequences of whitespace. This was detected in the Git configuration file
parsing, but could affect other places as well, depending on how the parsed
strings were formatted.
2.9.8 2018-10-08 22:33:20-03:00 America/Sao_Paulo
[Fix]
- CheckFile: Skip case-sensitive filesystem checks on darwin OS.
2.9.7 2018-10-06 17:58:22-03:00 America/Sao_Paulo
[Fix]
- CheckFile: Some tests started to fail after Git 2.18.0.
2.9.6 2018-05-06 22:35:14-03:00 America/Sao_Paulo
[Documentation]
- Tutorial: Add section for Bitbucket administrators.
[Internal changes]
- Enable a few extra author and release tests. In particular, the Perl::Critic
author test uncovered several style problems which were fixed in this
version.
2.9.5 2018-04-30 21:49:42-03:00 America/Sao_Paulo
[Fixes]
- CheckFile: Fix the pre-commit hook which was broken on v2.9.3.
- CheckFile: Fix the deny-token option processing on pre-commit hooks. It
should search for tokens on the index but it was searching for them on the
working copy.
[Thanks]
- Kudos to @Eluminae who reported the above issues.
2.9.4 2018-04-29 10:42:54-03:00 America/Sao_Paulo
[Fixes]
- GitHooks: The blob method wasn't throwing an exception when the git cat-file
command failed.
- CheckJira: Do not invoke 'code-check' checks when none of the cited JIRAs
match the JQL expression.
[Documentation]
- CheckJira: Tell what a 'code-check' routine must return to signal successes
and failures.
- Hooks: Quote the here-document delimiter used to create the git-hooks.pl
script to avoid variable interpolation.
2.9.3 2018-04-14 11:15:22-03:00 America/Sao_Paulo
[Enhancement]
- CheckFile: Group ACL errors per ACL/ACTION, so that all files denied by the
same reason are listed together. Also, show the ACL denying the files, to
make the error message more understandable.
2.9.2 2018-03-28 16:24:51-03:00 America/Sao_Paulo
[Fixes]
- CheckReference: Remove a try/catch block that was missed when we removed the
dependency on Try::Tiny.
- Notify: Skip a test which requires HTML::Entities.
2.9.1 2018-03-26 09:34:31-03:00 America/Sao_Paulo
[Documentation]
- The secion headings about configuration options now mention their basename
only, so that instead of 'githooks.checkfile.acl' it's just 'acl'. This
makes the HTML index easier to read.
- Replaced every use of the 'git config' command by a snipped of the
configuration file which it would produce. I think most people aren't
familiar with the git-config command and they will have an easier time
understanding the configuration file.
[Internal changes]
- Removed some bogus dependencies and some dependencies that weren't that
necessary. This allowed me to avoid the following previously required
modules: Data::Dumper, Authen::SASL, Email::Sender, MIME::Base64, Cwd,
Data::Dump, Email::Valid, File::pushd, HTML::Entities, Set::Scalar,
Sub::Util, Try::Tiny, URI::file. Hopefully, this will make the module
smoother to install and faster to load.
2.9.0 2018-03-23 21:49:01-03:00 America/Sao_Paulo
[New features]
- CheckFile: a new option 'acl' allows one to restrict who can do what (add,
modify, or delete) to specific files in a very general way.
- CheckReference: a new option 'acl' allows one to restrict who can do what
(create, rewrite, update, or delete) to which references in a very general
way.
- GitHooks: a new method 'grok_acls' is used by the plugins CheckFile and
CheckReference to pre-process their respective 'acl' multi-valued options.
- Notify: a new placeholder (%R) can be used in the option 'commit-url'. It's
replaced by the repository name.
[Deprecations]
- CheckFile: the options 'basename.deny', 'basename.allow', 'path.deny', and
'path.allow' are deprecated because they can be implemented more generally
with the new 'acl' option.
- CheckReference: the options 'allow' and 'deny' are deprecated because they
can be implemented more generally with the new 'acl' option.
- CheckAcls: this plugin is deprecated because its funcionality can now be
implemented with the new 'githooks.checkreference.acl' option.
2.8.1 2018-03-13 15:53:42-03:00 America/Sao_Paulo
[Fix]
- CheckFile: fix case that should be tested only on case-sensitive
filesystems.
2.8.0 2018-03-11 20:44:24-03:00 America/Sao_Paulo
[New features]
- New options githooks.ref and githooks.noref allow one to enable or disable
most hooks for commits affecting specific references (usually branches).
[Deprecations]
- CheckJira: the githooks.checkjira.ref and githooks.checkjira.noref options
are deprecated and should be replaced by the new global options.
- CheckLog: the githooks.checklog.ref and githooks.checklog.noref options are
deprecated and should be replaced by the new global options.
2.7.0 2018-03-07 16:01:53-03:00 America/Sao_Paulo
[New features]
- Git::Hooks now can produces colorized output by default, which can be
configured by the new githooks.color option. There are options to specify
the colors to use for each part of the output.
- The error messages were reformatted to contain a "context" line telling the
name of the plugin which detected the error and, optionally, a commit SHA1,
a reference name, and a configuration option name.
- CheckFile: new options 'executable' and 'not-executable' allows one to check
if specific files are executable or not, rejecting the commit otherwise.
- CheckFile: new option 'deny-token' rejects commits when their patch contains
one or more tokens. Useful to avoid committing "FIXME" lines.
- CheckFile: new option 'deny-case-conflict' rejects commits which add files
with names that would conflict with each other or with the names of other
files already in the repository in case-insensitive filesystems, such as the
ones on Windows.
[Documentation]
- The Git::Hooks documentation has a new section about our Perl and Git
compatibility policy.
2.6.3 2018-02-28 09:31:25-03:00 America/Sao_Paulo
[Fix]
- PrepareLog: the tests required a feature implemented on Git 1.7.2. It was
rewritten to support Git 1.7.1.
2.6.2 2018-02-27 14:24:12-03:00 America/Sao_Paulo
[Fix]
- CheckJira: some error messages weren't expanding the commit SHA1 correctly.
2.6.1 2018-02-26 18:44:54-03:00 America/Sao_Paulo
[Fix]
- PrepareLog: require Git >= 2.8.0 in order to insert issues in the log
message trailers. Previously we required Git >= 2.7.0, but they didn't
implement a feature we use.
2.6.0 2018-02-26 16:38:54-03:00 America/Sao_Paulo
[New features]
- The plugins which were associated with the pre-commit, commit-msg, and
post-commit hooks are now also associated with the pre-applypatch,
applypatch-msg, and post-applypatch hooks, when is makes sense.
- CheckLog: complains about duplicate Signed-off-by trailers in commit
messages.
- CheckReference: new option require-annotated-tag.
- PrepareLog: new plugin associated with the prepare-commit-msg hook. For now
it makes it possible to insert an issue ID in the commit message, inferring
it from the current branch's name.
- The distribution now installs a three-line script called githooks.pl which
can be used as a generic driver for Git::Hooks.
[Documentation]
- The README and Tutorials that were kept in the GitHub wiki are now
internalized in the distribution as POD files.
2.5.0 2018-02-16 16:44:43-02:00 America/Sao_Paulo
[Documentation]
- Added a SYNOPSIS section to the POD of all plugins showing an example of the
Git configuration for it.
- Improved almost all error messages making them more useful to the end-user.
- The SHA1s appearing in error messages are shortened to make them easier to
read by the end-user.
[New feature]
- GitHooks: deprecate the errors/get_errors methods and replace them by the
newly added fault/get_faults methods. The new ones have a different
signature which is more flexible.
2.4.0 2018-02-11 14:08:19-02:00 America/Sao_Paulo
[New feature]
- CheckLog: implement option deny-merge-reverts.
[Fix]
- Notify: fix numstat lines for binary files. Since they don't have lines, an
hyphen is shown for them.
2.3.0 2017-12-14 11:34:40-02:00 America/Sao_Paulo
[New features]
- The GitHooks plugin implements two new methods: get_config_boolean and
get_config_integer. They're used whenever we want to get a configuration
value explicitly as a boolean or an integer, following git-config's
documentation about typed options. If the option's value doesn't comply with
git-config's syntax specification for booleans or integers the methods
croak, making clear to the user that she has a configuration
error. Moreover, this allows the user to specify booleans and integers in
whatever syntax they prefer, according to git-config's specification.
[Changes]
- Notify: in the notification headers, replace 'BY:' by 'PUSHED BY:' to make
it clear that we're talking about the user who pushed the commits being
notified about.
- Support Git 1.7.1, which is the version installed by default in CentOS
6. There was no code changes to make it so. We only changed the check make
during the building of the module to allow the use of version
1.7.1. Previously we supported from version 1.7.2 on.
[Fix]
- Notify: use the option i18n.commitEncoding to decode commit information
before inserting it into the notifications.
- The GitHooks::get_config method now treats the $var argument as
case-insensitive, following what the git-config documentation implies.
2.2.1 2017-12-12 14:36:38-02:00 America/Sao_Paulo
[Fix]
- The new Notify plugin unearthed an unintended dependency on Git 2.7.0. This
version fix it to make Git::Hooks work with at least Git 1.7.2.
2.2.0 2017-12-11 20:28:45-02:00 America/Sao_Paulo
[New features]
- Notify: a new plugin that can be configured to send email notifications to
specific addresses telling about new commits modifying specific paths inside
the repository.
- New method GitHooks::repository_name returns the name of the repository in
the server.
2.1.8 2017-10-29 21:51:37-02:00 America/Sao_Paulo
[Fix]
- The githooks.checkjira.jql and githooks.checkjira.ref-jql options were being
used as multi-valued, but this was never the intention. The idea is to
evaluate only the most specific value of each option so that one can
specialize checks on specific repositories.
2.1.7 2017-10-21 23:27:42-02:00 America/Sao_Paulo
[Fix]
- Remove directive githooks.nocarp which had no meaning since v2.0.0.
- Fix CheckWhitespace::check_affected_refs so that it works with newly created
or just deleted branches.
[Thanks]
- Thanks to @boudekerk for referring me to both problems.
2.1.6 2017-09-26 18:31:44-03:00 America/Sao_Paulo
[Fix]
- Fix the githooks.nocarp directive which was broken since v2.0.1.
2.1.5 2017-09-21 22:32:00-03:00 America/Sao_Paulo
[Fixes]
- Messages sent to Gerrit are truncated to less than 64kB. Otherwise they
aren't saved and Gerrit logs an error.
- The method G::R::P::GH::get_sha1 wasn't working at all! Since it was only
used by CheckCommit's check_post_commit method, it seems that nobody ever
used it.
2.1.4 2017-09-21 08:49:37-03:00 America/Sao_Paulo
[Fix]
- CheckWhitespace was trying to get error messages from STDERR instead of
STDOUT, which besides making it be mute about them, could make it hang if
there was too much errors to show.
2.1.3 2017-08-05 23:55:55-03:00 America/Sao_Paulo
[Fixes]
- Git::Hooks was broken for Gerrit since v2.0.0.
- CheckJira's deprecated options (issuetype and status) were broken if
their values contained whitespace.
2.1.2 2017-08-03 09:58:07-03:00 America/Sao_Paulo
[Fix]
- A simple improvement over the previous fix of CheckLog.
2.1.1 2017-08-02 23:34:44-03:00 America/Sao_Paulo
[Fix]
- CheckLog was considering every file in the repository when a new branch
or tag was pushed, during the pre-receive and the update hooks. Now it
can calculate correctly the files affected by the new commits pushed
along with the new commit.
2.1.0 2017-07-12 15:06:42-03:00 America/Sao_Paulo
[New features]
- CheckJira and CheckLog now admit a new option called 'noref' allowing
one to explicitly exclude some references from the checks performed by
these plugins.
[Fixes]
- The githooks.checkcommit.check-code directive now works when one pushes
more than one commit.
2.0.1 2017-06-23 10:53:06-03:00 America/Sao_Paulo
- Official release of version 2.0.
[Documentation]
- The TUTORIAL.pod file was removed and its contents were moved to the
projects wiki at https://github.com/gnustavo/Git-Hooks/wiki.
[Internal changes]
- Substituted Dist::Zilla::Plugin::MakeMaker::Awesome for
Dist::Zilla::Plugin::MakeMaker::Custom as a Dist::Zilla dependency.
2.0.0 2017-06-15 20:42:17-03:00 America/Sao_Paulo (TRIAL RELEASE)
This is a major new version of Git::Hooks and there is a few incompatible
changes mentioned below. Most of them affect only hook and plugin
developers, but not users. As a user you'll be affected only if you use
the CheckStructure plugin, which was removed from the distribution. If you
depend on it, you may reimplement its checks using the CheckFile and the
CheckReference plugins.
[Incompatible changes]
- Replace the Git module by the Git::Repository module as the underlying
git wrapper. This means that hooks now receive a Git::Repository object
as their first argument instead of a Git::More object, which may affect
the code of hooks and plugins.
- The Git::More module was transformed into the
Git::Repository::Plugin::GitHooks module to take advantage of
Git::Repository's plugin architecture. This means that the
Git::Repository object passed to hooks will have the
Git::Repository::Plugin::GitHooks plugin enabled, which brings most of
the methods previously provided by Git::More.
- The Git::Hooks::nocarp method was removed. The 'nocarp' function is
meant to be enabled via the githooks.nocarp configuration option only.
- Git::Hooks now only exports the hook directives and the 'run_hook'
function. All the other functions previously implemented by it are now
provided by Git::Repository::Plugin::GitHooks.
- Git::Repository::Plugin::GitHooks's methods 'get_commit', 'get_commits',
and 'get_affected_ref_commits' now return Git::Repository::Log objects
instead of naked hashes to represent commits.
- The CheckStructure plugin was removed from the distribution. Its
funcionality is provided by the CheckFile and the new CheckReference
plugins.
[New features]
- New options for the 'githooks' section: 'error-header' and
'error-footer'. These allow for the injection of a header and/or a
footer along with Git::Hooks's error messages.
- CheckReference: new plugin for checking branch names.
- CheckJira: new options: 'jql', 'ref-jql'. These allow one to use JIRA's
JQL expressions to impose restrictions on the JIRA issues cited on
commit messages.
- CheckJira: new option 'skip-merges' to avoid checking merge commits.
- CheckCommit: new configuration option 'merger' to define the users
allowed to push merge commits.
- CheckCommit: new configuration option 'push-limit' to specify the
maximum number of commits that may be pushed at once over a branch.
- CheckFile: New configuration option 'basename.sizelimit' to specify size
limits per file name.
- The Git::Hooks documentation now contains a section for plugin
developers.
[Deprecations]
- Remove the deprecated configuration options
'githooks.gerrit.review-label', 'githooks.gerrit.vote-ok', and
'githooks.gerrit.vote-nok'.
- CheckJira: deprecates the configuration options 'project', 'status', and
'issuetype'. They're better implemented by the new 'jql' option.
1.16.0 2017-05-20 18:48:38-03:00 America/Sao_Paulo
[New features]
- CheckLog: New option title-match to check the commit message title.
[Fixes]
- (PR#37) Specifying multiple anonymous subs for the same hooks did not
work. Only the first sub that was defined would actually be called. Fixed
by Dave Rolsky.
- Test suite bug triggered by Git 2.13.0.
1.15.1 2017-03-02 14:26:16-03:00 America/Sao_Paulo
[Changes]
- The old t/test-functions.pl file was turned into a proper module as
Git::Hooks::Test, which made the tests simpler.
- Add Travis CI support in GitHub.
- Use Test::Requires::Git to check the Git version during testing.
[Thanks]
- Thanks for the good folks at CV-Library for a bunch of pull requests
that made most of this new version.
http://tech-blog.cv-library.co.uk/2017/02/16/february-pull-request-challenge/
1.15.0 2017-01-04 21:45:26-02:00 America/Sao_Paulo
[New features]
- New method Git::More::hookname returns the name of the current hook.
[Fixes]
- Fix regression on Git::More::get_commits
1.14.2 2016-11-25 10:44:51-02:00 America/Sao_Paulo
[Fixes]
- Gerrit 2.13 slightly changed how it passes information to the hooks and
we had to make some changes to accommodate it.
1.14.1 2016-11-06 17:02:19-02:00 America/Sao_Paulo
[Fixes]
- As it were the boolean return from the hooks were being
disregarded. Git::Hooks considered a failure only when some hooks
invoked the Git::Hooks::error method. Now it considers a failure if any
hook returns false OR if any one of them invoked the Git::Hooks::erro
method. Some hooks weren't returning the correct boolean value that
Git::Hooks expected and they were fixed too.
1.14.0 2016-10-15 09:47:47-03:00 America/Sao_Paulo
[New features]
- Add new option githooks.gerrit.notify to specify who should be notified
when a review is cast into Gerrit.
1.13.1 2016-08-07 21:16:40-03:00 America/Sao_Paulo
[Fixes]
- Git::More::get_commits always returned an empty list when invoked in a
post-receive and post-update hook so that these hooks really didn't work
before.
- CheckJira: Fix call to JIRA's method to insert a comment.
[Changes]
- CheckJira: The githooks.checkjira.comment option must be set to 'all' if
you do not want to restrict its visibility. Previously it was documented
that you should leave it without value. This is not really an
incompatible change, since the comment insertion was performed in the
post-receive/post-update hooks which weren't working anyway.
1.13.0 2016-07-02 16:36:38-03:00 America/Sao_Paulo
[New features]
- Add new boolean option githooks.gerrit.auto-submit to submit the change
in Gerrit automatically if all hooks succeed.
- Add new options for specifying Gerrit votes:
githooks.gerrit.votes-to-approve and
githooks.gerrit.votes-to-reject. They allow for voting in multiple
labels depending on the outcome of the hooks.
[Deprecations]
- The options githooks.gerrit.review-label, githooks.gerrit.vote-nok, and
githooks.gerrit.vote-ok are deprecated and should be replaced by the new
options mentioned above. These old options will continue to work for a
few more versions and cannot be used together with the new ones. They
must be completely replaced.
1.12.5 2016-05-31 07:45:06-03:00 America/Sao_Paulo
[Fix]
- Fix typo that was preventing githooks.checkjira.comment to work.
1.12.4 2016-03-29 17:00:03-03:00 America/Sao_Paulo
[New features]
- CheckFile: Pass the GIT_COMMIT environment variable to the external
commands.
1.12.3 2016-02-15 13:50:36-02:00 America/Sao_Paulo
[Fix]
- Fix Git::More::get_commits for all branches.
[Thanks]
- Thanks to @boudekerk for referring me to this problem in
https://github.com/gnustavo/Git-Hooks/issues/26.
1.12.2 2016-02-09 11:07:58-02:00 America/Sao_Paulo
[Fix]
- Fix Git::More::get_commits for new branches.
[Thanks]
- Many thanks to @ate, @boudekerk, and @schans who showed me the bug and
how to fix it in https://github.com/gnustavo/Git-Hooks/issues/24.
1.12.1 2016-01-16 19:14:52-02:00 America/Sao_Paulo
[Fix]
- Remove dependency on Data::Util and add dependency on Sub::Util.
1.12.0 2015-09-27 10:18:35-03:00 America/Sao_Paulo
[Incompatible changes]
- CheckCommit: The recently implemented githooks.checkcommit.check-ref
option is being replaced by another one called
githooks.checkcommit.check-code, which performs the checks for every
commit in an update or pre-receive hook, not for every affected
reference. Now it applies also to the local pre-commit hook.
The githooks.checkcommit.check-ref option was ill-conceived. The
CheckCommit plugin is meant to check "commits", not "references". As
such, all checks should apply to the local commit being constructed in a
pre-commit hook and to all commits being pushed in an update or
pre-receive hook.
The callback routines associated with the option now get three
arguments ($git, $commit, $ref) instead of two ($git, $ref).
Since the ...check-ref option was implemented just five days ago,
hopefully no one is yet depending on it so that this change won't affect
anybody. Hence, I'm not bumping the package major version as the
Semantic Versioning scheme would advise.
1.11.1 2015-09-22 10:19:40-03:00 America/Sao_Paulo
[Changes]
- Git::More::blob now throws exceptions on errors instead of injecting the
messages with Git::More::error. This makes it suitable for use by user
hooks.
1.11.0 2015-09-22 09:45:26-03:00 America/Sao_Paulo
[New features]
- CheckCommit: Add option checkcommit.check-ref to allow one to specify
Perl code to check commits during a git push.
1.10.0 2015-07-04 15:13:40-03:00 America/Sao_Paulo
[New features]
- CheckFile: Implement new directives to check files by comparing their
names with regular expressions.
[Changes]
- Git::Hooks's homepage now is the GitHub Page
http://gnustavo.github.io/Git-Hooks/.
1.9.0 2015-05-27 21:28:52-03:00 America/Sao_Paulo
[Changes]
- DROP SUPPORT FOR GITS OLDER THAN VERSION 1.7.2 !!!
Previously Git::Hooks supported Gits since version 1.6.0.