Commit d8662b0
templates: detect messages that contain a separator line
Messages that contain "---" separator lines will be truncated by
"git am". This often surprises users so add a check to the sample
"commit-msg" hook to reject such messages. As it's conceivable that
someone is using "---" as their comment string we delete any commented
lines before checking for a separator. The trailing ".*" when matching
commented lines ensures that if the comment string ends with a "$"
it is not treated as an anchor.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 76cba32 commit d8662b0
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
0 commit comments