按贡献排序的漂亮打印“git”存储库协作者

git-fame的Python项目详细描述


漂亮的打印git按贡献排序的存储库协作者。

PyPI-VersionsPyPI-StatusDockerSnapcraft

Build-StatusCoverage-StatusBranch-Coverage-StatusCodacy-GradeLibraries-RankPyPI-Downloads

DOI-URILICENCEOpenHub-StatusGift-Casper

~$ git fame
Blame: 100%|██████████|20/20 [00:00<00:00, 175.94file/s]
Total commits: 99
Total files: 21
Total loc: 305| Author               |   loc |   coms |   fils |  distribution   ||:---------------------|------:|-------:|-------:|:----------------|| Casper da Costa-Luis |304|97|20|99.7/98.0/95.2  || Igor Gnatenko        |1|1|1|0.3/ 1.0/ 4.8   || Johann Mortara       |0|1|0|0.0/ 1.0/ 0.0   |

distribution列是其他列的百分比细分 (例如,在上表中,casper在 20/21 = 95.2%所有文件)。


Installation

Latest PyPI stable release

PyPI-StatusPyPI-DownloadsLibraries-Dependents

pip install git-fame

Latest development release on GitHub

GitHub-StatusGitHub-StarsGitHub-CommitsGitHub-ForksGitHub-Updated

在当前目录中拉入并安装:

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

Latest Snapcraft release

Snapcraft

snap install git-fame

Latest Docker release

Docker

docker pull casperdcl/git-fame
docker run --rm casperdcl/git-fame --help
docker run --rm -v </local/path/to/repository>:/repo casperdcl/git-fame

Register alias with git

这在UNIX系统上可能是不必要的

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

Tab completion

可选地,具有bash-completion的系统可以安装tab completion 支持。这个 git-fame_completion.bash 需要将文件复制到适当的文件夹中。

在ubuntu上,程序是:

$ # 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

然后是终端重启

Changelog

所有更改的列表可在GitHub的版本中找到: GitHub-Status或爬虫程序,如 allmychanges.com

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

例如,在C++/CUDA中打印关于所有源文件的统计信息 存储库(*.c/h/t(pp), *.cu(h)),仔细处理空白和行 副本:

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

也可以从python shell或脚本中运行。

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

Documentation

PyPI-VersionsREADME-Hits

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|hours|months.
  --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).
  --cost=<method>  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.
  -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].
  --warn-binary   Don't silently skip files which appear to be binary data
                  [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].
  -e, --show-email      Show author email instead of name [default: False].
  -M  Detect intra-file line moves and copies [default: False].
  -C  Detect inter-file line moves and copies [default: False].
  --format=<format>        Table format
      [default: pipe]|md|markdown|yaml|yml|json|csv|tsv|tabulate.
      May require `git-fame[<format>]`, e.g. `pip install git-fame[yaml]`.
      Any `tabulate.tabulate_formats` is also accepted.
  --manpath=<path>         Directory in which to install git-fame man pages.
  --log=<lvl>     FATAL|CRITICAL|ERROR|WARN(ING)|[default: INFO]|DEBUG|NOTSET.

如果多个用户名和/或电子邮件对应于同一个用户,则聚合 git-famestatistics并通过添加 .mailmap file

Examples

CODEOWNERS

生成 CODEOWNERS

# 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 echodone}# 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

Contributions

GitHub-CommitsGitHub-IssuesGitHub-PRsOpenHub-Status

所有源代码都托管在GitHub上。 欢迎捐款

LICENCE

开源(OSI批准):LICENCE

引文信息:DOI-URI

Authors

OpenHub-Status

  • 卡斯帕·达·科斯塔·路易斯(casperdclGift-Casper

我们感谢所有人。

README-Hits

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JavaFX 11可编辑组合框引发IndexOutOfBoundsException   java选择数组中的数组元素   java我从来没有找到创建2D ArrayList的正确方法   java JPA查找orderById的顶部数据,并按字符串过滤Id   使用java在ejabberd中进行xmpp外部身份验证   从ajax调用向java传递点运算符   java如何使用ReadWriteLock   使用Spring控制器和jQueryAjax的java重定向   java使JFrame中的JPanel可滚动   java如何用多个。jar库?   java EditText在RecyclerView中失去了对滚动的关注   java为什么我们必须扩展Servlet或GenericServlet或HttpServlet来创建Servlet应用程序?如果不扩展,我们可以开发Servlet应用程序吗?   使用递归java查找数组中的最大值   具有不同字段数的html表单的java域传输对象   java文本视图扩展;不支持操作异常   java如何使用iText的HTMLWorker类将多语言HTML字符串呈现为PDF