Commit 801a88c
committed
commit: deprecate support for core.commentString=auto
When 'core.commentString' is set to "auto" then 'git commit' will
automatically select the comment character ensuring that it does not
match the start of any of the lines in the commit message. This was
introduced by commit 84c9dc2 (commit: allow core.commentChar=auto
for character auto selection, 2014-05-17) The motivation seems to be
to avoid commenting out lines from the existing message when amending
a commit that was created with a message from a file.
Unfortunately this feature does not work with:
- commit message templates that contain comments including the
conflict comments added by "git commands" etc.
- prepare-commit-msg hooks that introduce comments.
- the 'fixup' and 'squash' commands of "git rebase -i".
- when creating a commit with
"git commit --cleanup=strip -F <file>"
It is also ignored by "git notes" when amending a note.
The issues with comments comming from a template or a hook and the
failure to strip comments from a file are a consequence of the design
of this feature and are therefore hard to fix. The other issues could
in principle be fixed but it would complicate the implementation.
As the costs of this feature seem to outweigh the befits deprecate
it and remove it in Git 3.0. If someone comes up with some patches
that fix all the issues in a maintainable way then I'd be happy to
see this change reverted.
Signed-off-by: Phillip Wood <[email protected]>1 parent f0135a9 commit 801a88c
File tree
8 files changed
+41
-6
lines changed- Documentation
- config
- builtin
- t
8 files changed
+41
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
| 535 | + | |
535 | 536 | | |
536 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
537 | 553 | | |
538 | 554 | | |
539 | 555 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
692 | 697 | | |
693 | 698 | | |
694 | 699 | | |
| |||
716 | 721 | | |
717 | 722 | | |
718 | 723 | | |
| 724 | + | |
719 | 725 | | |
720 | 726 | | |
721 | 727 | | |
| |||
912 | 918 | | |
913 | 919 | | |
914 | 920 | | |
| 921 | + | |
915 | 922 | | |
916 | 923 | | |
| 924 | + | |
917 | 925 | | |
918 | 926 | | |
919 | 927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1176 | 1176 | | |
1177 | 1177 | | |
1178 | 1178 | | |
1179 | | - | |
| 1179 | + | |
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
| 959 | + | |
960 | 960 | | |
961 | | - | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
962 | 964 | | |
963 | 965 | | |
964 | 966 | | |
965 | | - | |
| 967 | + | |
966 | 968 | | |
967 | 969 | | |
968 | 970 | | |
| |||
0 commit comments