From nobody Tue Apr 19 14:40:33 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 743C311CBD36; Tue, 19 Apr 2022 14:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KjRL92kLfz4pBj; Tue, 19 Apr 2022 14:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650379233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=saMS4CatW2WAA3G5jN92c9ftJzBvq5wz18hNNYrR9jQ=; b=G4o3FC3DUT9VJGnNRhrueomOi8yZx8EoKWOZtZI/A9IQY/S4j4FiwpmYh9l8JxFRBmrOVa 7E5tYkooOW6fy7x8yBYHBq+sa9OKgaTeGK+SHOHbkjJF4/Z3ZopYmNjvpVyTYY+QrmSdoo M5NYnkepD9ugzTFMfnWqN78/lgzRRLcGlFoukqbK2UWRZj8K7ioz4b4pT24sqTsTSt513y PzPUlDUaBf8ijQ/NUpbuTyNzVzu4Ojf2EJkRlkcpGvuwL/0JygOEn1uVdhh+cxmPIQQNUb Clg4XOTwuWJ+Bw7M1bKeDJhAowbJn3p9A1MiqiTSa6vxuWaIgnzzPHeG84zlcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D77F28E65; Tue, 19 Apr 2022 14:40:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23JEeX3E088335; Tue, 19 Apr 2022 14:40:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23JEeXfu088334; Tue, 19 Apr 2022 14:40:33 GMT (envelope-from git) Date: Tue, 19 Apr 2022 14:40:33 GMT Message-Id: <202204191440.23JEeXfu088334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: df092859b478 - main - diff3: seperate old and new markers from file markers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df092859b478d4776cbc6c120de5bf21e7543e30 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650379233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=saMS4CatW2WAA3G5jN92c9ftJzBvq5wz18hNNYrR9jQ=; b=TNr2dZygFU3jRP5c06hU9jfXle18o4fuec1y526ggEnix0vN13r1j5lsrj7B7sMk2Y2N3x Y1VhFtzma2XjsTFXH74UxzLkRMG1I1sa0vMN2xrX5+I5FBzg4ydLhymlDOOO85xOA6gLSw b8BitDEDLd6PnUs4+tYhzl6WsBGmpQrNVKhu+9FPdeJcK5Z3E8WSEas412d2g/cCU/J2IG sLogziz176JDRKksi0Y362rZfVj4rttmqsSeWk+RCddHi681dIC4U/lAuDNaXPFBdISBr+ T5YxRSsyFx5MfWqz67xkZSmILW2LDtLpHPqenbFrn3LcudtbddKXTDd3AK2Apw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650379233; a=rsa-sha256; cv=none; b=hjDl6d2Jjd2je6bufnuOHMF/uVEig/nDCxZS/MzaJDdGyYw+I+PW7pZx4M1Y2Lb3Fxfuw1 CWbejJ2wokbBS5WUYKBtp9EMvK7z+Em/WXMd/F1asUj+vJ7/sDCFAnOGv3QPrpsJ6RQd4n sJL8SaQ4vrzojyJoqkWOoSpBNr0DSawW6VGCQ7NBtdHLK/p9k4p4YNK8zSp+YD8oxZx4Jj 7wB0/R7A+f1sPb27f8/KqUZ23KAwxAXjg1qzc17VWevBzcA+XpD0GI264tXZgpokCDgMOP G5pKR7aRXXJSWyJlyQB6unfwPYAkgtyJYuDVUDAliachunfdpGEdnApG5B0DuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=df092859b478d4776cbc6c120de5bf21e7543e30 commit df092859b478d4776cbc6c120de5bf21e7543e30 Author: Tom Jones AuthorDate: 2022-04-19 14:38:30 +0000 Commit: Tom Jones CommitDate: 2022-04-19 14:40:07 +0000 diff3: seperate old and new markers from file markers With -A and -m output the conflict markers are not tied to the file name. Seperate out these markers. Sponsored by: Klara, Inc. --- usr.bin/diff3/diff3.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/usr.bin/diff3/diff3.c b/usr.bin/diff3/diff3.c index 396b2620d22c..97fccc739ebe 100644 --- a/usr.bin/diff3/diff3.c +++ b/usr.bin/diff3/diff3.c @@ -128,6 +128,8 @@ static int Aflag, eflag, iflag, mflag, Tflag; static int oflag; /* indicates whether to mark overlaps (-E or -X) */ static int strip_cr; static char *f1mark, *f2mark, *f3mark; +static const char *oldmark = "<<<<<<<"; +static const char *newmark = ">>>>>>>"; static bool duplicate(struct range *, struct range *); static int edit(struct diff *, bool, int); @@ -561,8 +563,9 @@ edscript(int n) if (!delete) printf(".\n"); } else { - printf("%s\n.\n", f3mark); - printf("%da\n%s\n.\n", de[n].old.from - 1, f1mark); + printf("%s %s\n.\n", newmark, f3mark); + printf("%da\n%s %s\n.\n", de[n].old.from - 1, + oldmark, f1mark); } } if (iflag) @@ -705,15 +708,15 @@ main(int argc, char **argv) file3 = argv[2]; if (oflag) { - asprintf(&f1mark, "<<<<<<< %s", + asprintf(&f1mark, "%s", labels[0] != NULL ? labels[0] : file1); if (f1mark == NULL) err(2, "asprintf"); - asprintf(&f2mark, "||||||| %s", + asprintf(&f2mark, "%s", labels[1] != NULL ? labels[1] : file2); if (f2mark == NULL) err(2, "asprintf"); - asprintf(&f3mark, ">>>>>>> %s", + asprintf(&f3mark, "%s", labels[2] != NULL ? labels[2] : file3); if (f3mark == NULL) err(2, "asprintf");