[darcs-users] Re: File/Directory Metadata

Michael Conrad conradme at email.uc.edu
Sun Nov 14 04:53:35 UTC 2004

dual reply:

On November 13, 2004, Mark Stosberg wrote:
> On 2004-11-13, David Roundy <droundy at abridgegame.org> wrote:
> > On Wed, Nov 10, 2004 at 08:38:09PM -0500, Michael Conrad wrote:
> >> I've been giving some thought to the whole discussion generated about
> >> line endings, and got thinking that maybe what darcs needs next is some
> >> name=value type metadata associated with each file.
> >>
> >> This would solve a number of things:
> >>
> >> * for the line endings issue, tags like "lines=logical" or
> >>   could be added on a per-file basis.
> >>
> >> * for permissions, tags like "unixperm=rwxr-xr-x" could solve the
> >>   with preserving permissions, and maybe another one like
> >>   that would cause darcs to auto-record changes to the permissions.
> >>
> >> * for character encoding, tags could be "charset=UTF-8", etc.
> > ...
> >> Ideas? Comments?
> >
> > Not necesarily a bad idea, but opens up a number of cans of worms.  Any
> > "meta" value that causes darcs to do something (which I guess is all but
> > the charset one, in your examples) will need to have very well-defined
> > behavior (and unchangeable--we can't fix bugs in it).

It does add a lot of extra "use cases".  It would also require a lot of
discussion and decision on exactly what the tags would do.  It would
probably also add a lot of code to darcs.  But, see my next point.

> I agree with David here. The three examples above all seem useful,
> although they are never features I've sought after with darcs.
> I agree that tracking the executable status of a file would be nice.
> I will be using darcs to manage website code where I want the CGI
> scripts to have specific permissions.

Well, I guess it all comes down to how large of a feature set darcs wants.
As things are, darcs doesn't do logical lines, permissions, ownership, and
several other things probably that people out there might want.

> However, if the executable bit gets lost with darcs, I can start using
> a standard script that fixes them.

If people have additional needs, they will either try to hack together a
workaround (like a chflags script), alter the tool (like someone did in a
previous post to handle line endings) or just use a different tool.

When a person looks for a tool, they look for something that fits their
needs.  The more needs it fits, the better the tool is for them.  For people
in the sysadmin Unix world, they probably want something that acts like tar.
Tar not only preserves permissions, but also ownership, times, and statuses
like symlinks.  The field of "Version Control" really doesn't require
tracking ownership and etc, and in fact it would probably get in the way for
the most part.  *However* there are people out there who want to preserve
ownership, and currently darcs is "not for them".  They use other things
like rsync.

But, what if darcs were extendable to handle things like ownership?  What if
darcs could even be extended to handle NT access control lists?  I don't
necessarily see the /capability/ as a bad thing.

I think the ability to track metadata tags as I described earlier would be a
valuable addition to darcs.  It would pave the way for people to track
additional information about their files, and then use the information to
make the tool work for them.

*** Minor instant brainstorm
What if darcs had the ability to run a script on applying a patch (as
suggested previously) and the meta tags were defined as environment
variables while running the script for a given file!  This would make it
trivial to set the permissions for a file:

  chmod $unix_perm $CURRENT_FILE

And, this would mean that darcs wouldn't need to have any of these features
decided on or built-in!!  I could add a script that would clobber the '\r'
as well:

  [ -n "$logical_lines" ] && dos2unix -o $CURRENT_FILE

I suppose I'd also suggest that you put in a nice hooking-spot in the darcs
code in case people want to do their 'script' in haskell.

So, what do people think now?


More information about the darcs-users mailing list