git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Thielow <ralf.thielow@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Ralf Thielow <ralf.thielow@gmail.com>
Subject: [PATCH v2] rebase-i: print an abbreviated hash when stop for editing
Date: Mon, 28 Mar 2016 18:00:00 +0200	[thread overview]
Message-ID: <1459180800-5744-1-git-send-email-ralf.thielow@gmail.com> (raw)
In-Reply-To: <1458844281-13107-1-git-send-email-ralf.thielow@gmail.com>

The message that is shown when rebase-i stops for editing prints
the full hash of the commit where it stopped which makes the message
overflow to the next line on smaller terminal windows.  Print an
abbreviated hash instead.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 4cde685..9ea3075 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -548,7 +548,8 @@ do_next () {
 
 		mark_action_done
 		do_pick $sha1 "$rest"
-		warn "Stopped at $sha1... $rest"
+		sha1_abbrev=$(git rev-parse --short $sha1)
+		warn "Stopped at $sha1_abbrev... $rest"
 		exit_with_patch $sha1 0
 		;;
 	squash|s|fixup|f)
-- 
2.8.0.rc4.285.gc3ac548

  parent reply	other threads:[~2016-03-28 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 18:31 [PATCH] rebase-i: print abbreviated hash when stop for editing Ralf Thielow
2016-03-24 19:56 ` Junio C Hamano
2016-03-24 21:06   ` Ralf Thielow
2016-03-28 16:00 ` Ralf Thielow [this message]
2016-03-28 18:43   ` [PATCH v2] rebase-i: print an " Junio C Hamano

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

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

  git send-email \
    --in-reply-to=1459180800-5744-1-git-send-email-ralf.thielow@gmail.com \
    --to=ralf.thielow@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
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 NNTP newsgroup(s).