How to create patch suitable for reviewing in crucible?
git diff branch master --no-prefix > patch
This generates only 3 lines of context. S
Got inspiration and so I added a git alias.
$ cat ~/.gitconfig | fgrep diff
df = "!git diff -U$(wc -l \"$1\" | cut -d ' ' -f 1) \"$1\""
$ git df
Update:
Just found "git df" does not work sometimes, due to directory change when executing git alias. (See git aliases operate in the wrong directory). So this is the updated version:
$ cat ~/.gitconfig | fgrep df
df = "! [ \"$GIT_PREFIX\" != \"\" ] && cd \"$GIT_PREFIX\"; ~/bin/git_df.sh"
$
$ cat ~/bin/git_df.sh
#!/bin/bash
for FILE in $@; do
git diff -U$(wc -l "${FILE}" | cut -d ' ' -f 1) "${FILE}"
done
exit 0