Re: [PATCH 4/5] Add --remote option to send-pack

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 4/5] Add --remote option to send-pack

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:08

Daniel Barkalow [off-list ref] writes:
Indeed. Is there documentation on all the possibilities for refspecs 
somewhere all together? I could only find it for particular programs, and 
didn't see a no-colon option permitted anywhere.
Documentation/pull-fetch-param.txt which is included by various
manpages would be the best place to start.

    <refspec>::
            The canonical format of a <refspec> parameter is
            `+?<src>:<dst>`; that is, an optional plus `+`, followed
            by the source ref, followed by a colon `:`, followed by
            the destination ref.
    +
    The remote ref that matches <src>
    is fetched, and if <dst> is not empty string, the local
    ref that matches it is fast forwarded using <src>.
    Again, if the optional plus `+` is used, the local ref
    is updated even if it does not result in a fast forward
    update.

Hmph.  So <dst> could be empty, and in such a case there is no
tracking.  But this does not say missing colon is allowed (but
that was intentionally left out as we clarify it later).  Let's
read on.  After a few [Notes], we find this.

    Some short-cut notations are also supported.
    +
    * `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`; 
      it requests fetching everything up to the given tag.
    * A parameter <ref> without a colon is equivalent to
      <ref>: when pulling/fetching, so it merges <ref> into the current
      branch without storing the remote branch anywhere locally

Ahh, so a refspec that does not have a colon, and ends with a
colon (hence an empty <dst>) are equivalent, and does not result
in remote tracking.

Re: [PATCH 4/5] Add --remote option to send-pack

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:43:08

On Wed, 2 May 2007, Junio C Hamano wrote:
Daniel Barkalow [off-list ref] writes:
quoted
Indeed. Is there documentation on all the possibilities for refspecs 
somewhere all together? I could only find it for particular programs, and 
didn't see a no-colon option permitted anywhere.
Documentation/pull-fetch-param.txt which is included by various
manpages would be the best place to start.

    <refspec>::
            The canonical format of a <refspec> parameter is
            `+?<src>:<dst>`; that is, an optional plus `+`, followed
            by the source ref, followed by a colon `:`, followed by
            the destination ref.
    +
    The remote ref that matches <src>
    is fetched, and if <dst> is not empty string, the local
    ref that matches it is fast forwarded using <src>.
    Again, if the optional plus `+` is used, the local ref
    is updated even if it does not result in a fast forward
    update.

Hmph.  So <dst> could be empty, and in such a case there is no
tracking.  But this does not say missing colon is allowed (but
that was intentionally left out as we clarify it later).  Let's
read on.  After a few [Notes], we find this.

    Some short-cut notations are also supported.
    +
    * `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`; 
      it requests fetching everything up to the given tag.
    * A parameter <ref> without a colon is equivalent to
      <ref>: when pulling/fetching, so it merges <ref> into the current
      branch without storing the remote branch anywhere locally

Ahh, so a refspec that does not have a colon, and ends with a
colon (hence an empty <dst>) are equivalent, and does not result
in remote tracking.
Is this actually supported in config files? At least for pulls, the "tag 
<tag>" notation is only available on the command line, afaict. For that 
matter, I think that having "<ref>:" or "<ref>" in a config file fetch 
line would be really bad; these refs would always be merged into any 
current head (without any remote tracking) when the remote is fetched 
from?

	-Daniel
*This .sig left intentionally blank*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help