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

Re: Anyone know why git ls-remote output might be corrupted?

From
Elijah Newren <newren@gmail.com>
Date
Jun 3, 2023, 01:17 UTC
Message-ID
<CABPp-BF0VZzDbB87JNCfCxkCDZk7LGZ=1SfnxCyHwCpQ3ZFPoQ@mail.gmail.com>
In-Reply-To
<000f01d9958d$347d6220$9d782660$@nexbridge.com>
On Fri, Jun 2, 2023 at 1:26 PM <rsbecker@nexbridge.com> wrote:
Show 28 quoted lines
>
> On Friday, June 2, 2023 3:53 PM, Paul Smith wrote:
> >On Fri, 2023-06-02 at 15:34 -0400, rsbecker@nexbridge.com wrote:
> >> On Friday, June 2, 2023 3:13 PM, Paul Smith wrote:
> >> > On Fri, 2023-06-02 at 14:59 -0400, Paul Smith wrote:
> >> > > Also a bunch of the heads are missing.  It's pretty clear that
> >> > > right in the middle of printing one of the SHAs we suddenly lost a
> >> > > bunch of output, and started printing stuff from later (in the
> >> > > last instance 66 out of 131 heads were missing).
> >> >
> >> > I forgot to mention: git ls-remote does not exit with an error code.
> >> > The exit code is 0 (success).
> >> >
> >> > The reason I get this failure is that as I parse the output I notice
> >> > that the SHA is invalid (contains a non-hex character "i") and it
> >> > throws this error.
> >>
> >> Does your CI/CD system use sparse checkout or depth=1 or some other
> >> partial clone?
> >
> >Yes, the local copy of the repo is a sparse checkout.
> >
> >I'm surprised that matters to ls-remote... I would have expected that the "sparseness"
> >of the local repo is irrelevant when listing the state of the remote's heads?  Is that
> >the reason for the issue I'm seeing?
>
> I'm just wondering whether this might be an impact somehow and adding info to help the team diagnose. I have seen other commands have some issues in the past with --depth=n
> --Randall

I think if shallowness or sparseness affected ls-remote output in any way whatsoever, that would itself be a bug. Granted, I don't know much about the protocol side of things, but I'd be very surprised if either of these conditions mattered.

Previous: Paul SmithNext: Elijah Newren
Message 7 of 14 in “Anyone know why git ls-remote output might be corrupted?”
  1. Paul SmithJun 2, 2023
  2. Paul SmithJun 2, 2023
  3. rsbecker@nexbridge.comJun 2, 2023
  4. Paul SmithJun 2, 2023
  5. rsbecker@nexbridge.comJun 2, 2023
  6. Paul SmithJun 2, 2023
  7. Elijah NewrenJun 3, 2023
  8. Elijah NewrenJun 3, 2023
  9. Jeff KingJun 4, 2023
  10. Jeff KingJun 4, 2023
  11. Jeff KingJun 4, 2023
  12. Paul SmithJun 9, 2023
  13. Junio C HamanoJun 9, 2023
  14. Paul SmithJun 12, 2023

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.