git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: git@vger.kernel.org, Steffen Prohaska <prohaska@zib.de>
Subject: [PATCH] rebase: make the warning more useful when the work tree is unclean.
Date: Tue, 02 Oct 2007 22:30:12 -0700	[thread overview]
Message-ID: <7vejgchijf.fsf_-_@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vd4vxmmxr.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Tue, 02 Oct 2007 10:44:00 -0700")

Instead of letting "update-index --refresh" report paths needing
updates and merges, use git-status to give more useful output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * I won't be a good judge of the updated behaviour, as I never
   start rebase in an unclear tree.  Running git-status in a
   large tree may be too expensive to be worth changing the
   output.

 git-rebase.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 1583402..93e3b3c 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -254,7 +254,11 @@ else
 fi
 
 # The tree must be really really clean.
-git update-index --refresh || exit
+git update-index -q --refresh || {
+	git status
+	printf "cannot rebase: the work tree is not clean.\n"
+	exit 1
+}
 diff=$(git diff-index --cached --name-status -r HEAD)
 case "$diff" in
 ?*)	echo "cannot rebase: your index is not up-to-date"
-- 
1.5.3.3.1144.gf10f2

  reply	other threads:[~2007-10-03  5:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06  8:52 What's cooking in git.git (topics) Junio C Hamano
     [not found] ` <7v1wd1d0le.fsf@gitster.siamese.dyndns.org>
2007-09-14 18:30   ` Shawn O. Pearce
2007-09-15  7:47     ` db/fetch-pack topic (was: What's cooking in git.git (topics)) Shawn O. Pearce
2007-09-16  4:03       ` Shawn O. Pearce
2007-09-14 23:47   ` What's cooking in git.git (topics) Johannes Schindelin
2007-09-26 21:07     ` Carlos Rica
2007-09-26 20:05   ` Junio C Hamano
2007-09-26 21:44     ` Johannes Schindelin
2007-09-26 21:53       ` Tom Clarke
2007-09-27  2:36     ` Jeff King
2007-09-27  6:08       ` David Kastrup
2007-09-27  6:43         ` David Kastrup
2007-09-27 13:30         ` Jeff King
2007-09-27 13:46           ` David Kastrup
2007-10-02  4:16       ` Jeff King
2007-10-02  5:01         ` Junio C Hamano
2007-10-02  5:08           ` Jeff King
2007-10-02  5:13             ` Jeff King
2007-10-02  6:10               ` David Kastrup
2007-10-02 16:11                 ` Jeff King
2007-10-02 16:31                   ` David Kastrup
2007-10-02 17:39                     ` Jeff King
2007-10-02 18:44                       ` David Kastrup
2007-10-03  2:28                     ` Linus Torvalds
2007-10-03  6:54                       ` Jeff King
2007-10-03 16:13                         ` Linus Torvalds
2007-10-03  8:20                       ` David Kastrup
2007-10-03 16:59                         ` Jeff King
2007-10-03 17:53                           ` Linus Torvalds
2007-10-03 18:09                             ` David Kastrup
2007-10-04  7:10                       ` Junio C Hamano
2007-09-28  3:24     ` Daniel Barkalow
2007-10-02  5:53     ` Junio C Hamano
2007-10-02  6:41       ` Steven Grimm
2007-10-02  6:44       ` Steffen Prohaska
2007-10-02  7:03         ` Matthieu Moy
2007-10-02  7:21           ` Junio C Hamano
2007-10-02  8:01             ` David Kågedal
2007-10-02  8:07             ` Matthieu Moy
2007-10-02 17:44               ` Junio C Hamano
2007-10-03  5:30                 ` Junio C Hamano [this message]
2007-10-03  9:02                   ` [PATCH] rebase: make the warning more useful when the work tree is unclean Matthieu Moy
2007-10-02 12:52       ` What's cooking in git.git (topics) Johannes Schindelin
2007-10-02 17:00       ` Daniel Barkalow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vejgchijf.fsf_-_@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=prohaska@zib.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).