git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rebase: consistent error messages for staged and unstaged changes.

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2009, 17:24 UTC
Message-ID
<7vws5i9nsy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1249485221-10510-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> Previous version expose the output of the plumbing update-index to the
> user, which novice users have difficulty to understand.
Can't -q(uiet) option of update-index be used for this?
Show 26 quoted lines
>
> We still need to run update-index to refresh the cache (if
> diff.autorefreshindex is false, git diff won't do it).
> ---
>  git-rebase.sh |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/git-rebase.sh b/git-rebase.sh
> index 18bc694..3555d17 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -382,8 +382,10 @@ else
>  fi
>  
>  # The tree must be really really clean.
> -if ! git update-index --ignore-submodules --refresh; then
> -	die "cannot rebase: you have unstaged changes"
> +if ! git update-index --ignore-submodules --refresh > /dev/null; then
> +	echo >&2 "cannot rebase: you have unstaged changes"
> +	git diff --name-status -r --ignore-submodules -- >&2
> +	exit 1
>  fi
>  diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
>  case "$diff" in
> -- 
> 1.6.4.18.g07a4a.dirty
Previous: Matthieu MoyNext: Matthieu Moy
Message 2 of 3 in “rebase: consistent error messages for staged and unstaged changes.”
  1. rebase: consistent error messages for staged and unstaged changes.Matthieu Moy, Aug 5, 2009
  2. Junio C HamanoAug 5, 2009
  3. Matthieu MoyAug 6, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.