From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Stephen Manz via GitGitGadget <gitgitgadget@gmail.com>,
Git List <git@vger.kernel.org>, Stephen Manz <smanz@alum.mit.edu>
Subject: Re: [PATCH v2 0/3] worktree: teach add to accept --reason with --lock
Date: Sat, 10 Jul 2021 03:15:44 -0400 [thread overview]
Message-ID: <CAPig+cQyOgQb1zHA49kOT4+2SmTxUjZpfQ-f1ZxV1AwigCz01A@mail.gmail.com> (raw)
In-Reply-To: <xmqqv95j79ut.fsf@gitster.g>
On Fri, Jul 9, 2021 at 12:03 PM Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > The reason I suggested re-purposing `add_opts.keep_locked` is to avoid
> > polluting that structure with members having overlapping meaning, thus
> > reducing the confusion-factor for clients of that structure (assuming
> > that a tri-state `keep_locked` is indeed less confusing). That doesn't
> > preclude adding a new variable or two local to the `add()` function to
> > facilitate keeping `add_opts` pure. For instance, it might be as
> > simple as the below patch.
>
> True. It is less trivial to construct the command line option
> parser so that --reason=<why> and --lock can be given in any order
> (e.g. they no longer can be a simple OPT_BOOL and OPT_STRING that
> can be given independently but needs some postprocessing like your
> patch did), but it is not rocket science and keeping add_opts struct
> leaner will reduce the risk of runtime confusion, I would think, but
> at the same time, the room for runtime confusion would probably be
> minor to begin with---so I am fine, if the coder cannot cleanly
> write the option parser to do so, with the code as posted.
Although the leaner approach seems "simpler" and more obvious to me,
it is subjective, and I can see how other people might find a
tri-state add_opts::keep_locked confusing. So, I'm fine with it either
way and don't consider it a blocker at all.
next prev parent reply other threads:[~2021-07-10 7:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 5:47 [PATCH] worktree: teach `add` to accept --reason <string> with --lock Stephen Manz via GitGitGadget
2021-07-06 6:19 ` Eric Sunshine
2021-07-06 19:42 ` Junio C Hamano
2021-07-09 6:11 ` Eric Sunshine
2021-07-09 15:23 ` Junio C Hamano
2021-07-10 7:11 ` Eric Sunshine
2021-07-08 15:50 ` [PATCH v2 0/3] worktree: teach add to accept --reason " Stephen Manz via GitGitGadget
2021-07-08 15:50 ` [PATCH v2 1/3] t2400: remove unneeded `git rev-parse` from '"add" worktree with lock' test Stephen Manz via GitGitGadget
2021-07-08 15:50 ` [PATCH v2 2/3] worktree: default lock string should be marked with `_()` for translation Stephen Manz via GitGitGadget
2021-07-09 6:19 ` Eric Sunshine
2021-07-09 15:58 ` Junio C Hamano
2021-07-08 15:50 ` [PATCH v2 3/3] worktree: teach `add` to accept --reason <string> with --lock Stephen Manz via GitGitGadget
2021-07-09 7:45 ` [PATCH v2 0/3] worktree: teach add to accept --reason " Eric Sunshine
2021-07-09 16:03 ` Junio C Hamano
2021-07-10 7:15 ` Eric Sunshine [this message]
2021-07-11 0:27 ` [PATCH v3 " Stephen Manz via GitGitGadget
2021-07-11 0:27 ` [PATCH v3 1/3] t2400: clean up '"add" worktree with lock' test Stephen Manz via GitGitGadget
2021-07-11 0:27 ` [PATCH v3 2/3] worktree: mark lock strings with `_()` for translation Stephen Manz via GitGitGadget
2021-07-11 0:27 ` [PATCH v3 3/3] worktree: teach `add` to accept --reason <string> with --lock Stephen Manz via GitGitGadget
2021-07-13 3:37 ` Eric Sunshine
2021-07-13 3:47 ` [PATCH v3 0/3] worktree: teach add to accept --reason " Eric Sunshine
2021-07-15 2:32 ` [PATCH v4 " Stephen Manz via GitGitGadget
2021-07-15 2:32 ` [PATCH v4 1/3] t2400: clean up '"add" worktree with lock' test Stephen Manz via GitGitGadget
2021-07-15 2:32 ` [PATCH v4 2/3] worktree: mark lock strings with `_()` for translation Stephen Manz via GitGitGadget
2021-07-15 2:32 ` [PATCH v4 3/3] worktree: teach `add` to accept --reason <string> with --lock Stephen Manz via GitGitGadget
2021-07-15 17:17 ` [PATCH v4 0/3] worktree: teach add to accept --reason " Eric Sunshine
2021-07-17 0:14 ` Eric Sunshine
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=CAPig+cQyOgQb1zHA49kOT4+2SmTxUjZpfQ-f1ZxV1AwigCz01A@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=smanz@alum.mit.edu \
/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).