From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: "Guillaume Pagès" <guillaume.pages@ensimag.grenoble-inp.fr>
Cc: git@vger.kernel.org,
Remi Galan <remi.galan-alfonso@ensimag.grenoble-inp.fr>,
Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>,
Louis-Alexandre Stuber
<louis--alexandre.stuber@ensimag.grenoble-inp.fr>,
Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>,
Junio Hamano <gitster@pobox.com>
Subject: Re: [PATCH 3/4] status: give more information during rebase -i
Date: Mon, 08 Jun 2015 18:17:49 +0200 [thread overview]
Message-ID: <vpqeglm41jm.fsf@anie.imag.fr> (raw)
In-Reply-To: <1433775308-5451-1-git-send-email-guillaume.pages@ensimag.grenoble-inp.fr> ("Guillaume \=\?iso-8859-1\?Q\?Pag\=E8s\=22's\?\= message of "Mon, 8 Jun 2015 16:55:07 +0200")
Please, include a version number in the subject. git send-email -v2 does
this for you.
Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr> writes:
> +static void show_rebase_information(struct wt_status *s,
> + struct wt_status_state *state,
> + const char *color)
> +{
> + if (state->rebase_interactive_in_progress) {
> + int i, begin;
> + int lines_to_show_nr = 2;
> +
> + struct strbuf buf = STRBUF_INIT;
> + struct string_list have_done = STRING_LIST_INIT_DUP;
> + struct string_list yet_to_do = STRING_LIST_INIT_DUP;
> +
> + strbuf_read_file(&buf, git_path("rebase-merge/done"), 0);
> + stripspace(&buf, 1);
> + have_done.nr = string_list_split(&have_done, buf.buf, '\n', -1);
> + string_list_remove_empty_items(&have_done, 1);
> + strbuf_release(&buf);
I'd release buf one line earlier (meaning "I'm done with buf, now let's
talk about something else"), but it's OK like this too
> + strbuf_read_file(&buf, git_path("rebase-merge/git-rebase-todo"), 0);
> + stripspace(&buf, 1);
> + string_list_split(&yet_to_do, buf.buf, '\n', -1);
> + string_list_remove_empty_items(&yet_to_do, 1);
> + strbuf_release(&buf);
Nice. Much simpler than the previous iteration.
> + if (have_done.nr == 0)
> + status_printf_ln(s, color, _("No commands done."));
> + else{
Missing space before {
> + status_printf_ln(s, color,
> + Q_("Last command done (%d command done):",
> + "Last commands done (%d commands done):",
> + have_done.nr),
> + have_done.nr);
> + begin = (have_done.nr > lines_to_show_nr) ? have_done.nr-lines_to_show_nr : 0;
Missing space around '-'
> + for (i = begin; i < have_done.nr; i++) {
> + status_printf_ln(s, color, " %s", have_done.items[i].string);
> + }
Useless braces.
> + if (have_done.nr > lines_to_show_nr && s->hints)
> + status_printf_ln(s, color,
Indentation with space (open in Emacs, M-x whitespace-mode RET to see
this kind of things).
> + _(" (see more in file %s)"), git_path("rebase-merge/done"));
> + }
> + if (yet_to_do.nr == 0)
> + status_printf_ln(s, color,
> + _("No commands remaining."));
> + else{
> +
> + status_printf_ln(s, color,
> + Q_("Next command to do (%d remaining command):",
> + "Next commands to do (%d remaining commands):",
> + yet_to_do.nr),
> + yet_to_do.nr);
> + for (i = 0; i < lines_to_show_nr && i < yet_to_do.nr; i++) {
> + status_printf_ln(s, color, " %s", yet_to_do.items[i].string);
> + }
Useless braces.
> + if (s->hints)
> + status_printf_ln(s, color,
Indentation with space again.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2015-06-08 16:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 14:55 [PATCH 3/4] status: give more information during rebase -i Guillaume Pagès
2015-06-08 14:55 ` [PATCH 4/4] status: add new tests for status " Guillaume Pagès
2015-06-08 16:17 ` Matthieu Moy [this message]
2015-06-08 22:11 ` [PATCH 3/4] status: give more information " Junio C Hamano
2015-06-09 8:57 ` Guillaume Pages
-- strict thread matches above, loose matches on Subject: below --
2015-06-09 14:42 [PATCH 1/4] status: factor two rebase-related messages together Guillaume Pagès
2015-06-09 14:42 ` [PATCH 3/4] status: give more information during rebase -i Guillaume Pagès
2015-06-03 22:00 [PATCH 1/4] status: factor two rebase-related messages together Guillaume Pagès
2015-06-03 22:00 ` [PATCH 3/4] status: give more information during rebase -i Guillaume Pagès
2015-06-04 8:06 ` Matthieu Moy
2015-06-04 17:19 ` Junio C Hamano
2015-06-05 16:35 ` Guillaume Pages
2015-06-05 17:11 ` 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=vpqeglm41jm.fsf@anie.imag.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=antoine.delaite@ensimag.grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=guillaume.pages@ensimag.grenoble-inp.fr \
--cc=louis--alexandre.stuber@ensimag.grenoble-inp.fr \
--cc=remi.galan-alfonso@ensimag.grenoble-inp.fr \
--cc=remi.lespinet@ensimag.grenoble-inp.fr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.