rahulpathakgit / codeswarm

Automatically exported from code.google.com/p/codeswarm
GNU General Public License v3.0
0 stars 0 forks source link

patch to support git in convert_logs.py #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The attached patch allows to use git repositories to generate activity xml
files.

The git-log output should be prepared with this options to mimic svn log
output:

git-log --name-status
--pretty=format:'%n-------------------------------------------------------------
-----------%nr%h
| %ae | %ai (%aD) | x lines%nChanged paths:' > activity.log

Original issue reported on code.google.com by shad...@gmail.com on 28 Jun 2008 at 5:33

Attachments:

GoogleCodeExporter commented 8 years ago
I'll be taking a look at this today :)

Original comment by cgalvan1...@gmail.com on 29 Jun 2008 at 4:45

GoogleCodeExporter commented 8 years ago
I have applied/tested this patch, thanks shadone :)

Original comment by cgalvan1...@gmail.com on 7 Jul 2008 at 5:52

GoogleCodeExporter commented 8 years ago
I've tried it and it does not work on log from linux-2.6-stable :

head activity.log

------------------------------------------------------------------------
r92dcffb| torvalds@linux-foundation.org | 2010-01-21 15:31:35 -0800 (Thu, 21 
Jan 2010
15:31:35 -0800) | x lines
Changed paths:
M   Makefile

------------------------------------------------------------------------
re80b135| torvalds@linux-foundation.org | 2010-01-21 08:50:04 -0800 (Thu, 21 
Jan 2010
08:50:04 -0800) | x lines
Changed paths:

python convert_logs.py -g activity.log
Traceback (most recent call last):
  File "convert_logs.py", line 408, in <module>
    main()
  File "convert_logs.py", line 116, in main
    date = time.strptime(date, '%Y-%m-%d %H:%M:%S')
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data 'x lines\n' does not match format '%Y-%m-%d %H:%M:%S'

Original comment by cscet...@gmail.com on 25 Jan 2010 at 9:48

GoogleCodeExporter commented 8 years ago
correct line for conversion should have a space before '|' in '%h| %ae |', 
should be
'%h | %ae | %ai'

git log --name-status
--pretty=format:'%n-------------------------------------------------------------
-----------%nr%h
| %ae | %ai (%aD) | x lines%nChanged paths:' >
~/src/codeswarm-read-only/convert_logs/activity.log

Original comment by oct...@gmail.com on 27 Jan 2010 at 9:36