git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sam Watkins" <swatkins@fastmail.fm>
To: "Junio C Hamano" <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: git-push hook to update remote working copy safely
Date: Sat, 24 Feb 2007 03:35:00 +1100	[thread overview]
Message-ID: <1172248500.32514.1176151445@webmail.messagingengine.com> (raw)
In-Reply-To: <7v649t5ebq.fsf@assigned-by-dhcp.cox.net>

On Fri, 23 Feb 2007 03:00:09 -0800, "Junio C Hamano" <junkio@cox.net>
said:
> "Sam Watkins" <swatkins@fastmail.fm> writes:
> 
> > I'm looking for a command that will update the remote working copy after
> > a "git push", without damaging any changes that may have been made to
> > the working copy.
> 
> Define "without damaging".  If there are changes to paths that
> are modified by the pushed commit since the current HEAD, what
> should your "update the remote working copy" procedure would
> do?

hi Junio,

it should merge the changes as if I'd run git-pull on the remote box,
and handle conflicts in the same way.

If possible I want to get exactly the effect of having run on box B
"git-pull A", by running a command like "git-push B" on box A.  I think
maybe that's not possible without commiting all changes to the working
copy on B first, but for our app it's fine to do that it's meant to do
that automatically and frequently anyway.
so I will just do that then run checkout -f from the hook.

I don't understand git very well yet but that will work I think.  I
thought "push" would be symmetrical to "pull" more or less, maybe it is
symmetrical to "fetch" ?

thank-you for your help, I am reading some more of the git manual
because I understand only some of your reply and very little about git
yet!

The app "arcs" we are writing, it is peer to peer, not necessarily using
a central repository, it commits pulls and pushes all changes made to
working copies automatically or when asked to.  currently I'm
implementing push as a remote pull because of this problem, but that
can't connect back through firewalls and suchlike.


Sam

  reply	other threads:[~2007-02-23 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23  8:51 git-push hook to update remote working copy safely Sam Watkins
2007-02-23 11:00 ` Junio C Hamano
2007-02-23 16:35   ` Sam Watkins [this message]
2007-02-23 16:40     ` Johannes Schindelin
2007-02-23 17:04       ` Sam Watkins
2007-02-23 18:13         ` Johannes Schindelin
2007-02-23 18:32       ` 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=1172248500.32514.1176151445@webmail.messagingengine.com \
    --to=swatkins@fastmail.fm \
    --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).