Re: git: "git stash" changes owners and permissions
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 6, 2011, 22:12 UTC
- Message-ID
- <20110406221205.GB2894@elie>
- In-Reply-To
- <7voc4jgig7.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> 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.
All true. It's a little better than "git checkout" because rsync will stage files and then rename them into place rather than leaving a window with files unlinked[1], but it is not much better.
In fact the rsync was a misleading placeholder. What I really meant to convey is that this is not something "git checkout" and "git reset --hard" are designed to do, and that when this much control is needed, it can be easier to update files out-of-band.
Show 5 quoted lines
> 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.True. Though in practice, a little race might be considered ok. :)
Thanks for clarifying. Jonathan
[1] rsync with --files-from can update files in a specific order, which might be appropriate in some cases.