[darcs-users] darcs patch: Add Patch-salt as ignored prefix
zooko
zooko at zooko.com
Wed Oct 8 16:42:00 UTC 2008
On Oct 8, 2008, at 7:50 AM, Nathan Gray wrote:
> On Wed, Oct 08, 2008 at 07:25:49AM -0600, zooko wrote:
>> For example, let
>> us require that the "Ignore-this-patch-salt: BLAHBLAHBLAH" field is
>> always the last line of the patch comment, and that it gets hidden
>> only if it is the last line and only if BLAHBLAHBLAH matches the
>> pattern of a a hex encoded random string of the right length.
>
> This starts to sound scary when the user could cause their
> 'Ignore-this' line to get absorbed instead of the
> 'Ignore-this-patch-salt', just by putting theirs at the end of the
> comment:
>
> Ignore-this-count-of-entries-to-ignore: 2
> Ignore-this-patch-salt: BLAHBLAHBLAH
> Ignore-this-my-own-metadata: this messes up the ordering
This would only be possible if the user is able to edit the entire
patch comment. My proposal is that the user is not able to do so:
they edit the patch comment in an editor, then they save it, then
darcs appends "Ignore-this-patch-salt: BLAHBLAHBLAH" and "Ignore-this-
count-of-entries-to-ignore: 2".
Therefore, if the last line of the patch comment as the user wrote it
is this:
Ignore-this-my-own-metadata: note to self: remember to frobble the
whatsits. note to others: ignore this note.
Then after darcs processes the patch comment it will end with this:
Ignore-this-my-own-metadata: note to self: remember to frobble the
whatsits. note to others: ignore this note.
Ignore-this-patch-salt: BLAHBLAHBLAH
Ignore-this-count-of-entries-to-ignore: 2
Now when darcs >= 2.1.0 displays the patch comment, the display will
come out to the user looking like this:
Ignore-this-my-own-metadata: note to self: remember to frobble the
whatsits. note to others: ignore this note.
See what I mean? That's the key concept of "out-of-band
signalling". Make it so that the metadata which darcs adds and which
darcs parses and hides and uses is completely separate from the patch
comment that the user edits, and make it so the two cannot be
confused with one another.
Regards,
Zooko
---
http://allmydata.org -- Tahoe, the Least-Authority Filesystem
http://allmydata.com -- back up all your files for $5/month
More information about the darcs-users
mailing list