Shell alias: running a script with a repo-relative path

Shell aliases no longer allow shell syntax. I was warned about this two months ago.

This means what I was doing before doesn’t work anymore:

"aliases": {
    "sub1": ["!\"`git rev-parse --show-toplevel`/bin/arc-xyz\" sub1"],
    ...
}

$ arc sub1 blah
 SHELL ALIAS  arc sub1 -> $ '"`git rev-parse --show-toplevel`/bin/arc-xyz" sub1' blah
sh: "`git rev-parse --show-toplevel`/bin/arc-xyz" sub1: No such file or directory

Getting rid of the shell code gets me further:

"aliases": {
    "sub1": ["!./bin/arc-xyz", "sub1"],
    ...
}

But this fails when my CWD is not the top level of the repo:

$ arc sub1
 SHELL ALIAS  arc sub1 -> $ ./bin/arc-xyz sub1
sh: ./bin/arc-xyz: No such file or directory

Any ideas?

(Also, is there a way to get it to not print “SHELL ALIAS” every time?)

Is there a particular reason you’d prefer to implement this command as an arc alias rather than an actual alias in your shell or a shell script? It seems like moving this code to a standalone shell script would solve both concerns.

(The big advantage I can come up with is that arc sub1 is easier to distribute to other people on your team like this – is that the driving advantage here?)

Yes, that’s the main advantage.