aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff3
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-164-4/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* diff3: Use ranges for new and old diffedits in ed scriptsTom Jones2022-08-021-5/+9
| | | | | | | This should make the output logic easier to read. No functional change intended. Sponsored by: Klara, Inc.
* diff3: Use ranges for the old and new diffedits in A scriptsTom Jones2022-08-021-18/+23
| | | | | | | This makes the output logic easier to read. No functional change intended. Sponsored by: Klara, Inc.
* diff3: Simplify startmark calculation in AscriptTom Jones2022-08-021-2/+3
| | | | | | Remove redundant calculation for startmark. Sponsored by: Klara, Inc.
* diff3: Use variables for old and new in A scriptsTom Jones2022-08-011-17/+19
| | | | | | This makes the code easier to follow, no functional changes intended Sponsored by: Klara, Inc.
* diff3: Replace literal marker with variableTom Jones2022-08-011-5/+6
| | | | Sponsored by: Klara, Inc.
* diff3: Fix indentationTom Jones2022-08-011-1/+1
| | | | Sponsored by: Klara, Inc.
* diff3: make the eflag logic easier to followTom Jones2022-07-051-13/+20
| | | | | | Discussed with: dim Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35324
* diff3: Add man page description for version and helpTom Jones2022-06-231-2/+9
| | | | | | Reviewed by: Pau Amma Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35325
* diff3: Add help and version optionsTom Jones2022-05-251-3/+16
| | | | | Add help and version flags. Exit values in these paths are set to match the behaviour of gnu diff3.
* diff3: Copy line into debug informationTom Jones2022-05-251-1/+1
| | | | Sponsored by: Klara Inc.
* diff3: Don't perform a bitwise OR when comparing diffsTom Jones2022-05-251-1/+1
| | | | | | This fixes the build now that it uses -Wbitwise-instead-of-logical Sponsored by: Klara Inc.
* diff3: Remove test case that references non existent test filesTom Jones2022-05-021-2/+1
| | | | Sponsored by: Klara, Inc.
* diff3: Add support for -mTom Jones2022-04-195-3/+137
| | | | | | | | | | | | | | | 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.
* diff3: Add support for -ATom Jones2022-04-195-8/+157
| | | | | | | | | | | | | | | | | | | 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.
* diff3: seperate old and new markers from file markersTom Jones2022-04-191-5/+8
| | | | | | | With -A and -m output the conflict markers are not tied to the file name. Seperate out these markers. Sponsored by: Klara, Inc.
* diff3: Clean up printing of ranges for edscript outputTom Jones2022-04-191-35/+37
| | | | | | | | | | | | | | | | | | | Replace the edscript code that tracked and printed lines using byte offsets with code that can work from line offsets. This tidies up the reduces duplication in the edscript output code. It also fixes the usage of the de struct so that it only tracks diffs as line offsets rather than the usage changing from line offsets to byte offsets during the lifetime of diff3. Large files with large numbers of ranges will probably suffer in performance here, but as we don't use diff3 yet this isn't a regression. Include a warning for future hackers so they have a place to start hacking from. Reviewed by: pstef Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D34941
* diff3: allow diff3 ed scripts to generate deletionsTom Jones2022-04-157-16/+113
| | | | | | | | | | | diff3 with the -e (ed script flag) can generate line deletions, add support for deletions and add a test case to exercise this behaviour. This functionality was unearthed through comparison of bsd diff3 and gnu diff3 output. Reviewed by: pstef Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D34912
* diff3: document and test -TPiotr Pawel Stefaniak2021-08-254-2/+27
| | | | | Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D31650
* diff3: implement --strip-trailing-crPiotr Pawel Stefaniak2021-08-235-1/+21
| | | | | Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D31626
* diff3.1: update manual page to match codePiotr Pawel Stefaniak2021-08-231-6/+27
|
* diff3: improve stylePiotr Pawel Stefaniak2021-08-231-17/+19
|
* diff3: sync with upstreamPiotr Pawel Stefaniak2021-08-231-6/+15
| | | | | | | * replace realloc calls with reallocarray calls * fix merging of files that lack newlines Obtained from: OpenBSD
* Replace homemade getline(3) by actual getline(3)Baptiste Daroussin2019-12-171-17/+5
| | | | Notes: svn path=/head/; revision=355854
* Use strtoimax.Baptiste Daroussin2019-12-171-16/+6
| | | | | | | Use existing strtoimax instead of reinventing it Notes: svn path=/head/; revision=355847
* capsicum: use a new capsicum helpers in toolsMariusz Zaborski2018-11-041-3/+3
| | | | | | | Use caph_{rights,ioctls,fcntls}_limit to simplify the code. Notes: svn path=/head/; revision=340138
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+1
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* DIRDEPS_BUILD: Connect new directories.Bryan Drewery2017-10-311-0/+11
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325187
* Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Update the diff3 manpage to reflect the fact the version in freebsd doesBaptiste Daroussin2017-05-251-21/+1
| | | | | | | not use temporary files nor uses a /usr/libexec/diff3prog Notes: svn path=/head/; revision=318892
* For now comment tests for arguments which are not in par with GNU diff3 yetBaptiste Daroussin2017-05-251-5/+5
| | | | Notes: svn path=/head/; revision=318890
* Remove the MAX_CHECK macro, it was initially used to test if a file was aBaptiste Daroussin2017-05-251-2/+0
| | | | | | | | | | text file or not. The check is not done by diff3 but by diff (the argument -a is directly passed to diff(1)) Notes: svn path=/head/; revision=318889
* Import working progress BSD diff3Baptiste Daroussin2017-05-2517-0/+1171
import bsd diff3 from OpenBSD. Differences with OpenBSD: - lots of warning fixed - no shell wrapper with diff3 actually living in libexec - capsicumized Keep it disconnected as it is not yet good enough to replace GNU diff The motivation to import it now it to allow other people to jump in and also to have an open development on it Obtained from: OpenBSD Notes: svn path=/head/; revision=318888