git-fame

:star: Pretty-print `git` repository collaborators sorted by contributions

https://github.com/casperdcl/git-fame

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary

Keywords

author blame code-analysis commit cost git git-blame git-log loc ls-files pages shortlog

Keywords from Contributors

mathematics developer-tools energy-system-model animations
Last synced: 6 months ago · JSON representation

Repository

:star: Pretty-print `git` repository collaborators sorted by contributions

Basic Info
  • Host: GitHub
  • Owner: casperdcl
  • License: other
  • Language: Python
  • Default Branch: main
  • Homepage: https://git-fame.cdcl.ml
  • Size: 462 KB
Statistics
  • Stars: 747
  • Watchers: 4
  • Forks: 40
  • Open Issues: 15
  • Releases: 0
Topics
author blame code-analysis commit cost git git-blame git-log loc ls-files pages shortlog
Created almost 10 years ago · Last pushed 7 months ago
Metadata Files
Readme Funding Codeowners Zenodo

README.rst

git-fame
========

Pretty-print ``git`` repository collaborators sorted by contributions.

|Py-Versions| |PyPI| |Conda-Forge| |Docker| |Snapcraft|

|Build-Status| |Coverage-Status| |Branch-Coverage-Status| |Codacy-Grade| |Libraries-Rank| |PyPI-Downloads|

|DOI-URI| |LICENCE| |OpenHub-Status| |Sponsor-Casper|

.. code::

    https://git-fame.cdcl.ml/gh/{owner}/{repo}

|Contributions|

.. code:: sh

    git fame --cost hour,month --loc ins

.. code:: sh

    Processing: 100%|██████████████████████████| 1/1 [00:00<00:00,  2.16repo/s]
    Total commits: 1775
    Total ctimes: 2770
    Total files: 461
    Total hours: 449.7
    Total loc: 41659
    Total months: 151.0
    | Author               |   hrs |   mths |   loc |   coms |   fils |  distribution   |
    |:---------------------|------:|-------:|------:|-------:|-------:|:----------------|
    | Casper da Costa-Luis |   228 |    108 | 28572 |   1314 |    172 | 68.6/74.0/37.3  |
    | Stephen Larroque     |    28 |     18 |  5243 |    203 |     25 | 12.6/11.4/ 5.4  |
    | pgajdos              |     2 |      9 |  2606 |      2 |     18 | 6.3/ 0.1/ 3.9   |
    | Martin Zugnoni       |     2 |      5 |  1656 |      3 |      3 | 4.0/ 0.2/ 0.7   |
    | Kyle Altendorf       |     7 |      2 |   541 |     31 |      7 | 1.3/ 1.7/ 1.5   |
    | Hadrien Mary         |     5 |      1 |   469 |     31 |     17 | 1.1/ 1.7/ 3.7   |
    | Richard Sheridan     |     2 |      1 |   437 |     23 |      3 | 1.0/ 1.3/ 0.7   |
    | Guangshuo Chen       |     3 |      1 |   321 |     18 |      7 | 0.8/ 1.0/ 1.5   |
    | Noam Yorav-Raphael   |     4 |      1 |   229 |     11 |      6 | 0.5/ 0.6/ 1.3   |
    | github-actions[bot]  |     2 |      1 |   186 |      1 |     51 | 0.4/ 0.1/11.1   |
    ...

The ``distribution`` column is a percentage breakdown of ``loc/coms/fils``.
(e.g. in the table above, Casper has written surviving code in
``172/461 = 37.3%`` of all files).

------------------------------------------

.. contents:: Table of contents
   :backlinks: top
   :local:


Installation
------------

Latest PyPI stable release
~~~~~~~~~~~~~~~~~~~~~~~~~~

|PyPI| |PyPI-Downloads| |Libraries-Dependents|

.. code:: sh

    pip install git-fame

Latest development release on GitHub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

|GitHub-Status| |GitHub-Stars| |GitHub-Commits| |GitHub-Forks| |GitHub-Updated|

Pull and install:

.. code:: sh

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

Latest Conda release
~~~~~~~~~~~~~~~~~~~~

|Conda-Forge|

.. code:: sh

    conda install -c conda-forge git-fame

