From: Phillip Wood <phillip.wood123@gmail.com>
To: Li Chen <me@linux.beauty>, phillipwood <phillip.wood@dunelm.org.uk>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC PATCH 2/2] rebase: support --trailer
Date: Fri, 16 May 2025 11:04:37 +0100 [thread overview]
Message-ID: <8b431310-ff03-424b-b24c-672d9b492057@gmail.com> (raw)
In-Reply-To: <196d79d922d.127d7eb7f870411.3309775784450179401@linux.beauty>
Hi Li
On 16/05/2025 06:42, Li Chen wrote:
> Hi Phillip,
>
> ---- On Thu, 08 May 2025 22:17:17 +0800 Phillip Wood <phillip.wood123@gmail.com> wrote ---
> >
> > (c) Only adds the trailers on the commandline. I'm a bit confused by the
> > various trailer config options - the man page reads to me like "git
> > interpret-trailers" can add missing trailers that are configured but not
> > passed on the commandline.
>
> About part (c), just to be sure I understand correctly:
>
> Do you want the trailer implementation to completely drop any handling of trailer configuration
> (i.e. remove parse_trailers_from_config() and related config-based behavior from the codepath and man page/documents)?
>
> Or would you rather leave the config machinery in place, but have rebase --trailer explicitly
> ignore all trailer.* configuration and only append the exact trailers passed on its command line?
I think I had misunderstood what trailer.ifMissing did. I was concerned
that it could add trailers that were not on the command-line but I don't
think that's the case. We certainly want to respect the config for
trailer.<alias>.key and trailer.<alias>.command as they make it possible
for the user to set "trailer.review.key=Reviewed-by" and
"trailer.review.command=git var GIT_COMMITTER_IDENT | sed 's/[^>]*$//'
#" and then run "git rebase --trailer=review" to add their Reviewed-by:
trailer. I think it makes sense to respect the other config as well -
that does mean that trailers that the user passes on the command-line
may not be added because they already exist or are configured not to be
added if they are missing but is consistent with "git
interpret-trailers". It means that the user can set
"trailer.myKey.ifExists=doNothing" and then run "git rebase --trailer
MyKey=value" to ensure all the commits have a MyKey trailer without
duplicating it in the commits where it already exists.
That's a long-winded way of saying that on reflection I think respecting
the trailer config setting is the right thing to do after all.
Best Wishes
Phillip
> Please let me know which you prefer (or if there’s a third path I’m missing) and I’ll add the patches accordingly.
>
> Regards,
> Li
prev parent reply other threads:[~2025-05-16 10:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 12:57 [RFC PATCH 0/2] rebase: support --trailer and add --reviewby Li Chen
2025-05-06 12:58 ` [RFC PATCH 1/2] rebase, am: add --reviewby option Li Chen
2025-05-06 18:07 ` Junio C Hamano
2025-05-07 6:46 ` Li Chen
2025-05-07 10:17 ` Phillip Wood
2025-05-07 10:26 ` Phillip Wood
2025-05-07 10:39 ` Kristoffer Haugsbakk
2025-05-07 13:38 ` Phillip Wood
2025-05-07 17:39 ` Junio C Hamano
2025-05-06 12:58 ` [RFC PATCH 2/2] rebase: support --trailer Li Chen
2025-05-08 14:17 ` Phillip Wood
2025-05-08 15:55 ` Li Chen
2025-05-08 15:58 ` phillip.wood123
2025-05-08 16:29 ` Phillip Wood
2025-05-16 5:42 ` Li Chen
2025-05-16 10:04 ` Phillip Wood [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b431310-ff03-424b-b24c-672d9b492057@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@linux.beauty \
--cc=phillip.wood@dunelm.org.uk \
/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.
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 NNTP newsgroup(s).