On Fri, Aug 27, 2021 at 6:20 PM Matheus Tavares Bernardino <matheus.bernardino@xxxxxx> wrote: > > On Tue, Aug 24, 2021 at 6:54 PM Derrick Stolee via GitGitGadget > <gitgitgadget@xxxxxxxxx> wrote: > > > > diff --git a/builtin/mv.c b/builtin/mv.c > > index c2f96c8e895..b58fd4ce5ba 100644 > > --- a/builtin/mv.c > > +++ b/builtin/mv.c > > @@ -176,10 +177,22 @@ int cmd_mv(int argc, const char **argv, const char *prefix) > > const char *src = source[i], *dst = destination[i]; > > int length, src_is_dir; > > const char *bad = NULL; > > + int skip_sparse = 0; > > > > if (show_only) > > printf(_("Checking rename of '%s' to '%s'\n"), src, dst); > > > > + if (!path_in_sparse_checkout(src, &the_index)) { > > `git mv` can only move/rename tracked paths, but since we check > whether `src` is sparse before checking if it is in the index, the > user will get the sparse error message instead. This is OK, but the > advice might be misleading, as it says they can use `--sparse` if they > really want to move the file, but repeating the command with > `--sparse` will now fail for another reason. I wonder if we should > check whether `src` is tracked before checking if it is sparse, or if > that is not really an issue we should bother with. Another problem is that the displayed message will say that the pathspecs "match index entries outside sparse checkout" even when the path given to mv doesn't really exist: git sparse-checkout set some/dir/ git mv nonexistent-file foo The following pathspecs didn't match any eligible path, but they do match index entries outside the current sparse checkout: nonexistent-file hint: Disable or modify the sparsity rules if you intend to update such entries. hint: Disable this message with "git config advice.updateSparsePath false"