git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: nbelakovski@gmail.com
Cc: "Git List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Mike Rappazzo" <rappazzo@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] worktree: populate lock_reason in get_worktrees and light refactor/cleanup in worktree files
Date: Wed, 24 Oct 2018 04:11:31 -0400	[thread overview]
Message-ID: <CAPig+cRN_0VVe6dzhnmU73pgo-8ncPzmOx4bRrTBVvReLW6RfQ@mail.gmail.com> (raw)
In-Reply-To: <20181024063904.36096-1-nbelakovski@gmail.com>

On Wed, Oct 24, 2018 at 2:39 AM <nbelakovski@gmail.com> wrote:
> lock_reason is now populated during the execution of get_worktrees
>
> is_worktree_locked has been simplified, renamed, and changed to internal
> linkage. It is simplified to only return the lock reason (or NULL in case
> there is no lock reason) and to not have any side effects on the inputs.
> As such it made sense to rename it since it only returns the reason.
>
> Since this function was now being used to populate the worktree struct's
> lock_reason field, it made sense to move the function to internal
> linkage and have callers refer to the lock_reason field. The
> lock_reason_valid field was removed since a NULL/non-NULL value of
> lock_reason accomplishes the same effect.
>
> Some unused variables within worktree source code were removed.

Thanks for the submission.

One thing which isn't clear from this commit message is _why_ this
change is desirable at this time, aside from the obvious
simplification of the code and client interaction (or perhaps those
are the _why_?).

Although I had envisioned populating the "reason" field greedily in
the way this patch does, not everyone agrees that doing so is
desirable. In particular, Junio argued[1,2] for populating it lazily,
which accounts for the current implementation. That's why I ask about
the _why_ of this change since it will likely need to be justified in
a such a way to convince Junio to change his mind.

Thanks.

[1]: https://public-inbox.org/git/xmqq8tyq5czn.fsf@gitster.mtv.corp.google.com/
[2]: https://public-inbox.org/git/xmqq4m9d0w6v.fsf@gitster.mtv.corp.google.com/

  reply	other threads:[~2018-10-24  8:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24  6:39 [PATCH] worktree: populate lock_reason in get_worktrees and light refactor/cleanup in worktree files nbelakovski
2018-10-24  8:11 ` Eric Sunshine [this message]
2018-10-25  5:46   ` Nickolai Belakovski
2018-10-25  5:51     ` [PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible nbelakovski
2018-10-25  6:56       ` Junio C Hamano
2018-10-28 21:56         ` Nickolai Belakovski
2018-10-29  3:52           ` Junio C Hamano
2018-10-29  5:43             ` Nickolai Belakovski
2018-10-29  6:42               ` Junio C Hamano
     [not found]         ` <CAC05386cSUhBm4TLD5NUeb5Ut9GT5=h-1MvqDnFpuc+UdZFmwg@mail.gmail.com>
2018-10-28 23:02           ` Eric Sunshine
2018-10-29  1:10             ` Nickolai Belakovski
2018-10-29  4:01               ` Eric Sunshine
2018-10-29  5:45                 ` Nickolai Belakovski
2018-10-29  6:21                   ` Eric Sunshine
2018-10-30  6:24       ` [PATCH v3 1/2] worktree: update documentation for lock_reason and lock_reason_valid nbelakovski
2018-10-31  2:28         ` Junio C Hamano
2018-10-30  6:24       ` [PATCH v3 2/2] worktree: rename is_worktree_locked to worktree_lock_reason nbelakovski
2018-10-31  2:41         ` Junio C Hamano
2018-10-25 19:14     ` [PATCH] worktree: populate lock_reason in get_worktrees and light refactor/cleanup in worktree files 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPig+cRN_0VVe6dzhnmU73pgo-8ncPzmOx4bRrTBVvReLW6RfQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nbelakovski@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=rappazzo@gmail.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.
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).