Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Sep 2021 08:41:36 GMT
From:      Piotr Pawel Stefaniak <pstef@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a8446d4124d0 - stable/13 - diff3: document and test -T
Message-ID:  <202109250841.18P8fafY018201@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by pstef:

URL: https://cgit.FreeBSD.org/src/commit/?id=a8446d4124d0639b0fe49e25642a18a51fde8666

commit a8446d4124d0639b0fe49e25642a18a51fde8666
Author:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
AuthorDate: 2021-08-23 19:33:27 +0000
Commit:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
CommitDate: 2021-09-25 08:34:39 +0000

    diff3: document and test -T
    
    (cherry picked from commit 9f7a81b133c715f649136dcd0ad004e4180c56c9)
---
 usr.bin/diff3/diff3.1             | 11 +++++++++--
 usr.bin/diff3/tests/1t.out        | 14 ++++++++++++++
 usr.bin/diff3/tests/Makefile      |  1 +
 usr.bin/diff3/tests/diff3_test.sh |  3 +++
 4 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/usr.bin/diff3/diff3.1 b/usr.bin/diff3/diff3.1
index 22e04b6af5e8..2cf1e57cb74e 100644
--- a/usr.bin/diff3/diff3.1
+++ b/usr.bin/diff3/diff3.1
@@ -30,7 +30,7 @@
 .\"     @(#)diff3.1	8.2 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd May 25, 2017
+.Dd August 23, 2021
 .Dt DIFF3 1
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .Nd 3-way differential file comparison
 .Sh SYNOPSIS
 .Nm diff3
-.Op Fl 3aEeiXx
+.Op Fl 3aEeiTXx
 .Op Fl Fl diff-program Ar program
 .Op Fl Fl strip-trailing-cr
 .Op Fl L | Fl Fl label Ar label1
@@ -115,6 +115,13 @@ Defines labels to print instead of file names
 .Ar file2
 and
 .Ar file3 .
+.It Fl T, Fl Fl initial-tab
+In the normal listing,
+use a tab instead of two spaces
+at the beginning of each line.
+In modes that produce an
+.Xr ed 1
+script, this option changes nothing.
 .It Fl x, Fl Fl overlap-only
 Produces an output script suitable for
 .Xr ed 1
diff --git a/usr.bin/diff3/tests/1t.out b/usr.bin/diff3/tests/1t.out
new file mode 100644
index 000000000000..fc54ce50286f
--- /dev/null
+++ b/usr.bin/diff3/tests/1t.out
@@ -0,0 +1,14 @@
+====
+1:2,3c
+	which multiple lines
+	and a few typ0s to fix
+2:2,3c
+	which multiple lines
+	and a few typos to fix
+3:2c
+	and a few typ0s to fix
+====2
+1:4a
+3:3a
+2:5c
+	New line
diff --git a/usr.bin/diff3/tests/Makefile b/usr.bin/diff3/tests/Makefile
index 2ec7fbaab564..b8bea154944b 100644
--- a/usr.bin/diff3/tests/Makefile
+++ b/usr.bin/diff3/tests/Makefile
@@ -10,6 +10,7 @@ ${PACKAGE}FILES+=	\
 	2.txt \
 	3.txt \
 	1.out \
+	1t.out \
 	2.out \
 	3.out \
 	4.out \
diff --git a/usr.bin/diff3/tests/diff3_test.sh b/usr.bin/diff3/tests/diff3_test.sh
index f4b5adf95700..64031b023187 100755
--- a/usr.bin/diff3/tests/diff3_test.sh
+++ b/usr.bin/diff3/tests/diff3_test.sh
@@ -11,6 +11,9 @@ diff3_body()
 	atf_check -o file:$(atf_get_srcdir)/1.out \
 		diff3 --strip-trailing-cr $(atf_get_srcdir)/1cr.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
 
+	atf_check -o file:$(atf_get_srcdir)/1t.out \
+		diff3 -T $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
+
 	atf_check -o file:$(atf_get_srcdir)/2.out \
 		diff3 -e $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109250841.18P8fafY018201>