git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] cg-init shouldn't create master branch when pulling
@ 2005-04-27 21:33 Pavel Roskin
  2005-05-03 20:48 ` Pavel Roskin
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2005-04-27 21:33 UTC (permalink / raw
  To: git

Hello!

>From what I see in the current cogito sources, ".git/refs/heads/master"
is never used once it's created by cg-init.  I believe the "master"
branch is only useful when creating a new repository.  Then it's the
only branch in the repository.

When pulling from a remote repository, the "origin" branch is created,
and it should be default.  There is no need in having a separate
"master" branch unless the user decides to create it for local
development.

This patch changes cg-init so that the "master" branch is only created
when the remote URI is not specified.

Signed-off-by: Pavel Roskin <proski@gnu.org>

Index: cg-init
===================================================================
--- 8dc4ace046ad3545d48088e604012f95e34e24d3/cg-init  (mode:100755 sha1:d249140002888742c46ecba5925cae7c8025ea93)
+++ uncommitted/cg-init  (mode:100755)
@@ -14,17 +14,18 @@
 
 init-db
 mkdir .git/branches .git/refs .git/refs/heads .git/refs/tags
-touch .git/refs/heads/master
-ln -s refs/heads/master .git/HEAD
 
 if [ "$uri" ]; then
 	echo "$uri" >.git/branches/origin
+	ln -s refs/heads/origin .git/HEAD
 	cg-pull origin || die "pull failed"
 
-	cp .git/refs/heads/origin .git/refs/heads/master
 	read-tree $(tree-id)
 	checkout-cache -a
 	update-cache --refresh
 
 	echo "Cloned (origin $uri available as branch \"origin\")"
+else
+	touch .git/refs/heads/master
+	ln -s refs/heads/master .git/HEAD
 fi


-- 
Regards,
Pavel Roskin


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cg-init shouldn't create master branch when pulling
  2005-04-27 21:33 [PATCH] cg-init shouldn't create master branch when pulling Pavel Roskin
@ 2005-05-03 20:48 ` Pavel Roskin
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Roskin @ 2005-05-03 20:48 UTC (permalink / raw
  To: git

Hello!

Replying to myself.

On Wed, 2005-04-27 at 17:33 -0400, Pavel Roskin wrote:
> Hello!
> 
> >From what I see in the current cogito sources, ".git/refs/heads/master"
> is never used once it's created by cg-init.  I believe the "master"
> branch is only useful when creating a new repository.  Then it's the
> only branch in the repository.
> 
Please ignore this patch for now.  It turn out that the repositories
with only "origin" branch don't get updated properly by cg-update.
Changes don't get merged, so cg-cancel need to be run after cg-update.

It looks like that the "master" branch is needed, although it's not
documented anywhere.  Or maybe we need some further changes to support
origin-only repositories.  In any case, changing cg-init is not
sufficient.

-- 
Regards,
Pavel Roskin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-03 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-27 21:33 [PATCH] cg-init shouldn't create master branch when pulling Pavel Roskin
2005-05-03 20:48 ` Pavel Roskin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).