Re: git branch <refspec>

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

 



On 6/2/15, Zenaan Harkness <zen@xxxxxxxxxxxx> wrote:
> <refspec> - git's guilty little secret. Let's milk the guilt.
>
> git branch <refspec> ought work in a similar way to
> git fetch <refspec>
>
> One syntax to rule them all. Or something.
>
> I just learned how git fetch uses refspecs and how this can just as
> well apply to tags to create "remote tags" (refs/rtags/remote_name/*),
> finally grokking the ridiculously simple yet powerful refspec concept
> - it really is generic.
>
> And now combining two remotes such as postgresql and postgresql-xc
> (which share substantial code and parent commits), or (a bit out of
> date now, but) the openmoko-kernel and linux mainline, becomes
> simpler/saner when "inventing" rtags as explained here:
> http://stackoverflow.com/questions/22108391/git-checkout-a-remote-tag

Regarding this stackoverflow article and "rtags", what I'm now doing
is, for postgresql mainline "origin" and postresql-xc "pgxc" remotes:
[remote "origin"]
  url = git://git.postgresql.org/git/postgresql.git
  fetch = +refs/*:refs/*
  fetch = +refs/*:refs/remotes/origin/*
[remote "pgxc"]
  url = https://github.com/postgres-x2/postgres-x2.git
  fetch = +refs/*:refs/remotes/origin/*

so that origin is my normal --mirror, but also with origin and pgxc
having everything (!) under refs/remotes/$name/*

This allows for those who want multiple related remotes in the one
mirror to include 'interesting' refs from each remote in a way that
does not clash, e.g. github's refs/pull/* pull requests.

This only leads to the "how to minimize typing without extra
porcelain", and of course a symlink here can help:
cd refs/
ln -s remotes r

or perhaps even better :
ln -s remotes/* .

Using +refs/*:refs/remotes/origin/*  feels better than e.g.:
refs/rtags/origin/*
refs/rpull/origin/*
refs/rtags/pgxc/*
refs/rpull/pgxc/*
refs/blah?/origin/*
refs/blah?/pgxc/*
althogh these forms might simplify porcelain (e.g. tab completion)
which needs to work with all refs of a particular 'type'.

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