darcs

Issue 307 File and Directory Metadata

Title File and Directory Metadata
Priority feature Status duplicate
Milestone Resolved in
Superseder track permissions, file and directory meta-data
View: 54
Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, tommy
Assigned To
Topics

Created on 2006-10-15.20:03:20 by kowey, last changed 2009-08-27.13:52:51 by admin.

Messages
msg1102 (view) Author: kowey Date: 2006-10-15.20:03:11
File and Directory Metadata
Import of RT #96

guest <silverdirk@silverdirk.com> 2004-11-24
--------------------------------------------
Subject: File and Directory Metadata

This is a clarification of the metadata feature I would like in darcs.
I'm willing to work on this, but currently have no time. I'm posting it
in case it inspires anyone else to investigate.

The feature would add metadata tags to arbitrary source files or
directories. It would allow miscelaneous data to be maintained about a
file. The properties would 'follow' a file through renames, and die
when the file was removed. The properties would be of the form
name=value, where name is a unique key (per-file) for looking up the
value.

The properties would behave much like single-line binary entries, in
that they could only have 1 value or no value, and the patching would
see "old" and "new" versions of the data (no line-based merging).

I'm using several debatable features in this example not to argue their
worth, but to show how this feature could make other features easier to
implement.

Reccomended Patch Format:

[Added foo and set unix permissions and set line type to logical
silverdirk@silverdirk.com**20041124000000] <> {
addfile ./foo
hunk ./foo 1
+blah blah blah
+blah blah blah
}
meta ./foo
+unixperm=rw-rw----
+linetype=logical
}
}
[Changed the unix perms to be executable, and added a sub-repo
silverdirk@silverdirk.com**20041124000000] <> {
meta ./foo
-unixperm=rw-rw----
+unixperm=rwxrwx---
}
adddir ./sub-project
meta ./sub-project
+is_subrepo=y
+subrepo_default_repo=http://conserv.silverdirk.com/repo/blah
}
}

Reccomended User Interface:
$ darcs add foo
$ darcs meta foo unixperm=rw-rw---- linetype=logical
$ darcs record
... etc ...
$ darcs meta foo unixperm=rwxrwx---
$ darcs get http://conserv.silverdirk.com/repo/sub-project
$ darcs add sub-project
$ darcs meta sub-project is_subrepo=y subrepo_default_repo=`cat sub-
project/_darcs/prefs/defaultrepo`
$ darcs record
... etc ...

$ darcs query meta foo sub-project --verbose
Metadata for ./foo:
unixperm = rwxrwx---
linetype = logical
Metadata for ./sub-project:
is_subrepo = y
subrepo_default_repo = http://...

$ darcs query meta foo sub-project --for-script
{foo
unixperm='rwxrwx---'
linetype='logical'
}
{sub_project
is_subrepo='y'
subrepo_default_repo='http://...
}
$ cd /tmp && darcs get /path/to/mainproj
$ darcs query meta * --for-script | (
while read fname; do
(
file="${fname/{/}";
while read attr; do
[ $attr -eq '}' ] && break;
export $attr;
done;
perl ~/bin/after-darcs.pl $file;
)
done;
)

Toss on the pre and post script, and we have Power to the People!
History
Date User Action Args
2006-10-15 20:03:20koweycreate
2007-08-19 21:05:37koweysettopic: - FromRequestTracker
nosy: + beschmi
2008-01-19 01:34:43systemsetstatus: unread -> duplicate
nosy: droundy, tommy, beschmi, kowey
superseder: + track permissions, file and directory meta-data
2009-08-06 17:35:29adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy
2009-08-06 20:32:38adminsetnosy: - beschmi
2009-08-10 21:57:14adminsetnosy: - markstos, darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:49:44adminsetnosy: + darcs-devel, - simon
2009-08-27 13:52:51adminsetnosy: tommy, kowey, darcs-devel, thorkilnaur, dmitry.kurochkin