From: Tao Klerks <tao@klerks.biz>
To: Junio C Hamano <gitster@pobox.com>
Cc: Tao Klerks via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] mergetool: new config guiDefault supports auto-toggling gui by DISPLAY
Date: Sun, 16 Oct 2022 22:07:38 +0200 [thread overview]
Message-ID: <CAPMMpohBOk2eQMbMxJhjr7cezrhMxVfaS--Aq8jJ1e-LQbEjrw@mail.gmail.com> (raw)
In-Reply-To: <xmqqilkmbelx.fsf@gitster.g>
On Fri, Oct 14, 2022 at 5:37 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Tao Klerks <tao@klerks.biz> writes:
>
> > My understanding, from ad-hoc testing, is that using OPT_BOOL causes
> > the target variable ("use_gui_tool" in this case) to *always* be set
> > to either "1" or "0", regardless of whether the user sets the main
> > flag, the --no form of the flag, or sets nothing at all.
>
> You are saying "git gc --keep-largest-pack" is broken ;-)
Now that I look at that, that does appear to have been implied by what
I was saying, yes!
>
> OPT_BOOL() and OPT_BOOL_F() are OPT_SET_INT() in disguise and there
> is no "set to this default value if no command line option is given"
> involved. At least I do not recall allowing such a code in.
>
I can confirm that it works the way you expected. I was sure I had
experienced such behavior during my early attempts at tristate
handling here, but in retrospect I was very much mistaken, not only
because --keep-largest-pack is not broken, but also because I just
ripped out all the arg-parsing function and enum stuff, and it all
works fine with -1, 0 and 1 as you pointed out it should. I don't know
exactly how I messed up my early testing, but I don't suppose it
matters.
Substantial simplification in the next update.
Thanks!
next prev parent reply other threads:[~2022-10-16 20:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 15:59 [PATCH] mergetool: new config guiDefault supports auto-toggling gui by DISPLAY Tao Klerks via GitGitGadget
2022-10-12 16:08 ` Tao Klerks
2022-10-12 18:12 ` Junio C Hamano
2022-10-13 6:49 ` Tao Klerks
2022-10-13 21:58 ` Junio C Hamano
2022-10-14 4:53 ` Tao Klerks
2022-10-14 9:10 ` Junio C Hamano
2022-10-14 12:32 ` Tao Klerks
2022-10-14 15:37 ` Junio C Hamano
2022-10-16 20:07 ` Tao Klerks [this message]
2022-10-14 8:00 ` [PATCH v2] RFC: " Tao Klerks via GitGitGadget
2022-10-14 8:24 ` Eric Sunshine
2022-10-14 9:11 ` Tao Klerks
2022-10-14 15:45 ` Junio C Hamano
2022-10-16 20:19 ` Tao Klerks
2022-10-17 5:50 ` Junio C Hamano
2022-10-18 6:54 ` [PATCH v3] " Tao Klerks via GitGitGadget
2023-02-17 10:59 ` Tao Klerks
2023-03-18 15:27 ` [PATCH v4] " Tao Klerks via GitGitGadget
2023-04-04 9:46 ` David Aguilar
2023-04-04 14:50 ` Tao Klerks
2023-04-04 20:35 ` Junio C Hamano
2023-04-06 3:33 ` David Aguilar
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=CAPMMpohBOk2eQMbMxJhjr7cezrhMxVfaS--Aq8jJ1e-LQbEjrw@mail.gmail.com \
--to=tao@klerks.biz \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--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).