History log of /src/usr.bin/diff3/diff3.c (Results 1 – 25 of 103)
Revision Date Author Comments
# 5778700f 12-Feb-2026 Tuukka Pasanen <tuukka.pasanen@ilmi.fi>

diff3: Add SPDX-License-Identifier tag

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55462


# fe534128 02-Mar-2026 Dag-Erling Smørgrav <des@FreeBSD.org>

diff3: Produce correct exit status

Use exit status 2 for errors, 1 only to indicate that differences were
found between the inputs (in some operating modes).

MFC after: 1 week
Sponsored by: Klara,

diff3: Produce correct exit status

Use exit status 2 for errors, 1 only to indicate that differences were
found between the inputs (in some operating modes).

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: ngie, bapt
Differential Revision: https://reviews.freebsd.org/D55608

show more ...


# 5ddfd1db 01-Mar-2026 Baptiste Daroussin <bapt@FreeBSD.org>

diff3: bump version to the date when the GNU diff3 compat was reached


# c2dee778 28-Feb-2026 Dag-Erling Smørgrav <des@FreeBSD.org>

diff3: Code cleanup

* Order includes.

* Turn the diff type into an enum.

* Turn an unreachable error message into an assertion.

* Remove unused debugging code.

* Remove some dead assignments.

*

diff3: Code cleanup

* Order includes.

* Turn the diff type into an enum.

* Turn an unreachable error message into an assertion.

* Remove unused debugging code.

* Remove some dead assignments.

* Consistently use 1 instead of EXIT_FAILURE.

* Turn a return from main() into an exit().

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D55517

show more ...


# 2cfca8e7 13-Feb-2026 Baptiste Daroussin <bapt@FreeBSD.org>

diff3: fix merge mode

Make the merge mode compatible with GNU diff3
Add tests for all the changes, those tests are extracted from the
etcupdate testsuite.

This version passes the etcupdate testsuit

diff3: fix merge mode

Make the merge mode compatible with GNU diff3
Add tests for all the changes, those tests are extracted from the
etcupdate testsuite.

This version passes the etcupdate testsuite and the diffutils diff3
test suite.

MFC After: 1 week

show more ...


# 8d442cf3 13-Feb-2026 Baptiste Daroussin <bapt@FreeBSD.org>

diff3: fix diff3 -A

for cases where file2 differs but file1 and file3 agrees, the code
stored the file2 and file3 line numbers in the de[] editing script
entries but used them as if they were file1

diff3: fix diff3 -A

for cases where file2 differs but file1 and file3 agrees, the code
stored the file2 and file3 line numbers in the de[] editing script
entries but used them as if they were file1 line numbers.

Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D55276

show more ...


# 40475366 02-Feb-2026 Baptiste Daroussin <bapt@FreeBSD.org>

diff3: use pdwait instead of homemade one

MFC After: 3 days


# f10f288f 26-Sep-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

diff3: Remove debugging remnant.

Fixes: cf73401c4f7a
MFC after: 3 weeks


# cf73401c 25-Sep-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

diff3: Fix merge mode.

This is mostly thj@'s work, with some tweaks and cleanup by me. There
are still some cases where our output differs from GNU diff3, but it's
much better than before and I'd r

diff3: Fix merge mode.

This is mostly thj@'s work, with some tweaks and cleanup by me. There
are still some cases where our output differs from GNU diff3, but it's
much better than before and I'd rather commit what I have now than let
it continue to languish in a metaphorical drawer.

MFC after 3 weeks
Sponsored by: Klara, Inc.
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D46762

show more ...


# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

R

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a pe

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# b37a6938 05-Sep-2023 Baptiste Daroussin <bapt@FreeBSD.org>

diff3: make the diff3 -E -m and diff3 -m behaviour match gnu diff3

In gnu diff3 3 way merging files where the new file and the target are
already the same will die and show what has failed to be mer

diff3: make the diff3 -E -m and diff3 -m behaviour match gnu diff3

