git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>, git@vger.kernel.org
Subject: Re: Re* [PATCH] commit-tree: do not pay attention to commit.gpgsign
Date: Tue, 3 May 2016 14:58:02 -0400	[thread overview]
Message-ID: <20160503185802.GB30530@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqfutznhqw.fsf_-_@gitster.mtv.corp.google.com>

On Tue, May 03, 2016 at 11:01:11AM -0700, Junio C Hamano wrote:

> Ignoring commit.gpgsign option _obviously_ breaks the backward
> compatibility, but it is easy to follow the standard pattern in
> scripts to honor whatever configuration variable they choose to
> follow.  E.g.
> 
> 	case $(git config --bool commit.gpgsign) in
> 	true) sign=-S ;;
> 	*) sign= ;;
> 	esac &&
> 	git commit-tree $sign ...whatever other args...
> 
> Do so to make sure that "git rebase" keeps paying attention to the
> configuration variable, which unfortunately is a documented mistake.
> 
> Helped-by: Jeff King <peff@peff.net>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  Documentation/git-commit-tree.txt |  4 ++--
>  builtin/commit-tree.c             |  4 ----
>  git-rebase.sh                     |  5 ++++-
>  t/t7510-signed-commit.sh          | 13 ++++++++++---
>  4 files changed, 16 insertions(+), 10 deletions(-)

Thanks, this looks good to me[1]. Especially thinking about the rebase
case you handle here makes me more convinced than ever that an option
like "--respect-commit-gpgsign-config" is the wrong path. Because the
ultimate fate for rebase may be something like:

  case $(git config --bool rebase.gpgsign) in
  true) sign=-S ;;
  false) sign= ;;
  *)
	case $(git config --bool commit.gpgsign) in
	true) sign=-S ;;
	*) sign= ;;
	esac
	;;
  esac

You _can_ implement that by falling back to --respect... in the "*"
case, but at that point it is not saving much code, and merely making
things unnecessarily confusing.

-Peff

[1] I will say that I am happy with rebase respecting commit.gpgsign
    myself. The config I want is really "sign all commits I create", so
    I'd end up setting rebase.gpgsign, too, if it existed. But maybe
    other people have different workflows.

      reply	other threads:[~2016-05-03 18:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 21:58 [PATCH] commit-tree: do not pay attention to commit.gpgsign Junio C Hamano
2016-05-03  4:12 ` Jeff King
2016-05-03 18:01   ` Re* " Junio C Hamano
2016-05-03 18:58     ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160503185802.GB30530@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).