{"thread":{"id":"56991","subject":"Git SSH/GPG signing flags and config","startedAt":"2021-11-28T12:59:09Z","lastAt":"2021-12-05T11:36:55Z","messageCount":3,"participants":["Fabian Stelzer","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"442414","messageId":"20211128125704.4twinfd3wriwdntz@fs","threadId":"56991","inReplyTo":null,"subject":"Git SSH/GPG signing flags and config","fromName":"Fabian Stelzer","fromEmail":"fs@gigacodes.de","sentAt":"2021-11-28T12:57:04Z","receivedAt":"2021-11-28T12:59:09Z","isPatch":false,"sender":{"key":"fs@gigacodes.de","avatar":"https://avatars.githubusercontent.com/u/564858?v=4"},"body":"Hi everyone,\nthe `signing git objects with ssh` series was released with 2.34 and i'd \nlike to thank everyone for your support and the good reviews!\nI think it would be beneficial now to adjust some of the wording in flags \nand the config. Currently everything is configured via gpg.* and all the \n`please sign this` flags are named --(no-?)gpg-sign.\nI would be in favor of a more generic flag independent of the signing \nmechanism. Adding something like `--ssh-sign` would suggest that you'd be \nable to switch signing format with it which i think would not be terribly \nuseful. If you need to use multiple signing mechanism those would usually be \nconfigured per repository and can easily be done with an `includeif gitdir:` \nin your config.\nTherefore i would suggest just adding a generic `--(no-?)sign` to all the \ncommands that support gpg-sign right now. The only problem i see is a \nconflict with `--signoff` so i'm open to other naming ideas. The same goes \nfor the config. `sign.` as an alias to `gpg.` would work well with the \ncurrent settings.\nLet me know what you think and i could prepare a first patch for one command \nto see what the alias / config / docs change could look like.\n\nBest regards,\nFabian\n"},{"id":"442425","messageId":"xmqqzgpn50l6.fsf@gitster.g","threadId":"56991","inReplyTo":"20211128125704.4twinfd3wriwdntz@fs","subject":"Re: Git SSH/GPG signing flags and config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-28T23:20:37Z","receivedAt":"2021-11-28T23:22:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Fabian Stelzer <fs@gigacodes.de> writes:\n\n> Hi everyone,\n> the `signing git objects with ssh` series was released with 2.34 and\n> i'd like to thank everyone for your support and the good reviews!\n> I think it would be beneficial now to adjust some of the wording in\n> flags and the config. Currently everything is configured via gpg.* and\n> all the `please sign this` flags are named --(no-?)gpg-sign.\n> I would be in favor of a more generic flag independent of the signing\n> mechanism. Adding something like `--ssh-sign` would suggest that you'd\n> be able to switch signing format with it which i think would not be\n> terribly useful. If you need to use multiple signing mechanism those\n> would usually be configured per repository and can easily be done with\n> an `includeif gitdir:` in your config.\n> Therefore i would suggest just adding a generic `--(no-?)sign` to all\n> the commands that support gpg-sign right now. The only problem i see\n> is a conflict with `--signoff` so i'm open to other naming ideas. The\n> same goes for the config. `sign.` as an alias to `gpg.` would work\n> well with the current settings.\n> Let me know what you think and i could prepare a first patch for one\n> command to see what the alias / config / docs change could look like.\n\nI do share your worry about --sign to be confused with the sign-off\nprocedure, and that was why the original used --gpg-sign.  We are\nextending \"gpg\" part because \"gpg\" is not the only cryptographic\nsigning protocol we support, so perhaps --crypto-sign would still be\nin the orginal spirit of \"This is different from the sign-off, but\nis a cryptographic signature, but it is a mouthful.\n\n"},{"id":"443106","messageId":"20211205113650.33hndvacye2fjwkh@fs","threadId":"56991","inReplyTo":"xmqqzgpn50l6.fsf@gitster.g","subject":"Re: Git SSH/GPG signing flags and config","fromName":"Fabian Stelzer","fromEmail":"fs@gigacodes.de","sentAt":"2021-12-05T11:36:50Z","receivedAt":"2021-12-05T11:36:55Z","isPatch":false,"sender":{"key":"fs@gigacodes.de","avatar":"https://avatars.githubusercontent.com/u/564858?v=4"},"body":"On 28.11.2021 15:20, Junio C Hamano wrote:\n>Fabian Stelzer <fs@gigacodes.de> writes:\n>\n>> Hi everyone,\n>> the `signing git objects with ssh` series was released with 2.34 and\n>> i'd like to thank everyone for your support and the good reviews!\n>> I think it would be beneficial now to adjust some of the wording in\n>> flags and the config. Currently everything is configured via gpg.* and\n>> all the `please sign this` flags are named --(no-?)gpg-sign.\n>> I would be in favor of a more generic flag independent of the signing\n>> mechanism. Adding something like `--ssh-sign` would suggest that you'd\n>> be able to switch signing format with it which i think would not be\n>> terribly useful. If you need to use multiple signing mechanism those\n>> would usually be configured per repository and can easily be done with\n>> an `includeif gitdir:` in your config.\n>> Therefore i would suggest just adding a generic `--(no-?)sign` to all\n>> the commands that support gpg-sign right now. The only problem i see\n>> is a conflict with `--signoff` so i'm open to other naming ideas. The\n>> same goes for the config. `sign.` as an alias to `gpg.` would work\n>> well with the current settings.\n>> Let me know what you think and i could prepare a first patch for one\n>> command to see what the alias / config / docs change could look like.\n>\n>I do share your worry about --sign to be confused with the sign-off\n>procedure, and that was why the original used --gpg-sign.  We are\n>extending \"gpg\" part because \"gpg\" is not the only cryptographic\n>signing protocol we support, so perhaps --crypto-sign would still be\n>in the orginal spirit of \"This is different from the sign-off, but\n>is a cryptographic signature, but it is a mouthful.\n>\nEven if it's a bit much, including the word crypto makes it quite clear what \nthe flag does. This is how this could look for `git commit`. I would do \nsomething similar for the `gpg.` configs and alias them with `cryptoSign.`\nIf this diff is acceptable i can prepare a patch series for all the commands \nand the config. Not sure if we want to mark the gpg options as deprecated.  \nThe problem is that the flags could imply that gpg is used even if another \nformat is configured.\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex 6c60bf98f9..67fc77dc1b 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -387,13 +387,18 @@ changes to tracked files.\n  \tdefault commit message.\n  \n  -S[<keyid>]::\n+--crypto-sign[=<keyid>]::\n+--no-crypto-sign::\n  --gpg-sign[=<keyid>]::\n  --no-gpg-sign::\n-\tGPG-sign commits. The `keyid` argument is optional and\n+\tCryptographically sign commits. The `keyid` argument is optional and\n  \tdefaults to the committer identity; if specified, it must be\n-\tstuck to the option without a space. `--no-gpg-sign` is useful to\n+\tstuck to the option without a space. `--no-crypto-sign` is useful to\n  \tcountermand both `commit.gpgSign` configuration variable, and\n-\tearlier `--gpg-sign`.\n+\tearlier `--crypto-sign`.\n+\t`--(no-)gpg-sign` is a compatibility alias and has no effect on which\n+\tcryptographic format will be used. This is determined by the\n+\tconfiguration variable cryptoSign.format (see linkgit:git-config[1]).\n  \n  \\--::\n  \tDo not interpret any more arguments as options.\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 883c16256c..2c789ff6f9 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1639,8 +1639,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n  \t\tOPT_BOOL('e', \"edit\", &edit_flag, N_(\"force edit of commit\")),\n  \t\tOPT_CLEANUP(&cleanup_arg),\n  \t\tOPT_BOOL(0, \"status\", &include_status, N_(\"include status in commit message template\")),\n-\t\t{ OPTION_STRING, 'S', \"gpg-sign\", &sign_commit, N_(\"key-id\"),\n+\t\t{ OPTION_STRING, 'S', \"crypto-sign\", &sign_commit, N_(\"key-id\"),\n+\t\t  N_(\"cryptographically sign commit\"), PARSE_OPT_OPTARG, NULL, (intptr_t) \"\" },\n+\t\t{ OPTION_STRING, 0, \"gpg-sign\", &sign_commit, N_(\"key-id\"),\n  \t\t  N_(\"GPG sign commit\"), PARSE_OPT_OPTARG, NULL, (intptr_t) \"\" },\n+\n  \t\t/* end commit message options */\n  \n  \t\tOPT_GROUP(N_(\"Commit contents options\")),\n\n"}]}