Skip to main content

Pretty-print `git` repository collaborators sorted by contributions

Project description

Pretty-print git repository collaborators sorted by contributions.

PyPI-Status PyPI-Versions

Build-Status Coverage-Status Branch-Coverage-Status Codacy-Grade

LICENCE Donate OpenHub-Status

~$ git fame
Blame: 100%|███████████████████████████████████| 11/11 [00:00<00:00, 208.43it/s]
Total commits: 302
Total files: 37
Total loc: 3134
+----------------------+------+------+------+----------------+
| Author               |  loc | coms | fils |  distribution  |
+======================+======+======+======+================+
| Casper da Costa-Luis | 3123 |  297 |   35 | 99.6/98.3/85.4 |
| Not Committed Yet    |    7 |    4 |    2 |  0.2/ 1.3/ 4.9 |
| Evïan Etàcidñys      |    4 |    1 |    1 |  0.1/ 0.3/ 2.4 |
+----------------------+------+------+------+----------------+

The distribution column is a percentage breakdown of the other columns (e.g. in the table above, Casper has written surviving code in 35/37 = 85.4% of all files)


Installation

Latest PyPI stable release

PyPI-Status

pip install git-fame

Latest development release on github

GitHub-Status

Pull and install in the current directory:

pip install -e git+https://github.com/casperdcl/git-fame.git@master#egg=git-fame

Register alias with git

This is probably not necessary on UNIX systems.

git config --global alias.fame "!python -m gitfame"

Tab completion

Optionally, systems with bash-completion can install tab completion support. The git-fame_completion.bash file needs to be copied to an appropriate folder.

On Ubuntu, the procedure would be:

$ # Ensure completion works for `git` itself
$ sudo apt-get install bash-completion

$ # Install `git fame` completions
$ sudo wget \
    https://raw.githubusercontent.com/casperdcl/git-fame/master/git-fame_completion.bash \
    -O /etc/bash_completion.d/git-fame_completion.bash

followed by a terminal restart.

Usage

git fame              # If alias registered with git (see above)
git-fame              # Alternative execution as python console script
python -m gitfame     # Alternative execution as python module
git-fame -h           # Print help

For example, to print statistics regarding all source files in a C++/CUDA repository (*.c/h/t(pp), *.cu(h)), carefully handling whitespace and line copies:

git fame --incl '\.[cht][puh]{0,2}$' -twMC

It is also possible to run from within a python shell or script.

>>> import gitfame
>>> gitfame.main(['--sort=commits', '-wt', '/path/to/my/repo'])

Documentation

Usage:
  gitfame [--help | options] [<gitdir>]

Arguments:
  <gitdir>       Git directory [default: ./].

Options:
  -h, --help     Print this help and exit.
  -v, --version  Print module version and exit.
  --branch=<b>    Branch or tag [default: HEAD] up to which to check.
  --sort=<key>    [default: loc]|commits|files.
  --excl=<f>      Excluded files (default: None).
                  In no-regex mode, may be a comma-separated list.
                  Escape (\,) for a literal comma (may require \\, in shell).
  --incl=<f>      Included files [default: .*]. See `--excl` for format.
  --since=<date>  Date from which to check. Can be absoulte (eg: 1970-01-31)
                  or relative to now (eg: 3.weeks).
  -n, --no-regex  Assume <f> are comma-separated exact matches
                  rather than regular expressions [default: False].
                  NB: if regex is enabled `,` is equivalent to `|`.
  -s, --silent-progress    Suppress `tqdm` [default: False].
  -t, --bytype             Show stats per file extension [default: False].
  -w, --ignore-whitespace  Ignore whitespace when comparing the parent's
                           version and the child's to find where the lines
                           came from [default: False].
  -M              Detect intra-file line moves and copies [default: False].
  -C              Detect inter-file line moves and copies [default: False].
  --log=<lvl>     FATAL|CRITICAL|ERROR|WARN(ING)|[default: INFO]|DEBUG|NOTSET.

Changelog

The list of all changes is available either on Github’s Releases or on crawlers such as allmychanges.com.

Licence

Open Source (OSI approved): LICENCE

Copyright (c) 2016-2018 Casper da Costa-Luis.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

Authors

OpenHub-Status

git-fame-hits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-fame-1.5.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_fame-1.5.0-py2.py3-none-any.whl (13.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file git-fame-1.5.0.tar.gz.

File metadata

  • Download URL: git-fame-1.5.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for git-fame-1.5.0.tar.gz
Algorithm Hash digest
SHA256 098ea0a25d79be93014f8b846a2d53c4cbab9f6cb221e939eb494a50a32c93ae
MD5 2669ee5397685e0c56ac48b6fec7ab21
BLAKE2b-256 6acd123a9b4460fac0542e701f14ed5b4bfccc829fecbf0fc55cc2c10859c24d

See more details on using hashes here.

File details

Details for the file git_fame-1.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for git_fame-1.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4fd798beddf0f447f23f3e80e8a2d97aae16a24e60a6181d5b3a7b7b63c7d626
MD5 d59179669e80aab716512922927fb776
BLAKE2b-256 d6d8af77203a54d753901bf50c89ec3f3d39b7f4f56a65590080e45474be1a0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page