git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Josh Triplett <josh@freedesktop.org>
Cc: Jamey Sharp <jamey@minilop.net>, Jan Hudec <bulb@ucw.cz>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	"Stephen R. van den Berg" <srb@cuci.nl>,
	david@lang.hm, Scott Chacon <schacon@gmail.com>,
	git@vger.kernel.org
Subject: Re: [RFC] Plumbing-only support for storing object metadata
Date: Sat, 16 Aug 2008 02:55:51 -0700	[thread overview]
Message-ID: <7vd4k9e120.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 20080816062130.GA4554@oh.minilop.net

Josh Triplett <josh@freedesktop.org>, Jamey Sharp <jamey@minilop.net>
writes:

> This hook would need to provide a way to process these updates before
> the blob or tree contents get put into place.  For example, if you check
> out /etc/shadow, you need to apply the non-world-readable permissions
> *before* you write out the contents.

I think such atomicity or "checkout race problem" is irrelevant.

I'd like to make a comment on this point, even though at the moment
(especially before the real release), I am not very interested in where
this "proposal" is going.

You mention that you would resolve attribute conflicts just the same way
you would resolve contents conflicts, which in turn means that you would
check out a half-merged state with conflict markers to the working tree,
fix up the filesystem entity (both contents and presumably its attributes
like perm bits, ownership, xa and whatnot), and mark the path resolved.
Even without talking about attributes conflicts, what's your position on
the time-window during which the contents of /etc/shadow and /etc/password
have conflict markers in them?

Luckily, the markers do not have sufficient number of colons, and that
would protect your system from attempts to break into it with a phoney
username '=======' with an empty password ;-), but I think you get the
idea.  Anything that has to be in some consistent state that cannot see
conflicted state in the middle should not be merged in-place [*1*], [*2*].

So please simplify your requirements and at least drop atomicity argument.

I am _not_ fundamentally opposed to somebody who wants to use git or any
other SCM as a cooler representation of snapshots than a sequence of
tarballs.  I however would be unhappy if your design and implementation
becomes more complicated than otherwise only because you try to deal with
the atomicity issue.  IOW, if your solution would become much simpler once
you pare down the atomicity requirement, then I'd reject the more complex
variant with atomicity in any second, even though I might still find the
simpler variant that does not care about atomicity worth considering.


[Footnotes]

*1* That is why people often frown upon "using SCM to track changes of a
live system in-place", and suggest tracking source material in SCM, and
build material to deploy from the source and install into the final
destination (not limited to /etc but more often so for e.g. web server
assets) as a better practice.

*2* Also you should realize your "/etc/shadow must be non-world-readable
from the beginning" is a very application specific wish.  What if the
attribute you are trying to enforce is "this path must always be
world-readable"?  Are you going to limit this "attribute enhancements" to
what you can specify at creat(2) time only?  How would you handle "this
path must be owned by user 'www-data' (assuming root drives git)", which
would be done by creat(2) followed by chown(2)?

  parent reply	other threads:[~2008-08-16  9:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-09 21:07 [RFC] Plumbing-only support for storing object metadata Jamey Sharp, Josh Triplett
2008-08-09 21:49 ` Scott Chacon
2008-08-10  3:51   ` Shawn O. Pearce
2008-08-10 11:20     ` Stephen R. van den Berg
2008-08-10 12:16       ` david
2008-08-10 14:50         ` Jan Hudec
2008-08-10 17:57           ` Stephen R. van den Berg
2008-08-10 18:11             ` Jan Hudec
2008-08-10 20:16               ` Stephen R. van den Berg
2008-08-10 22:34                 ` Junio C Hamano
2008-08-10 23:10                   ` david
2008-08-11 10:11                     ` Stephen R. van den Berg
2008-08-16  6:21                 ` Josh Triplett, Jamey Sharp
2008-08-16  7:56                   ` david
2008-08-16  9:55                   ` Junio C Hamano [this message]
2008-08-16 15:07                     ` Jan Hudec
2008-08-18  6:12                   ` Shawn O. Pearce
2008-08-18 23:06                     ` Derek Fawcus
2008-08-18 23:18                       ` Shawn O. Pearce
2008-08-18 23:23                       ` Marcus Griep
2008-08-18 23:28                         ` Shawn O. Pearce
2008-08-10 11:09 ` Jan Hudec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vd4k9e120.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=bulb@ucw.cz \
    --cc=david@lang.hm \
    --cc=git@vger.kernel.org \
    --cc=jamey@minilop.net \
    --cc=josh@freedesktop.org \
    --cc=schacon@gmail.com \
    --cc=spearce@spearce.org \
    --cc=srb@cuci.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).