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

Re: [PATCH] Require a struct remote in transport_get()

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Nov 4, 2009, 07:27 UTC
Message-ID
<alpine.LNX.2.00.0911040221100.14365@iabervon.org>
In-Reply-To
<7vbpjin8v0.fsf@alter.siamese.dyndns.org>
On Tue, 3 Nov 2009, Junio C Hamano wrote:
Show 24 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > cmd_ls_remote() was calling transport_get() with a NULL remote and a
> > non-NULL url in the case where it was run outside a git
> > repository. This involved a bunch of ill-tested special
> > cases. Instead, simply get the struct remote for the URL with
> > remote_get(), which works fine outside a git repository, and can also
> > take global options into account.
> >
> > This fixes a tiny and obscure bug where "git ls-remote" without a repo
> > didn't support global url.*.insteadOf, even though "git clone" and
> > "git ls-remote" in any repo did.
> >
> > Also, enforce that all callers provide a struct remote to transport_get().
> >
> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> > ---
> > This is sufficient to stop the segfault when tring "git ls-remote 
> > http://..." outside of a repo, but not to make it work, which requires 
> > either something simple but not ideal or something complex.
> 
> Thanks; I think this and your other patch are important fixes, and should
> go directly on 'maint'.  Do you prefer to queue them on 'next' to cook for
> a week instead?

I don't think a week on 'next' is likely to turn up any new information; these are all uncommon code paths. It might be worth seeing if the original reporter is happy with how it's behaving now, though.

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C Hamano
Message 3 of 3 in “Require a struct remote in transport_get()”
  1. Require a struct remote in transport_get()Daniel Barkalow, Nov 4, 2009
  2. Junio C HamanoNov 4, 2009
  3. Daniel BarkalowNov 4, 2009

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.