Re: [PATCH 3/5] environ: GIT_FLUSH should be made a usual Boolean
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 4, 2023, 06:37 UTC
- Message-ID
- <xmqqwn62u7nh.fsf@gitster.g>
- In-Reply-To
- <c58476c9-f7d1-bea4-17eb-c5346790df2e@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 15 quoted lines
> Subject: [PATCH] environ: use git_parse_maybe_bool() for GIT_FLUSH > > Accept textual boolean values like "true" and "false" for GIT_FLUSH by > using git_parse_maybe_bool() to parse the variable's value. Here's > how this changes whether to flush: > > before with this patch > ---------------------- ----------------------- ----------------------- > (unset) if stdin is not a file if stdin is not a file > GIT_FLUSH= no no > GIT_FLUSH=0 no no > GIT_FLUSH=1 yes yes > GIT_FLUSH=false no no > GIT_FLUSH=true no yes > GIT_FLUSH=bogus no if stdin is not a file
The above looks easy to grok, but the following caught my eyes.
> GIT_FLUSH=10000000000 yes if stdin is not a file
Is this because the int is so large that git_parse_signed() notices that it is out of bound (hence "bogus")?
Show 6 quoted lines
> Requested-by: Junio C Hamano <gitster@pobox.com> > Signed-off-by: René Scharfe <l.s.r@web.de> > --- > Documentation/git.txt | 10 ++++------ > write-or-die.c | 18 +++++++++--------- > 2 files changed, 13 insertions(+), 15 deletions(-)
I may have suggested it, but don't think I requested ;-)
The patch text looks good. Thanks.