git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Taylor Blau <me@ttaylorr.com>, David Caro <dcaro@wikimedia.org>,
	git@vger.kernel.org
Subject: Re: Skipping adding Signed-off-by even if it's not the last on git commit
Date: Fri, 09 Dec 2022 10:23:52 +0900	[thread overview]
Message-ID: <xmqq5yel2wuv.fsf@gitster.g> (raw)
In-Reply-To: <Y5GRx86i3ZIiVxb3@coredump.intra.peff.net> (Jeff King's message of "Thu, 8 Dec 2022 02:27:03 -0500")

Jeff King <peff@peff.net> writes:

> This made me curious about the opposite: is there config you can set to
> get this behavior for --signoff? I think the answer is "no". You can do:
>
>   git -c trailer.ifExists=addIfDifferent \
>       commit --amend --trailer="Signed-off-by: Jeff King <peff@peff.net>"
>
> to get the desired behavior, but using "--signoff" does not respect
> trailer settings.

A customization to allow addIfDifferent may be an interesting idea.

> I feel like config is probably a better match for the use cases here,
> because the decision about de-duping is not something you'd usually set
> for one particular operation, but is more likely to be a project policy
> about what the trailer means (and that includes Signed-off-by). So you'd
> want to set it per-repo, not per-operation.

Sure.

> ... The one exception is that the
> generic trailer.ifExists, etc, would start affecting --signoff, which
> _might_ be a surprise. If we wanted to retain the behavior there, we
> could say "--signoff is special, and doesn't respect generic trailer
> config".

Yeah, that may be safe, however it is very unsatisfying.

> Alternatively, it would be nice if there was an easy way to put your
> ident into a trailer (what I wrote above doesn't really work unless you
> have those variables in your environment, and of course it's a lot of
> typing). I think you can hack it up like:
>
>   git config trailer.sign.key Signed-off-by
>   git config trailer.sign.cmd \
>     'git var GIT_COMMITTER_IDENT | sed "s/>.*/>/";:'
>   git commit --trailer=sign
>
> which is only a little more typing than --signoff, but it's not very
> ergonomic.

It does not look _too_ bad, though.

  reply	other threads:[~2022-12-09  1:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 17:06 Skipping adding Signed-off-by even if it's not the last on git commit David Caro
2022-12-07  1:50 ` Taylor Blau
2022-12-07  4:11   ` Junio C Hamano
2022-12-07  8:40     ` David Caro
2022-12-07 22:13       ` Taylor Blau
2022-12-07 23:04         ` Junio C Hamano
2022-12-08  7:27           ` Jeff King
2022-12-09  1:23             ` Junio C Hamano [this message]
2022-12-09  1:42               ` Jeff King
2022-12-09  4:03                 ` Junio C Hamano
2022-12-09 20:39                   ` Jeff King
2022-12-07  4:31   ` Ævar Arnfjörð Bjarmason
2022-12-07  4:57     ` Junio C Hamano
2022-12-07 15:00     ` Konstantin Ryabitsev

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=xmqq5yel2wuv.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dcaro@wikimedia.org \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    /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).