{"id":15118033,"url":"https://github.com/casperdcl/git-fame","last_synced_at":"2025-05-14T10:13:55.717Z","repository":{"id":43736468,"uuid":"55291721","full_name":"casperdcl/git-fame","owner":"casperdcl","description":":star: Pretty-print `git` repository collaborators sorted by contributions","archived":false,"fork":false,"pushed_at":"2025-03-31T17:47:28.000Z","size":440,"stargazers_count":713,"open_issues_count":20,"forks_count":39,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T22:39:52.337Z","etag":null,"topics":["author","blame","code-analysis","commit","cost","git","git-blame","git-log","loc","ls-files","shortlog"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casperdcl.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"casperdcl","custom":"https://cdcl.ml/sponsor"}},"created_at":"2016-04-02T11:44:45.000Z","updated_at":"2025-03-27T02:44:52.000Z","dependencies_parsed_at":"2024-03-15T21:23:42.547Z","dependency_job_id":"8a2314fd-e3e4-4eb6-92d0-1f97e7500664","html_url":"https://github.com/casperdcl/git-fame","commit_stats":{"total_commits":255,"total_committers":13,"mean_commits":"19.615384615384617","dds":0.08235294117647063,"last_synced_commit":"f736731c59931836fd0489c7374630cd0ff0a029"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperdcl%2Fgit-fame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperdcl%2Fgit-fame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperdcl%2Fgit-fame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casperdcl%2Fgit-fame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casperdcl","download_url":"https://codeload.github.com/casperdcl/git-fame/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248338386,"owners_count":21087207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["author","blame","code-analysis","commit","cost","git","git-blame","git-log","loc","ls-files","shortlog"],"created_at":"2024-09-26T01:46:06.649Z","updated_at":"2025-04-11T03:38:24.772Z","avatar_url":"https://github.com/casperdcl.png","language":"Python","funding_links":["https://github.com/sponsors/casperdcl","https://cdcl.ml/sponsor"],"categories":["Python"],"sub_categories":[],"readme":"git-fame\n========\n\nPretty-print ``git`` repository collaborators sorted by contributions.\n\n|Py-Versions| |PyPI| |Conda-Forge| |Docker| |Snapcraft|\n\n|Build-Status| |Coverage-Status| |Branch-Coverage-Status| |Codacy-Grade| |Libraries-Rank| |PyPI-Downloads|\n\n|DOI-URI| |LICENCE| |OpenHub-Status| |Sponsor-Casper|\n\n.. code:: sh\n\n    ~$ git fame --cost hour,month --loc ins\n    Processing: 100%|██████████████████████████| 1/1 [00:00\u003c00:00,  2.16repo/s]\n    Total commits: 1775\n    Total ctimes: 2770\n    Total files: 461\n    Total hours: 449.7\n    Total loc: 41659\n    Total months: 151.0\n    | Author               |   hrs |   mths |   loc |   coms |   fils |  distribution   |\n    |:---------------------|------:|-------:|------:|-------:|-------:|:----------------|\n    | Casper da Costa-Luis |   228 |    108 | 28572 |   1314 |    172 | 68.6/74.0/37.3  |\n    | Stephen Larroque     |    28 |     18 |  5243 |    203 |     25 | 12.6/11.4/ 5.4  |\n    | pgajdos              |     2 |      9 |  2606 |      2 |     18 | 6.3/ 0.1/ 3.9   |\n    | Martin Zugnoni       |     2 |      5 |  1656 |      3 |      3 | 4.0/ 0.2/ 0.7   |\n    | Kyle Altendorf       |     7 |      2 |   541 |     31 |      7 | 1.3/ 1.7/ 1.5   |\n    | Hadrien Mary         |     5 |      1 |   469 |     31 |     17 | 1.1/ 1.7/ 3.7   |\n    | Richard Sheridan     |     2 |      1 |   437 |     23 |      3 | 1.0/ 1.3/ 0.7   |\n    | Guangshuo Chen       |     3 |      1 |   321 |     18 |      7 | 0.8/ 1.0/ 1.5   |\n    | Noam Yorav-Raphael   |     4 |      1 |   229 |     11 |      6 | 0.5/ 0.6/ 1.3   |\n    | github-actions[bot]  |     2 |      1 |   186 |      1 |     51 | 0.4/ 0.1/11.1   |\n    ...\n\nThe ``distribution`` column is a percentage breakdown of ``loc/coms/fils``.\n(e.g. in the table above, Casper has written surviving code in\n``172/461 = 37.3%`` of all files).\n\n------------------------------------------\n\n.. contents:: Table of contents\n   :backlinks: top\n   :local:\n\n\nInstallation\n------------\n\nLatest PyPI stable release\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n|PyPI| |PyPI-Downloads| |Libraries-Dependents|\n\n.. code:: sh\n\n    pip install git-fame\n\nLatest development release on GitHub\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n|GitHub-Status| |GitHub-Stars| |GitHub-Commits| |GitHub-Forks| |GitHub-Updated|\n\nPull and install:\n\n.. code:: sh\n\n    pip install \"git+https://github.com/casperdcl/git-fame.git@main#egg=git-fame\"\n\nLatest Conda release\n~~~~~~~~~~~~~~~~~~~~\n\n|Conda-Forge|\n\n.. code:: sh\n\n    conda install -c conda-forge git-fame\n\nLatest Snapcraft release\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n|Snapcraft|\n\n.. code:: sh\n\n    snap install git-fame\n\nLatest Docker release\n~~~~~~~~~~~~~~~~~~~~~\n\n|Docker|\n\n.. code:: sh\n\n    docker pull casperdcl/git-fame\n    docker run --rm casperdcl/git-fame --help\n    docker run --rm -v \u003c/local/path/to/repository\u003e:/repo casperdcl/git-fame\n\nRegister alias with git\n~~~~~~~~~~~~~~~~~~~~~~~\n\nOn Windows, run:\n\n.. code:: sh\n\n    git config --global alias.fame \"!python -m gitfame\"\n\nThis is probably not necessary on UNIX systems.\nIf ``git fame`` doesn't work after restarting the terminal on Linux \u0026 Mac OS, try (with single quotes):\n\n.. code:: sh\n\n    git config --global alias.fame '!python -m gitfame'\n\nTab completion\n~~~~~~~~~~~~~~\n\nOptionally, systems with ``bash-completion`` can install tab completion\nsupport. The\n`git-fame_completion.bash \u003chttps://raw.githubusercontent.com/casperdcl/git-fame/main/git-fame_completion.bash\u003e`__\nfile needs to be copied to an appropriate folder.\n\nOn Ubuntu, the procedure would be:\n\n.. code:: sh\n\n    $ # Ensure completion works for `git` itself\n    $ sudo apt-get install bash-completion\n\n    $ # Install `git fame` completions\n    $ sudo wget \\\n        https://raw.githubusercontent.com/casperdcl/git-fame/main/git-fame_completion.bash \\\n        -O /etc/bash_completion.d/git-fame_completion.bash\n\nfollowed by a terminal restart.\n\n\nChangelog\n---------\n\nThe list of all changes is available on the Releases page: |GitHub-Status|.\n\n\nUsage\n-----\n\n.. code:: sh\n\n    git fame              # If alias registered with git (see above)\n    git-fame              # Alternative execution as python console script\n    python -m gitfame     # Alternative execution as python module\n    git-fame -h           # Print help\n\nFor example, to print statistics regarding all source files in a C++/CUDA\nrepository (``*.c/h/t(pp), *.cu(h)``), carefully handling whitespace and line\ncopies:\n\n.. code:: sh\n\n    git fame --incl '\\.[cht][puh]{0,2}$' -twMC\n\nIt is also possible to run from within a python shell or script.\n\n.. code:: python\n\n    \u003e\u003e\u003e import gitfame\n    \u003e\u003e\u003e gitfame.main(['--sort=commits', '-wt', '/path/to/my/repo'])\n\n\nDocumentation\n-------------\n\n|Py-Versions| |README-Hits|\n\n.. code::\n\n    Usage:\n      git-fame [--help | options] [\u003cgitdir\u003e...]\n\n    Arguments:\n      \u003cgitdir\u003e       Git directory [default: ./].\n                     May be specified multiple times to aggregate across\n                     multiple repositories.\n\n    Options:\n      -h, --help     Print this help and exit.\n      -v, --version  Print module version and exit.\n      --branch=\u003cb\u003e   Branch or tag [default: HEAD] up to which to check.\n      --sort=\u003ckey\u003e   [default: loc]|commits|files|hours|months.\n      --loc=\u003ctype\u003e   surv(iving)|ins(ertions)|del(etions)\n                     What `loc` represents. Use 'ins,del' to count both.\n                     defaults to 'surviving' unless `--cost` is specified.\n      --excl=\u003cf\u003e     Excluded files (default: None).\n                     In no-regex mode, may be a comma-separated list.\n                     Escape (\\,) for a literal comma (may require \\\\, in shell).\n      --incl=\u003cf\u003e     Included files [default: .*]. See `--excl` for format.\n      --since=\u003cdate\u003e  Date from which to check. Can be absolute (eg: 1970-01-31)\n                      or relative to now (eg: 3.weeks).\n      --until=\u003cdate\u003e  Date to which to check. See `--since` for format.\n      --cost=\u003cmethod\u003e  Include time cost in person-months (COCOMO) or\n                       person-hours (based on commit times).\n                       Methods: month(s)|cocomo|hour(s)|commit(s).\n                       May be multiple comma-separated values.\n                       Alters `--loc` default to imply 'ins' (COCOMO) or\n                       'ins,del' (hours).\n      -R, --recurse  Recursively find repositories \u0026 submodules within \u003cgitdir\u003e.\n      -n, --no-regex  Assume \u003cf\u003e are comma-separated exact matches\n                      rather than regular expressions [default: False].\n                      NB: if regex is enabled ',' is equivalent to '|'.\n      -s, --silent-progress    Suppress `tqdm` [default: False].\n      --warn-binary  Don't silently skip files which appear to be binary data\n                     [default: False].\n      -e, --show-email  Show author email instead of name [default: False].\n      --enum         Show row numbers [default: False].\n      -t, --bytype             Show stats per file extension [default: False].\n      -w, --ignore-whitespace  Ignore whitespace when comparing the parent's\n                               version and the child's to find where the lines\n                               came from [default: False].\n      -M             Detect intra-file line moves and copies [default: False].\n      -C             Detect inter-file line moves and copies [default: False].\n      --ignore-rev=\u003crev\u003e       Ignore changes made by the given revision\n                               (requires `--loc=surviving`).\n      --ignore-revs-file=\u003cf\u003e   Ignore revisions listed in the given file\n                               (requires `--loc=surviving`).\n      --format=\u003cformat\u003e        Table format\n          [default: pipe]|md|markdown|yaml|yml|json|csv|tsv|tabulate.\n          May require `git-fame[\u003cformat\u003e]`, e.g. `pip install git-fame[yaml]`.\n          Any `tabulate.tabulate_formats` is also accepted.\n      --manpath=\u003cpath\u003e         Directory in which to install git-fame man pages.\n      --log=\u003clvl\u003e    FATAL|CRITICAL|ERROR|WARN(ING)|[default: INFO]|DEBUG|NOTSET.\n\n\nIf multiple user names and/or emails correspond to the same user, aggregate\n``git-fame`` statistics and maintain a ``git`` repository properly by adding a\n`.mailmap file \u003chttps://git-scm.com/docs/git-blame#_mapping_authors\u003e`_.\n\nFAQs\n~~~~\n\nOptions such as ``-w``, ``-M``, and ``-C`` can increase accuracy, but take\nlonger to compute.\n\nNote that specifying ``--sort=hours`` or ``--sort=months`` requires ``--cost``\nto be specified appropriately.\n\nNote that ``--cost=months`` (``--cost=COCOMO``) approximates\n`person-months \u003chttps://en.wikipedia.org/wiki/COCOMO\u003e`_ and should be used with\n``--loc=ins``.\n\nMeanwhile, ``--cost=hours`` (``--cost=commits``) approximates\n`person-hours \u003chttps://github.com/kimmobrunfeldt/git-hours/blob/8aaeee237cb9d9028e7a2592a25ad8468b1f45e4/index.js#L114-L143\u003e`_.\n\nExtra care should be taken when using ``ins`` and/or ``del`` for ``--loc``\nsince all historical files (including those no longer surviving) are counted.\nIn such cases, ``--excl`` may need to be significantly extended.\nOn the plus side, it is faster to compute ``ins`` and ``del`` compared to\n``surv``.\n\nExamples\n--------\n\nCODEOWNERS\n~~~~~~~~~~\n\nGenerating\n`CODEOWNERS \u003chttps://help.github.com/en/articles/about-code-owners\u003e`__:\n\n.. code:: sh\n\n    # bash syntax function for current directory git repository\n    owners(){\n      for f in $(git ls-files); do\n        # filename\n        echo -n \"$f \"\n        # author emails if loc distribution \u003e= 30%\n        git fame -esnwMC --incl \"$f\" | tr '/' '|' \\\n          | awk -F '|' '(NR\u003e6 \u0026\u0026 $6\u003e=30) {print $2}' \\\n          | xargs echo\n      done\n    }\n\n    # print to screen and file\n    owners | tee .github/CODEOWNERS\n\n    # same but with `tqdm` progress for large repos\n    owners \\\n      | tqdm --total $(git ls-files | wc -l) \\\n        --unit file --desc \"Generating CODEOWNERS\" \\\n      \u003e .github/CODEOWNERS\n\nZenodo config\n~~~~~~~~~~~~~\n\nGenerating `.zenodo.json \u003chttps://developers.zenodo.org/#deposit-metadata\u003e`__:\n\n.. code:: sh\n\n    git fame -wMC --format json \\\n      | jq -c '{creators: [.data[] | {name: .[0]}]}' \\\n      | sed -r -e 's/(\\{\"name\")/\\n    \\1/g' -e 's/:/: /g' \\\n      \u003e .zenodo.json\n\nContributions\n-------------\n\n|GitHub-Commits| |GitHub-Issues| |GitHub-PRs| |OpenHub-Status|\n\nAll source code is hosted on `GitHub \u003chttps://github.com/casperdcl/git-fame\u003e`__.\nContributions are welcome.\n\n\nLICENCE\n-------\n\nOpen Source (OSI approved): |LICENCE|\n\nCitation information: |DOI-URI|\n\n\nAuthors\n-------\n\n|OpenHub-Status|\n\n- Casper da Costa-Luis (`casperdcl \u003chttps://github.com/casperdcl\u003e`__ |Sponsor-Casper|)\n\nWe are grateful for all |GitHub-Contributions|.\n\n|README-Hits|\n\n.. |Build-Status| image:: https://img.shields.io/github/actions/workflow/status/casperdcl/git-fame/test.yml?branch=main\u0026label=git-fame\u0026logo=GitHub\n   :target: https://github.com/casperdcl/git-fame/actions/workflows/test.yml\n.. |Coverage-Status| image:: https://img.shields.io/coveralls/github/casperdcl/git-fame/main?logo=coveralls\n   :target: https://coveralls.io/github/casperdcl/git-fame\n.. |Branch-Coverage-Status| image:: https://codecov.io/gh/casperdcl/git-fame/branch/main/graph/badge.svg\n   :target: https://codecov.io/gh/casperdcl/git-fame\n.. |Codacy-Grade| image:: https://api.codacy.com/project/badge/Grade/bde789ee0e57491eb2bb8609bd4190c3\n   :target: https://www.codacy.com/app/casper-dcl/git-fame/dashboard\n.. |GitHub-Status| image:: https://img.shields.io/github/tag/casperdcl/git-fame.svg?maxAge=86400\u0026logo=github\n   :target: https://github.com/casperdcl/git-fame/releases\n.. |GitHub-Forks| image:: https://img.shields.io/github/forks/casperdcl/git-fame.svg?logo=github\n   :target: https://github.com/casperdcl/git-fame/network\n.. |GitHub-Stars| image:: https://img.shields.io/github/stars/casperdcl/git-fame.svg?logo=github\n   :target: https://github.com/casperdcl/git-fame/stargazers\n.. |GitHub-Commits| image:: https://img.shields.io/github/commit-activity/y/casperdcl/git-fame?label=commits\u0026logo=git\n   :target: https://github.com/casperdcl/git-fame/graphs/commit-activity\n.. |GitHub-Issues| image:: https://img.shields.io/github/issues-closed/casperdcl/git-fame.svg?logo=github\n   :target: https://github.com/casperdcl/git-fame/issues\n.. |GitHub-PRs| image:: https://img.shields.io/github/issues-pr-closed/casperdcl/git-fame.svg?logo=github\n   :target: https://github.com/casperdcl/git-fame/pulls\n.. |GitHub-Contributions| image:: https://img.shields.io/github/contributors/casperdcl/git-fame.svg?logo=github\n   :target: https://github.com/casperdcl/git-fame/graphs/contributors\n.. |GitHub-Updated| image:: https://img.shields.io/github/last-commit/casperdcl/git-fame?label=pushed\u0026logo=github\n   :target: https://github.com/casperdcl/git-fame/pulse\n.. |Sponsor-Casper| image:: https://img.shields.io/badge/sponsor-FOSS-dc10ff.svg?logo=Contactless%20Payment\n   :target: https://cdcl.ml/sponsor\n.. |PyPI| image:: https://img.shields.io/pypi/v/git-fame.svg?logo=PyPI\u0026logoColor=white\n   :target: https://pypi.org/project/git-fame\n.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/git-fame.svg?label=pypi%20downloads\u0026logo=DocuSign\n   :target: https://pypi.org/project/git-fame\n.. |Py-Versions| image:: https://img.shields.io/pypi/pyversions/git-fame.svg?logo=python\u0026logoColor=white\n   :target: https://pypi.org/project/git-fame\n.. |Conda-Forge| image:: https://img.shields.io/conda/v/conda-forge/git-fame.svg?label=conda-forge\u0026logo=conda-forge\n   :target: https://anaconda.org/conda-forge/git-fame\n.. |Snapcraft| image:: https://img.shields.io/badge/snap-install-blue.svg?logo=snapcraft\u0026logoColor=white\n   :target: https://snapcraft.io/git-fame\n.. |Docker| image:: https://img.shields.io/badge/docker-pull-blue.svg?logo=docker\u0026logoColor=white\n   :target: https://hub.docker.com/r/casperdcl/git-fame\n.. |Libraries-Rank| image:: https://img.shields.io/librariesio/sourcerank/pypi/git-fame.svg?color=green\u0026logo=koding\n   :target: https://libraries.io/pypi/git-fame\n.. |Libraries-Dependents| image:: https://img.shields.io/librariesio/dependent-repos/pypi/git-fame.svg?logo=koding\n    :target: https://github.com/casperdcl/git-fame/network/dependents\n.. |OpenHub-Status| image:: https://www.openhub.net/p/git-fame/widgets/project_thin_badge?format=gif\n   :target: https://www.openhub.net/p/git-fame?ref=Thin+badge\n.. |LICENCE| image:: https://img.shields.io/pypi/l/git-fame.svg?color=purple\u0026logo=SPDX\n   :target: https://raw.githubusercontent.com/casperdcl/git-fame/main/LICENCE\n.. |DOI-URI| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.2544975-blue.svg?color=purple\u0026logo=ORCID\n   :target: https://doi.org/10.5281/zenodo.2544975\n.. |README-Hits| image:: https://cgi.cdcl.ml/hits?q=git-fame\u0026style=social\u0026r=https://github.com/casperdcl/git-fame\n   :target: https://cgi.cdcl.ml/hits?q=git-fame\u0026a=plot\u0026r=https://github.com/casperdcl/git-fame\u0026style=social\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasperdcl%2Fgit-fame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasperdcl%2Fgit-fame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasperdcl%2Fgit-fame/lists"}