{"thread":{"id":"20407","subject":"[PATCH] rebase: consistent error messages for staged and unstaged changes.","startedAt":"2009-08-05T15:13:41Z","lastAt":"2009-08-06T09:56:27Z","messageCount":3,"participants":["Matthieu Moy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"119621","messageId":"1249485221-10510-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"20407","inReplyTo":null,"subject":"[PATCH] rebase: consistent error messages for staged and unstaged changes.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-08-05T15:13:41Z","receivedAt":"2009-08-05T15:13:41Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Previous version expose the output of the plumbing update-index to the\nuser, which novice users have difficulty to understand.\n\nWe still need to run update-index to refresh the cache (if\ndiff.autorefreshindex is false, git diff won't do it).\n---\n git-rebase.sh |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 18bc694..3555d17 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -382,8 +382,10 @@ else\n fi\n \n # The tree must be really really clean.\n-if ! git update-index --ignore-submodules --refresh; then\n-\tdie \"cannot rebase: you have unstaged changes\"\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+\texit 1\n fi\n diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)\n case \"$diff\" in\n-- \n1.6.4.18.g07a4a.dirty\n"},{"id":"119636","messageId":"7vws5i9nsy.fsf@alter.siamese.dyndns.org","threadId":"20407","inReplyTo":"1249485221-10510-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] rebase: consistent error messages for staged and unstaged changes.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-05T17:24:13Z","receivedAt":"2009-08-05T17:24:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Previous version expose the output of the plumbing update-index to the\n> user, which novice users have difficulty to understand.\n\nCan't -q(uiet) option of update-index be used for this?\n\n>\n> We still need to run update-index to refresh the cache (if\n> diff.autorefreshindex is false, git diff won't do it).\n> ---\n>  git-rebase.sh |    6 ++++--\n>  1 files changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index 18bc694..3555d17 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -382,8 +382,10 @@ else\n>  fi\n>  \n>  # The tree must be really really clean.\n> -if ! git update-index --ignore-submodules --refresh; then\n> -\tdie \"cannot rebase: you have unstaged changes\"\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> +\texit 1\n>  fi\n>  diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)\n>  case \"$diff\" in\n> -- \n> 1.6.4.18.g07a4a.dirty\n"},{"id":"119769","messageId":"vpqljlx465w.fsf@bauges.imag.fr","threadId":"20407","inReplyTo":"7vws5i9nsy.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] rebase: consistent error messages for staged and unstaged changes.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-08-06T09:56:27Z","receivedAt":"2009-08-06T09:56:27Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> Previous version expose the output of the plumbing update-index to the\n>> user, which novice users have difficulty to understand.\n>\n> Can't -q(uiet) option of update-index be used for this?\n\nNo, since update-index -q doesn't set the exit status properly:\n\n$ git update-index --ignore-submodules    --refresh  > /dev/null; echo $? \n1\n$ git update-index --ignore-submodules -q --refresh             ; echo $?  \n0\n\n-- \nMatthieu\n"}]}