Using git to identify all modified functions in a revision

前端 未结 3 694
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 13:15

Is there a good way to use git to identify all the modified functions in each revision in the history? I\'ve tried using the -p switch, but it doesn\'t seem to work in the

3条回答
  •  离开以前
    2020-11-30 13:40

    Here's a quick and dirty attempt at what I think you're going for. It does a git log to show all revisions, -p to include the diff in the log, a grep to only include the lines containing the commit ID and the hunk headers, and uses sed to filter out the line numbers, leaving only the guess at the function name that Git writes after the hunk header.

    git log -p | grep -E '^(commit|@@)' | sed 's/@@.*@@//'
    

提交回复
热议问题