Latest Snapcraft release
~~~~~~~~~~~~~~~~~~~~~~~~

|Snapcraft|

.. code:: sh

    snap install git-fame

Latest Docker release
~~~~~~~~~~~~~~~~~~~~~

|Docker|

.. code:: sh

    docker run --rm casperdcl/git-fame --help
    docker run --rm -v "/local/path/to/repository:/repo" -u "$(id -u)" casperdcl/git-fame

Register alias with git
~~~~~~~~~~~~~~~~~~~~~~~

On Windows, run:

.. code:: sh

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

This is probably not necessary on UNIX systems.
If ``git fame`` doesn't work after restarting the terminal on Linux & Mac OS, try (with single quotes):

.. code:: sh

    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:

.. code:: sh

    $ # 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/main/git-fame_completion.bash \
        -O /etc/bash_completion.d/git-fame_completion.bash

followed by a terminal restart.


Changelog
---------

The list of all changes is available on the Releases page: |GitHub-Status|


Usage
-----

.. code:: sh

    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:

.. code:: sh

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

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

.. code:: python

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

Finally, there is a live server for public GitHub repositories at `git-fame.cdcl.ml/gh/{owner}/{repo} `_.

The ``rendered by git-fame.cdcl.ml`` watermark is removed for sponsors of `casperdcl `_: |Sponsor-Casper|


Documentation
-------------

.. code::

    Usage:
      git-fame [--help | options] [...]

    Arguments:
             Git directory [default: ./].
                     May be specified multiple times to aggregate across
                     multiple repositories.

    Options:
      -h, --help     Print this help and exit.
      -v, --version  Print module version and exit.
      --branch=   Branch or tag [default: HEAD] up to which to check.
      --sort=   [default: loc]|commits|files|hours|months.
      --min=    Minimum value (of `--sort` key) to show [default: 0:int].
      --loc=   surv(iving)|ins(ertions)|del(etions)
                     What `loc` represents. Use 'ins,del' to count both.
                     defaults to 'surviving' unless `--cost` is specified.
      --excl=     Excluded files (default: None).
                     In no-regex mode, may be a comma-separated list.
                     Escape (\,) for a literal comma (may require \\, in shell).
      --incl=     Included files [default: .*]. See `--excl` for format.
      --since=  Date from which to check. Can be absolute (eg: 1970-01-31)
                      or relative to now (eg: 3.weeks).
      --until=  Date to which to check. See `--since` for format.
      --cost=  Include time cost in person-months (COCOMO) or
                       person-hours (based on commit times).
                       Methods: month(s)|cocomo|hour(s)|commit(s).
                       May be multiple comma-separated values.
                       Alters `--loc` default to imply 'ins' (COCOMO) or
                       'ins,del' (hours).
      -R, --recurse  Recursively find repositories & submodules within .
      -n, --no-regex  Assume  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].
      --warn-binary  Don't silently skip files which appear to be binary data
                     [default: False].
      --show=  Author information to show [default: name]|email.
                     Use 'name,email' to show both.
      -e, --show-email  Shortcut for `--show=email`.
      --enum         Show row numbers [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].
      --ignore-rev=       Ignore changes made by the given revision
                               (requires `--loc=surviving`).
      --ignore-revs-file=   Ignore revisions listed in the given file
                               (requires `--loc=surviving`).
      --format=        Table format
          svg|[default: pipe]|md|markdown|yaml|yml|json|csv|tsv|tabulate.
          May require `git-fame[]`, e.g. `pip install git-fame[yaml]`.
          Any `tabulate.tabulate_formats` is also accepted.
      --manpath=         Directory in which to install git-fame man pages.
      --log=    FATAL|CRITICAL|ERROR|WARN(ING)|[default: INFO]|DEBUG|NOTSET.


If multiple user names and/or emails correspond to the same user, aggregate
``git-fame`` statistics and maintain a ``git`` repository properly by adding a
`.mailmap file `_.

FAQs
~~~~

Options such as ``-w``, ``-M``, and ``-C`` can increase accuracy, but take
longer to compute.

Note that specifying ``--sort=hours`` or ``--sort=months`` requires ``--cost``
to be specified appropriately.

