From: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
To: Derrick Stolee <derrickstolee@github.com>
Cc: Victoria Dye <vdye@github.com>, git@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] mv: integrate with sparse-index
Date: Wed, 16 Mar 2022 22:46:46 +0800 [thread overview]
Message-ID: <CAJyCBORfAV_TV6DrOxgim4KtU9T-uTibOaQCsJZsi5_FQfci1Q@mail.gmail.com> (raw)
In-Reply-To: <675c7681-c495-727d-1262-ee8c6a5c8ce5@github.com>
Hi Derrick,
On Wed, Mar 16, 2022 at 9:34 PM Derrick Stolee <derrickstolee@github.com> wrote:
> The issue here is that this file is "untracked", not just outside
> of the sparse-checkout cone.
Thanks for the succinct explanation, it makes much more sense now :)
> Instead, what about
>
> git mv folder2/a deep/new
>
> since folder2/a is a tracked file, just not in the working tree
> since it is outside the sparse-checkout cone.
>
> (If it fails, then it should fail the same with and without the
> sparse index, which is what "test_sparse_match" is for.)
I tested this and it fails as expected with:
"fatal: bad source, source=folder2/a, destination=deep/new"
> Thanks,
> -Stolee
Thanks for the reply above!
Other than that, I also have found another issue (probably), with
$ mkdir folder2
$ git mv folder2 deep
After these I do:
$ git status
And the output indicates that the index is updated with the following changes:
renamed: folder2/0/0/0 -> deep/folder2/0/0/0
renamed: folder2/0/1 -> deep/folder2/0/1
renamed: folder2/a -> deep/folder2/a
Nothing fails, which is not what I expected. What I expect is `git mv` will
fail because it is being told to update a sparse-directory (which as I read the
blogs and sparse-index.txt is taken as a sparse-directory entry) outside of the
sparse-checkout cone. Unless `git mv` is supplied with `--sparse`, the command
will do nothing but fail, no?
What confuses me more is that the `folder2`, which is present in the index but
not in the working tree (due to sparse-checkout cone), seems to be "unlocked"
and re-picked up by Git after `mkdir folder2` and move `folder2` into
the cone area.
And still, the files under `deep/folder2` are not present in the
working tree (might
be relevant to the previous context).
I haven't run the gdb to see into the process, I just get somehow confused by
these discrepancies (seemingly to me). I think I should gdb into it though,
getting some info here from people can also be really helpful :)
--
Thanks & Regards,
Shaoxuan
next prev parent reply other threads:[~2022-03-16 14:47 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 [this message]
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
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=CAJyCBORfAV_TV6DrOxgim4KtU9T-uTibOaQCsJZsi5_FQfci1Q@mail.gmail.com \
--to=shaoxuan.yuan02@gmail.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--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).