archive mirror
 help / color / mirror / Atom feed
From: Lessley Dennington <>
To: Git Mailing List <>
Cc: Elijah Newren <>,
	Derrick Stolee <>,
	Junio C Hamano <>
Subject: Bug report - sparse-checkout ignores prefix when run in subdirectories
Date: Wed, 5 Jan 2022 14:13:22 -0600	[thread overview]
Message-ID: <> (raw)

Hello everyone! See the following bug report pertaining to sparse-checkout
when run outside top-level directories.

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

$ git init -b main tmp
$ cd tmp
$ mkdir -p a/b/c
$ touch a/b/c/d a/b/c/e
$ git add a/
$ git commit -m "initial"
$ cd a/  # Not at the top level anymore
$ git sparse-checkout set --cone b/c
$ git -C .. sparse-checkout list

What did you expect to happen? (Expected behavior)

We expected the output sparsity path to be a/b/c.

What happened instead? (Actual behavior)

The output was b/c. Running $ cat ../.git/info/sparse-checkout
showed that the paths in this file were incorrect:

What's different between what you expected and what actually happened?

The output path and the paths in the sparse-checkout file are missing the
expected 'a' prefix. This means that the `set` and `add` subcommands of
`sparse-checkout` can only be safely run from a repo's top-level directory.

Anything else you want to add:

This was discovered by in my recent tab-completion
series. You can find additional context at [1].

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.

[System Info]
git version:
git version (local build, based off
cpu: x86_64
shell-path: /bin/zsh
uname: Darwin
compiler info:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$SHELL (typically, interactive shell): /bin/zsh



             reply	other threads:[~2022-01-05 20:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 20:13 Lessley Dennington [this message]
2022-01-05 22:38 ` Junio C Hamano
2022-01-05 23:19   ` Elijah Newren
2022-01-05 23:29     ` Junio C Hamano
2022-01-06  0:08       ` Elijah Newren
2022-01-06  0:17         ` Junio C Hamano
2022-01-06  1:08           ` Elijah Newren
2022-01-06 19:25             ` Junio C Hamano
2022-01-27 16:43     ` Derrick Stolee
2022-01-27 17:30       ` Elijah Newren

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: Bug report - sparse-checkout ignores prefix when run in subdirectories' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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 NNTP newsgroup(s).