Allow to prepare a git commit message
Add a command to prepare a git commit message from to-be-commited changelog part files content.
The git commit message should adhere to the following git format:
summary
blank line
rest of description
Proposed algorithm:
- Find Added partlog files
- If there is only one, use that one
- Get the main one from the command line or bailout and ask to precise which one is the main one
- Extract first line of such a file and use it as the main title
- Parse the title to extract
message (ref)
if there is aref
- Construct the commit message:
- a title in the form
ref: message
.
Prepend the wordRef
beforeref
ifref
starts with a#
(because it will be seen as a comment by git).
Remove any-
from the start of message if any. - a blank line
- the rest of the main file as-is
- the rest of other files as-is (using category and lexicographic order)
- a title in the form
Edited by Cyrille Pontvieux