9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] patch: import replacement for ape/patch
@ 2022-05-22 22:57 ori
  2022-05-22 23:09 ` ori
  0 siblings, 1 reply; 12+ messages in thread
From: ori @ 2022-05-22 22:57 UTC (permalink / raw)
  To: 9front

We've been dragging along an antique version of Gnu patch
as part of ape. It's a bulky program with built in remote
code execution as part of ed-style diffs.

I'd like to eventually kill it. Let's start
by adding a replacement:

diff 6fbb1acc8fa0b6655b14e8c46240a4a8d2d8c672 uncommitted
--- /dev/null
+++ b//sys/man/1/patch
@@ -1,0 +1,57 @@
+.TH PATCH 1
+.SH NAME
+patch \- apply diffs
+.SH SYNOPSIS
+.B patch
+[
+.B -R
+]
+[
+.B -p
+.I nstrip
+]
+[
+.B -f
+.I maxfuzz
+]
+[
+.B patch...
+]
+.SH DESCRIPTION
+.I Patch
+will take a patch file in unified diff format, and apply it,
+skipping leading and trailing junk.
+If the file is not an exact match, it will search forwards and
+backwards for the surrounding context up to
+.I maxfuzz
+lines.
+
+The following options are supported:
+.TP
+.I -R
+Reverse direction of the patch. Addtions become removals,
+and the new and old file names are swapped.
+.TP
+.I -p nstrip
+Remove
+.I nstrip
+elements from the paths to the files.
+.TP
+.I -f maxfuzz
+Controls how far
+.I patch
+searches for context when applying a patch.
+.SH SEE ALSO
+.IR diff (1)
+.IR git/export (1)
+
+.SH BUGS
+.PP
+The output of
+.IR diff -c
+is not handled
+.PP
+Reject files and backups are not supported
+.PP
+All files are processed in memory, which limits
+the files handled to 2 gigabytes.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-05-28 21:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 22:57 [9front] patch: import replacement for ape/patch ori
2022-05-22 23:09 ` ori
2022-05-23  3:18   ` Amavect
2022-05-23 12:57     ` Humm
2022-05-24  2:38       ` Amavect
2022-05-24 16:39         ` Humm
2022-05-24 18:44           ` umbraticus
2022-05-24 19:42           ` Lyndon Nerenberg (VE7TFX/VE6BBM)
2022-05-24 21:19           ` Amavect
2022-05-23 21:40     ` ori
2022-05-23 23:51       ` ori
2022-05-28 21:09         ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).