{"thread":{"id":"17937","subject":"[EGIT] [PATCH 0/2] Make sure to setup a clone the same as git-clone does","startedAt":"2009-02-21T15:17:46Z","lastAt":"2009-02-23T16:47:33Z","messageCount":7,"participants":["ferry.huberts@pelagic.nl","Shawn O. Pearce","Ferry Huberts (Pelagic)"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"105722","messageId":"cover.1235228532.git.ferry.huberts@pelagic.nl","threadId":"17937","inReplyTo":null,"subject":"[EGIT] [PATCH 0/2] Make sure to setup a clone the same as git-clone does","fromName":"","fromEmail":"ferry.huberts@pelagic.nl","sentAt":"2009-02-21T15:17:46Z","receivedAt":"2009-02-21T15:17:46Z","isPatch":true,"sender":{"key":"ferry.huberts@pelagic.nl","avatar":"https://gravatar.com/avatar/9f63c0289ad23cbdef0f7609a0af85ff0f4b3babfd066de9ff58f62d48cfd6f2?d=mp&s=160"},"body":"From: Ferry Huberts <ferry.huberts@pelagic.nl>\n\nCurrently the plugin does not setup core.bare=false and also does not setup\nthe default (pull) remote branch for master, two things that git-clone does\ndo.\n\nThe first ommision is not a problem, but seconds is. When using git-clone\nit by default sets up the master to pull from the remote master.\n\nThis patch series fixes both issues and makes the plugin setup a cloned\nrepository exactly the same as git-clone.\n\nFerry Huberts (2):\n  Make sure to set core.bare to false when cloning\n  Make sure to set up the default (pull) remote branch for master\n\n .../org/spearce/egit/core/op/CloneOperation.java   |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n"},{"id":"105724","messageId":"80065b1339c7b235b19fa1f5a40a58dca335ae91.1235228532.git.ferry.huberts@pelagic.nl","threadId":"17937","inReplyTo":"cover.1235228532.git.ferry.huberts@pelagic.nl","subject":"[EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning","fromName":"","fromEmail":"ferry.huberts@pelagic.nl","sentAt":"2009-02-21T15:17:47Z","receivedAt":"2009-02-21T15:17:47Z","isPatch":true,"sender":{"key":"ferry.huberts@pelagic.nl","avatar":"https://gravatar.com/avatar/9f63c0289ad23cbdef0f7609a0af85ff0f4b3babfd066de9ff58f62d48cfd6f2?d=mp&s=160"},"body":"From: Ferry Huberts <ferry.huberts@pelagic.nl>\n\nThis is to make sure that the git plugin sets up a clone\nin the same fashion as the CLI git clone command.\n\nSigned-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>\n---\n .../org/spearce/egit/core/op/CloneOperation.java   |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\nindex 145c50b..f9ff6a3 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\n@@ -154,6 +154,9 @@ private void doInit(final IProgressMonitor monitor)\n \t\t\t\t\tremoteConfig.addFetchRefSpec(wcrs.expandFromSource(ref));\n \t\t}\n \n+\t\t/* we're setting up for a clone with a checkout */\n+\t\tlocal.getConfig().setBoolean(\"core\", null, \"bare\", false);\n+\t\t\n \t\tremoteConfig.update(local.getConfig());\n \t\tlocal.getConfig().save();\n \t}\n-- \n1.6.0.6\n"},{"id":"105723","messageId":"e26eb3c2a7a0ce2b96252f00c17a62913d741579.1235228532.git.ferry.huberts@pelagic.nl","threadId":"17937","inReplyTo":"80065b1339c7b235b19fa1f5a40a58dca335ae91.1235228532.git.ferry.huberts@pelagic.nl","subject":"[EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master","fromName":"","fromEmail":"ferry.huberts@pelagic.nl","sentAt":"2009-02-21T15:17:48Z","receivedAt":"2009-02-21T15:17:48Z","isPatch":true,"sender":{"key":"ferry.huberts@pelagic.nl","avatar":"https://gravatar.com/avatar/9f63c0289ad23cbdef0f7609a0af85ff0f4b3babfd066de9ff58f62d48cfd6f2?d=mp&s=160"},"body":"From: Ferry Huberts <ferry.huberts@pelagic.nl>\n\nThis is to make sure that the git plugin sets up a clone\nin the same fashion as the CLI git clone command.\n\nSigned-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>\n---\n .../org/spearce/egit/core/op/CloneOperation.java   |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\nindex f9ff6a3..ad786cb 100644\n--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\n+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/CloneOperation.java\n@@ -32,6 +32,7 @@\n import org.spearce.jgit.lib.Ref;\n import org.spearce.jgit.lib.RefUpdate;\n import org.spearce.jgit.lib.Repository;\n+import org.spearce.jgit.lib.RepositoryConfig;\n import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.WorkDirCheckout;\n import org.spearce.jgit.transport.FetchResult;\n@@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)\n \t\tlocal.getConfig().setBoolean(\"core\", null, \"bare\", false);\n \t\t\n \t\tremoteConfig.update(local.getConfig());\n+\n+\t\t/* setup the default (pull) remote branch for master */\n+\t\tlocal.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, \"remote\", remoteName);\n+\t\tlocal.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, \"merge\", Constants.R_HEADS + Constants.MASTER);\n+\n \t\tlocal.getConfig().save();\n \t}\n \n-- \n1.6.0.6\n"},{"id":"105911","messageId":"20090223160719.GJ22848@spearce.org","threadId":"17937","inReplyTo":"80065b1339c7b235b19fa1f5a40a58dca335ae91.1235228532.git.ferry.huberts@pelagic.nl","subject":"Re: [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-23T16:07:19Z","receivedAt":"2009-02-23T16:07:19Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"ferry.huberts@pelagic.nl wrote:\n> From: Ferry Huberts <ferry.huberts@pelagic.nl>\n> \n> This is to make sure that the git plugin sets up a clone\n> in the same fashion as the CLI git clone command.\n> \n> Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>\n\nThanks.  \"jgit clone\" also needed this added.  I did that in\na small followup patch.\n\nReally though we need to fix the abstraction of Repository so there's\na notion of a bare repository, and a repository+worktree.  And that\nabstraction should then set the core.bare property accordingly\nwhen creating a new repository (or new repository+worktree).\nUnfortunately that hasn't happened yet...\n\n> +\t\t/* we're setting up for a clone with a checkout */\n> +\t\tlocal.getConfig().setBoolean(\"core\", null, \"bare\", false);\n> +\t\t\n\n-- \nShawn.\n"},{"id":"105912","messageId":"20090223160957.GK22848@spearce.org","threadId":"17937","inReplyTo":"e26eb3c2a7a0ce2b96252f00c17a62913d741579.1235228532.git.ferry.huberts@pelagic.nl","subject":"Re: [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-23T16:09:57Z","receivedAt":"2009-02-23T16:09:57Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"ferry.huberts@pelagic.nl wrote:\n> This is to make sure that the git plugin sets up a clone\n> in the same fashion as the CLI git clone command.\n...\n> @@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)\n>  \t\tlocal.getConfig().setBoolean(\"core\", null, \"bare\", false);\n>  \t\t\n>  \t\tremoteConfig.update(local.getConfig());\n> +\n> +\t\t/* setup the default (pull) remote branch for master */\n> +\t\tlocal.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, \"remote\", remoteName);\n> +\t\tlocal.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, \"merge\", Constants.R_HEADS + Constants.MASTER);\n\nShouldn't this be \"branch\" and not \"Constants.MASTER\" ?\n\nIIRC the dialog lets you start off a branch that isn't \"master\",\nespecially if the remote repository has no branch named \"master\"\nbut has something else that HEAD points at.  \"git clone\" would\nsetup this branch.${branch}.merge to point at what the upstream\nbranch calls itself.\n\n-- \nShawn.\n"},{"id":"105918","messageId":"49A2CB47.6050303@pelagic.nl","threadId":"17937","inReplyTo":"20090223160957.GK22848@spearce.org","subject":"Re: [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master","fromName":"Ferry Huberts (Pelagic)","fromEmail":"ferry.huberts@pelagic.nl","sentAt":"2009-02-23T16:13:59Z","receivedAt":"2009-02-23T16:13:59Z","isPatch":true,"sender":{"key":"ferry.huberts@pelagic.nl","avatar":"https://gravatar.com/avatar/9f63c0289ad23cbdef0f7609a0af85ff0f4b3babfd066de9ff58f62d48cfd6f2?d=mp&s=160"},"body":"Shawn O. Pearce wrote:\n> ferry.huberts@pelagic.nl wrote:\n>> This is to make sure that the git plugin sets up a clone\n>> in the same fashion as the CLI git clone command.\n> ...\n>> @@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)\n>>  \t\tlocal.getConfig().setBoolean(\"core\", null, \"bare\", false);\n>>  \t\t\n>>  \t\tremoteConfig.update(local.getConfig());\n>> +\n>> +\t\t/* setup the default (pull) remote branch for master */\n>> +\t\tlocal.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, \"remote\", remoteName);\n>> +\t\tlocal.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, \"merge\", Constants.R_HEADS + Constants.MASTER);\n> \n> Shouldn't this be \"branch\" and not \"Constants.MASTER\" ?\n> \n> IIRC the dialog lets you start off a branch that isn't \"master\",\n> especially if the remote repository has no branch named \"master\"\n> but has something else that HEAD points at.  \"git clone\" would\n> setup this branch.${branch}.merge to point at what the upstream\n> branch calls itself.\n> \nyep. missed that. want a new patch? afaic you can patch that up yourself :-)\n\nFerry\n"},{"id":"105919","messageId":"20090223164733.GN22848@spearce.org","threadId":"17937","inReplyTo":"49A2CB47.6050303@pelagic.nl","subject":"Re: [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-23T16:47:33Z","receivedAt":"2009-02-23T16:47:33Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"\"Ferry Huberts (Pelagic)\" <ferry.huberts@pelagic.nl> wrote:\n> Shawn O. Pearce wrote:\n> > Shouldn't this be \"branch\" and not \"Constants.MASTER\" ?\n> \n> yep. missed that. want a new patch? afaic you can patch that up yourself :-)\n\nYes, new patch.  Its a large rewrite of what you had otherwise\nsubmitted.  Much easier on the maintainers if we don't have to\ndo such things... plus the attribution is more correct, its you\nthat did the rewrite, not us.  :)\n\n-- \nShawn.\n"}]}