aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-08-23 18:38:34 +0200
committerTeddy Wing2020-08-23 18:38:34 +0200
commit76079daf1e2175d02c9c584e47a21650fce30bb6 (patch)
treef8a7d80dc07500c8ed983686de399abb6fdc6a2e
parent4c15bad2a95768ab6e299866c55aed31215fe6cc (diff)
downloadgit-suggestion-76079daf1e2175d02c9c584e47a21650fce30bb6.tar.bz2
git-sugdiff: Add `--no-pager` to `git diff` command
The diff command wasn't exiting after outputting the diff. Add the `--no-pager` argument to ensure that the pager doesn't activate. This also seems to cause the command to exit once all the output is printed. We don't want the pager because we need to call `git diff` for each suggestion. If an early diff took up more than a page and activated the pager, that would block the next diffs from appearing. We want them all to appear at once.
-rw-r--r--src/bin/git-sugdiff.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/git-sugdiff.rs b/src/bin/git-sugdiff.rs
index 9c7ff1f..6bc67d9 100644
--- a/src/bin/git-sugdiff.rs
+++ b/src/bin/git-sugdiff.rs
@@ -46,6 +46,7 @@ fn main() {
let blob = suggestion.diff_command().unwrap();
Command::new("git")
+ .arg("--no-pager")
.arg("diff")
.arg(format!("{}:{}", suggestion.commit(), suggestion.path()))
.arg(blob.to_string())