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

[RFC PATCH 0/2] Allow detached forms (--option arg) for git log options.

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Jul 26, 2010, 18:14 UTC
Message-ID
<1280168078-31147-1-git-send-email-Matthieu.Moy@imag.fr>
Hi,

This has been bothering me for a while: many commands accept detached form (like "git commit -m message" instead of "git commit -mmessage"), but others don't, in particular, git log options like

git log -S<string> git log --grep=<string>

do not accept spaces.

This small patch serie is a very early RFC: it implements the feature for just two options. There are at least 4 ways towards a real implementations:

1) nobody except me likes the feature, drop the RFC.
2) Implement the same for other options. That's very repetitive (for
   each option, there are two ifs: a prefixcmp and a strcmp), I don't
   like it much.
3) Write a function or macro that accepts both variants, and use it
   everywhere.
4) use parse-option for "git log" options and then get the feature for
   free.

Hence my question: is there any reason why "git log" hasn't been migrated to parse-option? Or is it only that nobody did it yet?

What do you think?
Thanks,
Matthieu Moy (2):
  Allow "git log --grep foo" as synonym for "git log --grep=foo".
  Allow "git log -S string" as synonym for "git log -Sstring".
 diff.c     |    5 +++++
 revision.c |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)
-- 
1.7.2.23.g58c3b.dirty
Next: Matthieu Moy
Message 1 of 20 in “Allow detached forms (--option arg) for git log options.”
  1. 0/2 Allow detached forms (--option arg) for git log options.Matthieu Moy, Jul 26, 2010
  2. 1/2 Allow "git log --grep foo" as synonym for "git log --grep=foo".Matthieu Moy, Jul 26, 2010
  3. Sverre RabbelierJul 27, 2010
  4. Miles BaderJul 27, 2010
  5. Jakub NarebskiJul 27, 2010
  6. Matthieu MoyJul 27, 2010
  7. Ævar Arnfjörð BjarmasonJul 27, 2010
  8. Matthieu MoyJul 27, 2010
  9. Ævar Arnfjörð BjarmasonJul 27, 2010
  10. Matthieu MoyJul 27, 2010
  11. Ævar Arnfjörð BjarmasonJul 27, 2010
  12. 2/2 Allow "git log -S string" as synonym for "git log -Sstring".Matthieu Moy, Jul 26, 2010
  13. Sverre RabbelierJul 27, 2010
  14. Jonathan NiederJul 26, 2010
  15. Pierre HabouzitJul 27, 2010
  16. Jakub NarebskiJul 27, 2010
  17. Pierre HabouzitJul 28, 2010
  18. Jakub NarebskiJul 29, 2010
  19. Pierre HabouzitJul 29, 2010
  20. Jonathan NiederAug 1, 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.