Skip to contentSkip to conversation

rebase-i: print abbreviated hash when stop for editing

PATCH Superseded Ralf Thielow 2 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rebase-i: print abbreviated hash when stop for editing

---
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-rebase--interactive.sh +2 -1
index 4cde685..9ea3075 100644
@@ -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)
Signature · 1 line
2.8.0.rc4.7.g35d7ca9.dirty
#1 lore raw
Quoted 2 lines · Ralf Thielow

---

Hmph, the reason why this is a good thing to do is because an overlong $sha1 would push $rest too far to the right (possibly making it overflow to the next line)?

Quoted 17 lines
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-rebase--interactive.sh +2 -1
index 4cde685..9ea3075 100644
@@ -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 lore raw

2016-03-24 20:56 GMT+01:00 Junio C Hamano <[email protected]>:

Quoted 9 lines
Quoted 2 lines · Ralf Thielow

---

Hmph, the reason why this is a good thing to do is because an overlong $sha1 would push $rest too far to the right (possibly making it overflow to the next line)?

Yes. Another solution would have been to remove the "..." at the end, but I prefer to see a shorter message rather than having the full sha1 for whatever reason.

Quoted 18 lines
Quoted 18 lines
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-rebase--interactive.sh +2 -1
index 4cde685..9ea3075 100644
@@ -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)
#3 lore raw

PATCH v2 1/1 rebase-i: print an abbreviated hash when stop for editing

In reply to Ralf Thielow

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.

---
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-rebase--interactive.sh +2 -1
index 4cde685..9ea3075 100644
@@ -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)
Signature · 1 line
2.8.0.rc4.285.gc3ac548
#4 lore raw

Re: [PATCH v2] rebase-i: print an abbreviated hash when stop for editing

Quoted 7 lines · Ralf Thielow

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.

---

Thanks, will queue.

Quoted 17 lines
 git-rebase--interactive.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
git-rebase--interactive.sh +2 -1
index 4cde685..9ea3075 100644
@@ -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)