# [PATCH v3] contrib/rerere-train: avoid useless gpg sign in training

2 messages from 2022-07-19 to 2022-07-19. Participants: Celeste Liu, Junio C Hamano.
Thread: https://gitlist.dev/t/58188

## Celeste Liu, 2022-07-19 17:21

Subject: [PATCH v3] contrib/rerere-train: avoid useless gpg sign in training
Message-ID: <PH7PR14MB5594A27B9295E95ACA4D6A69CE8F9@PH7PR14MB5594.namprd14.prod.outlook.com>
URL: https://gitlist.dev/e/PH7PR14MB5594A27B9295E95ACA4D6A69CE8F9%40PH7PR14MB5594.namprd14.prod.outlook.com

```
Users may have configured "git merge" to always require GPG
signing the resulting commits. We are not running "git merge" to
re-create merge commits, but merely to replay merge conflicts,
and we will immediately discard the resulting commits; there
is no point in signing them.

Override such configuration that forces useless signing from the
command line with the "--no-gpg-sign" option.

Signed-off-by: Celeste Liu <coelacanthus@outlook.com>
---
v2: add problem detail in commit message.
v3: more detailed reason

 contrib/rerere-train.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/rerere-train.sh b/contrib/rerere-train.sh
index 26b724c8c6..bd01e430ef 100755
--- a/contrib/rerere-train.sh
+++ b/contrib/rerere-train.sh
@@ -75,7 +75,7 @@ do
 		continue
 	fi
 	git checkout -q "$parent1^0"
-	if git merge $other_parents >/dev/null 2>&1
+	if git merge --no-gpg-sign $other_parents >/dev/null 2>&1
 	then
 		# Cleanly merges
 		continue
-- 
2.37.1


```

## Junio C Hamano, 2022-07-19 18:23

Subject: Re: [PATCH v3] contrib/rerere-train: avoid useless gpg sign in training
Message-ID: <xmqqcze1arm1.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqcze1arm1.fsf%40gitster.g
In-Reply-To: <PH7PR14MB5594A27B9295E95ACA4D6A69CE8F9@PH7PR14MB5594.namprd14.prod.outlook.com>

```
Celeste Liu <coelacanthus@outlook.com> writes:

> Users may have configured "git merge" to always require GPG
> signing the resulting commits. We are not running "git merge" to
> re-create merge commits, but merely to replay merge conflicts,
> and we will immediately discard the resulting commits; there
> is no point in signing them.
>
> Override such configuration that forces useless signing from the
> command line with the "--no-gpg-sign" option.
>
> Signed-off-by: Celeste Liu <coelacanthus@outlook.com>
> ---
> v2: add problem detail in commit message.
> v3: more detailed reason

Makes sense.

Not a suggestion to change anything, but another possibility may be
to run the command with the --no-commit option, perhaps.  If we ever
gained more features added a knob to enable it by default, we would
need to add --no-that-feature as well to refuse it, just like we are
doing so for GPG here, and telling the command that there is no need
to make a commit could turn out to be an easier way to do so for all
extra features that will be invented in the future.

Thanks.  Will queue.

>
>  contrib/rerere-train.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/rerere-train.sh b/contrib/rerere-train.sh
> index 26b724c8c6..bd01e430ef 100755
> --- a/contrib/rerere-train.sh
> +++ b/contrib/rerere-train.sh
> @@ -75,7 +75,7 @@ do
>  		continue
>  	fi
>  	git checkout -q "$parent1^0"
> -	if git merge $other_parents >/dev/null 2>&1
> +	if git merge --no-gpg-sign $other_parents >/dev/null 2>&1
>  	then
>  		# Cleanly merges
>  		continue

```
