From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH v2 1/2] update-index: optionally leave skip-worktree entries alone
Date: Wed, 30 Oct 2019 09:34:38 +0100 (CET) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1910300930440.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqq5zk7593d.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Wed, 30 Oct 2019, Junio C Hamano wrote:
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > While `git update-index` mostly ignores paths referring to index entries
> > whose skip-worktree bit is set, in b4d1690df11 (Teach Git to respect
> > skip-worktree bit (reading part), 2009-08-20), for reasons that are not
> > entirely obvious, the `--remove` option was made special: it _does_
> > remove index entries even if their skip-worktree bit is set.
> >
> > Seeing as this behavior has been in place for a decade now, it does not
> > make sense to change it.
>
> If this were end-user facing Porcelain behaviour, even it is a
> decade old, the story would have been different, but given that it
> is in an obscure corner in a plumbing command, I agree that it does
> not make sense to even transition the default over releases.
>
> > +test_expect_success '--ignore-skip-worktree-entries leaves worktree alone' '
> > + test_commit geroff-me &&
> > + git update-index --skip-worktree geroff-me.t &&
> > + rm geroff-me.t &&
>
> I do not see a need to swear with a sample file name. It may make
> sense to use words that relate to what the test is checking (e.g.
> skip-me or something like that), but otherwise meaningless filenames
> used in other tests (like 1, 2, etc) would be more in line with the
> existing tests.
I changed this locally to `keep-me`. But then I saw that you merged this
patch pair to `next` already... Do you want an add-on patch, or revert
it out of `next`, or leave as-is?
I'd like to know because I still want to merge this into Git for Windows
v2.24.0-rc2, and I would love to deviate as little as possible from
git.git there.
> > +
> > + : ignoring the worktree &&
> > + git update-index --remove --ignore-skip-worktree-entries geroff-me.t &&
> > + git diff-index --cached --exit-code HEAD &&
>
> HEAD has it, working tree does not, and the one in the index should
> have been kept thanks to the new option added by this patch. Makes
> sense.
>
> > + : not ignoring the worktree, a deletion is staged &&
> > + git update-index --remove geroff-me.t &&
> > + test_must_fail git diff-index --cached --exit-code HEAD
>
> Testing the other side of the coin (i.e. adding the new feature did
> not accidentally stop the command from removing by default) is good;
> "should have no difference" was a good test for the other side, but
> in contrast, "should have some difference" is a very loose test when
> the difference we want to see is that the particular path gets removed
> and no other changes.
True. I changed it to `test_must_fail git rev-parse :keep-me` locally
(to test for the staged deletion, although it just occurred to me that I
would rather want to add the `--diff-filter=D` option and filter by the
file name to really verify that a deletion was staged), but again, I
noticed that you already merged this to `next`...
So: revert out of `next`, add-on patch, or leave as-is?
Thanks,
Dscho
>
> > +'
> > +
> > #TODO test_expect_failure 'git-apply adds file' false
> > #TODO test_expect_failure 'git-apply updates file' false
> > #TODO test_expect_failure 'git-apply removes file' false
>
>
next prev parent reply other threads:[~2019-10-30 8:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 7:42 [PATCH 0/2] Fix git stash with skip-worktree entries Johannes Schindelin via GitGitGadget
2019-09-26 7:42 ` [PATCH 1/2] update-index: optionally leave skip-worktree entries alone Johannes Schindelin via GitGitGadget
2019-10-28 4:38 ` Junio C Hamano
2019-10-28 21:07 ` Johannes Schindelin
2019-10-29 2:27 ` Junio C Hamano
2019-09-26 7:42 ` [PATCH 2/2] stash: handle staged changes in skip-worktree files correctly Johannes Schindelin via GitGitGadget
2019-10-28 5:35 ` Junio C Hamano
2019-10-27 21:05 ` [PATCH 0/2] Fix git stash with skip-worktree entries Johannes Schindelin
2019-10-28 2:33 ` Junio C Hamano
2019-10-28 20:56 ` Johannes Schindelin
2019-10-29 2:25 ` Junio C Hamano
2019-10-29 8:15 ` Johannes Schindelin
2019-10-28 11:20 ` [PATCH v2 " Johannes Schindelin via GitGitGadget
2019-10-28 11:20 ` [PATCH v2 1/2] update-index: optionally leave skip-worktree entries alone Johannes Schindelin via GitGitGadget
2019-10-30 1:13 ` Junio C Hamano
2019-10-30 8:34 ` Johannes Schindelin [this message]
2019-11-02 3:04 ` Junio C Hamano
2019-11-02 23:03 ` Johannes Schindelin
2019-10-28 11:20 ` [PATCH v2 2/2] stash: handle staged changes in skip-worktree files correctly Johannes Schindelin via GitGitGadget
2019-10-30 1:16 ` Junio C Hamano
2019-10-30 10:49 ` [PATCH v3 0/2] Fix git stash with skip-worktree entries Johannes Schindelin via GitGitGadget
2019-10-30 10:49 ` [PATCH v3 1/2] update-index: optionally leave skip-worktree entries alone Johannes Schindelin via GitGitGadget
2019-10-30 10:49 ` [PATCH v3 2/2] stash: handle staged changes in skip-worktree files correctly Johannes Schindelin via GitGitGadget
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=nycvar.QRO.7.76.6.1910300930440.46@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--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).