9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: [9front] patch: import replacement for ape/patch
Date: Sun, 22 May 2022 18:57:32 -0400	[thread overview]
Message-ID: <8A703EB8EACED4EFE003DD77486E70FE@eigenstate.org> (raw)

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.


             reply	other threads:[~2022-05-22 22:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 22:57 ori [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8A703EB8EACED4EFE003DD77486E70FE@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).