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

Re: Supporting "-v" option for git-log

From
Jeff King <peff@peff.net>
Date
May 25, 2011, 15:11 UTC
Message-ID
<20110525151115.GB8795@sigill.intra.peff.net>
In-Reply-To
<m3boyqzy3f.fsf@localhost.localdomain>
On Wed, May 25, 2011 at 06:53:31AM -0700, Jakub Narebski wrote:
Show 9 quoted lines
> > Which is a shame, because we already have all of the code for "--and",
> > "--or", and "--not" in git-grep. It is just a syntactic conflict. I
> > think you could get away with "--grep-and", "--grep-or", and
> > "--grep-not". They are obviously less nice to type, but there would be
> > not conflict.
> 
> Hmmm... perhaps short -! could be alias for --grep-not (it is the only
> that needs to be changed to avoid conflict, as there are no --or and
> --and for rev-list).

Ick. I really hate using shell metacharacters that need quoting (especially "!", which even gets expanded inside double-quotes). But as long as it's an alias, I guess people who care can use --grep-not.

We could use unadorned "--or" and "--and", though we should perhaps stop and think whether taking those basic operators will block future use that matches the current "--not" more.

Right now, "git log a b" is what I would expect "git log a --or b" to do. I guess "git log a --and b" would be "git log $(git merge-base a b)". So maybe it is not worth reserving them for the future, since what they would (probably) accomplish is easy to do now.

-Peff
Previous: Jakub NarebskiNext: Jakub Narebski
Message 11 of 14 in “Supporting "-v" option for git-log”
  1. Elazar LeibovichMay 25, 2011
  2. Tim MazidMay 25, 2011
  3. Elazar LeibovichMay 25, 2011
  4. Tim MazidMay 25, 2011
  5. Tim MazidMay 25, 2011
  6. Elazar LeibovichMay 25, 2011
  7. Tim MazidMay 25, 2011
  8. Elazar LeibovichMay 25, 2011
  9. Jeff KingMay 25, 2011
  10. Jakub NarebskiMay 25, 2011
  11. Jeff KingMay 25, 2011
  12. Jakub NarebskiMay 25, 2011
  13. Junio C HamanoMay 25, 2011
  14. Jeff KingMay 25, 2011

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.