I'm using diff
and patch
to patch some files. In my situation, I am not permitted to distribute any of the original file.
Right now, the diffs look something like this:
1c1
< Hello, this is the original.
---
> Hey, this is the new version.
I don't want to (and for reasons can't) include the original lines. Is it possible to make a diff that doesn't include the original lines, just what replaces the original lines?
The closest I've found is using diff -e
to generate an ed
script, but it doesn't look like ed
is installed by default on Debian. Is it possible to do this with diff
and patch
?
EDIT: For example, I want to take a file that looks like this:
Hello, this is a file.
It is pretty cool.
I wrote it in a text editor.
to a file like this:
Hello, this is a file.
It is kinda awesome.
I wrote it in a text editor.
A regular diff would include the original line, and look like this:
2c2
< It is pretty cool.
---
> It is kinda awesome.
I don't want the original line ("It is pretty cool.") to even be in the diff file. I'd like a diff file that basically says replace line 2 with: It is kinda awesomewhich has all the needed info to patch, but includes none of the original content. Essentially, I want a diff that says "replace whatever is on line 2 with this:".
Running patch -e
to make an ed
script generates all that I need, but I don't want to use that as ed isn't included in Debian by default.
2c
It is kinda awesome.
.