Re: [PATCH v2] An alias that starts with "!!" runs in the current directory.
- From
Will Palmer <wmpalmer@gmail.com>
- Date
- May 6, 2010, 06:21 UTC
- Message-ID
- <1273126876.3562.4.camel@dreddbeard>
- In-Reply-To
- <n2qc376da901005051705t821b073do178d0261c4e4b2c0@mail.gmail.com>
On Wed, 2010-05-05 at 20:05 -0400, Adam Brewster wrote:
Show 16 quoted lines
> On 5/5/10, Junio C Hamano <gitster@pobox.com> wrote: > > > > It probably is a good idea to switch aliases to start at the $cwd in 1.8.0 > > (or perhaps one major release after it), and using a notation that is more > > descriptive, something like "!(cwd)" vs "!(root)", may give us a better > > transtion strategy than casting cryptic "!!" in the stone. > > > > For what it's worth, I like "!cmd". > > Would it be good enough to set some environment variables? > > [alias] > command_in_cwd = "!cd $GIT_CWD; ..." > > Adam
I'd be tempted to say that setting $GIT_CWD was an ideal solution, if Junio hadn't mentioned the possibility of cwd being the default in 1.8.0, which to me sounds much more sane than defaulting to the repository root. Defaulting to the root has never made sense to me and has some perfectly good built-ins to emulate if needed. I know I have at least two scripts-which-should-be-aliases sitting around because of this restriction.
-- -- Will