在 ~/.gitconfig 中放入什么来暗示 --show-signature 对于每个支持它的 git 子命令?

2023-12-25

我刚刚搜索过git-config(1) https://git-scm.com/docs/git-config, git-log(1) https://git-scm.com/docs/git-log and git-show(1) https://git-scm.com/docs/git-showgit 2.6.2 的手册页,但没有发现任何提示--show-signature选项(例如git show or git log)可以在我的全局配置~/.gitconfig对全部git支持它的子命令。

一个选项是别名,但由于我不知道哪些子命令都支持它,所以这只是一种解决方法,而不是解决方案。

我猜可能是core.show-signature = yes or core.showSignature = yes但这并没有改变任何事情。


I confirm that this --show-signature option (initially introduced in commit 0c37f1f, Oct 2011, Git v1.7.9-rc0 https://github.com/git/git/commit/0c37f1fce6cb7997dbb2703d35eef0dfd86c5070) has no config setting or environment variable.

如图所示提交 f2fef7b https://github.com/git/git/commit/f2fef7b55aea64104a6aee662817e1e6f0b22f71,该选项是“漂亮选项”的一部分Documentation/pretty-options.txt https://github.com/git/git/blob/f2fef7b55aea64104a6aee662817e1e6f0b22f71/Documentation/pretty-options.txt, which :

  • git show https://git-scm.com/docs/git-show
  • git diff-tree https://git-scm.com/docs/git-diff-tree
  • git rev-list https://git-scm.com/docs/git-rev-list
  • git log https://git-scm.com/docs/git-log

2016 年 7 月更新(8 个月后),使用 Git 2.10(2016 年第 3 季度):“git log” 学习log.showSignature配置变量和命令行选项“--no-show-signature”来反驳它。

See commit fce04c3 https://github.com/git/git/commit/fce04c3ca695d32c1b3c59e1bfc1fb4019025c72, commit aa37999 https://github.com/git/git/commit/aa3799996c310da756c7845950def4f6d51cccf3 (22 Jun 2016), commit aa37999 https://github.com/git/git/commit/aa3799996c310da756c7845950def4f6d51cccf3 (22 Jun 2016), and commit aefc81a https://github.com/git/git/commit/aefc81ad38b3a6fc88a0e8db6fafe75692f0d4b3 (24 Jun 2016) by Mehul Jain (mehul2029) https://github.com/mehul2029.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 369dc40 https://github.com/git/git/commit/369dc4081c836bc17ee1debaf6688eb098359760, 11 Jul 2016)

log: add log.showSignature配置变量

用户可能希望始终使用“--show-signature“使用时git-log和 相关命令。

When log.showSignature设置为 true,git-log和相关命令的行为就像“--show-signature”被给予他们。

请注意,此配置变量旨在影响git-log, git-show, git-whatchanged and git-reflog.
其他命令如git-format-patch, git-rev-list不受此配置变量的影响。


2017 年 5 月更新(11 个月后)

The git config手册页 https://github.com/git/git/blob/ba4dce784e4db4c00c5d54bb22c239080049b3ee/Documentation/config.txt#L2060-L2062现在更清楚了:

log.showSignature

If true, makes git-log, git-show, and git-whatchanged assume --show-signature.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 ~/.gitconfig 中放入什么来暗示 --show-signature 对于每个支持它的 git 子命令? 的相关文章

随机推荐