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

Re: Unexpected cat-file --batch-check output

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 27, 2021, 08:08 UTC
Message-ID
<ad21b3f5-d352-64f4-0dd2-5ad1e839193a@kdbg.org>
In-Reply-To
<CAGyf7-Gaphb9q=4cyT0BQa7oYGKXQQsU-XfqvoxfDyijehJO3Q@mail.gmail.com>
Am 27.10.21 um 01:58 schrieb Bryan Turner:
Show 23 quoted lines
> $ /usr/bin/git rev-parse refs/heads/develop
> 28a05ce2e3079afcb32e4f1777b42971d7933a91
> $ /usr/bin/git rev-parse refs/heads/develop:path/to/parent/file
> cc10f4b278086325aab2f95df97c807c7c6cd75e
> 
> So it looks like rev-parse and cat-file --batch-check both exhibit the
> same behavior.
> 
> I also had them expand their cat-file --batch-check to include another
> file in the same "path/to/parent" directory:
> $ echo 'refs/heads/develop
> refs/heads/develop:path/to/parent/sibling
> refs/heads/develop:path/to/parent/file' | /usr/bin/git cat-file --batch-check
> 28a05ce2e3079afcb32e4f1777b42971d7933a91 commit 259
> 2bfe7b4b7c7cdeb9653801d99b65dfefe5780dda blob 897
> cc10f4b278086325aab2f95df97c807c7c6cd75e commit 330
> 
> So the "sibling" file in the same directory comes out as a "blob", as expected.
> 
> They also ran an ls-tree for the directory without any globs:
> # /usr/bin/git ls-tree refs/heads/develop:path/to/parent
> 100644 blob 2bfe7b4b7c7cdeb9653801d99b65dfefe5780dda    sibling
> 100644 blob 4c8d566ed80a1554a059b97f7cd533a55bbd2ea8    file

Just a shot in the dark: what happens when you use /usr/bin/git --no-replace-objects?

-- Hannes
Previous: Jeff King
Message 6 of 6 in “Unexpected cat-file --batch-check output”
  1. Bryan TurnerOct 25, 2021
  2. Jeff KingOct 25, 2021
  3. Bryan TurnerOct 25, 2021
  4. Bryan TurnerOct 26, 2021
  5. Jeff KingOct 27, 2021
  6. Johannes SixtOct 27, 2021

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.