git branch <refspec>

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

 



<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

Some remotes in this example:
git://git.postgresql.org/git/postgresql.git
https://github.com/postgres-x2/postgres-x2.git
git://postgres-xc.git.sourceforge.net/gitroot/postgres-xc/postgres-xc

(rtags also makes it "reasonable" to store a few other related repos
in the one local mirror, even when they don't share a parent commit
(e.g. postgresql-docs, -website etc) - where git fetch gives a
friendly little warning to this effect "warning: no common commits".
Git does after all store content, so it's entirely natural for a
mirror junkie to store related content in one "mirror" repo - where
there are no common commits, git could auto parallelize fetch, as long
as this could be ensured to be not brittle.)

This indicates some "rtags" porcelain might be in order, especially to
complement --mirror (since 1.6.0) and soon "git checkout --to=path"
(2.5.0).
E.g. git remote rename OLDNAME NEWNAME does not auto rename
refs/rtags/OLDNAME/ - thankfully there's a little warning though. Also
rtags ought be recognized as tags when not fully qualified by path,
for git merge <commit-ish> etc - try local tags then also rtags when
searching for a tag name.

My main wishlist though is for some porcelain for "git branch
<refspec>" - to my current mind that would make a lot of sense - learn
one LHS:RHS concept, and apply it all over the place.

Thanks for listening,
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]