It's all about the answers!

Ask a question

How to create a Log of changes done in code?


Benjamin Maier (3316) | asked Feb 20 '17, 10:09 a.m.
retagged Feb 24 '17, 4:15 p.m. by Ken Tessier (84117)

Hello,

Inspired by the book "Code as a Crime scene", we would like to implement a feature to see "hot spots" of files that get edited often or in combination with other files. For that, a log file is necessary. The open source tool "code maat" itself uses different log formats for that, e.g. git log in the form

  git log --pretty=format:'[%h] %aN %ad %s' --date=short --numstat --after=YYYY-MM-DD

So that you create a log of all commits from a certain time on, with the edited files, authors and dates.
Is there any way possible, to extract similar change logs with the JAVA API? The data I am looking for should be somehow saved in the change sets, right? Without a log like this, a historical meta data analysis is hardly possible.

Thanks!

One answer



permanent link
Ralph Schoon (56.6k23642) | answered Feb 20 '17, 11:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I would suggest to look into the Jazz SCM Command Line before trying the API. 


I am reasonably sure that the RTC Java APIs and code from the RTC Client SDK would allow this. So you basically would have to look at the history of a stream - the histories of components in that stream beginning with the latest sate and iterate the change sets and their content and log that. I have talked to a partner that did something similar using the API and hooked up to the RTC SCM Deliver follow up action to be able to gather information asap.

Nevertheless, I would suggest to try using the SCM command line, because the API is not documented. I provided you wit the starting points in my blog rsjazz already in other questions you asked. You can search the blog also for SCM to find all blogs that have SCM API. 


Comments
Ralph Schoon commented Feb 20 '17, 11:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Another thing you can try is, compare two snapshots or baselines on a component in the Eclipse client. 

Then in the Change Explorer save the change log, if that is what you want. There is a variety of options what to include in the change log.

Your answer


Register or to post your answer.