git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sequencer.c: abbreviate hashs placed in the middle of messages
@ 2015-05-08 16:53 Ralf Thielow
  2015-05-08 17:10 ` Eric Sunshine
  0 siblings, 1 reply; 14+ messages in thread
From: Ralf Thielow @ 2015-05-08 16:53 UTC (permalink / raw)
  To: git; +Cc: Ralf Thielow

Printing a 40 character sha1 hash in the middle of a message
stretches the sentence a lot. Print the abbreviated version
instead.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
 sequencer.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/sequencer.c b/sequencer.c
index c4f4b7d..2a39ab6 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -498,20 +498,21 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
 		struct commit_list *p;
 
 		if (!opts->mainline)
-			return error(_("Commit %s is a merge but no -m option was given."),
-				sha1_to_hex(commit->object.sha1));
+			return error(_("Commit %s... is a merge but no -m option was given."),
+				find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));
 
 		for (cnt = 1, p = commit->parents;
 		     cnt != opts->mainline && p;
 		     cnt++)
 			p = p->next;
 		if (cnt != opts->mainline || !p)
-			return error(_("Commit %s does not have parent %d"),
-				sha1_to_hex(commit->object.sha1), opts->mainline);
+			return error(_("Commit %s... does not have parent %d"),
+				find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),
+				opts->mainline);
 		parent = p->item;
 	} else if (0 < opts->mainline)
-		return error(_("Mainline was specified but commit %s is not a merge."),
-			sha1_to_hex(commit->object.sha1));
+		return error(_("Mainline was specified but commit %s... is not a merge."),
+			find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));
 	else
 		parent = commit->parents->item;
 
-- 
2.4.0.228.gc627b12

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-05-10 19:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08 16:53 [PATCH] sequencer.c: abbreviate hashs placed in the middle of messages Ralf Thielow
2015-05-08 17:10 ` Eric Sunshine
2015-05-08 17:20   ` Ralf Thielow
2015-05-08 17:20   ` Junio C Hamano
2015-05-08 17:26     ` Ralf Thielow
2015-05-08 17:31       ` Junio C Hamano
2015-05-08 17:58     ` Ralf Thielow
2015-05-08 18:42       ` Junio C Hamano
2015-05-08 19:56         ` Ralf Thielow
2015-05-08 20:24           ` Junio C Hamano
2015-05-08 20:57             ` Ralf Thielow
2015-05-10  9:05             ` Matthieu Moy
2015-05-10 19:17               ` Junio C Hamano
2015-05-10 19:36                 ` Matthieu Moy

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).