Re: [PATCH] Remove restriction on notes ref base

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

 



On Thu, Nov 04, 2010 at 01:49:47AM +0100, Johan Herland wrote:

> I'd probably suggest a more straightforward (and hopefully less confusing) 
> setup like this:
> 
>   Remote repo    ->   Local repo
>   ------------------------------------------------
>   refs/heads/*        refs/remotes/$remote/heads/*
>   refs/tags/*         refs/remotes/$remote/tags/*
>   refs/notes/*        refs/remotes/$remote/notes/*
> 
> ...and these would all be set in the config, i.e. no implicit/magic 
> refspecs.

I have often considered that something like that would be simpler, too.
But just specifying

  fetch = refs/tags/*:refs/remotes/$remote/tags/*

would pull down _all_ tags from the remote. Right now we only pull down
tags for things that we are actually fetching (i.e., auto-follow).

Now you could argue that auto-follow is not worth the effort. It is
somewhat confusing, and I can't think of a time when it ever actually
reduced the set of objects I was fetching (as opposed to just fetching
all tags). But maybe others have use cases where it matters.

> We would, for example, extend the ref disambiguation of <name> (as 
> documented in the "SPECIFYING REVISIONS" section of git-rev-parse(1)), so 
> that in the cases where <name> is of the form "<foo>/<bar>" AND <foo> is an 
> existing remote, we also check for the following refs (after none of the 
> existing checks have returned a match):
> 
>   7. refs/remotes/<foo>/tags/<bar>
>   8. refs/remotes/<foo>/heads/<bar>

This codifies that refs for remote $foo are in refs/remotes/$foo, which
is something we have avoided so far. For example, when finding the
"upstream" branch, we have the name of the remote and the merge branch,
look up the fetch refspecs in the config, and then figure out where that
branch would be fetched to. Which of course turns out as you say (as
remotes/$remote_name/$branch) in the default config, but we don't
restrict people to that.

-Peff
--
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]