Plumbing for mapping from a remote tracking ref to the remote ref?

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

 



Hi folks,

Given the following configured fetch refspec for a remote:

[remote "origin"]
        url = git@someserver:somerepo.git
        fetch = +refs/heads/*:refs/remotes/somepath/*

And given a ref of the form "refs/remotes/somepath/branch_A",

I'm wondering whether there is any plumbing that would be able to tell
me what to put in a "fetch" command, to get
"refs/remotes/somepath/branch_A" fetched - in other words, is there
any plumbing that can use the configured fetch refspecs to map
"refs/remotes/somepath/branch_A" to "refs/heads/branch_A" for me, so
that I can then do "git fetch origin refs/heads/branch_A".

I understand I can parse the fetch refspecs myself, assuming any
asterisk is only ever on the tail end of the ref pattern... but that
seems very complicated, given that this is *probably* something others
have needed to do in the past?

Fwiw I've noticed that "git rev-parse --symbolic-full-name" knows how
to do almost exactly the *opposite* of that, when presented with the
"@{u}" pattern - it looks up the "branch.XXX.merge" value, which is
written in a remote-relative form ("refs/heads/branch_A" in this
example), and converts that to the "local" fetch destination (eg
"refs/remotes/somepath/branch_A"). But I don't know how to go the
opposite way, given only a local fetch destination and wanting to tell
fetch what to get - it expects a remote-relative ref.

Any help appreciated!

Thanks,
Tao



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

  Powered by Linux