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

Re: [PATCH] git-remote-helpers.txt: explain how import works with multiple refs

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 1, 2011, 23:17 UTC
Message-ID
<20110901231734.GA21945@elie>
In-Reply-To
<1314809222-30528-1-git-send-email-Matthieu.Moy@imag.fr>
Hi Matthieu,
Matthieu Moy wrote:
Show 23 quoted lines
> --- a/Documentation/git-remote-helpers.txt
> +++ b/Documentation/git-remote-helpers.txt
> @@ -241,7 +241,22 @@ Supported if the helper has the "fetch" capability.
>  'push' +<src>:<dst>::
>  	Pushes the given local <src> commit or branch to the
>  	remote branch described by <dst>.  A batch sequence of
> -	one or more push commands is terminated with a blank line.
> +	one or more 'push' commands is terminated with a blank line
> +	(if there is only one reference to push, a single 'push' command
> +	is followed by a blank line). For example, the following would
> +	be two batches of 'push', the first asking the remote-helper
> +	to push the local ref 'master' to the remote ref 'master' and
> +	the local 'HEAD' to the remote 'branch', and the second
> +	asking to push ref 'foo' to ref 'bar' (forced update requested
> +	by the '+').
> ++
> +------------
> +push refs/heads/master:refs/heads/master
> +push HEAD:refs/heads/branch
> +\n
> +push +refs/heads/foo:refs/heads/bar
> +\n
> +------------
Probably examples like this could go in a later EXAMPLES section.

At first I was worried about this not actually working, thinking "push" might have traditionally had the newline-ends-command-stream semantics that "connect" has. But the push codepath does not set the no_disconnect_req flag, so I was worrying in vain. :) The stream passed to the helper ends with two newlines when git pushes.

Show 13 quoted lines
>  +
>  Zero or more protocol options may be entered after the last 'push'
>  command, before the batch's terminating blank line.
> @@ -266,6 +281,11 @@ Supported if the helper has the "push" capability.
>  Especially useful for interoperability with a foreign versioning
>  system.
>  +
> +Just like 'push', a batch sequence of one or more 'import' is
> +terminated with a blank line. For each batch of 'import', the remote
> +helper should produce a fast-import stream terminated by a 'done'
> +command.
> ++
>  Supported if the helper has the "import" capability.

This documents v1.7.7-rc0~61^2~3 (transport-helper: change import semantics, 2011-07-16). Such a documentation fix was desperately needed; thank you!

For what it's worth, with or without a change to prevent the example
from interrupting the flow of description,
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Previous: Sverre RabbelierNext: Matthieu Moy
Message 26 of 43 in “fast-import: initialize variable require_explicit_termination”
  1. 1/2 fast-import: initialize variable require_explicit_terminationMatthieu Moy, Aug 26, 2011
  2. 2/2 Add a remote helper to interact with mediawiki (fetch & push)Matthieu Moy, Aug 26, 2011
  3. Junio C HamanoAug 26, 2011
  4. Sverre RabbelierAug 29, 2011
  5. Junio C HamanoAug 29, 2011
  6. Sverre RabbelierAug 29, 2011
  7. Jonathan NiederAug 30, 2011
  8. Junio C HamanoAug 30, 2011
  9. Matthieu MoyAug 31, 2011
  10. Jonathan NiederSep 1, 2011
  11. done feature in remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push))Matthieu Moy, Aug 31, 2011
  12. Sverre RabbelierAug 31, 2011
  13. Matthieu MoyAug 31, 2011
  14. Sverre RabbelierAug 31, 2011
  15. Matthieu MoyAug 31, 2011
  16. Sverre RabbelierAug 31, 2011
  17. git-remote-helpers.txt: explain how import works with multiple refsMatthieu Moy, Aug 31, 2011
  18. (short) documentation for the testgit remote helperMatthieu Moy, Aug 31, 2011
  19. Sverre RabbelierSep 1, 2011
  20. Matthieu MoySep 1, 2011
  21. 1/2 Documentation/git-remote-helpers: explain how import works with multiple refsMatthieu Moy, Sep 1, 2011
  22. 2/2 (short) documentation for the testgit remote helperMatthieu Moy, Sep 1, 2011
  23. Sverre RabbelierSep 1, 2011
  24. Sverre RabbelierSep 1, 2011
  25. Sverre RabbelierSep 1, 2011
  26. Jonathan NiederSep 1, 2011
  27. Matthieu MoySep 3, 2011
  28. Add a remote helper to interact with mediawiki (fetch & push)Matthieu Moy, Aug 26, 2011
  29. Add a remote helper to interact with mediawiki (fetch & push)Matthieu Moy, Aug 31, 2011
  30. Sverre RabbelierAug 31, 2011
  31. Matthieu MoyAug 31, 2011
  32. Junio C HamanoSep 1, 2011
  33. Matthieu MoySep 1, 2011
  34. 0/2 Git-MediaWikiMatthieu Moy, Sep 1, 2011
  35. 1/2 Add a remote helper to interact with mediawiki (fetch & push)Matthieu Moy, Sep 1, 2011
  36. 2/2 git-remote-mediawiki: allow push to set MediaWiki metadataMatthieu Moy, Sep 1, 2011
  37. Clean termination of remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push))Matthieu Moy, Aug 31, 2011
  38. Sverre RabbelierAug 31, 2011
  39. Matthieu MoyAug 31, 2011
  40. Sverre RabbelierAug 31, 2011
  41. Junio C HamanoAug 26, 2011
  42. Matthieu MoyAug 26, 2011
  43. Junio C HamanoAug 26, 2011

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.