繁体   English   中英

使用 git rev-list(或任何其他管道命令)访问 reflog 主题

[英]Access reflog subject with git rev-list (or any other plumbing command)

我想使用管道命令访问 reflog 主题。 我希望:

$ git rev-list --format='%gs' --walk-reflogs HEAD

给我我想要的,但这只是给了我 output 之类的:

commit f1cb402488661fb3662ad876e98fcce991677333
commit 65e9bd51169e7f54f76edc9dbc926ec92af2fd7f
commit 1139b67c36f878a0e82e1dad141404ed7fb0923a
commit bea98a6a32477ad8e93929ac8d8f2ec66a9d3375
commit 9682247a229f2954820887212b7769a2a89ccd45
commit a73583bb74fd4d6db7bed6a6b61ba17be812e842
commit 96dbe20f02c58f6f5599495978e962a0ee285ce8
commit aba4a324c3f95ebebf8f3c8b2db3c89660a25ebe
commit 1139b67c36f878a0e82e1dad141404ed7fb0923a
commit f35aedc3594f9cb9dce5c89638d80e19c5f257b9

奥托:

git reflog --format='%gs' HEAD 

给了我我所期望的。

git refloggit log的前端(不是git rev-list )。 虽然git rev-list既是一个管道命令,也是git log的姊妹命令,但它并不完全等同git log的管道版本。 特别是——正如你所发现的——它没有很好的方法来访问和格式化部分提交。

相当可悲的 state是没有git log的管道版本 也许,像git status--porcelain把它变成管道, git log需要--porcelain ,这样我们就不需要运行git -c log.decorate=... log.pretty=...某些用户的.gitconfig中可能存在的任何内容。 (这并不是说只有装饰和漂亮的设置需要覆盖:这只是我在这里能想到的两个。哦,当然,寻呼机也是如此。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM