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

Re: git: "git stash" changes owners and permissions

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 6, 2011, 21:48 UTC
Message-ID
<7voc4jgig7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110406205212.GC1922@elie>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 12 quoted lines
> ...
> As mentioned before, I don't advise using git to deploy changed files.
> It will change them in the wrong order and creates windows when they're
> not present.  Perhaps a procedure like the following can work?
>
> 	cd /root; (umask 077 && mkdir tmp); cd tmp
> 	git clone /etc/interesting-subdir
>...
> 	# deploy.
> 	rsync -a --exclude='.git' /root/tmp/interesting-subdir/ .
> 	git reset jrn/proposed
> 	git diff;	# should show no changes.

How does this "rsync" solve "the wrong order" and "creates windows" problems? It will update the paths in the order rsync happens to discover and there is a wondow between the time the first path is updated and the whole directory gets finally in sync.

If you truly want an atomicity, you can make /etc/interesting-subdir a symbolic link that points to either interesting-subdir-{0,1}, do the above procedure of yours against interesting-subdir-0 (or 1) that is currently not pointed by the symbolic link, and when everything in that one is Ok, atomically switch the symbolic link to point at it.

Previous: Jonathan NiederNext: Jonathan Nieder
Message 2 of 3 in “Re: git: "git stash" changes owners and permissions”
  1. Jonathan NiederApr 6, 2011
  2. Junio C HamanoApr 6, 2011
  3. Jonathan NiederApr 6, 2011

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.