5

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.

exupero
  • 9,136
  • 8
  • 47
  • 63

1 Answers1

2

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
tito
  • 12,990
  • 1
  • 55
  • 75
  • Correct. Just to mention that Perforce does provide an option for generating diffs but they are not in unified diff format and are not appropriate for reviewboard. More info: https://www.reviewboard.org/docs/manual/dev/users/review-requests/creating/#pre-commit-review-requests – egelev Aug 01 '14 at 07:59