Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Git Mailing List <git@vger.kernel.org>,
	Daniel Barkalow <barkalow@iabervon.org>
Subject: Re: git-send-pack SIGSEGV..
Date: Thu, 14 Jun 2007 23:01:52 -0700	[thread overview]
Message-ID: <7vr6od92nj.fsf@assigned-by-dhcp.pobox.com> (raw)
In-Reply-To: <7vvedp935y.fsf@assigned-by-dhcp.pobox.com> (Junio C. Hamano's message of "Thu, 14 Jun 2007 22:50:49 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> 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;
 }

  reply	other threads:[~2007-06-15  6:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LFD.0.98.0706142124380.14121@woody.linux-foundation.org >
2007-06-15  4:29 ` git-send-pack SIGSEGV Linus Torvalds
2007-06-15  4:31   ` Linus Torvalds
2007-06-15  5:50   ` Junio C Hamano
2007-06-15  6:01     ` Junio C Hamano [this message]
2007-06-15  7:24       ` Alex Riesen
2007-06-15 14:27       ` Daniel Barkalow
2007-06-15 17:26         ` Linus Torvalds
2007-06-16  2:00         ` Junio C Hamano
2007-06-16  4:57           ` Daniel Barkalow
2007-06-16 21:05             ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr6od92nj.fsf@assigned-by-dhcp.pobox.com \
    --to=gitster@pobox.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox