git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/6] Make clearer which commands must be supported for which capabilities

From
Max Horn <max@quendi.de>
Date
Nov 27, 2012, 17:44 UTC
Message-ID
<1354038279-76475-6-git-send-email-max@quendi.de>
In-Reply-To
<1354038279-76475-1-git-send-email-max@quendi.de>

In particular, document 'list for-push' separately from 'list', as the former needs only be supported for the 'push' capability, and the latter only for fetch/import/export. In particular, a hypothetically 'push-only' helper only needs to support the former, not the latter.

Signed-off-by: Max Horn <max@quendi.de>
---
 Documentation/git-remote-helpers.txt | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/Documentation/git-remote-helpers.txt b/Documentation/git-remote-helpers.txt
index 7ac1461..023dcca 100644
--- a/Documentation/git-remote-helpers.txt
+++ b/Documentation/git-remote-helpers.txt
@@ -216,6 +216,8 @@ Commands are given by the caller on the helper's standard input, one per line.
 	which marks them mandatory for git versions using the remote
 	helper to understand. Any unknown mandatory capability is a
 	fatal error.
++
+Support for this command is mandatory.
 
 'list'::
 	Lists the refs, one per line, in the format "<value> <name>
@@ -225,9 +227,18 @@ Commands are given by the caller on the helper's standard input, one per line.
 	the name; unrecognized attributes are ignored. The list ends
 	with a blank line.
 +
-If 'push' is supported this may be called as 'list for-push'
-to obtain the current refs prior to sending one or more 'push'
-commands to the helper.
+Supported if the helper has the "fetch" or "import" capability.
+
+'list for-push'::
+	Similar to 'list', except that it is used if and only if
+	the caller wants to the resulting ref list to prepare
+	push commands.
+	A helper supporting both push and fetch can use this
+	to distinguish for which operation the output of 'list'
+	is going to be used, possibly reducing the amount
+	of work that needs to be performed.
++
+Supported if the helper has the "push" or "export" capability.
 
 'option' <name> <value>::
 	Sets the transport helper option <name> to <value>.  Outputs a
@@ -306,7 +317,7 @@ sequence has to be buffered before starting to send data to fast-import
 to prevent mixing of commands and fast-import responses on the helper's
 stdin.
 +
-Supported if the helper has the 'import' capability.
+Supported if the helper has the "import" capability.
 
 'export'::
 	Instructs the remote helper that any subsequent input is
@@ -322,7 +333,7 @@ fast-export', which then will load/store a table of marks for
 local objects. This can be used to implement for incremental
 operations.
 +
-Supported if the helper has the 'export' capability.
+Supported if the helper has the "export" capability.
 
 'connect' <service>::
 	Connects to given service. Standard input and standard output
-- 
1.8.0.393.gcc9701d
Previous: Max HornNext: Max Horn
Message 9 of 16 in “Improve remote helper documentation”
  1. 0/6 Improve remote helper documentationMax Horn, Nov 27, 2012
  2. 1/6 Document invocation first, then input formatMax Horn, Nov 27, 2012
  3. 2/6 Document missing remote helper capabilitiesMax Horn, Nov 27, 2012
  4. 3/6 Fix grammarMax Horn, Nov 27, 2012
  5. Junio C HamanoNov 27, 2012
  6. Max HornNov 27, 2012
  7. Junio C HamanoNov 27, 2012
  8. 4/6 Rearrange the description of remote helper capabilitiesMax Horn, Nov 27, 2012
  9. 5/6 Make clearer which commands must be supported for which capabilitiesMax Horn, Nov 27, 2012
  10. 6/6 Remove 'for-push' from ref list attributes list, link to subsectionsMax Horn, Nov 27, 2012
  11. Junio C HamanoDec 7, 2012
  12. Sverre RabbelierDec 7, 2012
  13. Max HornDec 7, 2012
  14. Junio C HamanoDec 7, 2012
  15. Max HornDec 7, 2012
  16. Felipe ContrerasDec 12, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.