diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-03-27 00:59:03 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-27 00:59:03 +0300 |
commit | 89519f662c9e2b1c406fa72ba7923fcf5c028e89 (patch) | |
tree | 377d0feee3a6b52752c135c8d8457c898539768b /commit.c | |
parent | fde07fc356783bd05695cd3826844f1590ac2e45 (diff) | |
parent | 00ea64ed7a0ee5ef0901b1eeb5add6954925590f (diff) |
Merge branch 'cm/rebase-i-fixup-amend-reword'
"git commit --fixup=<commit>", which was to tweak the changes made
to the contents while keeping the original log message intact,
learned "--fixup=(amend|reword):<commit>", that can be used to
tweak both the message and the contents, and only the message,
respectively.
* cm/rebase-i-fixup-amend-reword:
doc/git-commit: add documentation for fixup=[amend|reword] options
t3437: use --fixup with options to create amend! commit
t7500: add tests for --fixup=[amend|reword] options
commit: add a reword suboption to --fixup
commit: add amend suboption to --fixup to create amend! commit
sequencer: export and rename subject_length()
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -535,6 +535,20 @@ int find_commit_subject(const char *commit_buffer, const char **subject) return eol - p; } +size_t commit_subject_length(const char *body) +{ + const char *p = body; + while (*p) { + const char *next = skip_blank_lines(p); + if (next != p) + break; + p = strchrnul(p, '\n'); + if (*p) + p++; + } + return p - body; +} + struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p) { struct commit_list *new_list = xmalloc(sizeof(struct commit_list)); |