Commit Graph

21 Commits

Author SHA1 Message Date
Shannon Booth
2b46e6f664 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2023-07-15 16:21:29 +02:00
Shannon Booth
84b187e375 diff: Only output a unified/context header if there is a diff 2023-07-06 13:22:37 +02:00
Shannon Booth
c57658fffa diff: Allow configurable context for unified and context diffs
Add the options '-C','--context' and '-U','--unified', which can be used
to ask diff to write a diff in that format with a given number of
context lines surrounding the diff.
2023-07-05 10:26:48 +01:00
Shannon Booth
8c8b24d877 diff: Add support for writing diffs in context format 2023-07-03 10:41:30 +02:00
Shannon Booth
2c9db2de05 diff: Add support for writing diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth
ee92378b80 LibDiff: Make Diff::from_text fallible 2023-06-26 19:26:34 +02:00
Shannon Booth
84e8ff34a2 diff: Use StringView instead of DeprecatedString 2023-06-26 19:26:34 +02:00
Shannon Booth
2b56aefaed diff: Use Diff::write_normal to output hunks
Saving a bunch of code :^)
2023-06-24 18:34:08 +02:00
Shannon Booth
312de21498 diff: Remove "Hunk:" text from output
While this is a useful piece of information it means that diff is
producing hunks that are not of a valid normal diff format. This breaks
the ability to redirect the output of diff to a file to generate a
patch.
2023-06-24 18:34:08 +02:00
Tim Schumacher
874c7bba28 LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
Tim Schumacher
606a3982f3 LibCore: Move Stream-based file into the Core namespace 2023-02-13 00:50:07 +00:00
Linus Groh
6e7459322d AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
2023-01-27 20:38:49 +00:00
Tim Schumacher
ed4c2f2f8e LibCore: Rename Stream::read_all to read_until_eof
This generally seems like a better name, especially if we somehow also
need a better name for "read the entire buffer, but not the entire file"
somewhere down the line.
2022-12-12 14:16:42 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Sam Atkins
37d4e01fc4 diff: Port to Core::Stream
Also switched to calling Core::System::isatty(), and doing so once
instead of per hunk.
2022-11-19 17:00:10 +00:00
sin-ack
c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11:35 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Kenneth Myhra
4726532735 diff: Port to LibMain 2021-12-16 02:10:47 -08:00
Mustafa Quraish
07419b8931 diff: Only color output when stdout is a tty
If we're redirecting the output somewhere, we likely don't want to
have ANSI codes in the middle of our diff output.
2021-09-24 14:32:52 +02:00
Mustafa Quraish
4173f2ffad diff: Show start/end of line ranges in source/target files
This behaves very much like the regular diff command, showing the
start lines and ranges of additions/changes/deletions in both the
source and target files.
2021-09-24 14:32:52 +02:00
Mustafa Quraish
f552c26c79 Utilities: Add a basic diff utility 2021-09-17 16:56:59 +00:00