git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] help: align the longest command in the command listing
Date: Fri, 1 Feb 2019 15:24:21 +0700	[thread overview]
Message-ID: <CACsJy8B=7NsnnoSH1Bt_C-Nop95ky=rudHU3SOVERVudDD7Tfw@mail.gmail.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1902010842010.41@tvgsbejvaqbjf.bet>

On Fri, Feb 1, 2019 at 2:42 PM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> > diff --git a/help.c b/help.c
> > index ff05fd22df..520c9080e8 100644
> > --- a/help.c
> > +++ b/help.c
> > @@ -85,7 +85,8 @@ static void print_command_list(const struct cmdname_help *cmds,
> >               if (cmds[i].category & mask) {
> >                       size_t len = strlen(cmds[i].name);
> >                       printf("   %s   ", cmds[i].name);
> > -                     mput_char(' ', longest > len ? longest - len : 1);
> > +                     if (longest > len)
> > +                             mput_char(' ', longest - len);
>
> Why not simply replace the `1` by `0`?

While it makes the diff shorter, I think it's a bit more confusing
(why add zero spaces?)
-- 
Duy

      reply	other threads:[~2019-02-01  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31  9:23 [PATCH] help: align the longest command in the command listing Nguyễn Thái Ngọc Duy
2019-02-01  7:42 ` Johannes Schindelin
2019-02-01  8:24   ` Duy Nguyen [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CACsJy8B=7NsnnoSH1Bt_C-Nop95ky=rudHU3SOVERVudDD7Tfw@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).