{"thread":{"id":"20888","subject":"[PATCH] rebase: use plumbing to show dirty state","startedAt":"2009-09-09T14:59:37Z","lastAt":"2009-09-09T14:59:37Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"122765","messageId":"20090909145937.GA5723@sigill.intra.peff.net","threadId":"20888","inReplyTo":null,"subject":"[PATCH] rebase: use plumbing to show dirty state","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-09-09T14:59:37Z","receivedAt":"2009-09-09T14:59:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Commit 4cfbe06 introduced the use of \"git diff\" to show\ndirty state in a format more familiar to users. However, it\nshould have used the plumbing \"git diff-files\" instead.\n\nNot only is it good practice in general to use plumbing in\nscripts, but in this case we really don't want the automatic\npager to kick in for an error message.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI got quite a surprise when I ran \"git rebase\" and was presented with a\npager with nothing but:\n\n  M foo.c\n\nin it. I suspect this issue wasn't noticed while testing because most\npeople use \"-FX\" with \"less\", so their short list of dirty files causes\nthe pager to exit immediately.\n\n git-rebase.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 2315d95..6ec155c 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -387,7 +387,7 @@ fi\n # The tree must be really really clean.\n if ! git update-index --ignore-submodules --refresh > /dev/null; then\n \techo >&2 \"cannot rebase: you have unstaged changes\"\n-\tgit diff --name-status -r --ignore-submodules -- >&2\n+\tgit diff-files --name-status -r --ignore-submodules -- >&2\n \texit 1\n fi\n diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)\n-- \n1.6.5.rc0.166.ge65f.dirty\n"}]}