All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH] git-remote-helpers.txt: explain how import works with multiple refs
Date: Wed, 31 Aug 2011 18:47:02 +0200	[thread overview]
Message-ID: <1314809222-30528-1-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <CAGdFq_gooPGQMa5D19-wag=X+mDntHF1MwXiYF0zovB=L-Sybw@mail.gmail.com>

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 <Matthieu.Moy@imag.fr>
---
Sverre Rabbelier <srabbelier@gmail.com> writes:

> No, a list of 'import' statements has to be followed by a \n, similar
> to the push command. You can have multiple 'blocks' of import/push
> commands, but each block has to be followed by a newline. Again, you
> should read:
>
> import A
> import B
> \n
> import C
> import D
> \n

Thanks for the explanation. This was documented for 'push', but your
illustration made it easier for me to understand, so I've added the
example for push.

The documentation of "batch import" also fixes the "it's not
documented that remote-helpers should use 'done'" as a side-effect.

While investigating all this, I found in git-remote-testgit.py that
the remote-helpers had an "export" functionality, which seems totally
undocumented. Any volunteer to document it?

 Documentation/git-remote-helpers.txt |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-remote-helpers.txt b/Documentation/git-remote-helpers.txt
index 760b164..526fc6a 100644
--- 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
+------------
 +
 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.
 
 'connect' <service>::
-- 
1.7.7.rc0.78.ge4b5a.dirty

  reply	other threads:[~2011-08-31 16:47 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 17:11 [PATCH 1/2] fast-import: initialize variable require_explicit_termination Matthieu Moy
2011-08-26 17:11 ` [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push) Matthieu Moy
2011-08-26 17:53   ` Junio C Hamano
2011-08-29  5:42     ` Sverre Rabbelier
2011-08-29  6:05       ` Junio C Hamano
2011-08-29  6:41         ` Sverre Rabbelier
2011-08-30  3:56           ` Jonathan Nieder
2011-08-30 17:13             ` Junio C Hamano
2011-08-31 11:54             ` Matthieu Moy
2011-09-01 23:44               ` Jonathan Nieder
2011-08-31 12:05           ` done feature in remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push)) Matthieu Moy
2011-08-31 12:17             ` Sverre Rabbelier
2011-08-31 12:55               ` Matthieu Moy
2011-08-31 12:58                 ` Sverre Rabbelier
2011-08-31 13:12                   ` Matthieu Moy
2011-08-31 13:16                     ` Sverre Rabbelier
2011-08-31 16:47                       ` Matthieu Moy [this message]
2011-08-31 18:14                         ` [PATCH] (short) documentation for the testgit remote helper Matthieu Moy
2011-09-01 11:27                           ` Sverre Rabbelier
2011-09-01 15:52                             ` Matthieu Moy
2011-09-01 16:49                               ` [PATCH 1/2 v2] Documentation/git-remote-helpers: explain how import works with multiple refs Matthieu Moy
2011-09-01 16:49                                 ` [PATCH 2/2 v2] (short) documentation for the testgit remote helper Matthieu Moy
2011-09-01 16:59                                   ` Sverre Rabbelier
2011-09-01 16:59                                 ` [PATCH 1/2 v2] Documentation/git-remote-helpers: explain how import works with multiple refs Sverre Rabbelier
2011-09-01 11:24                         ` [PATCH] git-remote-helpers.txt: " Sverre Rabbelier
2011-09-01 23:17                         ` Jonathan Nieder
2011-09-03 10:35                           ` Matthieu Moy
2011-08-26 17:55   ` [PATCH v5] Add a remote helper to interact with mediawiki (fetch & push) Matthieu Moy
2011-08-31 16:55     ` [PATCH v6] " Matthieu Moy
2011-08-31 17:03       ` Sverre Rabbelier
2011-08-31 17:30         ` Matthieu Moy
2011-09-01  0:24           ` Junio C Hamano
2011-09-01  5:26             ` Matthieu Moy
2011-09-01 16:54               ` [PATCH 0/2] Git-MediaWiki Matthieu Moy
2011-09-01 16:54                 ` [PATCH 1/2 v7] Add a remote helper to interact with mediawiki (fetch & push) Matthieu Moy
2011-09-01 16:54                 ` [PATCH 2/2] git-remote-mediawiki: allow push to set MediaWiki metadata Matthieu Moy
2011-08-31 12:33   ` Clean termination of remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push)) Matthieu Moy
2011-08-31 13:25     ` Sverre Rabbelier
2011-08-31 14:53       ` Matthieu Moy
2011-08-31 15:00         ` Sverre Rabbelier
2011-08-26 17:51 ` [PATCH 1/2] fast-import: initialize variable require_explicit_termination Junio C Hamano
2011-08-26 17:59   ` Matthieu Moy
2011-08-26 18:55     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314809222-30528-1-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.