Re: done feature in remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push))
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 31, 2011, 12:55 UTC
- Message-ID
- <vpqk49tviza.fsf@bauges.imag.fr>
- In-Reply-To
- <CAGdFq_jyVK3_THYXzCOLDpNww0Npn2qzZ1qv-BMuLbg1vgVjZw@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
Show 15 quoted lines
> Heya, > > On Wed, Aug 31, 2011 at 14:05, Matthieu Moy > <Matthieu.Moy@grenoble-inp.fr> wrote: >> So, is this the expected behavior? Wouldn't it be more sensible to allow >> the remote-helper to issue a "done" after each "import" command? Right >> now, my understanding is that after an "import" command is issued, it's >> no longer possible to output anything other than fast-import stream on >> stdout, and I guess it'd be more future-proof to allow closing the >> fast-import with a "done", and allow any dialog between git and the >> remote helper afterwards. > > Wow, no that's not the intended behavior. We meant to make it exactly > as you describe, after each import command you end with a done. This > is (should) also be what the testgit implementation does currently,
Err, no, it isn't. From git-remote-testgit.py:
def do_import(repo, args):
[...]
while True:
line = sys.stdin.readline()
[...]
# strip of leading 'import '
ref = line[7:].strip()
refs.append(ref) repo = update_local_repo(repo)
repo.exporter.export_repo(repo.gitdir, refs)print "done"
What it does is that it reads multiple "import" commands, and process them all at once, with a single "print done" at the end. Actually, testgit would die("Expected import line.") if Git sent another command after "import".
-- Matthieu Moy http://www-verimag.imag.fr/~moy/