Skip to content

Commit 960e311

Browse files
moygitster
authored andcommitted
Documentation/git-remote-helpers: explain how import works with multiple refs
This is important for two reasons: * when two "import" lines follow each other, only one "done" command should be issued in the fast-import stream, not one per "import". * The blank line terminating an import command should not be confused with the one terminating the sequence of commands. While we're there, illustrate the corresponding explanation for push batches with an example. Signed-off-by: Matthieu Moy <[email protected]> Acked-by: Sverre Rabbelier <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b4fc8d6 commit 960e311

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Documentation/git-remote-helpers.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,22 @@ Supported if the helper has the "fetch" capability.
241241
'push' +<src>:<dst>::
242242
Pushes the given local <src> commit or branch to the
243243
remote branch described by <dst>. A batch sequence of
244-
one or more push commands is terminated with a blank line.
244+
one or more 'push' commands is terminated with a blank line
245+
(if there is only one reference to push, a single 'push' command
246+
is followed by a blank line). For example, the following would
247+
be two batches of 'push', the first asking the remote-helper
248+
to push the local ref 'master' to the remote ref 'master' and
249+
the local 'HEAD' to the remote 'branch', and the second
250+
asking to push ref 'foo' to ref 'bar' (forced update requested
251+
by the '+').
252+
+
253+
------------
254+
push refs/heads/master:refs/heads/master
255+
push HEAD:refs/heads/branch
256+
\n
257+
push +refs/heads/foo:refs/heads/bar
258+
\n
259+
------------
245260
+
246261
Zero or more protocol options may be entered after the last 'push'
247262
command, before the batch's terminating blank line.
@@ -266,6 +281,11 @@ Supported if the helper has the "push" capability.
266281
Especially useful for interoperability with a foreign versioning
267282
system.
268283
+
284+
Just like 'push', a batch sequence of one or more 'import' is
285+
terminated with a blank line. For each batch of 'import', the remote
286+
helper should produce a fast-import stream terminated by a 'done'
287+
command.
288+
+
269289
Supported if the helper has the "import" capability.
270290

271291
'connect' <service>::

0 commit comments

Comments
 (0)