Subject: Re: [PATCH v2 16/20] transport-helper: update ref status after push with export

From: Jonathan Nieder <[email-masked]>
Date: Sun, 19 Jun 2011 18:25:25 -0500

Sverre Rabbelier wrote:

>
> Signed-off-by: Sverre Rabbelier <[email-masked]>
> ---
>
>   This time a proper implementation of this patch.

Nice. :)

I assume this still does not return "error <dst> <reason>" 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 <dst> or
	error <dst> <why>?  lines to indicate success or failure of
	each pushed ref. The status report output is terminated by a
	blank line. The option field <why> 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/<repo>.git like you do
here seems like a reasonable enough heuristic.

What happens if no ref changed (the "already up to date" case)?