Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: note metadata for files

# ag4ve.us@xxxxxxxxx / 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.


Messages sorted by: Reverse Date, Date, Thread, Author