The next line should be an empty line, with no spaces.
+Subsequent lines can be a free form introductory text that should
+start column 0. The introductory text can have an arbitrary number of
+lines. No line in that text should start with the sequence
+<white-space>*. That is, no line in that text should start with a
+sequence of white spaces followed by the start character (*).
+
+If there was an introductory text, then the next line should be an
+empty line, with no spaces.
+
The subsequent lines should have the form of the Body of a GNU ChangeLog
entry, i.e:
* tests/Makefile.am: Adjust this.
~=~
+Another one could be:
+
+~=~
+PR 123456 Shorten compilation lines
+
+Blah blah, this is an introductory text explaining the purpose of this
+commit. It can contain whatever character I want. It just cannot
+contain a line that starts with white spaces immediately followed by
+the star character.
+
+ * configure.ac: Shorten compilation lines by regrouping
+ PKG_CHECK_MODULES calls.
+ * tests/Makefile.am: Adjust this.
+~=~
+
+
We encourage you to look at the existing commit logs or at the
-ChangeLog file for inspiration.
\ No newline at end of file
+ChangeLog file for inspiration.
break
top_line = lines[0]
+ subject_line_index = 0 if lines[1].startswith('*') else 1;
+ first_cl_body_line_index = 0;
+
+ for i in range(1, len(lines)):
+ if lines[i].startswith('*'):
+ first_cl_body_line_index = i
+ break;
# Clean up top line of ChangeLog entry:
fields = top_line.split(' ')
if not fileincommit:
for f in files:
print '\t* %s:' % f
- for l in lines[1:]:
- print '\t ', l
- print
+
+ if subject_line_index > 0:
+ print '\t', lines[subject_line_index]
+
+ if first_cl_body_line_index > 0:
+ for l in lines[first_cl_body_line_index:]:
+ if l.startswith('Signed-off-by:'):
+ continue
+ print '\t', l
+ print
def output_commits():
cmd = ['git', 'log', '--pretty=format:--START-COMMIT--%H%n%ai %an <%ae>%n%n%s%n%b%n--END-COMMIT--',