Re: [PATCH] sequencer.c: abbreviate hashs placed in the middle of messages
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 8, 2015, 17:10 UTC
- Message-ID
- <CAPig+cSeNn0r7N6vp+qs4NTNwfYx5p-zUX3tkifuXLu+nB2yNQ@mail.gmail.com>
- In-Reply-To
- <1431104035-2056-1-git-send-email-ralf.thielow@gmail.com>
On Fri, May 8, 2015 at 12:53 PM, Ralf Thielow <ralf.thielow@gmail.com> wrote:
> sequencer.c: abbreviate hashs placed in the middle of messages
s/hashs/hashes/
Show 18 quoted lines
> 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>
> ---
> 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));Are short SHA1's followed by "..." anywhere else in the project? It seems strange to introduce such usage here.
Show 26 quoted lines
> 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
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html