From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, me@ttaylorr.com
Subject: [PATCH 0/1] ref-filter.c: pass empty-string as NULL to atom parsers
Date: Sun, 1 Oct 2017 22:50:52 -0700 [thread overview]
Message-ID: <20171002055052.GB10729@D-10-157-251-166.dhcp4.washington.edu> (raw)
Hi,
Attached is a one-long patch series to un-distinguish between atoms
without sub-arguments ("%(refname)") and atoms with empty sub-argument
lists ("%(refname:)").
This addresses a user-experience issue that Peff points out:
> Doh, that string_list behavior is what I was missing in my earlier
> comments. I agree this is probably the best way of doing it. I'm tempted
> to say that parse_ref_filter_atom() should do a similar thing. Right now
> we've got:
>
> $ git for-each-ref --format='%(refname)' | wc
> 2206 2206 79929
> $ git for-each-ref --format='%(refname:short)' | wc
> 2206 2206 53622
> $ git for-each-ref --format='%(refname:)' | wc
> fatal: unrecognized %(refname:) argument:
> 0 0 0
By treating %(refname) and %(refname:) as the same thing. Peff has
convinced me that these _are_ indeed the same thing, as the first is a
%(refname) atom without any sub-arguments, and the later is a %(refname)
%atom with empty sub-arguments.
The reasoning is highlighted in the comment this patch adds, which makes
more ergonomic the use of string_list_split in atom parser
implementations.
Thank you in advance :-).
--
- Taylor
next reply other threads:[~2017-10-02 5:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 5:50 Taylor Blau [this message]
2017-10-02 5:53 ` [PATCH] ref-filter.c: pass empty-string as NULL to atom parsers Taylor Blau
2017-10-02 6:43 ` Jeff King
2017-10-02 16:12 ` Taylor Blau
2017-10-02 19:42 ` Jeff King
2017-10-02 16:10 ` [PATCH v2] " Taylor Blau
2017-10-02 19:42 ` Jeff King
2017-10-02 22:40 ` Jonathan Nieder
2017-10-02 23:55 ` Junio C Hamano
2017-10-03 3:37 ` Taylor Blau
2017-10-05 1:49 ` Junio C Hamano
2017-10-05 2:11 ` Jonathan Nieder
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=20171002055052.GB10729@D-10-157-251-166.dhcp4.washington.edu \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).