If it allows multiple authors.



skwashd’s picture

Status: Active » Needs review
4.98 KB

The attached patch for supporting the gource custom log format is attached. The patch also cleans up the git log a little more to produce nicer results.

marvil07’s picture

Status: Needs review » Needs work

I really appreciate the patch! :-)

It would be great if the creation of the gource format is at Makefile level.

+++ b/drupal_log_generator.py
@@ -142,7 +169,14 @@ def get_authors(subject, commit_id):
+def format_line(output_format, commit_hash, timestamp, filename, author, change_type):
+  if 'gource' == output_format:
+    return '{0}|{1}|{2}|{3}'.format(timestamp, author.lower(), change_type, filename)
+  else:
+    return '{0},{1},"{2}","{3}"'.format(commit_hash, timestamp, filename, author)

Based on the last hunk, I think it is possible to do it doing awk scripting(later called from the Makefile), so it will work the same as the generation of the codeswarm input.

On the other side, notice that making it at the same level of Makefile, it will use the sed replacing done via makefile on the drupal_log_generator.py output.

One minor question, any reason to lowercase the author?

skwashd’s picture

Thanks for the feedback. I will look into your scripts and suggestion to see if is makes sense to integrate it with the Makefile.

One minor question, any reason to lowercase the author?

It keeps the username consistent. While preparing the data for my Drupal history visualisation video I spent a fair bit of time checking the data in an attempt to make it consistent.

marvil07’s picture

I see. While I was doing the same, I ended up using custom replacing(see the *.sed files) to fix some errors, but in theory we should use full drupal.org username, as mentioned on the commit message standards. On the other side, note that given two users on d.o: "Some" ans "some", they are both valid(users.name field uses utf8_bin collation).

Notice this project currently uses 3 targets: D7, D8 and full history. So the idea is to use current infrastructure there to use gource for every target ;-), i.e. see codeswarm output.