Re: [RFC/PATCH 2/2] log: add "--no-show-signature" command line option
From: Mehul Jain <hidden>
Date: 2016-06-16 02:19:37
On Thu, May 26, 2016 at 10:52 PM, Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:quoted
On Thu, May 26, 2016 at 06:36:47PM +0530, Mehul Jain wrote:quoted
If "log.showsignature=true", then there is no way to override it using command line switch. Teach "git log" and "git show" about "--no-show-signature" command line option.I think this is teaching all of the revision machinery about it (which is a good thing).I agree that the proposed commit log message should be updated to say so. Because we do not want .showsignature configuration to affect rev-list nor format-patch, and we will not make "--show-sig" the default for them either. From that point of view, there is no reason for them to know about the "--no-show-signature" option. The only reason why teaching the "--no-show-signature" option to these commands is a good idea is because it would help people who create an alias with "--show-sig" in early part of the command line, e.g. [alias] fp = format-patch --show-signature by allowing them to countermand with --no-show-signature, i.e. $ git fp --no-show-signature ... If we are updating the log message in the final submission of this patch, we'd want it to be clear that the presence of this option is not an excuse to introduce .showsignature that affects rev-list later to make sure we do not have to waste our time rejecting such a patch in the future.
Currently, with the [patch 1/2], only git-show, git-log, git-whatchanged and git-reflog are able to learn about log.showsignature config variable. But commands which will learn about "--no-show-signature" with [patch 2/2] are notably a super-set of above mentioned commands. Introduction of this option should not give an impression that we might need log.showSignature for commands like git-format-patch etc, and it will definitely be a wise decision to convey the same in the commit message of this patch. I will do the necessary change. Just out of curiosity, I was thinking that we might be able to teach "--no-show-signature" option only to git-show, git-log, git-whatchanged and git-reflog. To do this we can introduce a new member "no_show_signature" in struct rev_info, and use this variable further to modify the value of value of "rev.show_signature" after init_revision() is called. This way we can selectively decide which commands should learn about "--no-show-signature". This may be a bad idea because we will have two variables in rev_info, for option --[no]-show-signature. Any thoughts? Thanks, Mehul