Re: Octopus merge: unique (?) to git, but is it useful?
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 3, 2008, 05:28 UTC
- Message-ID
- <alpine.DEB.1.00.0806030627440.13507@racer.site.net>
- In-Reply-To
- <7vskvv3xmx.fsf@gitster.siamese.dyndns.org>
Hi,
On Mon, 2 Jun 2008, Junio C Hamano wrote:
Show 21 quoted lines
> diff --git a/builtin-commit.c b/builtin-commit.c
> index b294c1f..1d8d208 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -883,10 +883,19 @@ static void add_parent(struct strbuf *sb, const unsigned char *sha1)
> {
> struct object *obj = parse_object(sha1);
> const char *parent = sha1_to_hex(sha1);
> + const char *cp;
> +
> if (!obj)
> die("Unable to find commit parent %s", parent);
> if (obj->type != OBJ_COMMIT)
> die("Parent %s isn't a proper commit", parent);
> + cp = strstr(sb->buf, parent);
> + if (cp &&
> + sb->buf + 8 <= cp && !memcmp(cp - 8, "\nparent ", 8) &&
> + cp[40] == '\n') {
> + error("duplicate parent %s ignored", parent);
> + return;
> + }Would it not be better (simpler, cleaner) to just use an object flag?
Ciao, Dscho