{"thread":{"id":"356","subject":"[PATCH] cg-init shouldn't create master branch when pulling","startedAt":"2005-04-27T21:33:37Z","lastAt":"2005-05-03T20:48:09Z","messageCount":2,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1913","messageId":"1114637617.15385.10.camel@dv","threadId":"356","inReplyTo":null,"subject":"[PATCH] cg-init shouldn't create master branch when pulling","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-04-27T21:33:37Z","receivedAt":"2005-04-27T21:33:37Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\n>From what I see in the current cogito sources, \".git/refs/heads/master\"\nis never used once it's created by cg-init.  I believe the \"master\"\nbranch is only useful when creating a new repository.  Then it's the\nonly branch in the repository.\n\nWhen pulling from a remote repository, the \"origin\" branch is created,\nand it should be default.  There is no need in having a separate\n\"master\" branch unless the user decides to create it for local\ndevelopment.\n\nThis patch changes cg-init so that the \"master\" branch is only created\nwhen the remote URI is not specified.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\nIndex: cg-init\n===================================================================\n--- 8dc4ace046ad3545d48088e604012f95e34e24d3/cg-init  (mode:100755 sha1:d249140002888742c46ecba5925cae7c8025ea93)\n+++ uncommitted/cg-init  (mode:100755)\n@@ -14,17 +14,18 @@\n \n init-db\n mkdir .git/branches .git/refs .git/refs/heads .git/refs/tags\n-touch .git/refs/heads/master\n-ln -s refs/heads/master .git/HEAD\n \n if [ \"$uri\" ]; then\n \techo \"$uri\" >.git/branches/origin\n+\tln -s refs/heads/origin .git/HEAD\n \tcg-pull origin || die \"pull failed\"\n \n-\tcp .git/refs/heads/origin .git/refs/heads/master\n \tread-tree $(tree-id)\n \tcheckout-cache -a\n \tupdate-cache --refresh\n \n \techo \"Cloned (origin $uri available as branch \\\"origin\\\")\"\n+else\n+\ttouch .git/refs/heads/master\n+\tln -s refs/heads/master .git/HEAD\n fi\n\n\n-- \nRegards,\nPavel Roskin\n\n"},{"id":"2520","messageId":"1115153289.28520.17.camel@dv.roinet.com","threadId":"356","inReplyTo":"1114637617.15385.10.camel@dv","subject":"Re: [PATCH] cg-init shouldn't create master branch when pulling","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-05-03T20:48:09Z","receivedAt":"2005-05-03T20:48:09Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nReplying to myself.\n\nOn Wed, 2005-04-27 at 17:33 -0400, Pavel Roskin wrote:\n> Hello!\n> \n> >From what I see in the current cogito sources, \".git/refs/heads/master\"\n> is never used once it's created by cg-init.  I believe the \"master\"\n> branch is only useful when creating a new repository.  Then it's the\n> only branch in the repository.\n> \nPlease ignore this patch for now.  It turn out that the repositories\nwith only \"origin\" branch don't get updated properly by cg-update.\nChanges don't get merged, so cg-cancel need to be run after cg-update.\n\nIt looks like that the \"master\" branch is needed, although it's not\ndocumented anywhere.  Or maybe we need some further changes to support\norigin-only repositories.  In any case, changing cg-init is not\nsufficient.\n\n-- \nRegards,\nPavel Roskin\n\n"}]}