git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] git-remote-mediawiki: reset private ref after non-dumb push

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Aug 23, 2013, 08:25 UTC
Message-ID
<vpqbo4o3jba.fsf@anie.imag.fr>
In-Reply-To
<CAMP44s3jh4iEbgONaEU0WSCc5YiGYoK8edcgWU6qmUARToVRuw@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 17 quoted lines
> On Wed, Aug 21, 2013 at 4:36 PM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>>> On Tue, Aug 13, 2013 at 8:31 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
>>>
>>>> Felipe: Is this the right fix for git-remote-mediawiki? Any better idea?
>>>
>>> Why not keep track of the revisions yourself? You can have file where
>>> you store which was the last revision that was fetched.
>>
>> I don't really understand the point of the "private namespace" anymore I
>> guess. Why do we have both refs/remotes/$remote and
>> refs/$foreign_vcs/$remote, if they are always kept in sync?
>
> They are not always in sync; if a push fails, the private namespace is
> not updated.
[...]
> As I said, they are not exactly the same. It is possible refs/remotes
> point to a mercurial revision on the remote server, and refs/hg points
> to a mercurial revision on the local internal repository, and they are
> not the same.
This is assuming you follow the scheme
  git -> local repo for other vcs -> remote repo for other vcs

which itself more or less assumes that the other VCS is a decentralized VCS. I understand this is a good idea for hg or bzr remote helpers, but not applicable for git-remote-mediawiki.

I find this very unclear in the doc. How about adding something like this in the "'refspec' <refspec>::" part?

--- a/Documentation/gitremote-helpers.txt
+++ b/Documentation/gitremote-helpers.txt
@@ -176,6 +176,12 @@ applicable refspec takes precedence.  The left-hand of refspecs
 advertised with this capability must cover all refs reported by
 the list command.  If no 'refspec' capability is advertised,
 there is an implied `refspec *:*`.
++
+When writing remote-helpers for decentralized version control
+systems, it is advised to keep a local copy of the repository to
+interact with, and to let the private namespace refs point to this
+local repository, while the refs/remotes namespace is used to track
+the remote repository.
 
 'bidi-import'::
        This modifies the 'import' capability.

So, now, I understand the point of the private namespace in the case of
DVCS, but still note really for interactions with centralized VCS.

Back to my original problem: the point of dumb push is to make sure the
next import will re-import the pushed revisions. if I use something
other than the private namespace to keep track of the last imported,
then I'll need to do a non-fast forward update to the private ref. I
could do that by sending "feature force\n" it the beginning of the
fast-import stream when importing, but that loses one safety feature
(e.g. I detected the breakage thanks to the non-fast forward error
message, while the tests incorrectly pass if I enable "force").
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Felipe ContrerasNext: Felipe Contreras
Message 5 of 28 in “git-remote-mediawiki: reset private ref after non-dumb push”
  1. git-remote-mediawiki: reset private ref after non-dumb pushMatthieu Moy, Aug 13, 2013
  2. Felipe ContrerasAug 21, 2013
  3. Matthieu MoyAug 21, 2013
  4. Felipe ContrerasAug 22, 2013
  5. Matthieu MoyAug 23, 2013
  6. Felipe ContrerasAug 23, 2013
  7. Matthieu MoyAug 24, 2013
  8. Junio C HamanoAug 25, 2013
  9. Matthieu MoyAug 26, 2013
  10. Matthieu MoyAug 26, 2013
  11. Felipe ContrerasAug 26, 2013
  12. Matthieu MoyAug 27, 2013
  13. 1/4 git-remote-mediawiki: add test and check Makefile targetsMatthieu Moy, Aug 29, 2013
  14. 2/4 transport-helper: add dont-update-private capabilityMatthieu Moy, Aug 29, 2013
  15. Felipe ContrerasAug 29, 2013
  16. 1/4 git-remote-mediawiki: add test and check Makefile targetsMatthieu Moy, Sep 2, 2013
  17. 2/4 transport-helper: add no-private-update capabilityMatthieu Moy, Sep 2, 2013
  18. Felipe ContrerasSep 2, 2013
  19. 2/4 transport-helper: add dont-update-private capabilityMatthieu Moy, Sep 2, 2013
  20. 2/4 transport-helper: add no-private-update capabilityMatthieu Moy, Sep 3, 2013
  21. 3/4 git-remote-mediawiki: use no-private-update capability on dumb pushMatthieu Moy, Sep 2, 2013
  22. 4/4 git-remote-mediawiki: no need to update private ref in non-dumb pushMatthieu Moy, Sep 2, 2013
  23. 3/4 git-remote-mediawiki: use dont-update-private capability on dumb pushMatthieu Moy, Aug 29, 2013
  24. Junio C HamanoAug 29, 2013
  25. 4/4 git-remote-mediawiki: no need to update private ref in non-dumb pushMatthieu Moy, Aug 29, 2013
  26. Junio C HamanoAug 29, 2013
  27. Junio C HamanoAug 26, 2013
  28. Matthieu MoyAug 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.