Note that ``--cost=months`` (``--cost=COCOMO``) approximates
`person-months `_ and should be used with
``--loc=ins``.

Meanwhile, ``--cost=hours`` (``--cost=commits``) approximates
`person-hours `_.

Extra care should be taken when using ``ins`` and/or ``del`` for ``--loc``
since all historical files (including those no longer surviving) are counted.
In such cases, ``--excl`` may need to be significantly extended.
On the plus side, it is faster to compute ``ins`` and ``del`` compared to
``surv``.


Examples
--------

Badges
~~~~~~

An SVG image for inclusion in README files and websites:

.. code:: sh

   git fame -wMC --format svg --min 1 > docs/authors.svg

Which can also be dynamically created for public GitHub repositories:

.. code:: md

   ![markdown-image](https://git-fame.cdcl.ml/gh/{owner}/{repo}?min=1)

CODEOWNERS
~~~~~~~~~~

Generating
`CODEOWNERS `_:

.. code:: sh

    # bash syntax function for current directory git repository
    owners(){
      for f in $(git ls-files); do
        # filename
        echo -n "$f "
        # author emails if loc distribution >= 30%
        git fame -esnwMC --incl "$f" | tr '/' '|' \
          | awk -F '|' '(NR>6 && $6>=30) {print $2}' \
          | xargs echo
      done
    }

    # print to screen and file
    owners | tee .github/CODEOWNERS

    # same but with `tqdm` progress for large repos
    owners \
      | tqdm --total $(git ls-files | wc -l) \
        --unit file --desc "Generating CODEOWNERS" \
      > .github/CODEOWNERS

Zenodo config
~~~~~~~~~~~~~

Generating `.zenodo.json `_:

.. code:: sh

    git fame -wMC --format json \
      | jq -c '{creators: [.data[] | {name: .[0]}]}' \
      | sed -r -e 's/(\{"name")/\n    \1/g' -e 's/:/: /g' \
      > .zenodo.json


Contributions
-------------

|GitHub-Commits| |GitHub-Issues| |GitHub-PRs| |OpenHub-Status|

All source code is hosted on `GitHub `_.
Contributions are welcome.

|Contributions|

The ``rendered by git-fame.cdcl.ml`` watermark is removed for sponsors of `casperdcl `_: |Sponsor-Casper|

LICENCE
-------

Open Source (OSI approved): |LICENCE|

Citation information: |DOI-URI|

|README-Hits|

.. |Build-Status| image:: https://img.shields.io/github/actions/workflow/status/casperdcl/git-fame/test.yml?branch=main&label=git-fame&logo=GitHub
   :target: https://github.com/casperdcl/git-fame/actions/workflows/test.yml
.. |Coverage-Status| image:: https://img.shields.io/coveralls/github/casperdcl/git-fame/main?logo=coveralls
   :target: https://coveralls.io/github/casperdcl/git-fame
.. |Branch-Coverage-Status| image:: https://codecov.io/gh/casperdcl/git-fame/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/casperdcl/git-fame
.. |Codacy-Grade| image:: https://api.codacy.com/project/badge/Grade/bde789ee0e57491eb2bb8609bd4190c3
   :target: https://www.codacy.com/app/casper-dcl/git-fame/dashboard
.. |GitHub-Status| image:: https://img.shields.io/github/tag/casperdcl/git-fame.svg?maxAge=86400&logo=github
   :target: https://github.com/casperdcl/git-fame/releases
.. |GitHub-Forks| image:: https://img.shields.io/github/forks/casperdcl/git-fame.svg?logo=github
   :target: https://github.com/casperdcl/git-fame/network
.. |GitHub-Stars| image:: https://img.shields.io/github/stars/casperdcl/git-fame.svg?logo=github
   :target: https://github.com/casperdcl/git-fame/stargazers
.. |GitHub-Commits| image:: https://img.shields.io/github/commit-activity/y/casperdcl/git-fame?label=commits&logo=git
   :target: https://github.com/casperdcl/git-fame/graphs/commit-activity
.. |GitHub-Issues| image:: https://img.shields.io/github/issues-closed/casperdcl/git-fame.svg?logo=github
   :target: https://github.com/casperdcl/git-fame/issues
.. |GitHub-PRs| image:: https://img.shields.io/github/issues-pr-closed/casperdcl/git-fame.svg?logo=github
   :target: https://github.com/casperdcl/git-fame/pulls
.. |Contributions| image:: https://git-fame.cdcl.ml/gh/casperdcl/git-fame
   :target: https://git-fame.cdcl.ml/gh/casperdcl/git-fame
.. |GitHub-Updated| image:: https://img.shields.io/github/last-commit/casperdcl/git-fame?label=pushed&logo=github
   :target: https://github.com/casperdcl/git-fame/pulse
.. |Sponsor-Casper| image:: https://img.shields.io/badge/sponsor-FOSS-dc10ff.svg?logo=Contactless%20Payment
   :target: https://cdcl.ml/sponsor
.. |PyPI| image:: https://img.shields.io/pypi/v/git-fame.svg?logo=PyPI&logoColor=white
   :target: https://pypi.org/project/git-fame
.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/git-fame.svg?label=pypi%20downloads&logo=DocuSign
   :target: https://pypi.org/project/git-fame
.. |Py-Versions| image:: https://img.shields.io/pypi/pyversions/git-fame.svg?logo=python&logoColor=white
   :target: https://pypi.org/project/git-fame
.. |Conda-Forge| image:: https://img.shields.io/conda/v/conda-forge/git-fame.svg?label=conda-forge&logo=conda-forge
   :target: https://anaconda.org/conda-forge/git-fame
.. |Snapcraft| image:: https://img.shields.io/badge/snap-install-blue.svg?logo=snapcraft&logoColor=white
   :target: https://snapcraft.io/git-fame
.. |Docker| image:: https://img.shields.io/badge/docker-pull-blue.svg?logo=docker&logoColor=white
   :target: https://hub.docker.com/r/casperdcl/git-fame
.. |Libraries-Rank| image:: https://img.shields.io/librariesio/sourcerank/pypi/git-fame.svg?color=green&logo=koding
   :target: https://libraries.io/pypi/git-fame
.. |Libraries-Dependents| image:: https://img.shields.io/librariesio/dependent-repos/pypi/git-fame.svg?logo=koding
    :target: https://github.com/casperdcl/git-fame/network/dependents
.. |OpenHub-Status| image:: https://www.openhub.net/p/git-fame/widgets/project_thin_badge?format=gif
   :target: https://www.openhub.net/p/git-fame?ref=Thin+badge
.. |LICENCE| image:: https://img.shields.io/pypi/l/git-fame.svg?color=purple&logo=SPDX
   :target: https://raw.githubusercontent.com/casperdcl/git-fame/main/LICENCE
.. |DOI-URI| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.2544975-blue.svg?color=purple&logo=ORCID
   :target: https://doi.org/10.5281/zenodo.2544975
.. |README-Hits| image:: https://cgi.cdcl.ml/hits?q=git-fame&style=social&r=https://github.com/casperdcl/git-fame
   :target: https://cgi.cdcl.ml/hits?q=git-fame&a=plot&r=https://github.com/casperdcl/git-fame&style=social

Owner

  • Name: Casper da Costa-Luis
  • Login: casperdcl
  • Kind: user
  • Location: London, UK

Open Core Software Consultant & Technical Product Manager; Computational Physicist; member of IEEE, IOP, & @python Software Foundation

GitHub Events

Total
  • Create event: 6
  • Release event: 5
  • Issues event: 12
  • Watch event: 101
  • Delete event: 2
  • Issue comment event: 26
  • Push event: 31
  • Pull request review event: 8
  • Pull request review comment event: 4
  • Pull request event: 16
  • Fork event: 5
Last Year
  • Create event: 6
  • Release event: 5
  • Issues event: 12
  • Watch event: 101
  • Delete event: 2
  • Issue comment event: 26
  • Push event: 31
  • Pull request review event: 8
  • Pull request review comment event: 4
  • Pull request event: 16
  • Fork event: 5

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 268
  • Total Committers: 15
  • Avg Commits per committer: 17.867
  • Development Distribution Score (DDS): 0.067
Past Year
  • Commits: 23
  • Committers: 6
  • Avg Commits per committer: 3.833
  • Development Distribution Score (DDS): 0.217
Top Committers
Name Email Commits
Casper da Costa-Luis c****l@p****g 250
Cory Carson (Salesforce) c****n@s****m 5
BHA b****k@g****m 1
Constantin Piber c****r@g****m 1
Enda Farrell e****l@h****m 1
Gina Häußge f****l 1
Igor Gnatenko i****n@g****m 1
Jason R. Coombs j****o@j****m 1
Johann Mortara j****a@g****m 1
Nathanaël Houn c****t@n****r 1
Sebastian Spier g****b@s****u 1
Sebastien Lebreton s****n@l****r 1
Waldir Pimenta w****s@g****m 1
pre-commit-ci[bot] 6****] 1
Paolo Simone p****e@m****t 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 63
  • Total pull requests: 60
  • Average time to close issues: 4 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 44
  • Total pull request authors: 22
  • Average comments per issue: 1.73
  • Average comments per pull request: 2.35
  • Merged pull requests: 40
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 5
  • Pull requests: 19
  • Average time to close issues: 28 minutes
  • Average time to close pull requests: about 2 months
  • Issue authors: 4
  • Pull request authors: 7
  • Average comments per issue: 0.4
  • Average comments per pull request: 1.21
  • Merged pull requests: 12
  • Bot issues: 0
  • Bot pull requests: 5
