{"thread":{"id":"27497","subject":"Git fast-import : Warning duplicated ref: refs/remotes/origin/master","startedAt":"2011-05-29T16:09:31Z","lastAt":"2011-05-30T23:09:50Z","messageCount":15,"participants":["Jérémie NIKAES","Jonathan Nieder","Daniel Barkalow","Sverre Rabbelier","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"168944","messageId":"BANLkTinTuEppMGO16z2sMkjV8FveCbrwEQ@mail.gmail.com","threadId":"27497","inReplyTo":null,"subject":"Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jérémie NIKAES","fromEmail":"jeremie.nikaes@gmail.com","sentAt":"2011-05-29T16:09:31Z","receivedAt":"2011-05-29T16:09:31Z","isPatch":false,"sender":{"key":"jeremie.nikaes@gmail.com","avatar":null},"body":"Hi,\nI am currently working on the git-mediawiki gateway project.\nThis project uses fast-import to get data from mediawiki. For each\nrevision from mediawiki, we generate a chunk of fast-export stream\nlooking like this :\n\ncommit refs/remotes/origin/master\nmark :<int>\ncommiter <user> <address> <timestamp> +0000\ndata <sizeofcomment>\n<comment>\nM 644 inline <title>.wiki\ndata <sizeoffile>\n<content>\n\nAt the end of a git clone mediawiki::http://ourwikitest, everything\nlooks perfectly fine, including the git log, but a \"Warning duplicated\nref: refs/remotes/origin/master\" is thrown. And indeed, it is\nduplicated in .git/packedrefs\n\nA git gc solves everything, but I wondered if there was a way to fix\nthis or if this was a known bug.\n\nThank you,\nRegards,\n\n--\nJérémie Nikaes\n"},{"id":"168959","messageId":"20110529232405.GA8369@elie","threadId":"27497","inReplyTo":"BANLkTinTuEppMGO16z2sMkjV8FveCbrwEQ@mail.gmail.com","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-05-29T23:24:05Z","receivedAt":"2011-05-29T23:24:05Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Jérémie,\n\nJérémie NIKAES wrote:\n\n> At the end of a git clone mediawiki::http://ourwikitest, everything\n> looks perfectly fine\n\nI just wanted to say, thank you for working on this[1].\n\nThis code answers some questions I had about the remote helper\nprotocol, among other things.\n\n> a \"Warning duplicated\n> ref: refs/remotes/origin/master\" is thrown.\n\nTo end the suspense: I assume this was fixed by 9055039c (Bug fix for\npulls with multiple revisions pulled, 2011-05-29).\n\nCheers,\nJonathan\n\n[1] git://github.com/Bibzball/Git-Mediawiki.git\n"},{"id":"168999","messageId":"BANLkTinhH7ksP8EZV+Sd4ryCT1_bhVhgaw@mail.gmail.com","threadId":"27497","inReplyTo":"20110529232405.GA8369@elie","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jérémie NIKAES","fromEmail":"jeremie.nikaes@gmail.com","sentAt":"2011-05-30T14:44:08Z","receivedAt":"2011-05-30T14:44:08Z","isPatch":false,"sender":{"key":"jeremie.nikaes@gmail.com","avatar":null},"body":"Jonathan,\n\n> I just wanted to say, thank you for working on this[1].\n>\n> This code answers some questions I had about the remote helper\n> protocol, among other things.\n\nGlad we can help !\n\n>\n>> a \"Warning duplicated\n>> ref: refs/remotes/origin/master\" is thrown.\n>\n> To end the suspense: I assume this was fixed by 9055039c (Bug fix for\n> pulls with multiple revisions pulled, 2011-05-29).\n\nNo, I actually still have the problem. The version commited on github\nis pulling revisions straight to refs/heads/master which is gross\nAfter discussing this matter with our teacher Matthieu Moy, I wanted\nto change this to refs/remotes/origin/master but then this warning\ngets thrown.\n\nDoes anyone have an idea ?\n\nThanks,\nCheers,\n-- \nJérémie Nikaes\n"},{"id":"169001","messageId":"20110530145203.GA10879@elie","threadId":"27497","inReplyTo":"BANLkTinhH7ksP8EZV+Sd4ryCT1_bhVhgaw@mail.gmail.com","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-05-30T14:52:04Z","receivedAt":"2011-05-30T14:52:04Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jérémie NIKAES wrote:\n>> Jérémie NIKAES wrote:\n\n>>> a \"Warning duplicated\n>>> ref: refs/remotes/origin/master\" is thrown.\n[...]\n> No, I actually still have the problem. The version commited on github\n> is pulling revisions straight to refs/heads/master which is gross\n> After discussing this matter with our teacher Matthieu Moy, I wanted\n> to change this to refs/remotes/origin/master but then this warning\n> gets thrown.\n\nCould you push a branch exhibiting the problem?  The reason I ask\nis that searching with\n\n\tgit grep -F -e 'duplicated ref' origin/master\n\nin git.git yields no hits for me, so I wanted to reproduce this to get\nthe exact error message or figure out which program is printing it.\n\nThanks.\n"},{"id":"169003","messageId":"BANLkTinRscvPLHbob55pxhXSTKqm+eSF6g@mail.gmail.com","threadId":"27497","inReplyTo":"20110530145203.GA10879@elie","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jérémie NIKAES","fromEmail":"jeremie.nikaes@gmail.com","sentAt":"2011-05-30T15:07:26Z","receivedAt":"2011-05-30T15:07:26Z","isPatch":false,"sender":{"key":"jeremie.nikaes@gmail.com","avatar":null},"body":">\n> Could you push a branch exhibiting the problem?  The reason I ask\n> is that searching with\n>\n>        git grep -F -e 'duplicated ref' origin/master\n>\n> in git.git yields no hits for me, so I wanted to reproduce this to get\n> the exact error message or figure out which program is printing it.\n>\n> Thanks.\n>\n\nOk I just committed my changes to the master branch, feel free to pull\nand try it out.\n\nThanks for your help\n-- \nJérémie Nikaes\n"},{"id":"169005","messageId":"20110530155256.GC10879@elie","threadId":"27497","inReplyTo":"BANLkTinRscvPLHbob55pxhXSTKqm+eSF6g@mail.gmail.com","subject":"[PATCH] Documentation: do not misinterpret refspecs as bold text (Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-05-30T15:52:56Z","receivedAt":"2011-05-30T15:52:56Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jérémie NIKAES wrote:\n\n> Ok I just committed my changes to the master branch, feel free to pull\n> and try it out.\n\nNice.  Now I get\n\n| $ git fetch --all\n[...]\n| Fetching & writing export data...\n| 1/2: Revision n°7 of New_page\n| 2/2: Revision n°8 of New_page\n| \n| error: Ref refs/remotes/origin/master is at d94a46270250454f1fc6c1fb47abfde31a2196c9 but expected dfb79bbc658333d5c9b0427b71f6b1bc48629949\n| From mediawiki::http://localhost/mediawiki\n|  ! dfb79bb...c57c15b master     -> origin/master  (unable to update local ref)\n| error: Could not fetch origin\n\nwhich means that the transport machinery thought the helper was going\nto be fetching directly to \"master\".  I suspect you will want a\n'refspec' capability like\n\n\trefspec refs/heads/*:refs/mediawiki/${remotename}/*\n\nto fix this.\n\nCc-ing Daniel who invented v1.7.0-rc0~62^2~19 (Allow helper to map\nprivate ref names into normal names, 2009-11-18).  What namespace\nshould a helper use when asked to fetch to FETCH_HEAD without a remote\nname, like\n\n\tgit fetch mediawiki::testwiki\n\n?\n\n-- >8 --\nSubject: Documentation: do not misinterpret refspecs as bold text\n\nIn v1.7.3.3~2 (Documentation: do not misinterpret pull refspec as bold\ntext, 2010-12-03) many uses of asterisks in expressions like\n\"refs/heads/*:refs/svn/origin/branches/*\" were escaped as {asterisk}\nto avoid being treated as delimiters for bold text, but these two were\nmissed.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-remote-helpers.txt |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-remote-helpers.txt b/Documentation/git-remote-helpers.txt\nindex 87cd11f..58f6ad4 100644\n--- a/Documentation/git-remote-helpers.txt\n+++ b/Documentation/git-remote-helpers.txt\n@@ -181,11 +181,11 @@ CAPABILITIES\n \tWhen using the import command, expect the source ref to have\n \tbeen written to the destination ref. The earliest applicable\n \trefspec takes precedence. For example\n-\t\"refs/heads/*:refs/svn/origin/branches/*\" means that, after an\n-\t\"import refs/heads/name\", the script has written to\n+\t\"refs/heads/{asterisk}:refs/svn/origin/branches/{asterisk}\" means\n+\tthat, after an \"import refs/heads/name\", the script has written to\n \trefs/svn/origin/branches/name. If this capability is used at\n \tall, it must cover all refs reported by the list command; if\n-\tit is not used, it is effectively \"*:*\"\n+\tit is not used, it is effectively \"{asterisk}:{asterisk}\"\n \n REF LIST ATTRIBUTES\n -------------------\n-- \n1.7.5.3\n"},{"id":"169011","messageId":"20110530164013.GG10879@elie","threadId":"27497","inReplyTo":"20110530155256.GC10879@elie","subject":"remote helpers: best practices for using the \"refspec\" capability","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-05-30T16:40:13Z","receivedAt":"2011-05-30T16:40:13Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jonathan Nieder wrote:\n\n> | error: Ref refs/remotes/origin/master is at d94a46270250454f1fc6c1fb47abfde31a2196c9 but expected dfb79bbc658333d5c9b0427b71f6b1bc48629949\n> | From mediawiki::http://localhost/mediawiki\n> |  ! dfb79bb...c57c15b master     -> origin/master  (unable to update local ref)\n> | error: Could not fetch origin\n>\n> which means that the transport machinery thought the helper was going\n> to be fetching directly to \"master\".  I suspect you will want a\n> 'refspec' capability like\n>\n>\trefspec refs/heads/*:refs/mediawiki/${remotename}/*\n>\n> to fix this.\n>\n> Cc-ing Daniel who invented v1.7.0-rc0~62^2~19 (Allow helper to map\n> private ref names into normal names, 2009-11-18).  What namespace\n> should a helper use when asked to fetch to FETCH_HEAD without a remote\n> name, like\n>\n>\tgit fetch mediawiki::testwiki\n>\n> ?\n\nActually cc-ing this time.  Sorry for the noise.\n"},{"id":"169012","messageId":"20110530173517.GA13539@elie","threadId":"27497","inReplyTo":"BANLkTinhH7ksP8EZV+Sd4ryCT1_bhVhgaw@mail.gmail.com","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-05-30T17:35:17Z","receivedAt":"2011-05-30T17:35:17Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jérémie NIKAES wrote:\n\n> No, I actually still have the problem. The version commited on github\n> is pulling revisions straight to refs/heads/master which is gross\n> After discussing this matter with our teacher Matthieu Moy, I wanted\n> to change this to refs/remotes/origin/master but then this warning\n> gets thrown.\n\nThe following fixes it for me.\n\n-- >8 --\nSubject: use refs/mediawiki/<remote> namespace for private refs\n\nUnless the \"refspec\" capability is used, the remote helper machinery\nexpects remote helpers to write remote refs/heads/master ref to\nrefs/heads/master.  That's not very good since it scribbles on top of\nwhatever local changes the user might have.\n\nSo specify a refspec that puts the refs elsewhere.  For now this\nonly works when fetching from a named remote, like so:\n\n\tgit remote add origin mediawiki::testwiki\n\tgit fetch origin\n\nAttempting to fetch directly from a URL with a command like\n\"git fetch mediawiki::testwiki\" produces an \"Invalid refspec\"\nerror.\n---\n git-remote-mediawiki |   10 ++++++----\n 1 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/git-remote-mediawiki b/git-remote-mediawiki\nindex af66b58..7a3fdd3 100755\n--- a/git-remote-mediawiki\n+++ b/git-remote-mediawiki\n@@ -7,6 +7,7 @@ use Storable qw(freeze thaw);\n use DateTime::Format::ISO8601;\n use Encode qw(encode_utf8);\n \n+my $remotename = $ARGV[0];\n my $url = $ARGV[1];\n \n print STDERR \"$url\\n\";\n@@ -62,6 +63,7 @@ while ($loop) {\n \n sub mw_capabilities {\n #\tprint STDOUT \"fetch\\n\";\n+\tprint STDOUT \"refspec refs/heads/*:refs/mediawiki/$remotename/*\\n\";\n \tprint STDOUT \"import\\n\";\n \tprint STDOUT \"list\\n\";\n \tprint STDOUT \"option\\n\";\n@@ -91,7 +93,7 @@ sub mw_import {\n \t\n \tsub get_last_revision {\n \t\t# Get last commit sha1\n-\t\tmy $commit_sha1 = `git rev-parse refs/remotes/origin/master 2>/dev/null`;\n+\t\tmy $commit_sha1 = `git rev-parse refs/mediawiki/$remotename/master 2>/dev/null`;\n \n \t\t# Get note regarding that commit\n \t\tchomp($commit_sha1);\n@@ -202,15 +204,15 @@ sub mw_import {\n \t\t\n \t\t# If it's a clone and the first revision, initalize this ref\n \t\tif ($fetch_from == 1 && $n == 1) {\n-\t\t\t#print \"reset refs/remotes/origin/master\\n\";\n+\t\t\t#print \"reset refs/mediawiki/$remotename/master\\n\";\n \t\t}\n-\t\tprint \"commit refs/remotes/origin/master\\n\";\n+\t\tprint \"commit refs/mediawiki/$remotename/master\\n\";\n \t\tprint \"mark :$n\\n\";\n \t\tprint \"committer $user <$user\\@$wiki_name> \", $dt->epoch, \" +0000\\n\";\n \t\tprint \"data \", bytes::length(encode_utf8($comment)), \"\\n\", encode_utf8($comment);\n \t\t# If it's not a clone, needs to know where to start from\n \t\tif ($fetch_from != 1 && $n == 1) {\n-\t\t\tprint \"from refs/remotes/origin/master^0\\n\";\n+\t\t\tprint \"from refs/mediawiki/$remotename/master^0\\n\";\n \t\t}\n \t\tprint \"M 644 inline $title.wiki\\n\";\n \t\tprint \"data \", bytes::length(encode_utf8($content)), \"\\n\", encode_utf8($content);\n-- \n1.7.5.3\n"},{"id":"169013","messageId":"alpine.LNX.2.00.1105301300520.2233@iabervon.org","threadId":"27497","inReplyTo":"20110530164013.GG10879@elie","subject":"Re: remote helpers: best practices for using the \"refspec\" capability","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2011-05-30T17:43:02Z","receivedAt":"2011-05-30T17:43:02Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 30 May 2011, Jonathan Nieder wrote:\n\n> Jonathan Nieder wrote:\n> \n> > | error: Ref refs/remotes/origin/master is at d94a46270250454f1fc6c1fb47abfde31a2196c9 but expected dfb79bbc658333d5c9b0427b71f6b1bc48629949\n> > | From mediawiki::http://localhost/mediawiki\n> > |  ! dfb79bb...c57c15b master     -> origin/master  (unable to update local ref)\n> > | error: Could not fetch origin\n> >\n> > which means that the transport machinery thought the helper was going\n> > to be fetching directly to \"master\".  I suspect you will want a\n> > 'refspec' capability like\n> >\n> >\trefspec refs/heads/*:refs/mediawiki/${remotename}/*\n> >\n> > to fix this.\n> >\n> > Cc-ing Daniel who invented v1.7.0-rc0~62^2~19 (Allow helper to map\n> > private ref names into normal names, 2009-11-18).  What namespace\n> > should a helper use when asked to fetch to FETCH_HEAD without a remote\n> > name, like\n> >\n> >\tgit fetch mediawiki::testwiki\n> >\n> > ?\n\nThe main purpose of having the private ref names is to support incremental \nimports, where you obviously need to identify the sha1 of the last thing \nyou imported, and you may have included sufficient machine-readable \ninformation in your imported commit messages to know what the foreign \nstate was that generated that sha1. (And you need a namespace because you \nmay have multiple refs that you imported.) I'm not sure that it makes much \nsense to do incremental imports without a remote name, since that's \ngenerally an operation you're not planning do repeatedly.\n\nBut the purpose of the namespacing is to be able to continue the correct \nincremental import, so it would make sense to do some arbitrary \ntransformation to make your url be a valid ref directory, and use that.\n\nIt would make sense to add support for a namespace where fast-import can \nwrite whatever it wants, and it'll get discarded after the fetch is done, \nif it's the case that anyone can stand not having incremental imports.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"169015","messageId":"BANLkTimoQtZLw4NhenR9QbAt6EhSThWj2A@mail.gmail.com","threadId":"27497","inReplyTo":"alpine.LNX.2.00.1105301300520.2233@iabervon.org","subject":"Re: remote helpers: best practices for using the \"refspec\" capability","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-05-30T18:04:26Z","receivedAt":"2011-05-30T18:04:26Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, May 30, 2011 at 12:43, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> But the purpose of the namespacing is to be able to continue the correct\n> incremental import, so it would make sense to do some arbitrary\n> transformation to make your url be a valid ref directory, and use that.\n>\n> It would make sense to add support for a namespace where fast-import can\n> write whatever it wants, and it'll get discarded after the fetch is done,\n> if it's the case that anyone can stand not having incremental imports.\n\nI remember a patch series by someone else a lot more that _disabled_\ncreating of refs during fast-import, and instead allowed for\nspecifying what refs to update with which values at the end of the\nimport.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"169020","messageId":"vpqzkm4gef2.fsf@bauges.imag.fr","threadId":"27497","inReplyTo":"20110530173517.GA13539@elie","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-05-30T19:46:09Z","receivedAt":"2011-05-30T19:46:09Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Jérémie NIKAES wrote:\n>\n>> No, I actually still have the problem. The version commited on github\n>> is pulling revisions straight to refs/heads/master which is gross\n>> After discussing this matter with our teacher Matthieu Moy, I wanted\n>> to change this to refs/remotes/origin/master but then this warning\n>> gets thrown.\n>\n> The following fixes it for me.\n\nIt seems it does, thanks!\n\nclone does not give the warning anymore, and incremental pull work.\n\n>  sub mw_capabilities {\n>  #\tprint STDOUT \"fetch\\n\";\n> +\tprint STDOUT \"refspec refs/heads/*:refs/mediawiki/$remotename/*\\n\";\n\nIs this \"mediawiki\" comming from the URL (mediawiki::...), or is it just\na convention you've set?\n\nWe've tried with refspec refs/heads/*:refs/remotes/origin/*, but without\nsuccess.\n\nDo I understand correctly that the \"pull\" is done in 3 stages:\n\n1) import into refs/mediawiki/origin\n\n2) fetch the imported ref into refs/remotes/origin\n\n3) and merge as usual into the current branch\n\n?\n\nIf so, I don't understand why the distinction between 1) and 2) is\nnecessary, and why not to fetch directly into refs/remotes/origin/. IOW,\nin which case is refs/remotes/origin/master different from\nrefs/mediawiki/origin/master for example?\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"169021","messageId":"BANLkTi=t-TpbsWP2mhkDnRgMw8p2jJC=nw@mail.gmail.com","threadId":"27497","inReplyTo":"vpqzkm4gef2.fsf@bauges.imag.fr","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jérémie NIKAES","fromEmail":"jeremie.nikaes@gmail.com","sentAt":"2011-05-30T19:55:35Z","receivedAt":"2011-05-30T19:55:35Z","isPatch":false,"sender":{"key":"jeremie.nikaes@gmail.com","avatar":null},"body":"2011/5/30 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n>\n>> Jérémie NIKAES wrote:\n>>\n>>> No, I actually still have the problem. The version commited on github\n>>> is pulling revisions straight to refs/heads/master which is gross\n>>> After discussing this matter with our teacher Matthieu Moy, I wanted\n>>> to change this to refs/remotes/origin/master but then this warning\n>>> gets thrown.\n>>\n>> The following fixes it for me.\n>\n> It seems it does, thanks!\n>\n> clone does not give the warning anymore, and incremental pull work.\n>\n\nYes ! It definitely does ! Works like a charm.\n\n>>  sub mw_capabilities {\n>>  #    print STDOUT \"fetch\\n\";\n>> +     print STDOUT \"refspec refs/heads/*:refs/mediawiki/$remotename/*\\n\";\n>\n> Is this \"mediawiki\" comming from the URL (mediawiki::...), or is it just\n> a convention you've set?\n>\n> We've tried with refspec refs/heads/*:refs/remotes/origin/*, but without\n> success.\n>\n> Do I understand correctly that the \"pull\" is done in 3 stages:\n>\n> 1) import into refs/mediawiki/origin\n>\n> 2) fetch the imported ref into refs/remotes/origin\n>\n> 3) and merge as usual into the current branch\n>\n> ?\n>\n> If so, I don't understand why the distinction between 1) and 2) is\n> necessary, and why not to fetch directly into refs/remotes/origin/. IOW,\n> in which case is refs/remotes/origin/master different from\n> refs/mediawiki/origin/master for example?\n>\n> Thanks,\n\nWe just committed this change to our master branch on github. We\nactually have the same questions as Matthieu. We don't really\nunderstand why we have to use another ref to make it work.\n\nHuge thanks to you,\n\n-- \nJérémie Nikaes\n"},{"id":"169023","messageId":"20110530201351.GB14427@elie","threadId":"27497","inReplyTo":"vpqzkm4gef2.fsf@bauges.imag.fr","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-05-30T20:13:51Z","receivedAt":"2011-05-30T20:13:51Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nMatthieu Moy wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>>  sub mw_capabilities {\n>>  #\tprint STDOUT \"fetch\\n\";\n>> +\tprint STDOUT \"refspec refs/heads/*:refs/mediawiki/$remotename/*\\n\";\n>\n> Is this \"mediawiki\" comming from the URL (mediawiki::...), or is it just\n> a convention you've set?\n>\n> We've tried with refspec refs/heads/*:refs/remotes/origin/*, but without\n> success.\n\nYes, I stole the convention for the namespace name from the commit message\nto v1.7.0-rc0~62^2~19 (Allow helper to map private ref names into\nnormal names, 2009-11-18).\n\n> Do I understand correctly that the \"pull\" is done in 3 stages:\n>\n> 1) import into refs/mediawiki/origin\n>\n> 2) fetch the imported ref into refs/remotes/origin\n>\n> 3) and merge as usual into the current branch\n>\n> ?\n>\n> If so, I don't understand why the distinction between 1) and 2) is\n> necessary, and why not to fetch directly into refs/remotes/origin/. IOW,\n> in which case is refs/remotes/origin/master different from\n> refs/mediawiki/origin/master for example?\n\nThat's a good question.  One answer is that fetching to elsewhere\nallows the transport machinery to take care of rejecting non-fast-forward\nfetches and pretty-printing the ref update information:\n\n From mediawiki::http://localhost/mediawiki\n    479ee21..accd2c1  master     -> origin/master\n\nI think in the long term, importing to no ref at all as Sverre\nsuggested and teaching the transport-helper to do the ref update would\nmake more sense.\n\nRegards,\nJonathan\n"},{"id":"169027","messageId":"BANLkTi=+v0Jt2+xgxy=qV+BT7pOUMpoMtw@mail.gmail.com","threadId":"27497","inReplyTo":"20110530201351.GB14427@elie","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Jérémie NIKAES","fromEmail":"jeremie.nikaes@gmail.com","sentAt":"2011-05-30T20:32:21Z","receivedAt":"2011-05-30T20:32:21Z","isPatch":false,"sender":{"key":"jeremie.nikaes@gmail.com","avatar":null},"body":"> Matthieu Moy wrote:\n>> Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> If so, I don't understand why the distinction between 1) and 2) is\n>> necessary, and why not to fetch directly into refs/remotes/origin/. IOW,\n>> in which case is refs/remotes/origin/master different from\n>> refs/mediawiki/origin/master for example?\n>\n> That's a good question.  One answer is that fetching to elsewhere\n> allows the transport machinery to take care of rejecting non-fast-forward\n> fetches and pretty-printing the ref update information:\n>\n>  From mediawiki::http://localhost/mediawiki\n>    479ee21..accd2c1  master     -> origin/master\n>\n> I think in the long term, importing to no ref at all as Sverre\n> suggested and teaching the transport-helper to do the ref update would\n> make more sense.\n\nWell yes that would indeed make more sense. It feels weird to have to\ndo it like this.\nAnyways, thanks a lot again for your help, a rfc patch should come\nrelatively quickly with the project in its current state.\n\nRegards,\n-- \nJérémie Nikaes\n"},{"id":"169036","messageId":"BANLkTikxZfgQ18L2qHMBMTCnJG=hAXUikg@mail.gmail.com","threadId":"27497","inReplyTo":"BANLkTi=+v0Jt2+xgxy=qV+BT7pOUMpoMtw@mail.gmail.com","subject":"Re: Git fast-import : Warning duplicated ref: refs/remotes/origin/master","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-05-30T23:09:50Z","receivedAt":"2011-05-30T23:09:50Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, May 30, 2011 at 15:32, Jérémie NIKAES <jeremie.nikaes@gmail.com> wrote:\n> Well yes that would indeed make more sense. It feels weird to have to\n> do it like this.\n\nThe patch series I was referring to can be found at [0].\n\n[0] http://thread.gmane.org/gmane.comp.version-control.git/157860/focus=157864\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}