How to create patch suitable for reviewing in crucible?
git diff branch master --no-prefix > patch
This generates only 3 lines of context. S
Previously accepted solutions don't work for me when viewing a specific file/commit (the -U
option seems to mess with rev/path parsing), but --inter-hunk-context=
works in this case on git version 2.24.0
:
git diff \
--no-prefix \
--inter-hunk-context=2000 \
master -- \
path/to/file.py
If you don't know the file size, you can of course find it with wc -l
instead of hard-coding it:
git diff \
--no-prefix \
--inter-hunk-context=$(wc -l path/to/file.py) \
master -- \
path/to/file.py