* note metadata for files @ 2014-07-02 17:59 shawn wilson 2014-07-03 7:27 ` Roman Neuhauser ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: shawn wilson @ 2014-07-02 17:59 UTC (permalink / raw) To: Zsh Users Maybe not a zsh specific question, but... Does anyone have a system for attaching notes to a file? The issue is I track down why a change was made to a file (annotate/blame/whatever) and then I remember that I've tracked down that change before. It would be useful if I could attach a note to files outside of any repo (or the repo they belong to anyway) that pops something up (maybe desktop-notify) when I look at the file (not stat, but manually grep/cat/less/diff/whatever from a cli). This could almost be a shell script, but I'm not sure how to make an event that would trigger the script with a filename parameter - is there a way to do this? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-02 17:59 note metadata for files shawn wilson @ 2014-07-03 7:27 ` Roman Neuhauser 2014-07-03 21:44 ` Peter Stephenson 2014-07-03 21:52 ` Mikael Magnusson 2 siblings, 0 replies; 8+ messages in thread From: Roman Neuhauser @ 2014-07-03 7:27 UTC (permalink / raw) To: shawn wilson; +Cc: Zsh Users # ag4ve.us@gmail.com / 2014-07-02 13:59:24 -0400: > Maybe not a zsh specific question, but... > > Does anyone have a system for attaching notes to a file? git, mercurial and others > The issue is I track down why a change was made to a file > (annotate/blame/whatever) and then I remember that I've tracked down > that change before. git notes might be useful > It would be useful if I could attach a note to files outside of any > repo you can run git init anywhere, like in /etc. > (or the repo they belong to anyway) that pops something up (maybe > desktop-notify) when I look at the file (not stat, but manually > grep/cat/less/diff/whatever from a cli). > > This could almost be a shell script, but I'm not sure how to make an > event that would trigger the script with a filename parameter - is > there a way to do this? see preexec in zshmisc(1), you can tokenize the first argument with "${(@Z:C:)1}" (zshezpn(1)), and see if any word in the resulting array names the file you're interested in. -- roman ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-02 17:59 note metadata for files shawn wilson 2014-07-03 7:27 ` Roman Neuhauser @ 2014-07-03 21:44 ` Peter Stephenson 2014-07-04 3:55 ` shawn wilson 2014-07-03 21:52 ` Mikael Magnusson 2 siblings, 1 reply; 8+ messages in thread From: Peter Stephenson @ 2014-07-03 21:44 UTC (permalink / raw) To: Zsh Users On Wed, 2 Jul 2014 13:59:24 -0400 shawn wilson <ag4ve.us@gmail.com> wrote: > Maybe not a zsh specific question, but... > > Does anyone have a system for attaching notes to a file? You might be interested in Oliver's article on using Linux file attributes for metadata with zsh: http://www.linux-mag.com/id/2126/ pws ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-03 21:44 ` Peter Stephenson @ 2014-07-04 3:55 ` shawn wilson 2014-07-04 10:50 ` François Revol 0 siblings, 1 reply; 8+ messages in thread From: shawn wilson @ 2014-07-04 3:55 UTC (permalink / raw) To: Peter Stephenson; +Cc: Zsh Users Thanks all. I didn't know of hooks... I looked for something like this in zsh a few years ago and didn't find anything (so didn't think to look for that). I also like using xattr like that way - I'm going to have to look into what can overwrite this though - if vim or cvs or even touch can overwrite this, that's kinda a non-starter unless I can find a way around it with cgroup or an LSM. On Thu, Jul 3, 2014 at 5:44 PM, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote: > On Wed, 2 Jul 2014 13:59:24 -0400 > shawn wilson <ag4ve.us@gmail.com> wrote: >> Maybe not a zsh specific question, but... >> >> Does anyone have a system for attaching notes to a file? > > You might be interested in Oliver's article on using Linux file > attributes for metadata with zsh: > > http://www.linux-mag.com/id/2126/ > > pws ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-04 3:55 ` shawn wilson @ 2014-07-04 10:50 ` François Revol 2014-07-06 22:32 ` shawn wilson 0 siblings, 1 reply; 8+ messages in thread From: François Revol @ 2014-07-04 10:50 UTC (permalink / raw) To: zsh-users On 04/07/2014 05:55, shawn wilson wrote: > Thanks all. I didn't know of hooks... I looked for something like this > in zsh a few years ago and didn't find anything (so didn't think to > look for that). I also like using xattr like that way - I'm going to > have to look into what can overwrite this though - if vim or cvs or > even touch can overwrite this, that's kinda a non-starter unless I can > find a way around it with cgroup or an LSM. > > On Thu, Jul 3, 2014 at 5:44 PM, Peter Stephenson > <p.w.stephenson@ntlworld.com> wrote: >> On Wed, 2 Jul 2014 13:59:24 -0400 >> shawn wilson <ag4ve.us@gmail.com> wrote: >>> Maybe not a zsh specific question, but... >>> >>> Does anyone have a system for attaching notes to a file? >> >> You might be interested in Oliver's article on using Linux file >> attributes for metadata with zsh: >> >> http://www.linux-mag.com/id/2126/ As for xattrs, you'll want to check the XDG guidelines instead of redefining your own: http://www.freedesktop.org/wiki/CommonExtendedAttributes/ Also, keep in mind xattrs are anything but standardized (OSX has a different API and namespace layout (reverse DNS vs {user.*,system.*...}), Windows (NTFS) has both xattrs and named streams... In addition of the issues mentionned (applications forget about them when moving things around), many filesystems either don't support them, or use their own mangling scheme, which aren't idempotent. And of course, if most kernels now finally support them out of the box, in many cases the filesystems are still not mounted with them enabled by default. It's really a shame because xattrs can be very useful. BeOS and Haiku use them extensively (for storing MIME type, icons, email headers...). In case you're interested in the xattr compatibility issue, I've written a paper about this: http://dcevents.dublincore.org/IntConf/dc-2011/paper/view/53 Sadly it seems nobody cares. François. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-04 10:50 ` François Revol @ 2014-07-06 22:32 ` shawn wilson 2014-07-07 9:25 ` François Revol 0 siblings, 1 reply; 8+ messages in thread From: shawn wilson @ 2014-07-06 22:32 UTC (permalink / raw) To: François Revol; +Cc: Zsh Users So, I'm pushing this more into the realm of OT here (ie, this no longer has anything to do with zsh and for this reason and possibly others, this discussion might want to go offlist) On Fri, Jul 4, 2014 at 6:50 AM, François Revol <revol@free.fr> wrote: > On 04/07/2014 05:55, shawn wilson wrote: >> On Thu, Jul 3, 2014 at 5:44 PM, Peter Stephenson >> <p.w.stephenson@ntlworld.com> wrote: >>> On Wed, 2 Jul 2014 13:59:24 -0400 >>> shawn wilson <ag4ve.us@gmail.com> wrote: >>>> Maybe not a zsh specific question, but... >>>> >>>> Does anyone have a system for attaching notes to a file? >>> >>> You might be interested in Oliver's article on using Linux file >>> attributes for metadata with zsh: >>> >>> http://www.linux-mag.com/id/2126/ > > As for xattrs, you'll want to check the XDG guidelines instead of > redefining your own: > > http://www.freedesktop.org/wiki/CommonExtendedAttributes/ > Heh, I had no idea there was a standard (kinda your point I guess) :) > In case you're interested in the xattr compatibility issue, I've written > a paper about this: > http://dcevents.dublincore.org/IntConf/dc-2011/paper/view/53 > Sadly it seems nobody cares. Hmmmm, so how far has your research gone here? What software ignores xattr on which fs (how well does something like ncase deal with it)? What security mechanisms rely on EAs and have you tried to mangle them in order to bypass these mechanisms (either OS or application policies)? I'd be more interested in the networked ramifications of mangled EAs, but a copy from a thumb drive might be interesting as well (though I doubt that would be very fruitful since moving into a higher security realm is a bit harder in kernel space). ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-06 22:32 ` shawn wilson @ 2014-07-07 9:25 ` François Revol 0 siblings, 0 replies; 8+ messages in thread From: François Revol @ 2014-07-07 9:25 UTC (permalink / raw) To: shawn wilson; +Cc: Zsh Users On 07/07/2014 00:32, shawn wilson wrote: > So, I'm pushing this more into the realm of OT here (ie, this no > longer has anything to do with zsh and for this reason and possibly > others, this discussion might want to go offlist) [...] >> In case you're interested in the xattr compatibility issue, I've written >> a paper about this: >> http://dcevents.dublincore.org/IntConf/dc-2011/paper/view/53 >> Sadly it seems nobody cares. > > Hmmmm, so how far has your research gone here? What software ignores > xattr on which fs (how well does something like ncase deal with it)? Well, even things like /bin/cp -p (--preserve) by default only preserves mode,owner‐ship,timestamps but not xattr... I think rsync supports the linux xattrs, probably not enabled by default again, but I didn't try yet. Don't know about ncase. > What security mechanisms rely on EAs and have you tried to mangle them > in order to bypass these mechanisms (either OS or application > policies)? I didn't really consider this question, given Samba alone already has a hard time enough converting the ACLs. Note, xattrs on Linux (and the now-withdrawn POSIX draft about xattrs) have only been done on purpose of implementing ACLs atop. > I'd be more interested in the networked ramifications of > mangled EAs, but a copy from a thumb drive might be interesting as > well (though I doubt that would be very fruitful since moving into a > higher security realm is a bit harder in kernel space). Besides, things like Samba and NTFS-3g differ (at least used to) on the way the mangle named-stream inside xattrs... François. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: note metadata for files 2014-07-02 17:59 note metadata for files shawn wilson 2014-07-03 7:27 ` Roman Neuhauser 2014-07-03 21:44 ` Peter Stephenson @ 2014-07-03 21:52 ` Mikael Magnusson 2 siblings, 0 replies; 8+ messages in thread From: Mikael Magnusson @ 2014-07-03 21:52 UTC (permalink / raw) To: shawn wilson; +Cc: Zsh Users On 2 July 2014 19:59, shawn wilson <ag4ve.us@gmail.com> wrote: > Maybe not a zsh specific question, but... > > Does anyone have a system for attaching notes to a file? > > The issue is I track down why a change was made to a file > (annotate/blame/whatever) and then I remember that I've tracked down > that change before. It would be useful if I could attach a note to > files outside of any repo (or the repo they belong to anyway) that > pops something up (maybe desktop-notify) when I look at the file (not > stat, but manually grep/cat/less/diff/whatever from a cli). > > This could almost be a shell script, but I'm not sure how to make an > event that would trigger the script with a filename parameter - is > there a way to do this? Closest I have is http://mika.l3ib.org/code/zsh-functions/note http://cgit.mika.l3ib.org/cgit/zsh-cvs/commit/?h=mika&id=45550f3971d50f8aa0ba63b1a55ce6dd28662200 http://cgit.mika.l3ib.org/cgit/zsh-cvs/commit/?h=mika&id=2d0d2e6750383151551b62980f322ac90de07ec4 zstyle ':completion:dirprop:*' file-list dirprop=user.notes zstyle ':completion:dirprop:*' dirinfo-format '%f '${(%):-%F{11}}%i${(%):-%f} zle -C dirprop complete-word _generic bindkey "^_^V" dirprop (or just set the style for your default context to always disable the notes on tab completion, but it overrides filetype coloring which is why i don't). Also note that most programs will silently delete all xattrs when you edit/copy/etc a file. -- Mikael Magnusson ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-07-07 9:36 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-07-02 17:59 note metadata for files shawn wilson 2014-07-03 7:27 ` Roman Neuhauser 2014-07-03 21:44 ` Peter Stephenson 2014-07-04 3:55 ` shawn wilson 2014-07-04 10:50 ` François Revol 2014-07-06 22:32 ` shawn wilson 2014-07-07 9:25 ` François Revol 2014-07-03 21:52 ` Mikael Magnusson
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ 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).