Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a manual diff?

I have an existing codebase that I'd like to highlight particular portions of for demonstration purposes. We use Review Board, which allows a user to upload a diff and conveniently compare it against the repository in question.

That given, is there a good way to create a diff manually so it will show the relevant portions as having been added? The only way that comes to mind is by deleting the relevant code and reversing the diff.

like image 970
exupero Avatar asked Nov 06 '22 00:11

exupero


1 Answers

Use diff command manually:

cp yourfile.py yourfile.py.orig
# then edit the file
# and generate the diff
diff -Naur yourfile.py.orig yourfile.py

If you are already using a version control software (like git, svn, hg...), you can directly use them before commit:

hg diff
git diff
svn diff
like image 154
tito Avatar answered Dec 04 '22 05:12

tito