Commit Graph

17 Commits

Author SHA1 Message Date
Adam Waldenberg e0941fdcf1 The gitinspector.py entry module now considers all repositories.
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.
2015-10-30 23:46:13 +01:00
Adam Waldenberg c01a59430c Rewrote the config module into a class (GitConfig).
This class takes the initialization variable "global_only" which
will be set in the future whenever multiple repositories are
specified (See issue #24).

This will make sure that the git configuration is only read from the
global settings instead of per-repository.
2015-10-30 01:24:33 +01:00
Adam Waldenberg 124636cb85 Restructured imports slightly. 2015-10-21 05:26:20 +02:00
Marc Harper 9abb9b3d56 Relative imports to fix packaging issues 2015-10-20 09:40:08 -07:00
Adam Waldenberg b48c65efb1 All subprocess.Popen calls now use the list variant.
Most (all?) hard coded quotations have been removed in favor of automation
and the pipes or shlex modules.
2015-09-07 01:53:24 +02:00
Adam Waldenberg bc182c6924 Completely removed the missing module and the --checkout-missing option.
This is flag should not be needed anymore, as gitinspector always uses
a reference point such as HEAD or some reivision when looking into the
repository (never the file structure directly).
2013-08-03 10:30:43 +02:00
Adam Waldenberg cf63af8819 Fixed some pylint violations in some newly added code. 2013-07-14 04:47:34 +02:00
Adam Waldenberg 4fbcb48127 Rewrote git-config support once again.
It was still presuming that we were using optparse.
2013-07-14 04:15:10 +02:00
Adam Waldenberg 3b82acdfa1 Added a --localize-output flag.
The default behaviour is now not to localize the output, only the help
text and error messages (all the user interaction).

The way localized messages are fetched in the modules has been modified
as well; to allow for the ability to enable and disable the localization.
2013-07-10 05:24:18 +02:00
Adam Waldenberg 109fefb978 Fixed some small mistakes in relation to handling of git-config settings. 2013-07-10 03:32:29 +02:00
Adam Waldenberg 0d2bf9b0a8 Implemented optional boolean arguments to some command-line options.
Just like in many GNU tools, it is now possible to pass an optional
boolean to some of the flags of gitinspector in the form;

--flag[=BOOL]

This gives us the ability to override options set via git-config.
For example; say we did the following:

git-config --global inspector.timeline true

We could then override this setting when running gitinspector by supplying:

./gitinspector.py --timeline=false

Implementing this was not a trivial task, as no command-line parser in
Python supports this by default (getopt, optparse, argparse). In order to
properly handle optional boolean arguments; some clever patching had to
be done to the command-line in combination with a callback function that
can handle boolean strings. To maintain compatibility with Python 2.6,
this was implemented using optparse (instead of argparse).
2013-07-09 12:40:59 +02:00
Adam Waldenberg 021c1e479e git-config settings were not being fetched when a git directory was set.
It was only working if gitinspector was invoked inside a git directory.
2013-07-01 01:38:19 +02:00
Adam Waldenberg ce98a2ed70 Fixed a syntax error in the config module. 2013-07-01 00:34:28 +02:00
Adam Waldenberg ac5e38c8f0 The handling of output format was wrong in the config module. 2013-07-01 00:33:58 +02:00
Adam Waldenberg 84a7fd1945 Added support for --exclude to the git-config support.
In contrast to the -x/--exclude option that can be given on the command
line, --exclude can not be set multiple times when used with git-config.

Luckily, the same behavior can be attained by using the pipe ("|")
character. Ie, specifying the following on the command line:

-x "hello.txt" -x "goodbye.txt"

is the same thing as:

-x "hello.txt|goodbye.txt"

when sent to git-config or the command line.
2013-07-01 00:26:06 +02:00
Adam Waldenberg dcb4cedf27 Fixed some reported pylint violations. 2013-07-01 00:11:34 +02:00
Adam Waldenberg 8bd761f872 Settings for gitinspector can now be set using git-config.
All long options that can be set in gitinspector (with the exception of
--version and --help) can be configured using git-config. This is only the
first step towards the support of git-config. The reading of the command
line also needs to be changed to support overriding settings from
git-config before this is fully usable. Also; support for --exclude is
not yet included.

If we wanted to enable the timeline across all repositories when running
gitinspector we could do;

git-config --global inspector.timeline true

For local settings (per repository); the --local option can of course be
used when calling git-config.
2013-06-30 20:58:30 +02:00