[plt-dev] using the "props" script

From: Eli Barzilay (eli at barzilay.org)
Date: Tue May 4 19:38:38 EDT 2010

On May  4, Eli Barzilay wrote:
> To use the "props" script, I recommended adding a git alias.  This
> doesn't work well, since such aliases are always executed from the
> repository root (and there is no way to know where the command
> originally started from).  So if you did this, please remove that
> alias, then add it as a shell script -- put this in a "git-prop" file
> that is somewhere in your path:
> 
>   #!/bin/sh
>   exec "$(git rev-parse --show-toplevel)/collects/meta/props" "$@"
> 
> and "chmod +x" it, then continue using it as usual.

Two more notes:

1. In case it wasn't clear, the problem with the alias is that `git
   prop' would work with a path that is relative to the plt repository
   root -- once you switch to the script, it would work with the files
   relative to where you invoke this command from.

2. This is a slightly better version which will properly error out if
   you're not in a git repository.

     #!/bin/sh
     top="$(git rev-parse --show-toplevel)" || exit 1
     exec "$top/collects/meta/props" "$@"

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.