git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] clean up parsing of maybe_bool
@ 2017-08-07 18:20 Martin Ågren
  2017-08-07 18:20 ` [PATCH 1/6] Doc/git-{push,send-pack}: correct --sign= to --signed= Martin Ågren
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Martin Ågren @ 2017-08-07 18:20 UTC (permalink / raw)
  To: git; +Cc: Dave Borowitz, Junio C Hamano, Stefan Beller

When we want to parse a boolean config item without dying on error, we
call git_config_maybe_bool() which takes two arguments: the value to be
parsed (obviously) and a `name` which is completely ignored. Junio has
suggested to drop `name` and rename the function [1]. That effort even
started shortly after that, by introducing git_parse_maybe_bool(). The
new function currently only has a single user outside config.c.

Patch 5 of this series deprecates the old function and updates all
callers to use git_parse_maybe_bool() instead. Patch 6 is a final
cleanup: one of the converted callers suddenly had an unused argument.

Patches 3 and 4 prepare for the switch. In particular, patch 4 ensures
that the two functions are actually equivalent. In doing so, it affects
`git push --signed=..` which was very slightly inconsistent to the rest
of Git.

Patch 2 adds a failing test in preparation for patch 4. Patch 1 corrects
the documentation not to say "git push --sign=.." to make it a bit more
obvious that the opposite typo is not being made in patches 2 and 4.

git_parse_maybe_bool is used in sb/diff-color-move, which is in "next".
This series makes --color-moved and diff.colormoved consistent with
other booleans. That should be a good thing, but cc Stefan to be sure.

Martin

[1] https://public-inbox.org/git/xmqq7fotd71o.fsf@gitster.dls.corp.google.com/

Martin Ågren (6):
  Doc/git-{push,send-pack}: correct --sign= to --signed=
  t5334: document that git push --signed=1 does not work
  config: introduce git_parse_maybe_bool_text
  config: make git_{config,parse}_maybe_bool equivalent
  treewide: deprecate git_config_maybe_bool, use git_parse_maybe_bool
  parse_decoration_style: drop unused argument `var`

 Documentation/git-push.txt             |  4 ++--
 Documentation/git-send-pack.txt        |  4 ++--
 Documentation/technical/api-config.txt |  4 ++++
 t/t5534-push-signed.sh                 |  7 +++++++
 builtin/log.c                          | 10 +++++-----
 builtin/merge.c                        |  4 ++--
 builtin/pull.c                         |  4 ++--
 builtin/push.c                         |  2 +-
 builtin/remote.c                       |  2 +-
 builtin/send-pack.c                    |  2 +-
 config.c                               | 15 ++++++++++-----
 pager.c                                |  2 +-
 submodule-config.c                     |  6 +++---
 13 files changed, 41 insertions(+), 25 deletions(-)

-- 
2.14.0.5.g0f7b1ed27


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-08-08 17:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-07 18:20 [PATCH 0/6] clean up parsing of maybe_bool Martin Ågren
2017-08-07 18:20 ` [PATCH 1/6] Doc/git-{push,send-pack}: correct --sign= to --signed= Martin Ågren
2017-08-07 18:20 ` [PATCH 2/6] t5334: document that git push --signed=1 does not work Martin Ågren
2017-08-07 20:25   ` Junio C Hamano
2017-08-07 18:20 ` [PATCH 3/6] config: introduce git_parse_maybe_bool_text Martin Ågren
2017-08-07 18:20 ` [PATCH 4/6] config: make git_{config,parse}_maybe_bool equivalent Martin Ågren
2017-08-07 18:20 ` [PATCH 5/6] treewide: deprecate git_config_maybe_bool, use git_parse_maybe_bool Martin Ågren
2017-08-07 18:20 ` [PATCH 6/6] parse_decoration_style: drop unused argument `var` Martin Ågren
2017-08-07 18:44 ` [PATCH 0/6] clean up parsing of maybe_bool Stefan Beller
2017-08-07 21:12   ` Junio C Hamano
2017-08-08  4:02     ` Martin Ågren
2017-08-08 17:04       ` Junio C Hamano
2017-08-08 17:21         ` Martin Ågren

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 NNTP newsgroup(s).