* [EGIT] [PATCH 0/2] Make sure to setup a clone the same as git-clone does
@ 2009-02-21 15:17 ferry.huberts
2009-02-21 15:17 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning ferry.huberts
0 siblings, 1 reply; 7+ messages in thread
From: ferry.huberts @ 2009-02-21 15:17 UTC (permalink / raw)
To: git; +Cc: Ferry Huberts
From: Ferry Huberts <ferry.huberts@pelagic.nl>
Currently the plugin does not setup core.bare=false and also does not setup
the default (pull) remote branch for master, two things that git-clone does
do.
The first ommision is not a problem, but seconds is. When using git-clone
it by default sets up the master to pull from the remote master.
This patch series fixes both issues and makes the plugin setup a cloned
repository exactly the same as git-clone.
Ferry Huberts (2):
Make sure to set core.bare to false when cloning
Make sure to set up the default (pull) remote branch for master
.../org/spearce/egit/core/op/CloneOperation.java | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning
2009-02-21 15:17 [EGIT] [PATCH 0/2] Make sure to setup a clone the same as git-clone does ferry.huberts
@ 2009-02-21 15:17 ` ferry.huberts
2009-02-21 15:17 ` [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master ferry.huberts
2009-02-23 16:07 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning Shawn O. Pearce
0 siblings, 2 replies; 7+ messages in thread
From: ferry.huberts @ 2009-02-21 15:17 UTC (permalink / raw)
To: git; +Cc: Ferry Huberts
From: Ferry Huberts <ferry.huberts@pelagic.nl>
This is to make sure that the git plugin sets up a clone
in the same fashion as the CLI git clone command.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
---
.../org/spearce/egit/core/op/CloneOperation.java | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --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
index 145c50b..f9ff6a3 100644
--- 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
@@ -154,6 +154,9 @@ private void doInit(final IProgressMonitor monitor)
remoteConfig.addFetchRefSpec(wcrs.expandFromSource(ref));
}
+ /* we're setting up for a clone with a checkout */
+ local.getConfig().setBoolean("core", null, "bare", false);
+
remoteConfig.update(local.getConfig());
local.getConfig().save();
}
--
1.6.0.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master
2009-02-21 15:17 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning ferry.huberts
@ 2009-02-21 15:17 ` ferry.huberts
2009-02-23 16:09 ` Shawn O. Pearce
2009-02-23 16:07 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning Shawn O. Pearce
1 sibling, 1 reply; 7+ messages in thread
From: ferry.huberts @ 2009-02-21 15:17 UTC (permalink / raw)
To: git; +Cc: Ferry Huberts
From: Ferry Huberts <ferry.huberts@pelagic.nl>
This is to make sure that the git plugin sets up a clone
in the same fashion as the CLI git clone command.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
---
.../org/spearce/egit/core/op/CloneOperation.java | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --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
index f9ff6a3..ad786cb 100644
--- 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
@@ -32,6 +32,7 @@
import org.spearce.jgit.lib.Ref;
import org.spearce.jgit.lib.RefUpdate;
import org.spearce.jgit.lib.Repository;
+import org.spearce.jgit.lib.RepositoryConfig;
import org.spearce.jgit.lib.Tree;
import org.spearce.jgit.lib.WorkDirCheckout;
import org.spearce.jgit.transport.FetchResult;
@@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)
local.getConfig().setBoolean("core", null, "bare", false);
remoteConfig.update(local.getConfig());
+
+ /* setup the default (pull) remote branch for master */
+ local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "remote", remoteName);
+ local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "merge", Constants.R_HEADS + Constants.MASTER);
+
local.getConfig().save();
}
--
1.6.0.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning
2009-02-21 15:17 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning ferry.huberts
2009-02-21 15:17 ` [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master ferry.huberts
@ 2009-02-23 16:07 ` Shawn O. Pearce
1 sibling, 0 replies; 7+ messages in thread
From: Shawn O. Pearce @ 2009-02-23 16:07 UTC (permalink / raw)
To: ferry.huberts; +Cc: git
ferry.huberts@pelagic.nl wrote:
> From: Ferry Huberts <ferry.huberts@pelagic.nl>
>
> This is to make sure that the git plugin sets up a clone
> in the same fashion as the CLI git clone command.
>
> Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Thanks. "jgit clone" also needed this added. I did that in
a small followup patch.
Really though we need to fix the abstraction of Repository so there's
a notion of a bare repository, and a repository+worktree. And that
abstraction should then set the core.bare property accordingly
when creating a new repository (or new repository+worktree).
Unfortunately that hasn't happened yet...
> + /* we're setting up for a clone with a checkout */
> + local.getConfig().setBoolean("core", null, "bare", false);
> +
--
Shawn.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master
2009-02-21 15:17 ` [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master ferry.huberts
@ 2009-02-23 16:09 ` Shawn O. Pearce
2009-02-23 16:13 ` Ferry Huberts (Pelagic)
0 siblings, 1 reply; 7+ messages in thread
From: Shawn O. Pearce @ 2009-02-23 16:09 UTC (permalink / raw)
To: ferry.huberts; +Cc: git
ferry.huberts@pelagic.nl wrote:
> This is to make sure that the git plugin sets up a clone
> in the same fashion as the CLI git clone command.
...
> @@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)
> local.getConfig().setBoolean("core", null, "bare", false);
>
> remoteConfig.update(local.getConfig());
> +
> + /* setup the default (pull) remote branch for master */
> + local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "remote", remoteName);
> + local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "merge", Constants.R_HEADS + Constants.MASTER);
Shouldn't this be "branch" and not "Constants.MASTER" ?
IIRC the dialog lets you start off a branch that isn't "master",
especially if the remote repository has no branch named "master"
but has something else that HEAD points at. "git clone" would
setup this branch.${branch}.merge to point at what the upstream
branch calls itself.
--
Shawn.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master
2009-02-23 16:09 ` Shawn O. Pearce
@ 2009-02-23 16:13 ` Ferry Huberts (Pelagic)
2009-02-23 16:47 ` Shawn O. Pearce
0 siblings, 1 reply; 7+ messages in thread
From: Ferry Huberts (Pelagic) @ 2009-02-23 16:13 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
Shawn O. Pearce wrote:
> ferry.huberts@pelagic.nl wrote:
>> This is to make sure that the git plugin sets up a clone
>> in the same fashion as the CLI git clone command.
> ...
>> @@ -158,6 +159,11 @@ private void doInit(final IProgressMonitor monitor)
>> local.getConfig().setBoolean("core", null, "bare", false);
>>
>> remoteConfig.update(local.getConfig());
>> +
>> + /* setup the default (pull) remote branch for master */
>> + local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "remote", remoteName);
>> + local.getConfig().setString(RepositoryConfig.BRANCH_SECTION, Constants.MASTER, "merge", Constants.R_HEADS + Constants.MASTER);
>
> Shouldn't this be "branch" and not "Constants.MASTER" ?
>
> IIRC the dialog lets you start off a branch that isn't "master",
> especially if the remote repository has no branch named "master"
> but has something else that HEAD points at. "git clone" would
> setup this branch.${branch}.merge to point at what the upstream
> branch calls itself.
>
yep. missed that. want a new patch? afaic you can patch that up yourself :-)
Ferry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master
2009-02-23 16:13 ` Ferry Huberts (Pelagic)
@ 2009-02-23 16:47 ` Shawn O. Pearce
0 siblings, 0 replies; 7+ messages in thread
From: Shawn O. Pearce @ 2009-02-23 16:47 UTC (permalink / raw)
To: Ferry Huberts (Pelagic); +Cc: git
"Ferry Huberts (Pelagic)" <ferry.huberts@pelagic.nl> wrote:
> Shawn O. Pearce wrote:
> > Shouldn't this be "branch" and not "Constants.MASTER" ?
>
> yep. missed that. want a new patch? afaic you can patch that up yourself :-)
Yes, new patch. Its a large rewrite of what you had otherwise
submitted. Much easier on the maintainers if we don't have to
do such things... plus the attribution is more correct, its you
that did the rewrite, not us. :)
--
Shawn.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-02-23 16:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-21 15:17 [EGIT] [PATCH 0/2] Make sure to setup a clone the same as git-clone does ferry.huberts
2009-02-21 15:17 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning ferry.huberts
2009-02-21 15:17 ` [EGIT] [PATCH 2/2] Make sure to set up the default (pull) remote branch for master ferry.huberts
2009-02-23 16:09 ` Shawn O. Pearce
2009-02-23 16:13 ` Ferry Huberts (Pelagic)
2009-02-23 16:47 ` Shawn O. Pearce
2009-02-23 16:07 ` [EGIT] [PATCH 1/2] Make sure to set core.bare to false when cloning Shawn O. Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).