git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-push hook to update remote working copy safely

From
Sam Watkins <swatkins@fastmail.fm>
Date
Feb 23, 2007, 17:04 UTC
Message-ID
<1172250283.5505.1176180417@webmail.messagingengine.com>
In-Reply-To
<Pine.LNX.4.63.0702231737300.22628@wbgn013.biozentrum.uni-wuerzburg.de>

On Fri, 23 Feb 2007 17:40:02 +0100 (CET), "Johannes Schindelin" <Johannes.Schindelin@gmx.de> said:

Show 9 quoted lines
> Hi,
>
> On Sat, 24 Feb 2007, Sam Watkins wrote:
>
> > it should merge the changes as if I'd run git-pull on the remote
> > box, and handle conflicts in the same way.
>
> But that leaves conflicts in the working directory! You _have_ to
> resolve them (or reset) before proceding.
hi Johannes,

I think it's ok for our application if the push+hook leaves conflicts in the working directory, I just want to replicate the effect of running git-pull remotely without actually having to go through ssh contortions to achieve that. It might not be such a good idea to do that in the normal usage of git, but we are using it in not a normal way, and that is what I am trying to do, replicate the effect of running git-pull remotely using git-push plus (unknown attempt-to-merge command or whatever in the hook).

> Don't you have any user interaction? I.e. if the remote working
> directory is only ever changed by your hook, you can use what Junio
> sent. It is even overkill for that purpose.

no, the remote working directory can be edited just like the local working directory. there's user interaction in the form of editing on both ends. otherwise, the committing/syncing process is intended to be non-interactive.

If we were using a central non-editable repository, we could use "checkout -f" in the hook we did try that before.

thanks for your help :)
Sam
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 7 in “git-push hook to update remote working copy safely”
  1. Sam WatkinsFeb 23, 2007
  2. Junio C HamanoFeb 23, 2007
  3. Sam WatkinsFeb 23, 2007
  4. Johannes SchindelinFeb 23, 2007
  5. Sam WatkinsFeb 23, 2007
  6. Johannes SchindelinFeb 23, 2007
  7. Junio C HamanoFeb 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.