git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/5] Sparse index integration with 'git show'

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2022, 20:55 UTC
Message-ID
<xmqqmtg7pntg.fsf@gitster.g>
In-Reply-To
<pull.1207.v2.git.1651005800.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> This ":" syntax is shared by other commands like "git rev-parse", but we are
> not adding those integrations at this point.

This has been the most curious thing since the initial round. The changes in the series are mostly about the code that parses the ":<path>" syntax and yield an object name (when exists) or give an error messages (otherwise) and die, before the computed object name gets used by "git show", or any other command that takes an object name from the command line.

I guess what has been confusing me was the phrase "integration", that you seem to be using to refer only to the final step of setting require_full_index to 0, while that is the least interesting part of a series like this one. The work done in patches 3/ and 4/ that paves the way to allow us to set the require_full_index to 0 in any command that needs to work with the ":<path>" syntax is much more interesting part of the series, and when viewed from that angle, the series is not about preparing "show" but about ":<path>" syntax to work better with the sparse index.

Show 6 quoted lines
> I know that Victoria intends to submit her 'git stash' integration soon, and
> this provides a way to test if our split of test changes in t1092 are easy
> to merge without conflict. If that is successful, then I will likely submit
> my integration with the 'sparse-checkout' builtin after this series is
> complete. (UPDATE: we inserted a test in the same location of t1092, but
> otherwise there are no textual or semantic conflicts.)

Yeah, I think I already queued Victoria's and the previous round of this series in 'seen' without problematic conflicts.

Let's take a brief look at the range-diff before I go do something else...

Show 48 quoted lines
>  2:  27ab853a9b4 ! 2:  2e9d47ab09b show: integrate with the sparse index
>      @@ t/t1092-sparse-checkout-compatibility.sh: test_expect_success 'show (cached blob
>       -	# does not work as implemented. The error message is
>       -	# different for a full checkout and a sparse checkout
>       -	# when the directory is outside of the cone.
>      -+	# changes depending on the existence of a sparse index.
>      ++	# had different behavior depending on the existence
>      ++	# of a sparse index.
>        	test_all_match test_must_fail git show :deep/ &&
>        	test_must_fail git -C full-checkout show :folder1/ &&
>       -	test_sparse_match test_must_fail git show :folder1/
>  3:  f5da5327673 = 3:  5a7561637f0 object-name: reject trees found in the index
>  4:  99c09ccc240 ! 4:  b730457fccc object-name: diagnose trees in index properly
>      @@ Commit message
>           checkout. The error message from diagnose_invalid_index_path() reports
>           whether the path is on disk or not. The full checkout will have the
>           directory on disk, but the path will not be in the index. The sparse
>      -    checokut could have the directory not exist, specifically when that
>      +    checkout could have the directory not exist, specifically when that
>           directory is outside of the sparse-checkout cone.
>       
>           In the case of a sparse index, we have yet another state: the path can
>      @@ object-name.c: static void diagnose_invalid_index_path(struct repository *r,
>       
>        ## t/t1092-sparse-checkout-compatibility.sh ##
>       @@ t/t1092-sparse-checkout-compatibility.sh: test_expect_success 'show (cached blobs/trees)' '
>      + 	test_all_match git show :deep/a &&
>      + 	test_sparse_match git show :folder1/a &&
>      + 
>      +-	# Asking "git show" for directories in the index
>      +-	# had different behavior depending on the existence
>      +-	# of a sparse index.
>      ++	# The error message differs depending on whether
>      ++	# the directory exists in the worktree.
>      + 	test_all_match test_must_fail git show :deep/ &&
>        	test_must_fail git -C full-checkout show :folder1/ &&
>      - 	test_must_fail git -C sparse-checkout show :folder1/ &&
>      +-	test_must_fail git -C sparse-checkout show :folder1/ &&
>      ++	test_sparse_match test_must_fail git show :folder1/ &&
>        
>       -	test_must_fail git -C sparse-index show :folder1/ 2>err &&
>       -	grep "is in the index, but not at stage 0" err
>      -+	test_sparse_match test_must_fail git show :folder1/ &&
>      -+
>       +	# Change the sparse cone for an extra case:
>       +	run_on_sparse git sparse-checkout set deep/deeper1 &&
>       +
>  -:  ----------- > 5:  69efe637a18 rev-parse: integrate with sparse index
OK, nothing unexpected other than the rev-parse stuff.
Thanks.
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 25 of 26 in “Sparse index integration with 'git show'”
  1. 0/4 Sparse index integration with 'git show'Derrick Stolee via GitGitGadget, Apr 7, 2022
  2. 1/4 t1092: add compatibility tests for 'git show'Derrick Stolee via GitGitGadget, Apr 7, 2022
  3. Josh SteadmonApr 14, 2022
  4. Derrick StoleeApr 18, 2022
  5. 2/4 show: integrate with the sparse indexDerrick Stolee via GitGitGadget, Apr 7, 2022
  6. Josh SteadmonApr 14, 2022
  7. Derrick StoleeApr 18, 2022
  8. 3/4 object-name: reject trees found in the indexDerrick Stolee via GitGitGadget, Apr 7, 2022
  9. Josh SteadmonApr 14, 2022
  10. Derrick StoleeApr 18, 2022
  11. 4/4 object-name: diagnose trees in index properlyDerrick Stolee via GitGitGadget, Apr 7, 2022
  12. Philip OakleyApr 7, 2022
  13. Junio C HamanoApr 12, 2022
  14. Derrick StoleeApr 12, 2022
  15. Junio C HamanoApr 12, 2022
  16. Josh SteadmonApr 14, 2022
  17. Junio C HamanoApr 14, 2022
  18. Derrick StoleeApr 18, 2022
  19. 0/5 Sparse index integration with 'git show'Derrick Stolee via GitGitGadget, Apr 26, 2022
  20. 1/5 t1092: add compatibility tests for 'git show'Derrick Stolee via GitGitGadget, Apr 26, 2022
  21. 2/5 show: integrate with the sparse indexDerrick Stolee via GitGitGadget, Apr 26, 2022
  22. 3/5 object-name: reject trees found in the indexDerrick Stolee via GitGitGadget, Apr 26, 2022
  23. 4/5 object-name: diagnose trees in index properlyDerrick Stolee via GitGitGadget, Apr 26, 2022
  24. 5/5 rev-parse: integrate with sparse indexDerrick Stolee via GitGitGadget, Apr 26, 2022
  25. Junio C HamanoApr 26, 2022
  26. Derrick StoleeApr 27, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.