git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: keeping remote repo checked out?
Date: Mon, 28 Nov 2005 22:28:04 +0100	[thread overview]
Message-ID: <20051128212804.GV22159@pasky.or.cz> (raw)
In-Reply-To: <7vsltgtvk4.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Mon, Nov 28, 2005 at 08:35:23PM CET, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Both of us are right and talking about the same thing.  You are
> right that as long as hooks/post-update is done correctly the
> one who works on the server should not have to worry.  I am
> right that the hooks/post-update for that setup needs to be done
> very carefully ;-).

Aha, then I misunderstood what you wrote before - sorry. Obviously,
you are right. ;-)

> Here are the things whoever is doing the hooks/post-update for
> this particular setup needs to think about.
> 
>  - is it safe to assume that the guy working on the server
>    working tree never switch branches?  otherwise, what to do if
>    the working tree has different branch checked out when push
>    called post-update?

I wouldn't do anything. Working copy reflects the HEAD; if you don't
update HEAD, you needn't touch the working copy.

>  - should it allow forced-push that sets HEAD to non descendant
>    of the current HEAD?  In a shared repository setup,
>    disallowing forced-push is a good discipline.  OTOH, if this
>    is primarily used as an installation mechanism to a remote
>    hosting site, allowing forced-push may be ok.

I would just leave this on the particular head policy.

>  - should it do 'git-checkout', 'git-reset --hard HEAD', or
>    'git-pull . branch_to_push_into'?  The former two pretty much
>    assumes no development happens on the server repository and
>    git push is used primarily as an installation mechanism.

Files should be removed properly, which pretty much excludes the former
two, I think.

>    The latter is to keep a branch, other than "master" that is
>    always checked out on the server machine, and have people
>    push into a different branch and merge with it automatically
>    when a push happens.  what would you do when a merge conflict
>    happens?

This seems weird and overcomplicated, and it seems to mirror that GIT
does not want to deal with trees containing local modifications - which
is fine, but I don't think you should go over huge hoops in the workflow
to adjust to that. Just verify in the pre-update hook that the tree
contains no local modifications, and disallow the push otherwise. Cogito
can then use own update hooks which will enable it to handle local
changes more gracefully (albeit still not ideally).

> On a tangent, the last point brings up an interesting
> shared-repo usage pattern.  When you have a shared central
> repository like CVS, you could arrange things this way:
..snip..
> I am not sure if people would find this useful, though.

It is certainly quite interesting idea. I'm not sure how useful in
practice is it either, though. ;-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

  reply	other threads:[~2005-11-28 21:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28  7:13 keeping remote repo checked out? James Cloos
2005-11-28  7:48 ` Junio C Hamano
2005-11-28 10:57   ` Petr Baudis
2005-11-28 19:35     ` Junio C Hamano
2005-11-28 21:28       ` Petr Baudis [this message]
2005-11-28 21:46         ` Junio C Hamano
2005-11-28 22:26         ` Linus Torvalds
2005-11-29  0:19           ` Daniel Barkalow
2005-11-29  0:43             ` Linus Torvalds
2005-11-29  2:35               ` Daniel Barkalow
2005-11-29  2:39                 ` Linus Torvalds
2005-11-29  3:40                   ` [PATCH] " Daniel Barkalow
2005-11-29  4:34                     ` Linus Torvalds
2005-11-29  6:02                       ` Daniel Barkalow
2005-11-29  6:38                         ` Junio C Hamano
2005-11-29  6:57                           ` Daniel Barkalow
2005-11-29  7:52                             ` Junio C Hamano
2005-11-29 13:39                               ` Matthias Urlichs
2005-11-29 17:31                                 ` Junio C Hamano
2005-11-29 17:22                               ` Daniel Barkalow
2005-11-29 19:28                                 ` Junio C Hamano
2005-11-29 21:44                                   ` Daniel Barkalow
2005-11-29 12:14                             ` Matthias Urlichs
2005-12-01  1:15   ` James Cloos
2005-12-01  2:43     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051128212804.GV22159@pasky.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).