• git commad —— git lsfiles —— 获取 文件 的修改信息


    $ git ls-files | while read f; do git blame -w -M -C -C --line-porcelain "$f" | grep -I '^author '; done 
    
    author CHN\123123
    author CHN\123123
    author CHN\123123
    author CHN\123123
    

      

    How do I show statistics for author's contributions in git?

    相关资料:https://gist.github.com/Alpha59/4e9cd6c65f7aa2711b79#file-creditwherecreditisdue-sh

    A very very slow one-liner that goes through a git blame and sees how many lines were contributed by each author.

    # creditwherecreditisdue.sh
     
    git ls-files -z | xargs -0n1 git blame -wfn | grep -v "test" | grep "\.(js|html)[^o]\s" | perl -n -e '/\((.*)\s[\d]{4}\-/ && print $1."\n"' | awk '{print $1" "$2" "$3}' | sort -f | uniq -c | sort -nr
     
    # Lists the number of lines that an author has contributed to the code base.
    # This also filters for !test and ==.js or .html (which was useful for this particular run)
     
    # A Django version of the same thing:
    git ls-files -z | xargs -0n1 git blame -wfn | grep -v "test" | grep -v "fixture" | grep -v "json" | grep -v "gpg" | grep -v ".md" | grep -v "initial_schema" | grep -v "fonts" | grep -v "min." | grep -v "migrations" | grep -v "images" | grep -v "/bootstrap" | grep -v "debug" | grep -v "/img" | grep -v "vendor" | perl -n -e '/\((.*)\s[\d]{4}\-/ && print $1."\n"' | awk '{print $1" "$2" "$3}' | sort -f | uniq -c | sort -nr
     
     
    # removemergedbranches.sh
     
    git branch --merged | grep -v `git rev-parse --abbrev-ref HEAD` | xargs git branch -d
     
    # checkout your dev branch, and then clean up your local by running this to remove all merged branches.
     
    # whatdidtheywrite.sh
     
    git ls-files -z | xargs -0n1 git blame -wfn | awk '/<author>/{print $0}'
     
    # I suggest only using this if the author has a small number of lines listed above.
    # I also adjusted it to include the file name and line number.
     
     
    # whatfilesdidtheychange.sh
     
    git ls-files -z | xargs -0n1 git blame -wfn | awk '/<author>/{print $2}' | sort -f | uniq -c | sort -nr
     
    # Lists out files that have been altered by a given author (including number of lines changed in that file).
    

      

  • 相关阅读:
    基于51单片机的独立按键和矩阵按键用法
    基于51单片机,蜂鸣器和led每秒1滴1亮的程序
    基于51单片机,3秒1亮的程序
    n个灯,隔m个依次点亮的具体情况方法
    单片机的定时器
    有关芯片的认识
    MATLAB变量
    二组玩法介绍
    tkinter的GUI界面
    magento 物流问题
  • 原文地址:https://www.cnblogs.com/panpanwelcome/p/15895881.html
Copyright © 2020-2023  润新知