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

Re: git-send-pack SIGSEGV..

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 15, 2007, 06:01 UTC
Message-ID
<7vr6od92nj.fsf@assigned-by-dhcp.pobox.com>
In-Reply-To
<7vvedp935y.fsf@assigned-by-dhcp.pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
>
>> I *suspect* it's due to the refspec pattern matching changes Daniel did, 
>> but again - I haven't actually debugged it any deeper.
>
> I am officially recuperating from an operation I had today, so I
> cannot really take a deep look at this.
>
> I think what is going wrong is that struct refspec for pattern
> match that is parsed by parse_ref_spec does not have ->dst
> component filled for "refs/tags/*" refspec, but match_refs()
> does not check if pat->dst is NULL, in which case it should
> reuse pat->src value.
>
> Incidentally I have other remote.c fixes queued in 'next'.  I
> haven't yet checked if I (accidentally) fixed this already.
Completely untested, but this may fix it.
I suspect this has an side effect of allowing
	fetch = refs/heads/*
to mean the same thing as
	fetch = refs/heads/*:refs/heads/*

which is suitable for a bare mirroring repository, but I do not think of any downside, so it might be Ok.

But that is something from a person who was under anesthesia a few hours ago, so you should take it with a big grain of salt ;-)

---
 remote.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/remote.c b/remote.c
index ed62a62..356e6bc 100644
--- a/remote.c
+++ b/remote.c
@@ -252,6 +252,8 @@ static struct refspec *parse_ref_spec(int nr_refspec, const char **refspec)
 			ep = gp;
 		}
 		rs[i].src = xstrndup(sp, ep - sp);
+		if (rs[i].pattern && !rs[i].dst)
+			rs[i].dst = xstrdup(rs[i].src);
 	}
 	return rs;
 }
Previous: Junio C HamanoNext: Alex Riesen
Message 4 of 10 in “git-send-pack SIGSEGV..”
  1. Linus TorvaldsJun 15, 2007
  2. Linus TorvaldsJun 15, 2007
  3. Junio C HamanoJun 15, 2007
  4. Junio C HamanoJun 15, 2007
  5. Alex RiesenJun 15, 2007
  6. Daniel BarkalowJun 15, 2007
  7. Linus TorvaldsJun 15, 2007
  8. Junio C HamanoJun 16, 2007
  9. Daniel BarkalowJun 16, 2007
  10. Junio C HamanoJun 16, 2007

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.