{"thread":{"id":"43449","subject":"Re: remotes/* for \"foreign\" archives","startedAt":"2006-11-20T17:18:05Z","lastAt":"2006-11-21T20:42:38Z","messageCount":6,"participants":["Seth Falcon","Randal L. Schwartz","Petr Baudis","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"296248","messageId":"86y7q6m3zm.fsf@blue.stonehenge.com","threadId":"43449","inReplyTo":null,"subject":"tracking many cvs/svn/git remote archives","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-11-20T17:18:05Z","receivedAt":"2006-11-20T17:18:05Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":"\nNow that git-cvsimport and git-svn are mature, I'll share my script which I\ncall \"get.cvs\" to track a number of remote archives.  It's not extremely\ngeneral, but maybe it'll inspire someone else to generalize it.\n\nI have ~/MIRROR/foo-GITSVN tracking a remote archive using git-svn, so\nthe name of the directory reflects the tracking mechanism.  There's also\n*-CVS, *-SVN, *-GIT, and *-GITCVS.\n\nFor *-GITCVS, I have to keep the args for git-cvsimport around, so I\nstore that in the respository under getcvs.gitcvsargs.\n\nFor *-GITSVN, I have to force the head/origin to softlink to the proper remote\nsvn reference.\n\nThe *-GIT* merges are safe, because they won't pull over any uncommited\nentries, but they *will* merge into whatever the current branch is.  This\nkeeps any checked out tree trivially up to date, which is mostly what I'm\nwatching anyway.\n\nSetting up *-GIT* generally requires checking out a master branch to really\ntrack the files... I think I did this with \"git-checkout -b master origin\".\n\n#!/bin/sh\n\ncd && cd MIRROR || exit 1\n\ncase $# in\n    0) set -- '*';;\nesac\n\neval set -- \"$@\"\n\ntrap ':' 2\nfor i in \"$@\"\ndo (\n        trap - 2\n        cd $i || exit\n        echo == $i ==\n        case $i in\n            *-CVS) cvs -q update;;\n            *-SVN) svn update;;\n            *-GIT*)\n                ## first, update \"origin\":\n                case $i in\n                    *-GIT)\n                        git-fetch\n                        ;;\n                    *-GITCVS)\n                        git-cvsimport -k -i $(git-repo-config getcvs.gitcvsargs)\n                        ;;\n                    *-GITSVN)\n                        ## be sure to have origin \"ref: refs/remotes/git-svn\"\n                        git-svn multi-fetch\n                        ;;\n                esac\n                if git-status | grep -v 'nothing to commit'\n                then echo UPDATE SKIPPED\n                else\n                    if git-pull . origin | egrep -v 'up-to-date'\n                    then\n                        git log --no-merges ORIG_HEAD.. | git shortlog\n                    fi\n                fi\n                ;;\n            *)\n                echo \"[ignoring]\";;\n        esac\n        )\ndone\n\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\n"},{"id":"294948","messageId":"86r6vwkfti.fsf@blue.stonehenge.com","threadId":"43449","inReplyTo":"86y7q6m3zm.fsf@blue.stonehenge.com","subject":"remotes/* for \"foreign\" archives (was Re: tracking many cvs/svn/git remote archives)","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-11-21T14:57:45Z","receivedAt":"2006-11-21T14:57:45Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Randal\" == Randal L Schwartz <merlyn@stonehenge.com> writes:\n\nRandal>             *-GIT*)\nRandal>                 ## first, update \"origin\":\nRandal>                 case $i in\nRandal>                     *-GIT)\nRandal>                         git-fetch\nRandal>                         ;;\nRandal>                     *-GITCVS)\nRandal>                         git-cvsimport -k -i $(git-repo-config getcvs.gitcvsargs)\nRandal>                         ;;\nRandal>                     *-GITSVN)\nRandal>                         ## be sure to have origin \"ref: refs/remotes/git-svn\"\nRandal>                         git-svn multi-fetch\nRandal>                         ;;\nRandal>                 esac\n\nIt occurred to me after posting this, and while still thinking about the\npresentation I'm writing, that it'd be interesting if \"get-fetch\" could hide\nthis from me.\n\nIf the file in remotes/origin looked something like:\n\n        Pull: !git-svn multi-fetch trunk\n        Push: !git-svn commit\n\nthen git-fetch and git-push could treat \"origin\" as a \"foreign\" branch\nand indirect through these commands.\n\nThen I could just use \"git-pull\" naively, and it would git-fetch origin,\ninvoking git-svn multi-fetch trunk to update it, and later I could\ngit-push and it would use git-svn commit.\n\nThis idea is half baked, but it could definitely hide the various foreign\nadaptors from the invocation line, allowing layered tools to use them\ntransparently.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\n"},{"id":"294841","messageId":"m2y7q4bzo7.fsf@ziti.local","threadId":"43449","inReplyTo":"86r6vwkfti.fsf@blue.stonehenge.com","subject":"Re: remotes/* for \"foreign\" archives","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2006-11-21T15:13:44Z","receivedAt":"2006-11-21T15:13:44Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"merlyn@stonehenge.com (Randal L. Schwartz) writes:\n> It occurred to me after posting this, and while still thinking about the\n> presentation I'm writing, that it'd be interesting if \"get-fetch\" could hide\n> this from me.\n>\n> If the file in remotes/origin looked something like:\n>\n>         Pull: !git-svn multi-fetch trunk\n>         Push: !git-svn commit\n>\n> then git-fetch and git-push could treat \"origin\" as a \"foreign\" branch\n> and indirect through these commands.\n>\n> Then I could just use \"git-pull\" naively, and it would git-fetch origin,\n> invoking git-svn multi-fetch trunk to update it, and later I could\n> git-push and it would use git-svn commit.\n\nThis sort of integration could be quite cool.  But I think the most\ncommon use of git-svn is with rebase and not pull.  My experience\nwith git-svn and pull is that I very quickly ended up making broken\ncommits to svn --- I've had much better luck rebasing.\n\n"},{"id":"298548","messageId":"86lkm4kagy.fsf@blue.stonehenge.com","threadId":"43449","inReplyTo":"m2y7q4bzo7.fsf@ziti.local","subject":"Re: remotes/* for \"foreign\" archives","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-11-21T16:53:17Z","receivedAt":"2006-11-21T16:53:17Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Seth\" == Seth Falcon <sethfalcon@gmail.com> writes:\n\nSeth> This sort of integration could be quite cool.  But I think the most\nSeth> common use of git-svn is with rebase and not pull.  My experience\nSeth> with git-svn and pull is that I very quickly ended up making broken\nSeth> commits to svn --- I've had much better luck rebasing.\n\nWell, you'd still be using \"git-fetch origin\" then, transparently,\nand your push command could do your preferred thing.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\n"},{"id":"296540","messageId":"7v1wnwy4pv.fsf@assigned-by-dhcp.cox.net","threadId":"43449","inReplyTo":"86r6vwkfti.fsf@blue.stonehenge.com","subject":"Re: remotes/* for \"foreign\" archives","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-21T19:33:48Z","receivedAt":"2006-11-21T19:33:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"merlyn@stonehenge.com (Randal L. Schwartz) writes:\n\n> It occurred to me after posting this, and while still thinking about the\n> presentation I'm writing, that it'd be interesting if \"get-fetch\" could hide\n> this from me.\n\nI agree fully, as it was in my earlier \"wishlist\" ;-)\n\nAnybody?\n"},{"id":"295864","messageId":"20061121204238.GI7201@pasky.or.cz","threadId":"43449","inReplyTo":"7v1wnwy4pv.fsf@assigned-by-dhcp.cox.net","subject":"Re: remotes/* for \"foreign\" archives","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-11-21T20:42:38Z","receivedAt":"2006-11-21T20:42:38Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Tue, Nov 21, 2006 at 08:33:48PM CET, Junio C Hamano wrote:\n> merlyn@stonehenge.com (Randal L. Schwartz) writes:\n> \n> > It occurred to me after posting this, and while still thinking about the\n> > presentation I'm writing, that it'd be interesting if \"get-fetch\" could hide\n> > this from me.\n> \n> I agree fully, as it was in my earlier \"wishlist\" ;-)\n> \n> Anybody?\n\nIt's currently right after first stage of remotes support in Cogito in\nmy TODO list (and that's not a vaporware anymore but is actually what\nI'm already working on these days).\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nThe meaning of Stonehenge in Traflamadorian, when viewed from above, is:\n\"Replacement part being rushed with all possible speed.\"\n"}]}