From: Jay Soffian Date: Mon, 24 Mar 2008 01:54:49 GMT Subject: Re: git-config: aliases with parameter expansion ($1 and such) Message-ID: <76718490803231854u6ee76437h5acf37b0b602f3b1@mail.gmail.com> In-Reply-To: <20080323194514.GA23492@coredump.intra.peff.net> On Sun, Mar 23, 2008 at 3:45 PM, Jeff King wrote: > Hmm, I take it back. Git is doing the right thing, but it is a quirk of > the shell that it counts the first argument as the "name of the script" > even though the script actually comes from "-c". > > $ sh -c 'echo $0' foo > foo > $ echo 'echo $0' | sh > sh All my shell aliases therefor look like: h = "!sh -c 'git alias \"$1\" || git help \"$1\"' -" (Notice the trailing '-'.) j.