git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
To: Victoria Dye <vdye@github.com>
Cc: Derrick Stolee <derrickstolee@github.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC PATCH 1/1] mv: integrate with sparse-index
Date: Sun, 27 Mar 2022 11:48:43 +0800	[thread overview]
Message-ID: <CAJyCBOQT1TwkNX_be9B3uKsv4Buf_ojfZoqfTAUqQ22Na7dY=g@mail.gmail.com> (raw)
In-Reply-To: <97a665fe-07c9-c4f6-4ab6-b6c0e1397c31@github.com>

On Fri, Mar 18, 2022 at 5:57 AM Victoria Dye <vdye@github.com> wrote:

Hi all,

It's been a busy week, I'm sorry that did not have much time to respond.

=================================
A brief summary of my latest investigations:

I think the 'git mv' command still has some questionable aspects, especially
with the 'git sparse-checkout' command. And I feel we have to sort things out
between 'git mv' and sparse-checkout first, then proceed to the issues with
sparse-index.
===========

I'm trying to fix the first 2 of the 3 potential things mentioned earlier.

> 1. When empty folder2/ is on-disk, 'git mv' (without '--sparse') doesn't
>    fail with "bad source", even though it should.

In this case, 'git mv' does not fail with "bad source" is something expected,
because this error is related to the existence of an on-disk file, not
a directory.
The closest thing that it should fail with, in my opinion, is by
calling the advise
function 'advise_on_updating_sparse_paths'.

With that being said, I now raise the first question: should we change
the sparse-
checkout cone check to be placed at the very beginning of the checking process,
or keep it at the end as a very final check (where it is right now).
My preference is
to place it at the very beginning, since the user should always be
cautious about
touching contents outside of sparse-checkout cone, no matter what.

If a certain move touches out-of-cone stuff, and at the same time it will fail
with the, for example, "destination exists" or "conflicted" error, I
think these errors
should come second, after being supplied with the "--sparse" flag.

> 2. When you try to move a sparse file with 'git mv --sparse', it still
>    fails.

This is also related to the first question, because in this case,
"folder2/a" is not
on-disk, then 'git mv' will fail fast at the first check and ignore
the "--sparse" flag.
Even if we modify the code to place the out-of-cone check at the very beginning,
and supply a "--sparse" flag, we have to make 'git mv' look into the
index to find
a sparse file. And here I raise my second question: by moving a sparse
file, which
is normally not on-disk, we have to alter the original 'git mv' logic
to make it grope
into the index for the missing sparse file (for now it does not care
about the index, except
when it receives a directory as <source>); can we make this change?

--
Thanks & Regards,
Shaoxuan

  parent reply	other threads:[~2022-03-27  3:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 10:01 [RFC PATCH 0/1] mv: integrate with sparse-index Shaoxuan Yuan
2022-03-15 10:01 ` [RFC PATCH 1/1] " Shaoxuan Yuan
2022-03-15 16:07   ` Victoria Dye
2022-03-15 17:14     ` Derrick Stolee
2022-03-16  3:29       ` Shaoxuan Yuan
2022-03-17  8:37       ` Shaoxuan Yuan
2022-03-16  3:18     ` Shaoxuan Yuan
2022-03-16 10:45     ` Shaoxuan Yuan
2022-03-16 13:34       ` Derrick Stolee
2022-03-16 14:46         ` Shaoxuan Yuan
2022-03-17 21:57           ` Victoria Dye
2022-03-18  1:00             ` Junio C Hamano
2022-03-21 15:20               ` Derrick Stolee
2022-03-21 19:14                 ` Junio C Hamano
2022-03-21 19:45                   ` Derrick Stolee
2022-03-22  8:38                     ` Shaoxuan Yuan
2022-03-23 13:10                       ` Derrick Stolee
2022-03-23 21:33                         ` Junio C Hamano
2022-03-27  3:48             ` Shaoxuan Yuan [this message]
2022-03-28 13:32               ` Derrick Stolee
2022-03-15 17:23   ` Junio C Hamano
2022-03-15 20:00     ` Derrick Stolee

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='CAJyCBOQT1TwkNX_be9B3uKsv4Buf_ojfZoqfTAUqQ22Na7dY=g@mail.gmail.com' \
    --to=shaoxuan.yuan02@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=vdye@github.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).