From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Kevin Willford <kewillf@microsoft.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
"peff@peff.net" <peff@peff.net>,
"pclouds@gmail.com" <pclouds@gmail.com>
Subject: Re: [PATCH 1/1] reset: fix reset when using the sparse-checkout feature.
Date: Mon, 11 Sep 2017 13:15:36 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.1.1709111259430.4132@virtualbox> (raw)
In-Reply-To: <xmqqh8w951ek.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Mon, 11 Sep 2017, Junio C Hamano wrote:
> Stepping back a bit, I am not sure if it is sane or even valid for the
> end-user to modify paths outside sparse-checkout area, but that is
> probably a separate tangent.
That is not at all the scenario that Kevin fixed. Just have a quick look
at the regression test: in a sparse checkout, the user checked out a
branch, then called `reset` to switch to a different commit. No file was
touched by the user outside the sparse checkout.
Yet without Kevin's fix, `git status` would report that the user *deleted
files outside the sparse checkout*.
That is such an obvious bug, and Kevin's fix is such an obvious
improvement over the current upstream Git version, that I would think the
only thing worth discussing is whether the patch goes about it in a way of
which you approve.
For example, you mentioned that you would want to move the declaration of
`two` and `was_missing` into the conditional code block. That is a valid
suggestion for `was_missing` (but of course not for `two`, which is used
in the condition of the code block). That suggestion is more about code
style (and of course easily fixed by Kevin using Edit>Refactor>Move
Definition Location in VS), though, than about the correctness of the post
image.
Much more interesting would be a review of the conditional code block. And
I am not talking about the camelCasing of `ceBefore` (which will be fixed
as easily by Edit>Refactor>Rename). I am talking about the stuff where
tools cannot help, but where your experience is necessary: is it correct
to use make_cache_entry()/checkout_entry() in this case? Are the
parameters passed to those functions correct? Is the call to
cache_name_pos() followed by ce_skip_worktree() the best way to find out
whether the file that is absent was not actually deleted by the user, or
is there a less CPU-intensive way, seeing as we are already guaranteed to
iterate over the queue diff in alphabetical order?
I understand that those latter questions are a lot harder to answer, sorry
about that.
Ciao,
Dscho
next prev parent reply other threads:[~2017-09-11 11:15 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 18:00 [PATCH 0/1] reset: fix mixed reset when using sparse-checkout Kevin Willford
2017-09-08 18:00 ` [PATCH 1/1] reset: fix reset when using the sparse-checkout feature Kevin Willford
2017-09-08 18:54 ` Torsten Bögershausen
2017-09-08 19:04 ` Junio C Hamano
2017-09-08 19:01 ` Junio C Hamano
2017-09-08 20:08 ` Kevin Willford
2017-09-08 19:12 ` Junio C Hamano
2017-09-08 20:02 ` Kevin Willford
2017-09-09 3:18 ` Junio C Hamano
2017-09-09 4:54 ` Kevin Willford
2017-09-11 4:01 ` Junio C Hamano
2017-09-11 11:15 ` Johannes Schindelin [this message]
2017-09-12 3:56 ` Junio C Hamano
2017-09-12 20:20 ` Kevin Willford
2017-09-12 22:29 ` Jacob Keller
2017-09-12 23:30 ` Kevin Willford
2017-09-13 1:39 ` Jacob Keller
2017-09-13 17:09 ` Kevin Willford
2017-09-13 22:17 ` Junio C Hamano
2017-09-14 14:26 ` Kevin Willford
2017-09-15 5:00 ` Junio C Hamano
2017-09-15 17:21 ` Kevin Willford
2017-09-15 21:33 ` Jacob Keller
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=alpine.DEB.2.21.1.1709111259430.4132@virtualbox \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kewillf@microsoft.com \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/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