git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Unexpected cat-file --batch-check output
@ 2021-10-25 19:02 Bryan Turner
  2021-10-25 19:18 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Turner @ 2021-10-25 19:02 UTC (permalink / raw)
  To: Git Users

I'm working with some users trying to reconcile an odd mismatch
observed in some Git output.

Running an ls-tree for a branch and path, limited to a single pattern
within, shows this:
/usr/bin/git ls-tree -z refs/heads/develop:path/to/parent – file
100644 blob 4c8d566ed80a1554a059b97f7cd533a55bbd2ea8    file

If we then run cat-file --batch-check, though, we see this:
echo 'refs/heads/develop
refs/heads/develop:path/to/parent/file' | /usr/bin/git cat-file --batch-check
28a05ce2e3079afcb32e4f1777b42971d7933a91 commit 259
cc10f4b278086325aab2f95df97c807c7c6cd75e commit 330

There's a newline after the branch name, inside the single quotes,
followed by the same branch name plus the full path. In this output,
it comes back as a commit, though. Both commands were run with
refs/heads/develop at the same commit. I've checked for a .gitmodules
file and while they _do_ have submodules, they're at different,
non-intersecting paths to the one in question here.

I can't share the actual repository (I don't have access to it
myself), but I'm hoping someone might have some ideas. I've never seen
this sort of mismatch before; for every path in the repositories I do
have access to that I've tried this for, the cat-file --batch-check
always shows "commit" (or "tag") for the ref, and then "blob" for the
ref+path. Submodules were the only thing I could think of, but that
doesn't appear to be the case. Could it be a subtree instead? How
would I check?

Thanks in advance for any ideas; I appreciate any help.
Bryan Turner

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-27  8:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 19:02 Unexpected cat-file --batch-check output Bryan Turner
2021-10-25 19:18 ` Jeff King
2021-10-25 21:48   ` Bryan Turner
2021-10-26 23:58   ` Bryan Turner
2021-10-27  1:28     ` Jeff King
2021-10-27  8:08     ` Johannes Sixt

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).