In gnu diff3 3 way merging files where the new file and the target are
already the same will die and show what has failed to be merged except
if -E is passed in argument, in this case it will finish the merge.

This difference in behaviour was breaking one of the etcupdate testcase
with bsd diff3

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D41730

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 190c4c24 02-Aug-2022 Tom Jones <thj@FreeBSD.org>

diff3: Use ranges for new and old diffedits in ed scripts

This should make the output logic easier to read. No functional change
intended.

Sponsored by: Klara, Inc.


# c0e6ccb1 02-Aug-2022 Tom Jones <thj@FreeBSD.org>

diff3: Use ranges for the old and new diffedits in A scripts

This makes the output logic easier to read. No functional change
intended.

Sponsored by: Klara, Inc.


# 264a559a 02-Aug-2022 Tom Jones <thj@FreeBSD.org>

diff3: Simplify startmark calculation in Ascript

Remove redundant calculation for startmark.

Sponsored by: Klara, Inc.


# 2c4276aa 01-Aug-2022 Tom Jones <thj@FreeBSD.org>

diff3: Use variables for old and new in A scripts

This makes the code easier to follow, no functional changes intended

Sponsored by: Klara, Inc.


# ca53a844 01-Aug-2022 Tom Jones <thj@FreeBSD.org>

diff3: Replace literal marker with variable

Sponsored by: Klara, Inc.


# 85d92faf 01-Aug-2022 Tom Jones <thj@FreeBSD.org>

diff3: Fix indentation

Sponsored by: Klara, Inc.


# d458eb8d 05-Jul-2022 Tom Jones <thj@FreeBSD.org>

diff3: make the eflag logic easier to follow

Discussed with: dim
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35324


# 3ddd6eb6 25-May-2022 Tom Jones <thj@FreeBSD.org>

diff3: Add help and version options

Add help and version flags. Exit values in these paths are set to match
the behaviour of gnu diff3.


# 59f6408d 25-May-2022 Tom Jones <thj@FreeBSD.org>

diff3: Copy line into debug information

Sponsored by: Klara Inc.


# 7d975c7f 25-May-2022 Tom Jones <thj@FreeBSD.org>

diff3: Don't perform a bitwise OR when comparing diffs

This fixes the build now that it uses -Wbitwise-instead-of-logical

Sponsored by: Klara Inc.


# 034dd2d5 19-Apr-2022 Tom Jones <thj@FreeBSD.org>

diff3: Add support for -m

diff3 in -m mode generates a complete file with changes bracketed with
conflict markers. This adds support for diff3 to generate version
control style three way merge outpu

diff3: Add support for -m

diff3 in -m mode generates a complete file with changes bracketed with
conflict markers. This adds support for diff3 to generate version
control style three way merge output.

The output format was inferred from looking at the gnu diff3 output on a
selection of test files as a specification of what diff3 -m should
output is not available. It is likely there are cases where the -m
output differs from other tools and I am happy to update diff3 to
address these.

Discussed with: pstef, kevans
Sponsored by: Klara, Inc.

show more ...


# 9ab079c5 19-Apr-2022 Tom Jones <thj@FreeBSD.org>

diff3: Add support for -A

Diff3 in -A mode generates an ed script to show how the 3 files and
brackets changes that conflict. The ed script generated should when
applied leave familiar merge conflic

diff3: Add support for -A

Diff3 in -A mode generates an ed script to show how the 3 files and
brackets changes that conflict. The ed script generated should when
applied leave familiar merge conflict markers in a patched file.

Diff3 output is not documented, this feature has been arrived at by
comparing bsd diff3 output to gnu diff3 output until they were made to
agree. There are likely to still be differences between these formats.

The gnu diff3 guide is actually quite good at explaining how diff3
output should appear, but it doesn't cover every form of output from
diff3.

https://www.gnu.org/software/diffutils/manual/diffutils.html#Comparing-Three-Files

Discussed with: pstef, kevans
Sponsored by: Klara, Inc.

show more ...


12345