From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6188 invoked by alias); 3 Jul 2014 07:36:54 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18919 Received: (qmail 2271 invoked from network); 3 Jul 2014 07:36:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Date: Thu, 3 Jul 2014 09:27:25 +0200 From: Roman Neuhauser To: shawn wilson Cc: Zsh Users Subject: Re: note metadata for files Message-ID: <20140703072725.GC11492@isis.sigpipe.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) # 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