Top Authors
Issue Authors
  • casperdcl (11)
  • bobeff (3)
  • KrisThielemans (3)
  • movahhedi (3)
  • waldyrious (2)
  • jaraco (2)
  • tredeske (2)
  • sffc (1)
  • kuisis (1)
  • polargeex (1)
  • vivodi (1)
  • baitouwei (1)
  • MisterGoodcat (1)
  • PsiPhiTheta (1)
  • MartinThoma (1)
Pull Request Authors
  • casperdcl (31)
  • snyk-bot (7)
  • pre-commit-ci[bot] (5)
  • nathanaelhoun (2)
  • cpiber (2)
  • sailro (2)
  • thehesiod (2)
  • bhalbayrak (1)
  • ccarson-publicsalesforce (1)
  • mdmedley (1)
  • ignatenkobrain (1)
  • jaraco (1)
  • spier (1)
  • tiagojsalmeida (1)
  • waldyrious (1)
Top Labels
Issue Labels
enhancement (21) bug (14) question (10) help wanted (2) invalid (2) duplicate (1) framework (1)
Pull Request Labels
enhancement (19) bug (16) framework (10) question (1) help wanted (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 9,732 last-month
  • Total dependent packages: 4
    (may contain duplicates)
  • Total dependent repositories: 20
    (may contain duplicates)
  • Total versions: 101
  • Total maintainers: 1
pypi.org: git-fame

Pretty-print `git` repository collaborators sorted by contributions

  • Versions: 41
  • Dependent Packages: 4
  • Dependent Repositories: 20
  • Downloads: 9,732 Last month
Rankings
Dependent packages count: 2.3%
Stargazers count: 2.8%
Dependent repos count: 3.3%
Average: 4.5%
Downloads: 6.9%
Forks count: 7.1%
Maintainers (1)
Last synced: 7 months ago
proxy.golang.org: github.com/casperdcl/git-fame
  • Versions: 50
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 6 months ago
conda-forge.org: git-fame
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 17.7%
Forks count: 29.9%
Average: 33.2%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 7 months ago

Dependencies

.github/workflows/comment-bot.yml actions
  • actions/checkout v2 composite
  • actions/github-script v2 composite
.github/workflows/test.yml actions
  • actions/cache v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • casperdcl/deploy-pypi v2 composite
  • elgohr/Publish-Docker-Github-Action master composite
  • reviewdog/action-setup v1 composite
  • snapcore/action-build v1 composite
  • snapcore/action-publish v1 composite
  • softprops/action-gh-release v1 composite
Dockerfile docker
  • python 3.9-alpine build
.meta/requirements-build.txt pypi
  • py-make >=0.1.0
  • twine *
  • wheel *
pyproject.toml pypi
setup.py pypi