Re: [PATCH v6] fast-(import|export): improve on commit signature output format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 9, 2025, 23:14 UTC
- Message-ID
- <xmqqple99ctv.fsf@gitster.g>
- In-Reply-To
- <20250709141253.623563-1-christian.couder@gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 12 quoted lines
> +static void parse_one_signature(struct signature_data *sig, const char *v)
> +{
> + char *args = xstrdup(v); /* Will be freed when sig->hash_algo is freed */
> + char *space = strchr(args, ' ');
> +
> + if (!space)
> + die("Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', "
> + "got 'gpgsig %s'", args);
> + *space = '\0';
> +
> + sig->hash_algo = args;
> + sig->sig_format = space + 1;This is minor, but as I already said in the discussion of the previous round, let me remind readers.
I think "*space++ = '\0'" followed by "->sig_format = space", as you wrote originally, was easier to follow. If I were doing this 6th iteration, I would have kept that part of the code around here, but would have renamed "space" to a more generic "cp" (very often used in this codebase to stand for a character pointer).
Will replace and requeue (unless you have v7 before my tomorrow's integration cycle, in which case this iteration may be skipped).
Thanks.