-
Notifications
You must be signed in to change notification settings - Fork 344
FAQ
This document defines a list of some frequently asked questions from users of gitinspector. If you can't find your question in this list, there might very well be an issue available in the issue tracker that discusses it. The oldest questions added to this list are at the top.
Q: In our project, someone accidentally used two different e-mail addresses when committing and now we have duplicates for the same user shown by the generated gitinspector statistics.
A: This can easily happen. Luckily, git itself (not gitinspector) offers a solution via the use of a '.mailmap' file. See https://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html#_mapping_authors for more information.
Q: My insertions minus deletions in the statistics does not equal the number of lines that have survived. There must be something wrong with the statistics!
A: Probably not. The number of surviving lines will usually be different because the contributions from other authors will interfere with the statistics. Some other author might for example remove lines that you have written, or maybe you moved some of their code from one file to another?
Also, an insertion isn't strictly the same thing as the actual number of lines attributed to an author. When committing code, git will check for duplicates from other files and also check if a newly added file is a copy of some other file. If copies are detected; the author might not get the insertions but may still get some of the lines attributed to him or her.
Q: When showing responsibilities (via the -r flag), gitinspector shows that I am responsible for lines in a file (or files) that I have never edited. How can this be?
A: This is normal and probably means that someone else in the development team moved (or created) lines in that file from code originally written by you.
Q: How do I tell gitinspector to pass it's output to a file instead of the terminal? This would be very useful when outputting HTML. There doesn't seem to be any command-line parameter for this?
A: There isn't. You can just use the terminal to redirect stdout to a file. This can be done in most terminals by supplying ">". For example; passing the command "gitinspector -F html /path/to/git/repo > statistics.html" would write the gitinspector HTML output to the file "statistics.html" in the current directory.
Q: When running gitinspector; I get a UnicodeEncodeError exception.
A: This means that your terminal has an incompatible encoding configured that is unable to print out the characters being sent to it by gitinspector, typically because an author name contains characters outside ASCII. Since 0.5.0, gitinspector no longer aborts because of this: output that is redirected to a file or a pipe is always UTF-8, and a terminal that cannot show a character gets its escape sequence (such as J\xf6rg) instead. For a correct display, configure the terminal for UTF-8 or set the environment variable PYTHONIOENCODING to utf-8. See issue 161 for the background.
Q: When running gitinspector on Python 3, it exits immediately with TypeError: 'bool' object is not iterable.
A: This was caused by a change in the gettext module of Python 3 and is fixed since 0.5.0. If you use an older release, upgrade to the latest version.
Q: gitinspector reports fewer commits than git log shows for the same period, or leaves out an author I know committed during it.
A: Releases before 0.5.0 could lose commits made on branches that were merged later, because the analysis walked the history from the newest commit of each batch instead of taking the commits git had already listed. This is fixed since 0.5.0. If an author is still missing, check that the files committed have extensions that are included in the analysis; see the question below.
Q: When generating a HTML page with the -r flag, the number of minor authors in the responsibilities view does not equal the number of minor authors in the blame view. In fact, there are less minor authors in the responsibilities view. Strange things happen when generating text and HTML output also; some authors responsibilities are never shown at all. How is this possible?
A: Because the responsibilities view filters out any authors that only have lines inside comments. The responsibilities view calculates responsibilities by ELOC (Estimated-Lines-Of-Code). You can, in fact, even get a major author filtered out and not even shown if that author only has lines inside comments.
Q: When running gitinspector, there are authors missing from the report output that I am absolutely positive should be included. Why are they not being added as part of the statistical report?
A: Gitinspector is full of features and does a lot of things in order to remove data from reports that it considers "useless". One of the things gitinspector does on each execution is to filter out commits from the statistics based on file extension (suffix) and content. If your authors are not showing up, they have probably not committed any files or data that gitinspector considers valid. By default, gitinspector only considers the file extensions "java,c,cc,cpp,h,hh,hpp,py,glsl,rb,js,sql,go,swift". Use "-l" to see what file extensions are used and detected by gitinspector. Use "-f" to modify the list of scanned/included file extensions. Make sure to read through the complete Documentation and learn about the configuration options provided. As gitinspector only considers source code, binary data is never included in statistics. Consequently, pure binary commits are never counted.