How to get git-log to display commits using relati

2019-08-07 16:03发布

git show-branch displays commits using the relative revision expressions that can be parsed by git-parse-rev, for example "dev~106^2~52". How can I get the same output from git-log?

标签: git git-log
2条回答
时光不老,我们不散
2楼-- · 2019-08-07 16:26

Yes?: Something like git log | git name-rev --stdin, that is, see the git name-rev man page for obtaining this format.

I had a similar question describe a commit relative to a tag in parent^/ancestor~ format which was linked back here ;-)

查看更多
欢心
3楼-- · 2019-08-07 16:46

No.

The documentation for git log (git help log) describes ways to customize the output using --pretty=tformat:..., but unfortunately there is no placeholder for git describe-style revision identifiers, nor is there a placeholder to run a shell command and use its output. Either would make it possible to do what you want. Perhaps you can suggest them to the Git developers.

查看更多
登录 后发表回答