Re: [PATCH, 4th version] git-branch: register where to merge from, when branching off a remote branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 2 Mar 2007, Paolo Bonzini wrote:

> >  - (micronit) Is it true that both strlen() tests are about long
> >    *branch* names?

Yes. "name" refers to the _new_ branch, and "remote_branch_name" refers to 
the remote branch.

> >  - (moderately serious) The code blindly trusts that
> >    "refs/remotes/foo/bar" tracks "refs/heads/bar" from remote
> >    named "foo", which is a bit disturbing.  With the default
> >    configuration git-clone and git-remote creates, it always is
> >    the case, but I suspect you might want to at least verify
> >    that assumption (the user can have different settings in the
> >    config), if not figuring them out by reading the existing
> >    configuration yourself.
> 
> Ouch.  Absolutely right, but this means I will prepare the patch later 
> then.

I really recommend doing what I said in another reply: check that 
the remote information in the config for that remote meets our 
expectations. And do nothing at all if it does not (maybe warn that no 
branch.<foo> voodoo was done).

> >> +	else if (dwim_ref(start_name, strlen(start_name), sha1, &real_ref))
> >> +		remote = !prefixcmp(real_ref, "refs/remotes/");
> > 
> >  - (pure question) What happens if dwim_ref() returns more than one?
> 
> Then, real_ref is the one matching sha1.

Which one ;-)

What Junio tried to get at: if you have "refs/heads/my" and 
"refs/remotes/origin/my", dwim_ref("my", ...) returns 2 (or even more, if 
you have other refs ending in "/my").

Please test if the return value is exactly 1, and if it is not, do 
nothing.

Ciao,
Dscho


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]