git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] An alias that starts with "!!" runs in the current directory.

From
Eli Barzilay <eli@barzilay.org>
Date
May 5, 2010, 22:33 UTC
Message-ID
<19425.61989.608102.77250@winooski.ccs.neu.edu>
In-Reply-To
<1273098179.723.10.camel@dreddbeard>
On May  5, Will Palmer wrote:
Show 14 quoted lines
> On Wed, 2010-05-05 at 17:31 -0400, Eli Barzilay wrote:
> > With "!"-prefixed shell aliases, the shell command not only gets
> > executed at the repository top level, but there is no way to know the
> > current directory of the original call.  This adds "!!"-prefixed aliases
> > as a similar variant for "!"-prefixed ones, but the commands are
> > executed in the original directory instead of the top level.
> > 
> > Signed-off-by: Eli Barzilay <eli@barzilay.org>
> 
> Is there any precedent for the "!!" syntax? Something like ".!",
> "./!", or "!(.)" would make the intention more clear, I'd think, as
> well as leaving room for other extensions to be added later, and
> some explicit-opposite, like "/!", to complement it. (It's not like
> people are going around with binaries called "!", is it?)
[

The first time I saw the "!" syntax, it was slightly confusing to me in that it's similar to various shells using "!" for history expansion -- especially given that these things are popular with shell aliases made it hard to remember.

An alternative character that wouldn't have confused me, and even suggests shell commands is ";". So my preference would be for shell aliases to start with it and to be invoked in the original working directory, perhaps deprecating the "!" syntax.

But I'm new enough to be safely ignored... So this is all a parenthetical comment...

]
-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Previous: Will PalmerNext: Junio C Hamano
Message 15 of 23 in “Set GIT_PATHNAME_PREFIX with aliases.”
  1. Set GIT_PATHNAME_PREFIX with aliases.Jared Hance, May 5, 2010
  2. Jeff KingMay 5, 2010
  3. Johannes SixtMay 5, 2010
  4. Jeff KingMay 5, 2010
  5. Eli BarzilayMay 5, 2010
  6. Junio C HamanoMay 5, 2010
  7. An alias that starts with "!!" runs in the current directory.Eli Barzilay, May 5, 2010
  8. Jared HanceMay 5, 2010
  9. Eli BarzilayMay 5, 2010
  10. Eli BarzilayMay 5, 2010
  11. Re-submitting patchesJonathan Nieder, May 5, 2010
  12. Eli BarzilayMay 5, 2010
  13. An alias that starts with "!!" runs in the current directory.Eli Barzilay, May 5, 2010
  14. Will PalmerMay 5, 2010
  15. Eli BarzilayMay 5, 2010
  16. Junio C HamanoMay 5, 2010
  17. Adam BrewsterMay 6, 2010
  18. Will PalmerMay 6, 2010
  19. Will PalmerMay 6, 2010
  20. Johannes SixtMay 6, 2010
  21. Matthieu MoyMay 6, 2010
  22. Junio C HamanoMay 5, 2010
  23. Eli BarzilayMay 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.