【问题标题】:List last edits of all file by a collection of users列出一组用户对所有文件的最后编辑
【发布时间】:2015-03-07 23:30:42
【问题描述】:

问题:给定一个 git repo,显示由一组特定用户修改的文件,以及这些文件的最后一个编辑器(来自该组用户)。

可能的解决方案:

git ls-files | xargs -n 1 git log -1 --author="example.com" --name-only --pretty=format:'%aN' --follow -p | paste -d";" - -

这将产生所需的输出(如下),但它很慢

<author_a>;<file_a>
<author_b>;<file_b>
<author_b>;<file_c>
...

有没有更快/更好的方法来做到这一点?

【问题讨论】:

    标签: git git-ls-files


    【解决方案1】:

    您可以为此创建 alias,这样您就可以省去输入或复制该行的时间。

    要制作 alias,您只需使用 git alias 命令添加 alias 或直接将其粘贴到您的 .gitconfig 文件中

    您可以做的另一件事是修改 this script 以适应您所需的格式并将其添加到您的路径中,然后在您的 git 配置中为该脚本添加别名。

    例如,如果你想调用它git l

     = "!bash -c 'source ~/.githelpers && pretty_git_log'"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-07-31
      • 1970-01-01
      • 2013-08-11
      • 2016-05-09
      • 1970-01-01
      • 1970-01-01
      • 2020-08-06
      相关资源
      最近更新 更多