All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Brandon Casey <drafnel@gmail.com>
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: Re: [PATCH 3/3] parse-options: only insert newline in help text if needed
Date: Mon, 25 Sep 2017 14:53:28 +0900	[thread overview]
Message-ID: <xmqqefqve33b.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqing7e3qs.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Mon, 25 Sep 2017 14:39:23 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> Brandon Casey <drafnel@gmail.com> writes:
>
>> Currently, when parse_options() produces a help message it always emits
>> a blank line after the usage text to separate it from the options text.
>> If the option spec does not define any switches, or only defines hidden
>> switches that will not be displayed, then the help text will end up with
>> two trailing blank lines instead of one.  Let's defer emitting the blank
>> line between the usage text and the options text until it is clear that
>> the options section will not be empty.
>
> This somehow looks familiar.  I think (together with the fix in 2/3)
> this makes it definitely better.  
>
> I also wonder if we want the final blank line, but that is sort-of a
> different issue.
>
> Thanks.

Oh, no wonder that this looked familiar.  It solves the same issue
as 48b8d3cf ("usage_with_options: omit double new line on empty
option list", 2017-08-25) and of course it conflicts with it.

I find the solution presented with this patch is more direct and
straightforward, leaving less chance to future breakage.  Besides
it comes with tests ;-), so perhaps I should drop the other one.



      reply	other threads:[~2017-09-25  5:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25  4:08 [PATCH 1/3] t0040,t1502: Demonstrate parse_options bugs Brandon Casey
2017-09-25  4:08 ` [PATCH 2/3] parse-options: write blank line to correct output stream Brandon Casey
2017-09-25  4:08 ` [PATCH 3/3] parse-options: only insert newline in help text if needed Brandon Casey
2017-09-25  5:39   ` Junio C Hamano
2017-09-25  5:53     ` Junio C Hamano [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

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

  git send-email \
    --in-reply-to=xmqqefqve33b.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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.
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.