diff: Detect loops when diffing directories.Sponsored by: Klara, Inc.Reviewed by: markjDifferential Revision: https://reviews.freebsd.org/D50936
Remove residual blank line at start of MakefileThis is a residual of the $FreeBSD$ removal.MFC After: 3 days (though I'll just run the command on the branches)Sponsored by: Netflix
diff: Nits in tests.Sponsored by: Klara, Inc.
diff: honour -B flag with -qPR: 278988Reviewed by: baptSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D45220
diff: Integrate libdiff from OpenBSD GoT.This adds support for two new diff algorithms, Myers diff and Patiencediff.These algorithms perform a different form of search compared to theclassic St
diff: Integrate libdiff from OpenBSD GoT.This adds support for two new diff algorithms, Myers diff and Patiencediff.These algorithms perform a different form of search compared to theclassic Stone algorithm and support escapes when worst case scenariosare encountered.Add the -A flag to allow selection of the algorithm, but default tousing the new Myers diff implementation.The libdiff implementation currently only supports a subset of input andoutput options supported by diff. When these options are used, but thealgorithm is not selected, automatically fallback to the classic Stonealgorithm until support for these modes can be added.Based on work originally done by thj@ with contributions from kevans@.Sponsored by: Klara, Inc.Reviewed by: thjDifferential Revision: https://reviews.freebsd.org/D44302
show more ...
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
diff: fix side-by-side output with tabbed inputThe previous logic conflated some things... in this block:- j: input characters rendered so far- nc: number of characters in the line- col: columns
diff: fix side-by-side output with tabbed inputThe previous logic conflated some things... in this block:- j: input characters rendered so far- nc: number of characters in the line- col: columns rendered so far- hw: column width ((h)ard (w)idth?)Comparing j to hw or col to nc are naturally wrong, as col and hw arelimits on their respective counters and nc is already brought down to hwif the input line should be truncated to start with.Right now, we end up easily truncating lines with tabs in them as wecount each tab for $tabwidth lines in the input line, but we reallyshould only be accounting for them in the column count. The problem ismost easily demonstrated by the two input files added for the tests,the two tabbed lines lose at least a word or two even though there'splenty of space left in the row for each side.Reviewed by: bapt, pstefSponsored by: Klara, Inc.Differential Revision: https://reviews.freebsd.org/D37676
diff: tests: loosen up requirements for report_identicalThis test cannot run without an unprivileged_user being specifiedanyways, so just run as the unprivileged user. Revoking read permisionswo
diff: tests: loosen up requirements for report_identicalThis test cannot run without an unprivileged_user being specifiedanyways, so just run as the unprivileged user. Revoking read permisionsworks just as well if you're guaranteed non-root.Reviewed by: pstefSponsored by: Klara, Inc.Differential Revision: https://reviews.freebsd.org/D34950
Revert "Temporarily skip usr.bin.diff.diff_test.functionname in CI"This reverts commit 85eeb6ea62d45c5df893a16b87969bd7313a3dbb.The issue has been fixed by 4be7d087c2b566f4910683836be279d55c1a81c
Revert "Temporarily skip usr.bin.diff.diff_test.functionname in CI"This reverts commit 85eeb6ea62d45c5df893a16b87969bd7313a3dbb.The issue has been fixed by 4be7d087c2b566f4910683836be279d55c1a81c6.PR: 262086
Temporarily skip usr.bin.diff.diff_test.functionname in CIPR: 262086Sponsored by: The FreeBSD Foundation
diff: fix failed compare when ignoring file caseWith --ignore-file-name-case we need to compare files regardless ofcase. We need to propigate both names down to diffit so we can look upthe correc
diff: fix failed compare when ignoring file caseWith --ignore-file-name-case we need to compare files regardless ofcase. We need to propigate both names down to diffit so we can look upthe correct file when the names differ based on case, otherwise we tryto look up the file using the case from the a tree which might not bediscoverable if its case is different in the b tree.Reviewed by: baptSponsored by: Klara Inc.Differential Revision: https://reviews.freebsd.org/D34201
Remove surplus check for which diff is being testedMust have left this when I was testing the test invocation for8f79bd9b85716c495c2741ac25db37e8d71f22f7Pointy hat: thjSponsored by: Klara Inc.
diff: add --no-dereference flagWhen diffing files and directories, don't follow symbolic links, insteadcompare where the links point to.Reviewed by: baptSponsored by: Klara Inc.Differential Re
diff: add --no-dereference flagWhen diffing files and directories, don't follow symbolic links, insteadcompare where the links point to.Reviewed by: baptSponsored by: Klara Inc.Differential Revision: https://reviews.freebsd.org/D34203
diff: Detect Objective-C methodsWhen searching back for function definitions, consider lines startingwith '+' and '-', this allows us to pick up Objective-C methods as wellas C style function def
diff: Detect Objective-C methodsWhen searching back for function definitions, consider lines startingwith '+' and '-', this allows us to pick up Objective-C methods as wellas C style function definitions.Reviewed by: baptSponsored by: Klara Inc.Differential Revision: https://reviews.freebsd.org/D34202
diff: read whole files to determine if they are ASCII textBefore this change, only the first BUFSIZE bytes were checked.Reviewed by: bapt (previous version)Differential Revision: https://reviews
diff: read whole files to determine if they are ASCII textBefore this change, only the first BUFSIZE bytes were checked.Reviewed by: bapt (previous version)Differential Revision: https://reviews.freebsd.org/D31639
diff: don't output carriage returns that were stripped on input--strip-trailing-cr worked as intended for comparison between files,but the characters were still present in final output.
diff tests: Require root for report_identicalThis test switches users and either hangs or fails when run as anunprivileged user.MFC after: 1 weekSponsored by: The FreeBSD Foundation
diff: Use unprivileged_user with report_identical testApproved by: baptSponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D28466
diff: add a test case about the non regular file support
diff: add a test case for failed -s option
diff: honour flags with -qPreviously -q (just print a line when files differ) ignored flags like-w (ignore whitespace). Avoid the D_BRIEF short-circuit when flags arein effect.PR: 252515Repo
diff: honour flags with -qPreviously -q (just print a line when files differ) ignored flags like-w (ignore whitespace). Avoid the D_BRIEF short-circuit when flags arein effect.PR: 252515Reported by: Scott AitkenReviewed by: kevansMFC after: 1 weekSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D28064
diff: fix side_by_side after r363679It's currently unclear to me how this could have worked previously; \n hereis not a literal newline but actual '\' 'n', and was getting passed to theunderlying
diff: fix side_by_side after r363679It's currently unclear to me how this could have worked previously; \n hereis not a literal newline but actual '\' 'n', and was getting passed to theunderlying regex engine as such. regex(3) does not translate this to anewline, and this became an error because we don't really allow escapingof arbitrary ordinary characters anymore.Run the pattern strings through printf to make sure we're dealing with realnewlines before passing them through to atf_check, which ultimately feedsthem directly to regcomp(3).This fix is different than that will be needed for sed, in that this is theproper way to inject newlines into search strings as long as regex(3)won't combine \ + n as folks might expect.Reported by: Jenkins via lwhsuMFC after: 1 week
diff: restore compatibility with GNU diff regarding -N optionWhen -N is used the missing files are treated as empty.PR: 233402Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com>Reported by: Ro
diff: restore compatibility with GNU diff regarding -N optionWhen -N is used the missing files are treated as empty.PR: 233402Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com>Reported by: Roman Neuhauser <roman@sigpipe.cz>MFC after: 3 daysDifferential Revision: D25081
Restore compatibility with GNU diff regarding --labelVarious options to "diff(1)" show filenames, and traditionally make use of the"--label" parameter, if set.Restore this behaviour in BSD diff.
Restore compatibility with GNU diff regarding --labelVarious options to "diff(1)" show filenames, and traditionally make use of the"--label" parameter, if set.Restore this behaviour in BSD diff.While here add a regression testPR: 244533Submitted by: Jamie Landeg-Jones <jamie@catflap.org>MFC after: 3 days
diff(1): don't reject specifying the same format multiple timesThis may happen, for instance, if one happens to have an alias of diff todiff -up and attempts to specify the amount of context on to
diff(1): don't reject specifying the same format multiple timesThis may happen, for instance, if one happens to have an alias of diff todiff -up and attempts to specify the amount of context on top of that.Aliases like this may cause other problems, but if they're really not evergenerating non-unified diffs then we should at least not break thatuse-case.In addition, we'll now pick up a format mismatch if -p is specified with!contextual && !unified && !unset.Fix up a small trailing whitespace nit in the tests while we're here, andadd tests to make sure that we can double up all the formatting options.Reported by: jbeichMFC after: 3 days
12