Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)
- From
- Chris Wedgwood <cw@f00f.org>
- Date
- Jul 13, 2005, 04:53 UTC
- Message-ID
- <20050713045338.GA19819@taniwha.stupidest.org>
- In-Reply-To
- <loom.20050712T233332-364@post.gmane.org>
On Tue, Jul 12, 2005 at 09:37:00PM +0000, Junio C Hamano wrote:
Show 7 quoted lines
> > if [ "$newhead" ]; then > > echo "Committed as $newhead." > > - echo $newhead >$_git/HEAD > > + echo_to_file $newhead $_git/HEAD > > [ "$merging" ] && rm $_git/merging $_git/merging-sym $_git/merge-base > > Good intentions, but wouldn't the above clobber symlinked HEAD?
Yeah, but I would argue that is the right thing to do.
Symlink'd trees don't really make sense to me (they seem fragile and somewhat pointless) but perhaps I'm missing something?
> Not a fundamental flaw, though. You need to see if it is a symlink, > readlink it (repeatedly until you get a regular file or dangling > symlink target that does not exist --- immediately after git-init-db > has such a HEAD) and run your echo_to_file on the link target.
I don't see how that's helpful. The idea of echo_to_file is to make the metadata self-contained to the subtree --- so we don't want to have external links (possibly) pointing outside of it.