If the changeset was empty or filtered with no matching files a bunch of
errors would be thrown from git with no proper results being returned
back to gitinspector.
We now pipe stderr (catching the output) and also check the return code
when running these commands.
Previoulsy, we were just checking against the changes returned from the
last repository analyzed - which of course broke the whole thing if that
repository had no matching commits!
This terminal was allowing backspaces (\b) to bypass column zero on the
current row, completely breaking the current way gitinspector was
clearing text outputted to the currently active row.
The bug was introduced with the commit ecc67a3 and was caused by the
initialization of an empty Changes object.
This fix makes sure that the __iadd__() method properly handles empty
change sets and returns a satisfactory object back when completing
execution.
Thus, we are overriding the "+=" operator instead of "+". This
implementation results in a much cleaner solution as we were directly
updating "self" when overriding __add__(), something which isn't really
an acceptable solution as we were changing the supplied in-parameters.
These functions and methods were originally based on the XML output.
Consequently, those variable names were also preserved. All "<name>_xml"
variables are now named "<name>_json" instead.
If one repository is found, the following format is used:
<repository>name</repository>
If multiple repositories are found, the following format is used:
<repositories>
<repository>name</repository>
<repository>name</repository>
...
</repositories>
This is the minimal version required by Bootstrap3 (which we will
base the new responsive HTML theme on). This upgrade required changes
to the JavaScript code, as toggle(...) has been deprecated since
version 1.9.x of JQuery.
Instead of clearing the row using the "\b" character on each
iteration, the function now passes a carriage return ("\r") instead.
Furthermore, the row is now always completely cleared before
printing the progress.
Upon start-up, now directly passes all supplied paths to git in order
to check if all of them point to a valid git repository.
The clone.create() function now returns a list of Repository instances,
containing the name and location of the repository. This is later
used in the gitinspector module to execute and parse the repository.
format.output_header(...) now takes a list of Repository instances.
Thanks to this, each output format can print every supplied repository.
This enables us to change the working directory for the git commands
in the function upon request. This change is in preparation of the
completion of #24.
Only the metrics module is lacking support. While the rest should work,
please note that it is completely untested as of now and probably
has some rough edges.
Just as before, all other parts of gitinspector currently do not
support fetching statistics from multiple repositories and just
simply fetch data from the last repository specified.
While they are considered, they are not yet being merged. Statistics
are only calculated for the last repository passed.
This is being done in preparation of completing issue #24.