需要在 `git log` 上设置什么标志才能使其具有与 `git whatchanged` 相似的输出?
What flags need to be set on `git log` to make it have similar output to `git whatchanged`?
每个:Difference between git-log and git-whatchanged?
Encourage new users to use 'log' instead. These days, these commands are unified and just have different defaults.
我最近才发现 git whatchanged
但发现它的输出:
commit deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
Author: Egg Sample <mail@example.com>
Date: Mon Jan 28 16:32:04 2019 -0800
change some files
:100777 100644 abaddad1 feeb1e42 M src/changemymode.txt
:100644 100644 1234abcd abcd1234 M src/changemycontent.txt
:000000 100755 00000000 6600abcd A src/addme.txt
:100755 000000 feed1bee 00000000 D src/deleteme.txt
对我最近的特定工作流很有用(涉及一个有许多文件模式更改的分支)。出于好奇,我需要做什么才能使 git log
以这种方式运行,即:
- 显示提交信息,
- 旧模式、新模式、哈希值、
Modified|Added|Deleted
和更改文件的文件名
- 而不是差异本身
- (并默认排除合并,这也称为
git whatchanged
行为)。
我认为它可能是 --stat
或 --format
选项中的内容,但 git log --help
似乎没有提及任何有关获取文件模式和对象哈希值的信息使用这些选项,并快速扫描所述文档,我没有发现任何问题。
只是为了让这个问题得到解答:
通过这个 revised answer,git 的较新版本在 man git-whatchanged
上对此进行了解释
The whatchanged command is essentially the same as git-log(1) but defaults to show the raw format diff output and to skip merges.
所以:
git log --raw --no-merges
每个:Difference between git-log and git-whatchanged?
Encourage new users to use 'log' instead. These days, these commands are unified and just have different defaults.
我最近才发现 git whatchanged
但发现它的输出:
commit deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
Author: Egg Sample <mail@example.com>
Date: Mon Jan 28 16:32:04 2019 -0800
change some files
:100777 100644 abaddad1 feeb1e42 M src/changemymode.txt
:100644 100644 1234abcd abcd1234 M src/changemycontent.txt
:000000 100755 00000000 6600abcd A src/addme.txt
:100755 000000 feed1bee 00000000 D src/deleteme.txt
对我最近的特定工作流很有用(涉及一个有许多文件模式更改的分支)。出于好奇,我需要做什么才能使 git log
以这种方式运行,即:
- 显示提交信息,
- 旧模式、新模式、哈希值、
Modified|Added|Deleted
和更改文件的文件名 - 而不是差异本身
- (并默认排除合并,这也称为
git whatchanged
行为)。
我认为它可能是 --stat
或 --format
选项中的内容,但 git log --help
似乎没有提及任何有关获取文件模式和对象哈希值的信息使用这些选项,并快速扫描所述文档,我没有发现任何问题。
只是为了让这个问题得到解答:
通过这个 revised answer,git 的较新版本在 man git-whatchanged
The whatchanged command is essentially the same as git-log(1) but defaults to show the raw format diff output and to skip merges.
所以:
git log --raw --no-merges