Commit 2a63358
committed
show: skip diff when possible
Running:
git show -s $commit
will still compute a diff for $commit, even though we aren't going to
show it. This is wasted computation, since it cannot affect the output
or exit code of the program.
In the more general case:
- if the requested diff format is NO_OUTPUT, then we won't change the
output of the diff itself
- if rev_info.always_show_header is set, then we will show the commit
regardless of whether the diff is empty (which is true for git-show,
for example, but not git-log)
- we don't use --exit-code here (should check?)1 parent 68cb7f9 commit 2a63358
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1108 | 1112 | | |
1109 | 1113 | | |
1110 | 1114 | | |
| |||
0 commit comments