From: Jonathan Nieder Date: Sun, 19 Jun 2011 23:25:25 GMT Subject: Re: [PATCH v2 16/20] transport-helper: update ref status after push with export Message-ID: <20110619232525.GH23893@elie> In-Reply-To: <1308496725-22329-17-git-send-email-srabbelier@gmail.com> Sverre Rabbelier wrote: > > Signed-off-by: Sverre Rabbelier > --- > > This time a proper implementation of this patch. Nice. :) I assume this still does not return "error " responses, instead disconnecting the helper on error, which is fine but probably worth mentioning. > --- a/git-remote-testgit.py > +++ b/git-remote-testgit.py > @@ -148,11 +148,15 @@ def do_export(repo, args): > sys.stdout.flush() > > update_local_repo(repo) > - repo.importer.do_import(repo.gitdir) > + changed = repo.importer.do_import(repo.gitdir) > > if not repo.local: > repo.non_local.push(repo.gitdir) > > + for ref in changed: > + print "ok %s" % ref > + print > + The remote-helpers(1) manual says, concerning "push": When the push is complete, outputs one or more ok or error ? lines to indicate success or failure of each pushed ref. The status report output is terminated by a blank line. The option field may be quoted in a C style string if it contains an LF. Ideally we would want "export" to also print all refs intended for export, even if they did not actually change, but there's no obvious way to get that information. In the "not repo.local" case, seeing which refs changed in .git/info/fast-import/.git like you do here seems like a reasonable enough heuristic. What happens if no ref changed (the "already up to date" case)?