threads / patch / 33407

patchgitremote-helpers(1): clarify refspec behaviour

Subject: [PATCH] gitremote-helpers(1): clarify refspec behaviour

## tl;dr

3 messages between Apr 6, 2013 and Apr 17, 2013. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

John Keeping· Apr 6, 2013, 18:13 UTC · lore

The documentation says that "If no 'refspec' capability is advertised, there is an implied `refspec *:*`" but this is only the case for the "import" command.

Since there is a comment in transport-helper.c indicating that this default is for historical reasons, change the documentation to clarify that a refspec should always be specified.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 Documentation/gitremote-helpers.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to Documentation/gitremote-helpers.txt +2 −2
diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt
index 0c91aba..f506031 100644
--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -174,8 +174,8 @@ ref.
 This capability can be advertised multiple times.  The first
 applicable refspec takes precedence.  The left-hand of refspecs
 advertised with this capability must cover all refs reported by
-the list command.  If no 'refspec' capability is advertised,
-there is an implied `refspec *:*`.
+the list command.  If a helper does not need a specific 'refspec'
+capability then it should advertise `refspec *:*`.
 
 'bidi-import'::
 	This modifies the 'import' capability.
-- 
1.8.2.692.g17a9715
Sverre Rabbelier· Apr 6, 2013, 18:15 UTC · re: John Keeping · lore

Re: [PATCH] gitremote-helpers(1): clarify refspec behaviour

In Sat, Apr 6, 2013 at 11:13 AM, John Keeping <john@keeping.me.uk> wrote:
Show 9 quoted lines
> The documentation says that "If no 'refspec' capability is advertised,
> there is an implied `refspec *:*`" but this is only the case for the
> "import" command.
>
> Since there is a comment in transport-helper.c indicating that this
> default is for historical reasons, change the documentation to clarify
> that a refspec should always be specified.
>
> Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>

-- Cheers,

Sverre Rabbelier
Felipe Contreras· Apr 17, 2013, 22:30 UTC · re: John Keeping · lore

Re: [PATCH] gitremote-helpers(1): clarify refspec behaviour

On Sat, Apr 6, 2013 at 12:13 PM, John Keeping <john@keeping.me.uk> wrote:
Show 10 quoted lines
> --- a/Documentation/gitremote-helpers.txt
> +++ b/Documentation/gitremote-helpers.txt
> @@ -174,8 +174,8 @@ ref.
>  This capability can be advertised multiple times.  The first
>  applicable refspec takes precedence.  The left-hand of refspecs
>  advertised with this capability must cover all refs reported by
> -the list command.  If no 'refspec' capability is advertised,
> -there is an implied `refspec *:*`.
> +the list command.  If a helper does not need a specific 'refspec'
> +capability then it should advertise `refspec *:*`.

But if it advertises a straight 'refspec *:*', nothing would work. If anything, it should be 'refs/heads/*:refs/remotes/$alias/*', but then tags would fail. Why not just tell the remote helpers to do the right thing and avoid this comment altogether?

-- 
Felipe Contreras

← back to recent threads