Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git-send-pack SIGSEGV..
Date: Sat, 16 Jun 2007 14:05:10 -0700	[thread overview]
Message-ID: <7vfy4r3915.fsf@assigned-by-dhcp.pobox.com> (raw)
In-Reply-To: Pine.LNX.4.64.0706152342490.4740@iabervon.org

Daniel Barkalow <barkalow@iabervon.org> writes:

> That is, since "push = refs/heads/master" was already the same as "push = 
> refs/heads/master:refs/heads/master", the pattern fell into that code. I 
> was at least confidant enough of this to translate --tags into 
> "refs/tags/*" instead of "refs/tags/*:refs/tags/*" when I got to that 
> point.

This change sounds sensible.

> On the fetch side, the code isn't using my parser yet, anyway. But my 
> parser should be able to distinguish the one-sided refspec case, so that 
> the fetch logic can do whatever is determined to be right with the 
> combination of features.

Yes, but at the same time I know you are planning to rewrite
git-fetch using this code, so...

>> I think "fetch = refs/heads/*" syntax, if it just fetches
>> without storing, does not make much sense.  In a separate-remote
>> repository, "[remote "foo"] fetch = refs/heads/*" would probably
>> be useful if we treated it as "refs/heads/*:refs/remotes/foo/*".
>> In a bare repository used for mirrors, it would be useful if it
>> stood for "refs/heads/*:refs/heads/*".
>
> I'm kind of uncomfortable with this level of complexity for a fully 
> specified lhs pattern. Maybe "fetch = refs/heads/*" should be prohibited, 
> while something DWIM-y like "fetch = heads/*" or even "fetch = head *" 
> could come up with clever and useful patterns. In any case, the parser 
> should report "refs/heads/*" as pattern,refs/heads/,NULL and let the fetch 
> code decide what to do with it, rather than having the special case in the 
> parser.

Yeah, I am not very happy about DWIMmery either, especially a
magic that changes behaviour depending on the bareness [*1*].
As long as the parser can distinguish these five cases, I'd be
happy.

                        [push]			[fetch]
 (1) $any/*		same name		TBD
 (2) $any/*:		error			TBD
 (3) $any1/*:$any2/*	map any1 => any2	map any1 => any2
 (4) :$any/*		error			error
 (5) $any1/*:$any2	error			error
     $any1:$any2/*

(1-fetch) should probably be an error to avoid newbie confusion.

(2-push) is clearly an error.

(2-fetch) does not make much sense (octopus of random branches
    you do not even control what they are), but I do not have
    too strong an objection against it, so marked it TBD for now.

(3) is what we have always done.

(4-fetch) is clearly an error.

(4-push) could be "remove all refs", but I'd rather make that an
error.

(5) is clearly an error.  If you explicitly have both sides,
    they should both be wildcard, or non-wildcard.

[Footnote]

*1* Sometimes I see an incorrect suggestion given on #git to do
"mv .git ../project.git" to "make an incorrectly made repository
bare".  This is incorrect---at least you must update core.bare,
and also should make sure .git/object/info/alternates points at
a right directory if you used a relative path to specify one.
Luckily, we see much smaller number of such incorrect "help" on
the mailing list.

      reply	other threads:[~2007-06-16 21:05 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
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 [this message]

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=7vfy4r3915.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