Re: [PATCH 4/8] rebase-helper --make-script: introduce a flag to recreate merges
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jan 19, 2018, 10:34 UTC
- Message-ID
- <CAPig+cSn_X-0iir-cKSd=P8p5QCxrR2qU_GBj7zDbv8zTc+AQw@mail.gmail.com>
- In-Reply-To
- <b9cb2d915aa4ff564b1960ce0352664b1d26eecb.1516225925.git.johannes.schindelin@gmx.de>
On Thu, Jan 18, 2018 at 10:35 AM, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
> The sequencer just learned a new commands intended to recreate branch
s/a //
Show 21 quoted lines
> structure (similar in spirit to --preserve-merges, but with a
> substantially less-broken design).
> [...]
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> diff --git a/sequencer.c b/sequencer.c
> @@ -2785,6 +2787,335 @@ void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag)
> +static const char *label_oid(struct object_id *oid, const char *label,
> + struct label_state *state)
> +{
> + [...]
> + } else if (((len = strlen(label)) == GIT_SHA1_RAWSZ &&
> + !get_oid_hex(label, &dummy)) ||
> + hashmap_get_from_hash(&state->labels,
> + strihash(label), label)) {
> + /*
> + * If the label already exists, or if the label is a valid full
> + * OID, we append a dash and a number to make it unique.
> + */
> + [...]
> + for (i = 2; ; i++) {Why '2'? Is there some non-obvious significance to this value?
Show 17 quoted lines
> + strbuf_setlen(buf, len);
> + strbuf_addf(buf, "-%d", i);
> + if (!hashmap_get_from_hash(&state->labels,
> + strihash(buf->buf),
> + buf->buf))
> + break;
> + }
> +
> +static int make_script_with_merges(struct pretty_print_context *pp,
> + struct rev_info *revs, FILE *out,
> + unsigned flags)
> +{
> + [...]
> + is_octopus = to_merge && to_merge->next;
> +
> + if (is_octopus)
> + BUG("Octopus merges not yet supported");Is this a situation which the end-user can trigger by specifying a merge with more than two parents? If so, shouldn't this be just a normal error message rather than a (developer) bug message? Or, am I misunderstanding?