I appreciate the follow-up info David and Marton.

I did make the modifications to your script that you mentioned, Marton, so
maybe my choice of the word "straightforward" wasn't good, but the script
was understandable and easy to tailor.

My concerns were proper commit signing and closing PRs.  For example, my
manual squash - cherry-pick - sign process and push to git-wip-us.apache.org
resulted in an unverified commit [1] and a "Closed with unmerged commits"
PR [2].  Later, using Marton's script was better but I still pushed to
git-wip-us.apache.org, and that resulted in a verified commit [3] but
another "Closed with unmerged commits" PR [4].  I'm hoping these PR
shenanigans will resolve if I push to gitbox.apache.org or github.com.

[1] -
https://github.com/apache/nifi/commit/be650f2443a856292e2f9d8b8f8d84f419a8ce97
[2] - https://github.com/apache/nifi/pull/10360
[3] -
https://github.com/apache/nifi/commit/4076eaafb0b1a19ebcf7dde030d0f4c1d9bda548
[4] - https://github.com/apache/nifi/pull/10552

Thanks
-- Mike


On Tue, Dec 2, 2025 at 9:59 AM Marton Szasz <[email protected]> wrote:

> Mike, I think if you add your PGP key to GitHub, it should mark your
> commits as verified on GitHub regardless of where you have pushed them
> first.
>
> The script may need a bit of patching for NiFi, in the long line with
> sed pipelines, which remove the template part from the pull request
> description before generating a commit message from it. It's also
> assuming that git remotes match github usernames, and upsteam means
> apache. I'm glad you found it helpful.
>
> Marton
>
> On 12/2/25 3:52 PM, David Handermann wrote:
> > Mike,
> >
> > More recently, I have been using the Squash and Merge button, and then
> > adding Signed-off-by at the footer of the message in GitHub. That
> > approach provides commit signing using GitHub itself, and also
> > provides the sign off with the manual footer addition. GitHub includes
> > the PR number in the commit message title, which marks the PR as
> > merged.
> >
> > I also squash commits and push manually, usually to the GitHub mirror,
> > signing commits with my own key. The Apache Git bot automatically
> > mirrors commits between Apache Gitbox and GitHub, so pushing to Apache
> > Gitbox should work just as well as pushing to GitHub. When pushing a
> > commit to either repository, using the "This closes #12345" line in
> > the commit message triggers GitHub to close the PR.
> >
> > Regards,
> > David Handermann
> >
> > On Tue, Dec 2, 2025 at 8:32 AM Michael Moser <[email protected]> wrote:
> >> Thanks for the script, Marton!  I used it recently and it's
> straightforward
> >> to use.  I still pushed to the apache.org Git, and I suspect that's
> why my
> >> signed commits don't appear as "verified".  I will change my process to
> >> push to github.
> >>
> >> Scott, I was wondering how well the Github merge buttons worked.  When
> >> using the "Squash and merge" button, can you edit the commit message to
> >> include "Signed-off-by" and the PR number that triggers PR's to close?
> >>
> >> Thanks again,
> >> -- Mike
> >>
> >>
> >> On Mon, Dec 1, 2025 at 10:24 AM Scott Aslan <[email protected]>
> wrote:
> >>
> >>> On the frontend PRs we use the "Squash and merge" button on github but
> have
> >>> git config setup to sign commits etc.
> >>>
> >>> On Fri, Nov 21, 2025 at 9:39 AM Marton Szasz <[email protected]>
> wrote:
> >>>
> >>>> On MiNiFi C++, I usually use this script I developed over time:
> >>>>
> >>>>
> >>>
> https://github.com/szaszm/verify-nifi-release/blob/master/bin/minificpp-merge-pr.sh
> >>>> On NiFi, I followed the same steps manually for my recent commit.
> >>>>
> >>>> - look up pull request by id using the github API
> >>>> - get the author, title and description from the pull request
> >>>> - rebase the PR branch to main
> >>>> - squash merge to main (roughly equivalent to a cherry-pick for single
> >>>> commits)
> >>>> - set author and commit message based on info from the PR
> >>>> - signoff, GPG sign
> >>>> - push to github (not git-*.apache.org)
> >>>>
> >>>> Marton
> >>>>
> >>>> On 11/21/25 3:26 PM, Michael Moser wrote:
> >>>>> I'm writing to ask NiFi committers about their current best practice
> >>> for
> >>>>> committing PRs to git.  What process do you use?
> >>>>>
> >>>>> I admit I use a very old command-line process to commit, based on the
> >>>>> Contributor Guide [1], including manual squash, cherry-pick to main,
> >>> push
> >>>>> to git-wip-us.apache.org. There has to be a better way now.
> >>>>>
> >>>>> [1] -
> >>>>>
> >>>
> https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide#ContributorGuide-CodeReviewProcess
> >>>>> Thanks,
> >>>>> -- Mike
>

Reply via email to