{"thread":{"id":"34684","subject":"[RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","startedAt":"2013-08-13T13:31:40Z","lastAt":"2013-09-03T15:45:14Z","messageCount":28,"participants":["Matthieu Moy","Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"225142","messageId":"1376400700-8863-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":null,"subject":"[RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-08-13T13:31:40Z","receivedAt":"2013-08-13T13:31:40Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Git-mediawiki's \"dumb push\" sends the local revisions to the remote wiki,\nbut does not update the local metadata to reflect the push (hence, the\nnext pull will have to re-import the exported revisions).\n\nThe previous implementation was simply omitting the update to the private\nref after a dumb push. This was broken by 664059fb62 (Felipe Contreras,\nApr 17 2013, transport-helper: update remote helper namespace), which\ndoes an automatic update of the private ref (not just the\nremote-tracking) on push.\n\nThis patch fixes git-remote-mediawiki to reset the private ref after the\npush is completed, cancelling the automatic update triggered by\n664059fb62.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nFelipe: Is this the right fix for git-remote-mediawiki? Any better idea?\n\nThanks,\n\n contrib/mw-to-git/git-remote-mediawiki.perl | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex f8d7d2c..13919ad 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -53,6 +53,7 @@ if (@ARGV != 2) {\n \n my $remotename = $ARGV[0];\n my $url = $ARGV[1];\n+my $reset_private_ref_to = undef;\n \n # Accept both space-separated and multiple keys in config file.\n # Spaces should be written as _ anyway because we'll use chomp.\n@@ -161,6 +162,9 @@ sub parse_command {\n \tmy ($line) = @_;\n \tmy @cmd = split(/ /, $line);\n \tif (!defined $cmd[0]) {\n+\t\tif ($reset_private_ref_to) {\n+\t\t\trun_git(\"update-ref -m \\\"Git-MediaWiki non-dumb push\\\" refs/mediawiki/$remotename/master $reset_private_ref_to\");\n+\t\t}\n \t\treturn 0;\n \t}\n \tif ($cmd[0] eq 'capabilities') {\n@@ -1209,9 +1213,10 @@ sub mw_push_revision {\n \t\t\t\tdie(\"Unknown error from mw_push_file()\\n\");\n \t\t\t}\n \t\t}\n-\t\tif (!$dumb_push) {\n+\t\tif ($dumb_push) {\n+\t\t\t$reset_private_ref_to = $remoteorigin_sha1;\n+\t\t} else {\n \t\t\trun_git(qq(notes --ref=${remotename}/mediawiki add -f -m \"mediawiki_revision: ${mw_revision}\" ${sha1_commit}));\n-\t\t\trun_git(qq(update-ref -m \"Git-MediaWiki push\" refs/mediawiki/${remotename}/master ${sha1_commit} ${sha1_child}));\n \t\t}\n \t}\n \n-- \n1.8.2.1.349.ge888d28.dirty\n"},{"id":"225633","messageId":"CAMP44s2u1edB3g9GK_kak3Nc-fe4TDBjFU_JqskBW+J0Q9BJrg@mail.gmail.com","threadId":"34684","inReplyTo":"1376400700-8863-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-21T19:48:17Z","receivedAt":"2013-08-21T19:48:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Aug 13, 2013 at 8:31 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n>\n> Git-mediawiki's \"dumb push\" sends the local revisions to the remote wiki,\n> but does not update the local metadata to reflect the push (hence, the\n> next pull will have to re-import the exported revisions).\n>\n> The previous implementation was simply omitting the update to the private\n> ref after a dumb push. This was broken by 664059fb62 (Felipe Contreras,\n> Apr 17 2013, transport-helper: update remote helper namespace), which\n> does an automatic update of the private ref (not just the\n> remote-tracking) on push.\n>\n> This patch fixes git-remote-mediawiki to reset the private ref after the\n> push is completed, cancelling the automatic update triggered by\n> 664059fb62.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n> Felipe: Is this the right fix for git-remote-mediawiki? Any better idea?\n\nWhy not keep track of the revisions yourself? You can have file where\nyou store which was the last revision that was fetched.\n\n-- \nFelipe Contreras\n"},{"id":"225648","messageId":"vpqa9ka7mku.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"CAMP44s2u1edB3g9GK_kak3Nc-fe4TDBjFU_JqskBW+J0Q9BJrg@mail.gmail.com","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-21T21:36:49Z","receivedAt":"2013-08-21T21:36:49Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Tue, Aug 13, 2013 at 8:31 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n>\n>> Felipe: Is this the right fix for git-remote-mediawiki? Any better idea?\n>\n> Why not keep track of the revisions yourself? You can have file where\n> you store which was the last revision that was fetched.\n\nI don't really understand the point of the \"private namespace\" anymore I\nguess. Why do we have both refs/remotes/$remote and\nrefs/$foreign_vcs/$remote, if they are always kept in sync?\n\nKeeping the last imported revision in a separate file would be possible,\nbut then we'd have information about the remote in one file plus two\nrefs, and I don't understand why we need to split the information in so\nmany places. A ref seemed the right tool to store a revision.\n\n(These are genuine questions, you have far more experience than me with\nremote-helpers)\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225679","messageId":"CAMP44s3jh4iEbgONaEU0WSCc5YiGYoK8edcgWU6qmUARToVRuw@mail.gmail.com","threadId":"34684","inReplyTo":"vpqa9ka7mku.fsf@anie.imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-22T17:20:42Z","receivedAt":"2013-08-22T17:20:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Wed, Aug 21, 2013 at 4:36 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Tue, Aug 13, 2013 at 8:31 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n>>\n>>> Felipe: Is this the right fix for git-remote-mediawiki? Any better idea?\n>>\n>> Why not keep track of the revisions yourself? You can have file where\n>> you store which was the last revision that was fetched.\n>\n> I don't really understand the point of the \"private namespace\" anymore I\n> guess. Why do we have both refs/remotes/$remote and\n> refs/$foreign_vcs/$remote, if they are always kept in sync?\n\nThey are not always in sync; if a push fails, the private namespace is\nnot updated.\n\n> Keeping the last imported revision in a separate file would be possible,\n> but then we'd have information about the remote in one file plus two\n> refs, and I don't understand why we need to split the information in so\n> many places. A ref seemed the right tool to store a revision.\n\nAs I said, they are not exactly the same. It is possible refs/remotes\npoint to a mercurial revision on the remote server, and refs/hg points\nto a mercurial revision on the local internal repository, and they are\nnot the same.\n\n-- \nFelipe Contreras\n"},{"id":"225713","messageId":"vpqbo4o3jba.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"CAMP44s3jh4iEbgONaEU0WSCc5YiGYoK8edcgWU6qmUARToVRuw@mail.gmail.com","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-23T08:25:29Z","receivedAt":"2013-08-23T08:25:29Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Wed, Aug 21, 2013 at 4:36 PM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>> On Tue, Aug 13, 2013 at 8:31 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n>>>\n>>>> Felipe: Is this the right fix for git-remote-mediawiki? Any better idea?\n>>>\n>>> Why not keep track of the revisions yourself? You can have file where\n>>> you store which was the last revision that was fetched.\n>>\n>> I don't really understand the point of the \"private namespace\" anymore I\n>> guess. Why do we have both refs/remotes/$remote and\n>> refs/$foreign_vcs/$remote, if they are always kept in sync?\n>\n> They are not always in sync; if a push fails, the private namespace is\n> not updated.\n[...]\n> As I said, they are not exactly the same. It is possible refs/remotes\n> point to a mercurial revision on the remote server, and refs/hg points\n> to a mercurial revision on the local internal repository, and they are\n> not the same.\n\nThis is assuming you follow the scheme\n\n  git -> local repo for other vcs -> remote repo for other vcs\n\nwhich itself more or less assumes that the other VCS is a decentralized\nVCS. I understand this is a good idea for hg or bzr remote helpers, but\nnot applicable for git-remote-mediawiki.\n\nI find this very unclear in the doc. How about adding something like\nthis in the \"'refspec' <refspec>::\" part?\n\n--- a/Documentation/gitremote-helpers.txt\n+++ b/Documentation/gitremote-helpers.txt\n@@ -176,6 +176,12 @@ applicable refspec takes precedence.  The left-hand of refspecs\n advertised with this capability must cover all refs reported by\n the list command.  If no 'refspec' capability is advertised,\n there is an implied `refspec *:*`.\n++\n+When writing remote-helpers for decentralized version control\n+systems, it is advised to keep a local copy of the repository to\n+interact with, and to let the private namespace refs point to this\n+local repository, while the refs/remotes namespace is used to track\n+the remote repository.\n \n 'bidi-import'::\n        This modifies the 'import' capability.\n\nSo, now, I understand the point of the private namespace in the case of\nDVCS, but still note really for interactions with centralized VCS.\n\nBack to my original problem: the point of dumb push is to make sure the\nnext import will re-import the pushed revisions. if I use something\nother than the private namespace to keep track of the last imported,\nthen I'll need to do a non-fast forward update to the private ref. I\ncould do that by sending \"feature force\\n\" it the beginning of the\nfast-import stream when importing, but that loses one safety feature\n(e.g. I detected the breakage thanks to the non-fast forward error\nmessage, while the tests incorrectly pass if I enable \"force\").\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225742","messageId":"CAMP44s281qkdMXUM-2P6T+emFajASX6Jyj4nk8_cU5xYJYvdLA@mail.gmail.com","threadId":"34684","inReplyTo":"vpqbo4o3jba.fsf@anie.imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-23T19:52:17Z","receivedAt":"2013-08-23T19:52:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Aug 23, 2013 at 3:25 AM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n\n> This is assuming you follow the scheme\n>\n>   git -> local repo for other vcs -> remote repo for other vcs\n>\n> which itself more or less assumes that the other VCS is a decentralized\n> VCS. I understand this is a good idea for hg or bzr remote helpers, but\n> not applicable for git-remote-mediawiki.\n\nA centralized repository is a subset of decentralized workflows.\n\n> Back to my original problem: the point of dumb push is to make sure the\n> next import will re-import the pushed revisions. if I use something\n> other than the private namespace to keep track of the last imported,\n> then I'll need to do a non-fast forward update to the private ref. I\n> could do that by sending \"feature force\\n\" it the beginning of the\n> fast-import stream when importing, but that loses one safety feature\n> (e.g. I detected the breakage thanks to the non-fast forward error\n> message, while the tests incorrectly pass if I enable \"force\").\n\nI don't know if a dumb push is the right thing to do here, but\nsupposing it is, you can still report non-fast-forward errors:\n\nhttps://github.com/felipec/git/commit/0f7f0a223d710d29a4f1a03fc27348a8690d8a19\nhttps://github.com/felipec/git/commit/b67a8914bc1bb3ad23591875611165b84135aaf9\n\nIf it's too much hassle to find non-fast-forward situations by\nyourself, then perhaps it would make sense to update the remote\nnamespace only when a certain feature has been flagged.\n\n-- \nFelipe Contreras\n"},{"id":"225789","messageId":"vpq8uzr5y4v.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"CAMP44s281qkdMXUM-2P6T+emFajASX6Jyj4nk8_cU5xYJYvdLA@mail.gmail.com","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-24T07:46:56Z","receivedAt":"2013-08-24T07:46:56Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Fri, Aug 23, 2013 at 3:25 AM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>\n>> This is assuming you follow the scheme\n>>\n>>   git -> local repo for other vcs -> remote repo for other vcs\n>>\n>> which itself more or less assumes that the other VCS is a decentralized\n>> VCS. I understand this is a good idea for hg or bzr remote helpers, but\n>> not applicable for git-remote-mediawiki.\n>\n> A centralized repository is a subset of decentralized workflows.\n\nYes, a strict subset. You can't keep a local copy of a remote repository\nwith a centralized VCS, so the way to write remote-helpers for DVCS does\nnot apply for centralized VCS.\n\n> I don't know if a dumb push is the right thing to do here, but\n> supposing it is, you can still report non-fast-forward errors:\n\nThat would be really complicated, as you would need to check whether\nnon-fast forward errors are serious. The check is done on pull, and the\nreason the check should be disabled is dumb push.\n\n> https://github.com/felipec/git/commit/0f7f0a223d710d29a4f1a03fc27348a8690d8a19\n> https://github.com/felipec/git/commit/b67a8914bc1bb3ad23591875611165b84135aaf9\n\nErr, don't they apply when pushing? In my case, the non-fast forward\noccurs on pull.\n\n> If it's too much hassle to find non-fast-forward situations by\n> yourself, then perhaps it would make sense to update the remote\n> namespace only when a certain feature has been flagged.\n\nHow would I do that? The update to the remote namespace is done by Git,\nnot by the remote-helper.\n\nOK, I'm now convinced that my solution is the right one. The\nalternatives are far more complex and I still fail to see the benefits.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225813","messageId":"xmqq61uumnsz.fsf@gitster.dls.corp.google.com","threadId":"34684","inReplyTo":"vpq8uzr5y4v.fsf@anie.imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-25T03:50:20Z","receivedAt":"2013-08-25T03:50:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> How would I do that? The update to the remote namespace is done by Git,\n> not by the remote-helper.\n>\n> OK, I'm now convinced that my solution is the right one. The\n> alternatives are far more complex and I still fail to see the benefits.\n\nSounds like a plan, even though it smells like the \"update is done\nby Git\" that does not have any way to opt-out may be the real design\nmistake and your \"solution\" is a work-around to that.\n\nWould it be a possibility to make it tunable, perhaps by introducing\na capability on the remote-interface side that allows you to tell it\nnot to mess with the remote namespace?  If we were doing this from\nscratch, I would suspect that we would have made the capability work\nthe other way around (Git does not do the update by default, but\nhelpers c an ask Git to do so).\n"},{"id":"225893","messageId":"vpqhaeckfbh.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"xmqq61uumnsz.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-26T08:48:50Z","receivedAt":"2013-08-26T08:48:50Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> How would I do that? The update to the remote namespace is done by Git,\n>> not by the remote-helper.\n>>\n>> OK, I'm now convinced that my solution is the right one. The\n>> alternatives are far more complex and I still fail to see the benefits.\n>\n> Sounds like a plan, even though it smells like the \"update is done\n> by Git\" that does not have any way to opt-out may be the real design\n> mistake and your \"solution\" is a work-around to that.\n>\n> Would it be a possibility to make it tunable, perhaps by introducing\n> a capability on the remote-interface side that allows you to tell it\n> not to mess with the remote namespace?\n\nIdeally, it would be possible to ask for a non-update without a fatal\nerror on old Git versions, but this is not possible (hence, my fix is\nthe \"portable\" one, that works on Git 1.8.4).\n\nBut that's probably the best we can do now.\n\n> If we were doing this from scratch, I would suspect that we would have\n> made the capability work the other way around (Git does not do the\n> update by default, but helpers c an ask Git to do so).\n\nNot updating was the default until 664059fb62 (i.e. until 1.8.4), so the\ndefault already changed once. I tend to agree with Felipe that doing the\nupdate by default makes sense.\n\ngit-remote-mediawiki is kind of a special case, as the remote side uses\na very different data model, hence it can make sense to export+reimport\nto get locally what the remote side received. But when interacting with\nsomething closer to Git (bzr, hg, ...), the mapping should be close to\n1-1 and re-importing wouldn't make sense.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225894","messageId":"vpqr4dgizhm.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"vpqhaeckfbh.fsf@anie.imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-26T09:16:05Z","receivedAt":"2013-08-26T09:16:05Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>>\n>>> How would I do that? The update to the remote namespace is done by Git,\n>>> not by the remote-helper.\n>>>\n>>> OK, I'm now convinced that my solution is the right one. The\n>>> alternatives are far more complex and I still fail to see the benefits.\n>>\n>> Sounds like a plan, even though it smells like the \"update is done\n>> by Git\" that does not have any way to opt-out may be the real design\n>> mistake and your \"solution\" is a work-around to that.\n>>\n>> Would it be a possibility to make it tunable, perhaps by introducing\n>> a capability on the remote-interface side that allows you to tell it\n>> not to mess with the remote namespace?\n>\n> Ideally, it would be possible to ask for a non-update without a fatal\n> error on old Git versions, but this is not possible (hence, my fix is\n> the \"portable\" one, that works on Git 1.8.4).\n>\n> But that's probably the best we can do now.\n\n... and a patch implementing that would look like:\n\ncommit e438ddc58a3cedcf66332bddda792954c5905cea\nAuthor: Matthieu Moy <Matthieu.Moy@imag.fr>\nDate:   Mon Aug 26 11:10:30 2013 +0200\n\n    transport-helper: add dont-update-private capability\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 63cabc3..639b0e3 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -27,7 +27,8 @@ struct helper_data {\n                push : 1,\n                connect : 1,\n                signed_tags : 1,\n-               no_disconnect_req : 1;\n+               no_disconnect_req : 1,\n+               dont_update_private : 1;\n        char *export_marks;\n        char *import_marks;\n        /* These go from remote name (as in \"list\") to private name */\n@@ -205,6 +206,8 @@ static struct child_process *get_helper(struct transport *transport)\n                        strbuf_addstr(&arg, \"--import-marks=\");\n                        strbuf_addstr(&arg, capname + strlen(\"import-marks \"));\n                        data->import_marks = strbuf_detach(&arg, NULL);\n+               } else if (!prefixcmp(capname, \"dont-update-private\")) {\n+                       data->dont_update_private = 1;\n                } else if (mandatory) {\n                        die(\"Unknown mandatory capability %s. This remote \"\n                            \"helper probably needs newer version of Git.\",\n@@ -723,7 +726,7 @@ static void push_update_refs_status(struct helper_data *data,\n                if (push_update_ref_status(&buf, &ref, remote_refs))\n                        continue;\n \n-               if (!data->refspecs)\n+               if (!data->refspecs || data->dont_update_private)\n                        continue;\n \n                /* propagate back the update to the remote namespace */\n\n\n(Plus tests and docs)\n\nBased on this, git-remote-mediawiki could simply use:\n\ncommit aa745c3ccb6681df8dc6406b00e0d31b26e72d50\nAuthor: Matthieu Moy <Matthieu.Moy@imag.fr>\nDate:   Mon Aug 26 11:09:55 2013 +0200\n\n    git-remote-mediawiki: use dont-update-private capability on dumb push\n\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex a2e71d6..b29682e 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -601,6 +601,9 @@ sub mw_capabilities {\n        print {*STDOUT} \"import\\n\";\n        print {*STDOUT} \"list\\n\";\n        print {*STDOUT} \"push\\n\";\n+       if ($dumb_push) {\n+               print {*STDOUT} \"dont-update-private\\n\";\n+       }\n        print {*STDOUT} \"\\n\";\n        return;\n }\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225906","messageId":"xmqqmwo4ifk1.fsf@gitster.dls.corp.google.com","threadId":"34684","inReplyTo":"vpqhaeckfbh.fsf@anie.imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-26T16:26:38Z","receivedAt":"2013-08-26T16:26:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Not updating was the default until 664059fb62 (i.e. until 1.8.4), so the\n> default already changed once. I tend to agree with Felipe that doing the\n> update by default makes sense.\n\nOK.  Thanks.\n\n> git-remote-mediawiki is kind of a special case, as the remote side uses\n> a very different data model, hence it can make sense to export+reimport\n> to get locally what the remote side received.\n\nHmm, I am not sure how export+reimport would not make sense for\nothers like cvs and p4.\n\n> But when interacting with something closer to Git (bzr, hg, ...),\n> the mapping should be close to 1-1 and re-importing wouldn't make\n> sense.\n\nI agree if your argument is that re-importing should result in an\nidentitical result hence is unnecessary.\n"},{"id":"225907","messageId":"CAMP44s1dNHi5Xg9KPp_717BMfAem-H8YOv5c+K9-2b-Aewpe3w@mail.gmail.com","threadId":"34684","inReplyTo":"vpqr4dgizhm.fsf@anie.imag.fr","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-26T16:28:02Z","receivedAt":"2013-08-26T16:28:02Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Aug 26, 2013 at 4:16 AM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> Junio C Hamano <gitster@pobox.com> writes:\n>>\n>>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>>>\n>>>> How would I do that? The update to the remote namespace is done by Git,\n>>>> not by the remote-helper.\n>>>>\n>>>> OK, I'm now convinced that my solution is the right one. The\n>>>> alternatives are far more complex and I still fail to see the benefits.\n>>>\n>>> Sounds like a plan, even though it smells like the \"update is done\n>>> by Git\" that does not have any way to opt-out may be the real design\n>>> mistake and your \"solution\" is a work-around to that.\n>>>\n>>> Would it be a possibility to make it tunable, perhaps by introducing\n>>> a capability on the remote-interface side that allows you to tell it\n>>> not to mess with the remote namespace?\n>>\n>> Ideally, it would be possible to ask for a non-update without a fatal\n>> error on old Git versions, but this is not possible (hence, my fix is\n>> the \"portable\" one, that works on Git 1.8.4).\n>>\n>> But that's probably the best we can do now.\n>\n> ... and a patch implementing that would look like:\n\nThis is exactly what I meant by only update when a feature has been flagged.\n\n-- \nFelipe Contreras\n"},{"id":"225981","messageId":"vpqsixvfvdk.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"CAMP44s1dNHi5Xg9KPp_717BMfAem-H8YOv5c+K9-2b-Aewpe3w@mail.gmail.com","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-27T07:25:27Z","receivedAt":"2013-08-27T07:25:27Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Mon, Aug 26, 2013 at 4:16 AM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>>\n>>> Junio C Hamano <gitster@pobox.com> writes:\n>>>\n>>>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>>>\n>>> Ideally, it would be possible to ask for a non-update without a fatal\n>>> error on old Git versions, but this is not possible (hence, my fix is\n>>> the \"portable\" one, that works on Git 1.8.4).\n>>>\n>>> But that's probably the best we can do now.\n>>\n>> ... and a patch implementing that would look like:\n>\n> This is exactly what I meant by only update when a feature has been\n> flagged.\n\nOK, I didn't understand you meant patching Git itself for that. So it\nmakes sense to turn my toy patch into a real patch I guess. Any comment\non the capability name? I used dont-update-private, which is a bit long.\nThe actual precise name would be dont-update-private-for-push, but\nthat's really long. Any better idea?\n\nJust to be sure: you originally wrote \"update the remote namespace only\nwhen a certain feature has been flagged\". My patch differs in two ways:\nit's opt-out, not opt-in, and it's about updating the _private_\nnamespace, not the remote. Any comment on what's the best behavior?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225982","messageId":"vpqioyrfv8w.fsf@anie.imag.fr","threadId":"34684","inReplyTo":"xmqqmwo4ifk1.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-27T07:28:15Z","receivedAt":"2013-08-27T07:28:15Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> git-remote-mediawiki is kind of a special case, as the remote side uses\n>> a very different data model, hence it can make sense to export+reimport\n>> to get locally what the remote side received.\n>\n> Hmm, I am not sure how export+reimport would not make sense for\n> others like cvs and p4.\n\nActually, it is essentially what \"git svn rebase\" does. I guess it would\nmake even more sense for CVS (I don't know p4, nor git-p4).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"226241","messageId":"1377802704-30881-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"vpqsixvfvdk.fsf@anie.imag.fr","subject":"[PATCH 1/4] git-remote-mediawiki: add test and check Makefile targets","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-08-29T18:58:21Z","receivedAt":"2013-08-29T18:58:21Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"There are a few level 4 and 2 perlcritic issues in the current code. We\nmake level 5 fatal, and keep level 2 as warnings.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n contrib/mw-to-git/Makefile | 10 +++++++++-\n 1 file changed, 9 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile\nindex 76fcd4d..f206f96 100644\n--- a/contrib/mw-to-git/Makefile\n+++ b/contrib/mw-to-git/Makefile\n@@ -24,6 +24,11 @@ INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \\\n \n all: build\n \n+test: all\n+\t$(MAKE) -C t\n+\n+check: perlcritic test\n+\n install_pm:\n \tinstall $(GIT_MEDIAWIKI_PM) $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM)\n \n@@ -41,4 +46,7 @@ clean:\n \trm $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM)\n \n perlcritic:\n-\tperlcritic -2 *.perl\n+\tperlcritic -5 $(SCRIPT_PERL)\n+\t-perlcritic -2 $(SCRIPT_PERL)\n+\n+.PHONY: all test check install_pm install clean perlcritic\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226239","messageId":"1377802704-30881-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1377802704-30881-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 2/4] transport-helper: add dont-update-private capability","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-08-29T18:58:22Z","receivedAt":"2013-08-29T18:58:22Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Since 664059fb62 (Felipe Contreras, Apr 17 2013, transport-helper: update\nremote helper namespace), a 'push' operation on a remote helper updates\nthe private ref by default. This is often a good thing, but it can also\nbe desirable to disable this update to force the next 'pull' to re-import\nthe pushed revisions.\n\nAllow remote-helpers to disable the automatic update by introducing a new\ncapability.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nEssentially the same as the patch I sent earlier, with doc and test.\n\n Documentation/gitremote-helpers.txt |  6 ++++++\n git-remote-testgit.sh               |  1 +\n t/t5801-remote-helpers.sh           | 11 +++++++++++\n transport-helper.c                  |  7 +++++--\n 4 files changed, 23 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt\nindex 0827f69..3085823 100644\n--- a/Documentation/gitremote-helpers.txt\n+++ b/Documentation/gitremote-helpers.txt\n@@ -120,6 +120,12 @@ connecting (see the 'connect' command under COMMANDS).\n When choosing between 'push' and 'export', Git prefers 'push'.\n Other frontends may have some other order of preference.\n \n+'dont-update-private'::\n+\tWhen using the 'refspec' capability, git normally updates the\n+\tprivate ref on successful push. This update is disabled when\n+\tthe remote-helper declares the capability\n+\t'dont-update-private'.\n+\n \n Capabilities for Fetching\n ^^^^^^^^^^^^^^^^^^^^^^^^^\ndiff --git a/git-remote-testgit.sh b/git-remote-testgit.sh\nindex 2109070..a81aee8 100755\n--- a/git-remote-testgit.sh\n+++ b/git-remote-testgit.sh\n@@ -38,6 +38,7 @@ do\n \t\t\techo \"*export-marks $gitmarks\"\n \t\tfi\n \t\ttest -n \"$GIT_REMOTE_TESTGIT_SIGNED_TAGS\" && echo \"signed-tags\"\n+\t\ttest -n \"$GIT_REMOTE_TESTGIT_DONT_UPDATE_PRIVATE\" && echo \"dont-update-private\"\n \t\techo\n \t\t;;\n \tlist)\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 8c4c539..171cae3 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -182,6 +182,17 @@ test_expect_success 'push update refs' '\n \t)\n '\n \n+test_expect_success 'push update refs disabled by dont-update-private' '\n+\t(cd local &&\n+\techo more-update >>file &&\n+\tgit commit -a -m more-update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >expect &&\n+\tGIT_REMOTE_TESTGIT_DONT_UPDATE_PRIVATE=t git push origin update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >actual &&\n+\ttest_cmp expect actual\n+\t)\n+'\n+\n test_expect_success 'push update refs failure' '\n \t(cd local &&\n \tgit checkout update &&\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 63cabc3..639b0e3 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -27,7 +27,8 @@ struct helper_data {\n \t\tpush : 1,\n \t\tconnect : 1,\n \t\tsigned_tags : 1,\n-\t\tno_disconnect_req : 1;\n+\t\tno_disconnect_req : 1,\n+\t\tdont_update_private : 1;\n \tchar *export_marks;\n \tchar *import_marks;\n \t/* These go from remote name (as in \"list\") to private name */\n@@ -205,6 +206,8 @@ static struct child_process *get_helper(struct transport *transport)\n \t\t\tstrbuf_addstr(&arg, \"--import-marks=\");\n \t\t\tstrbuf_addstr(&arg, capname + strlen(\"import-marks \"));\n \t\t\tdata->import_marks = strbuf_detach(&arg, NULL);\n+\t\t} else if (!prefixcmp(capname, \"dont-update-private\")) {\n+\t\t\tdata->dont_update_private = 1;\n \t\t} else if (mandatory) {\n \t\t\tdie(\"Unknown mandatory capability %s. This remote \"\n \t\t\t    \"helper probably needs newer version of Git.\",\n@@ -723,7 +726,7 @@ static void push_update_refs_status(struct helper_data *data,\n \t\tif (push_update_ref_status(&buf, &ref, remote_refs))\n \t\t\tcontinue;\n \n-\t\tif (!data->refspecs)\n+\t\tif (!data->refspecs || data->dont_update_private)\n \t\t\tcontinue;\n \n \t\t/* propagate back the update to the remote namespace */\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226238","messageId":"1377802704-30881-3-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1377802704-30881-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 3/4] git-remote-mediawiki: use dont-update-private capability on dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-08-29T18:58:23Z","receivedAt":"2013-08-29T18:58:23Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n\nI prefer not to bother with compatibility of git-remote-mediawiki with\nolder Git versions. The recommanded way is to install Git and\ngit-remote-mediawiki from the same source tree. People who want to\nkeep an old Git version can still use old versions of\ngit-remote-mediawiki.\n\n contrib/mw-to-git/git-remote-mediawiki.perl | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex f8d7d2c..cdc278c 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -590,6 +590,9 @@ sub mw_capabilities {\n \tprint {*STDOUT} \"import\\n\";\n \tprint {*STDOUT} \"list\\n\";\n \tprint {*STDOUT} \"push\\n\";\n+\tif ($dumb_push) {\n+\t\tprint {*STDOUT} \"dont-update-private\\n\";\n+\t}\n \tprint {*STDOUT} \"\\n\";\n \treturn;\n }\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226240","messageId":"1377802704-30881-4-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1377802704-30881-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 4/4] git-remote-mediawiki: no need to update private ref in non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-08-29T18:58:24Z","receivedAt":"2013-08-29T18:58:24Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"We used to update the private ref ourselves, but this update is now done\nby default (since 664059fb62).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n contrib/mw-to-git/git-remote-mediawiki.perl | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex cdc278c..0b920cd 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -1214,7 +1214,6 @@ sub mw_push_revision {\n \t\t}\n \t\tif (!$dumb_push) {\n \t\t\trun_git(qq(notes --ref=${remotename}/mediawiki add -f -m \"mediawiki_revision: ${mw_revision}\" ${sha1_commit}));\n-\t\t\trun_git(qq(update-ref -m \"Git-MediaWiki push\" refs/mediawiki/${remotename}/master ${sha1_commit} ${sha1_child}));\n \t\t}\n \t}\n \n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226242","messageId":"xmqq61uo48ne.fsf@gitster.dls.corp.google.com","threadId":"34684","inReplyTo":"1377802704-30881-3-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 3/4] git-remote-mediawiki: use dont-update-private capability on dumb push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T19:08:37Z","receivedAt":"2013-08-29T19:08:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>\n> I prefer not to bother with compatibility of git-remote-mediawiki with\n> older Git versions. The recommanded way is to install Git and\n> git-remote-mediawiki from the same source tree. People who want to\n> keep an old Git version can still use old versions of\n> git-remote-mediawiki.\n\nI think that is a sane assumption.\n\n>\n>  contrib/mw-to-git/git-remote-mediawiki.perl | 3 +++\n>  1 file changed, 3 insertions(+)\n>\n> diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\n> index f8d7d2c..cdc278c 100755\n> --- a/contrib/mw-to-git/git-remote-mediawiki.perl\n> +++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n> @@ -590,6 +590,9 @@ sub mw_capabilities {\n>  \tprint {*STDOUT} \"import\\n\";\n>  \tprint {*STDOUT} \"list\\n\";\n>  \tprint {*STDOUT} \"push\\n\";\n> +\tif ($dumb_push) {\n> +\t\tprint {*STDOUT} \"dont-update-private\\n\";\n> +\t}\n>  \tprint {*STDOUT} \"\\n\";\n>  \treturn;\n>  }\n"},{"id":"226243","messageId":"xmqq1u5c48lk.fsf@gitster.dls.corp.google.com","threadId":"34684","inReplyTo":"1377802704-30881-4-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 4/4] git-remote-mediawiki: no need to update private ref in non-dumb push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-29T19:09:43Z","receivedAt":"2013-08-29T19:09:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> We used to update the private ref ourselves, but this update is now done\n> by default (since 664059fb62).\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n\nThanks; will queue all four.\n"},{"id":"226245","messageId":"CAMP44s2aV8X8TJigSqiSPB2HkK7hdxC2dFPWf5X62h90Y7M8Jg@mail.gmail.com","threadId":"34684","inReplyTo":"1377802704-30881-2-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 2/4] transport-helper: add dont-update-private capability","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-29T19:14:20Z","receivedAt":"2013-08-29T19:14:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Aug 29, 2013 at 1:58 PM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Since 664059fb62 (Felipe Contreras, Apr 17 2013, transport-helper: update\n> remote helper namespace), a 'push' operation on a remote helper updates\n> the private ref by default. This is often a good thing, but it can also\n> be desirable to disable this update to force the next 'pull' to re-import\n> the pushed revisions.\n>\n> Allow remote-helpers to disable the automatic update by introducing a new\n> capability.\n\nLooks good to me, but how about 'no-private-update'?\n\n-- \nFelipe Contreras\n"},{"id":"226519","messageId":"1378106388-27992-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"CAMP44s2aV8X8TJigSqiSPB2HkK7hdxC2dFPWf5X62h90Y7M8Jg@mail.gmail.com","subject":"[PATCH v2 1/4] git-remote-mediawiki: add test and check Makefile targets","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-09-02T07:19:45Z","receivedAt":"2013-09-02T07:19:45Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"There are a few level 4 and 2 perlcritic issues in the current code. We\nmake level 5 fatal, and keep level 2 as warnings.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n contrib/mw-to-git/Makefile | 10 +++++++++-\n 1 file changed, 9 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile\nindex 76fcd4d..f206f96 100644\n--- a/contrib/mw-to-git/Makefile\n+++ b/contrib/mw-to-git/Makefile\n@@ -24,6 +24,11 @@ INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \\\n \n all: build\n \n+test: all\n+\t$(MAKE) -C t\n+\n+check: perlcritic test\n+\n install_pm:\n \tinstall $(GIT_MEDIAWIKI_PM) $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM)\n \n@@ -41,4 +46,7 @@ clean:\n \trm $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM)\n \n perlcritic:\n-\tperlcritic -2 *.perl\n+\tperlcritic -5 $(SCRIPT_PERL)\n+\t-perlcritic -2 $(SCRIPT_PERL)\n+\n+.PHONY: all test check install_pm install clean perlcritic\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226518","messageId":"1378106388-27992-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1378106388-27992-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 2/4] transport-helper: add no-private-update capability","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-09-02T07:19:46Z","receivedAt":"2013-09-02T07:19:46Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Since 664059fb62 (Felipe Contreras, Apr 17 2013, transport-helper: update\nremote helper namespace), a 'push' operation on a remote helper updates\nthe private ref by default. This is often a good thing, but it can also\nbe desirable to disable this update to force the next 'pull' to re-import\nthe pushed revisions.\n\nAllow remote-helpers to disable the automatic update by introducing a new\ncapability.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nChange since v1: just changed the capability name.\n\n Documentation/gitremote-helpers.txt |  6 ++++++\n git-remote-testgit.sh               |  1 +\n t/t5801-remote-helpers.sh           | 11 +++++++++++\n transport-helper.c                  |  7 +++++--\n 4 files changed, 23 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt\nindex 0827f69..1eacf1e 100644\n--- a/Documentation/gitremote-helpers.txt\n+++ b/Documentation/gitremote-helpers.txt\n@@ -120,6 +120,12 @@ connecting (see the 'connect' command under COMMANDS).\n When choosing between 'push' and 'export', Git prefers 'push'.\n Other frontends may have some other order of preference.\n \n+'no-private-update'::\n+\tWhen using the 'refspec' capability, git normally updates the\n+\tprivate ref on successful push. This update is disabled when\n+\tthe remote-helper declares the capability\n+\t'no-private-update'.\n+\n \n Capabilities for Fetching\n ^^^^^^^^^^^^^^^^^^^^^^^^^\ndiff --git a/git-remote-testgit.sh b/git-remote-testgit.sh\nindex 2109070..6d2f282 100755\n--- a/git-remote-testgit.sh\n+++ b/git-remote-testgit.sh\n@@ -38,6 +38,7 @@ do\n \t\t\techo \"*export-marks $gitmarks\"\n \t\tfi\n \t\ttest -n \"$GIT_REMOTE_TESTGIT_SIGNED_TAGS\" && echo \"signed-tags\"\n+\t\ttest -n \"$GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE\" && echo \"no-private-update\"\n \t\techo\n \t\t;;\n \tlist)\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 8c4c539..613f69a 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -182,6 +182,17 @@ test_expect_success 'push update refs' '\n \t)\n '\n \n+test_expect_success 'push update refs disabled by no-private-update' '\n+\t(cd local &&\n+\techo more-update >>file &&\n+\tgit commit -a -m more-update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >expect &&\n+\tGIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE=t git push origin update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >actual &&\n+\ttest_cmp expect actual\n+\t)\n+'\n+\n test_expect_success 'push update refs failure' '\n \t(cd local &&\n \tgit checkout update &&\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 63cabc3..3328394 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -27,7 +27,8 @@ struct helper_data {\n \t\tpush : 1,\n \t\tconnect : 1,\n \t\tsigned_tags : 1,\n-\t\tno_disconnect_req : 1;\n+\t\tno_disconnect_req : 1,\n+\t\tno_private_update : 1;\n \tchar *export_marks;\n \tchar *import_marks;\n \t/* These go from remote name (as in \"list\") to private name */\n@@ -205,6 +206,8 @@ static struct child_process *get_helper(struct transport *transport)\n \t\t\tstrbuf_addstr(&arg, \"--import-marks=\");\n \t\t\tstrbuf_addstr(&arg, capname + strlen(\"import-marks \"));\n \t\t\tdata->import_marks = strbuf_detach(&arg, NULL);\n+\t\t} else if (!prefixcmp(capname, \"no-private-update\")) {\n+\t\t\tdata->no_private_update = 1;\n \t\t} else if (mandatory) {\n \t\t\tdie(\"Unknown mandatory capability %s. This remote \"\n \t\t\t    \"helper probably needs newer version of Git.\",\n@@ -723,7 +726,7 @@ static void push_update_refs_status(struct helper_data *data,\n \t\tif (push_update_ref_status(&buf, &ref, remote_refs))\n \t\t\tcontinue;\n \n-\t\tif (!data->refspecs)\n+\t\tif (!data->refspecs || data->no_private_update)\n \t\t\tcontinue;\n \n \t\t/* propagate back the update to the remote namespace */\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226521","messageId":"1378106388-27992-3-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1378106388-27992-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 3/4] git-remote-mediawiki: use no-private-update capability on dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-09-02T07:19:47Z","receivedAt":"2013-09-02T07:19:47Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n contrib/mw-to-git/git-remote-mediawiki.perl | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex f8d7d2c..22300a1 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -590,6 +590,9 @@ sub mw_capabilities {\n \tprint {*STDOUT} \"import\\n\";\n \tprint {*STDOUT} \"list\\n\";\n \tprint {*STDOUT} \"push\\n\";\n+\tif ($dumb_push) {\n+\t\tprint {*STDOUT} \"no-private-update\\n\";\n+\t}\n \tprint {*STDOUT} \"\\n\";\n \treturn;\n }\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226520","messageId":"1378106388-27992-4-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1378106388-27992-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 4/4] git-remote-mediawiki: no need to update private ref in non-dumb push","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-09-02T07:19:48Z","receivedAt":"2013-09-02T07:19:48Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"We used to update the private ref ourselves, but this update is now done\nby default (since 664059fb62).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n contrib/mw-to-git/git-remote-mediawiki.perl | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex 22300a1..c9a4805 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -1214,7 +1214,6 @@ sub mw_push_revision {\n \t\t}\n \t\tif (!$dumb_push) {\n \t\t\trun_git(qq(notes --ref=${remotename}/mediawiki add -f -m \"mediawiki_revision: ${mw_revision}\" ${sha1_commit}));\n-\t\t\trun_git(qq(update-ref -m \"Git-MediaWiki push\" refs/mediawiki/${remotename}/master ${sha1_commit} ${sha1_child}));\n \t\t}\n \t}\n \n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226523","messageId":"CAMP44s0rvsEixDz8v2aqAu2UCfXb8qTFAb+1CpwAyhC-6QONYw@mail.gmail.com","threadId":"34684","inReplyTo":"1378106388-27992-2-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2 2/4] transport-helper: add no-private-update capability","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-02T07:28:42Z","receivedAt":"2013-09-02T07:28:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Sep 2, 2013 at 2:19 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> Since 664059fb62 (Felipe Contreras, Apr 17 2013, transport-helper: update\n> remote helper namespace), a 'push' operation on a remote helper updates\n> the private ref by default. This is often a good thing, but it can also\n> be desirable to disable this update to force the next 'pull' to re-import\n> the pushed revisions.\n>\n> Allow remote-helpers to disable the automatic update by introducing a new\n> capability.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n\nAcked-by: Felipe Contreras <felipe.contreras@gmail.com>\n\nOr Reviewed-by, or whatever.\n\n> ---\n> Change since v1: just changed the capability name.\n>\n>  Documentation/gitremote-helpers.txt |  6 ++++++\n>  git-remote-testgit.sh               |  1 +\n>  t/t5801-remote-helpers.sh           | 11 +++++++++++\n>  transport-helper.c                  |  7 +++++--\n>  4 files changed, 23 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt\n> index 0827f69..1eacf1e 100644\n> --- a/Documentation/gitremote-helpers.txt\n> +++ b/Documentation/gitremote-helpers.txt\n> @@ -120,6 +120,12 @@ connecting (see the 'connect' command under COMMANDS).\n>  When choosing between 'push' and 'export', Git prefers 'push'.\n>  Other frontends may have some other order of preference.\n>\n> +'no-private-update'::\n> +       When using the 'refspec' capability, git normally updates the\n> +       private ref on successful push. This update is disabled when\n> +       the remote-helper declares the capability\n> +       'no-private-update'.\n> +\n>\n\nThere's an extra unnecessary space here, no?\n\n-- \nFelipe Contreras\n"},{"id":"226526","messageId":"1378107677-28741-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"CAMP44s0rvsEixDz8v2aqAu2UCfXb8qTFAb+1CpwAyhC-6QONYw@mail.gmail.com","subject":"[PATCH v3 2/4] transport-helper: add dont-update-private capability","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-09-02T07:41:17Z","receivedAt":"2013-09-02T07:41:17Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Since 664059fb62 (Felipe Contreras, Apr 17 2013, transport-helper: update\nremote helper namespace), a 'push' operation on a remote helper updates\nthe private ref by default. This is often a good thing, but it can also\nbe desirable to disable this update to force the next 'pull' to re-import\nthe pushed revisions.\n\nAllow remote-helpers to disable the automatic update by introducing a new\ncapability.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n> There's an extra unnecessary space here, no?\n\nIndeed (the new option is shorter, and I didn't rewrap). It doesn't\nreally matter, but in case, here's an updated version.\n\n Documentation/gitremote-helpers.txt |  5 +++++\n git-remote-testgit.sh               |  1 +\n t/t5801-remote-helpers.sh           | 11 +++++++++++\n transport-helper.c                  |  7 +++++--\n 4 files changed, 22 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt\nindex 0827f69..ee9e134 100644\n--- a/Documentation/gitremote-helpers.txt\n+++ b/Documentation/gitremote-helpers.txt\n@@ -120,6 +120,11 @@ connecting (see the 'connect' command under COMMANDS).\n When choosing between 'push' and 'export', Git prefers 'push'.\n Other frontends may have some other order of preference.\n \n+'no-private-update'::\n+\tWhen using the 'refspec' capability, git normally updates the\n+\tprivate ref on successful push. This update is disabled when\n+\tthe remote-helper declares the capability 'no-private-update'.\n+\n \n Capabilities for Fetching\n ^^^^^^^^^^^^^^^^^^^^^^^^^\ndiff --git a/git-remote-testgit.sh b/git-remote-testgit.sh\nindex 2109070..6d2f282 100755\n--- a/git-remote-testgit.sh\n+++ b/git-remote-testgit.sh\n@@ -38,6 +38,7 @@ do\n \t\t\techo \"*export-marks $gitmarks\"\n \t\tfi\n \t\ttest -n \"$GIT_REMOTE_TESTGIT_SIGNED_TAGS\" && echo \"signed-tags\"\n+\t\ttest -n \"$GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE\" && echo \"no-private-update\"\n \t\techo\n \t\t;;\n \tlist)\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 8c4c539..613f69a 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -182,6 +182,17 @@ test_expect_success 'push update refs' '\n \t)\n '\n \n+test_expect_success 'push update refs disabled by no-private-update' '\n+\t(cd local &&\n+\techo more-update >>file &&\n+\tgit commit -a -m more-update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >expect &&\n+\tGIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE=t git push origin update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >actual &&\n+\ttest_cmp expect actual\n+\t)\n+'\n+\n test_expect_success 'push update refs failure' '\n \t(cd local &&\n \tgit checkout update &&\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 63cabc3..3328394 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -27,7 +27,8 @@ struct helper_data {\n \t\tpush : 1,\n \t\tconnect : 1,\n \t\tsigned_tags : 1,\n-\t\tno_disconnect_req : 1;\n+\t\tno_disconnect_req : 1,\n+\t\tno_private_update : 1;\n \tchar *export_marks;\n \tchar *import_marks;\n \t/* These go from remote name (as in \"list\") to private name */\n@@ -205,6 +206,8 @@ static struct child_process *get_helper(struct transport *transport)\n \t\t\tstrbuf_addstr(&arg, \"--import-marks=\");\n \t\t\tstrbuf_addstr(&arg, capname + strlen(\"import-marks \"));\n \t\t\tdata->import_marks = strbuf_detach(&arg, NULL);\n+\t\t} else if (!prefixcmp(capname, \"no-private-update\")) {\n+\t\t\tdata->no_private_update = 1;\n \t\t} else if (mandatory) {\n \t\t\tdie(\"Unknown mandatory capability %s. This remote \"\n \t\t\t    \"helper probably needs newer version of Git.\",\n@@ -723,7 +726,7 @@ static void push_update_refs_status(struct helper_data *data,\n \t\tif (push_update_ref_status(&buf, &ref, remote_refs))\n \t\t\tcontinue;\n \n-\t\tif (!data->refspecs)\n+\t\tif (!data->refspecs || data->no_private_update)\n \t\t\tcontinue;\n \n \t\t/* propagate back the update to the remote namespace */\n-- \n1.8.4.12.g98a4f55.dirty\n"},{"id":"226627","messageId":"1378223114-12523-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"34684","inReplyTo":"1378107677-28741-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v4 2/4] transport-helper: add no-private-update capability","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2013-09-03T15:45:14Z","receivedAt":"2013-09-03T15:45:14Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Since 664059fb62 (Felipe Contreras, Apr 17 2013, transport-helper: update\nremote helper namespace), a 'push' operation on a remote helper updates\nthe private ref by default. This is often a good thing, but it can also\nbe desirable to disable this update to force the next 'pull' to re-import\nthe pushed revisions.\n\nAllow remote-helpers to disable the automatic update by introducing a new\ncapability.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n\nI feel really stupid for sending so many versions now :-(. v3 was\nfixing a whitespace issue, but forgot to re-apply the change I did\nmanually while sending v2, hence the commit message was wrong\n(dont-update-private -> no-private-update).\n\nNot terribly important, but if it's still time, this one should be\ncorrect.\n\n Documentation/gitremote-helpers.txt |  5 +++++\n git-remote-testgit.sh               |  1 +\n t/t5801-remote-helpers.sh           | 11 +++++++++++\n transport-helper.c                  |  7 +++++--\n 4 files changed, 22 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitremote-helpers.txt b/Documentation/gitremote-helpers.txt\nindex 0827f69..ee9e134 100644\n--- a/Documentation/gitremote-helpers.txt\n+++ b/Documentation/gitremote-helpers.txt\n@@ -120,6 +120,11 @@ connecting (see the 'connect' command under COMMANDS).\n When choosing between 'push' and 'export', Git prefers 'push'.\n Other frontends may have some other order of preference.\n \n+'no-private-update'::\n+\tWhen using the 'refspec' capability, git normally updates the\n+\tprivate ref on successful push. This update is disabled when\n+\tthe remote-helper declares the capability 'no-private-update'.\n+\n \n Capabilities for Fetching\n ^^^^^^^^^^^^^^^^^^^^^^^^^\ndiff --git a/git-remote-testgit.sh b/git-remote-testgit.sh\nindex 2109070..6d2f282 100755\n--- a/git-remote-testgit.sh\n+++ b/git-remote-testgit.sh\n@@ -38,6 +38,7 @@ do\n \t\t\techo \"*export-marks $gitmarks\"\n \t\tfi\n \t\ttest -n \"$GIT_REMOTE_TESTGIT_SIGNED_TAGS\" && echo \"signed-tags\"\n+\t\ttest -n \"$GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE\" && echo \"no-private-update\"\n \t\techo\n \t\t;;\n \tlist)\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 8c4c539..613f69a 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -182,6 +182,17 @@ test_expect_success 'push update refs' '\n \t)\n '\n \n+test_expect_success 'push update refs disabled by no-private-update' '\n+\t(cd local &&\n+\techo more-update >>file &&\n+\tgit commit -a -m more-update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >expect &&\n+\tGIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE=t git push origin update &&\n+\tgit rev-parse --verify testgit/origin/heads/update >actual &&\n+\ttest_cmp expect actual\n+\t)\n+'\n+\n test_expect_success 'push update refs failure' '\n \t(cd local &&\n \tgit checkout update &&\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 63cabc3..3328394 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -27,7 +27,8 @@ struct helper_data {\n \t\tpush : 1,\n \t\tconnect : 1,\n \t\tsigned_tags : 1,\n-\t\tno_disconnect_req : 1;\n+\t\tno_disconnect_req : 1,\n+\t\tno_private_update : 1;\n \tchar *export_marks;\n \tchar *import_marks;\n \t/* These go from remote name (as in \"list\") to private name */\n@@ -205,6 +206,8 @@ static struct child_process *get_helper(struct transport *transport)\n \t\t\tstrbuf_addstr(&arg, \"--import-marks=\");\n \t\t\tstrbuf_addstr(&arg, capname + strlen(\"import-marks \"));\n \t\t\tdata->import_marks = strbuf_detach(&arg, NULL);\n+\t\t} else if (!prefixcmp(capname, \"no-private-update\")) {\n+\t\t\tdata->no_private_update = 1;\n \t\t} else if (mandatory) {\n \t\t\tdie(\"Unknown mandatory capability %s. This remote \"\n \t\t\t    \"helper probably needs newer version of Git.\",\n@@ -723,7 +726,7 @@ static void push_update_refs_status(struct helper_data *data,\n \t\tif (push_update_ref_status(&buf, &ref, remote_refs))\n \t\t\tcontinue;\n \n-\t\tif (!data->refspecs)\n+\t\tif (!data->refspecs || data->no_private_update)\n \t\t\tcontinue;\n \n \t\t/* propagate back the update to the remote namespace */\n-- \n1.8.4.12.g98a4f55.dirty\n"}]}