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

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 23, 2007, 16:40 UTC
Message-ID
<Pine.LNX.4.63.0702231737300.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<1172248500.32514.1176151445@webmail.messagingengine.com>
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.

> 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" ?
Yes, that was the idea of the naming.
Show 5 quoted lines
> 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.

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.

Hth, Dscho

Previous: Sam WatkinsNext: Sam Watkins
Message 4 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.