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

[PATCH/RFC 0/3] teaching log's --glob=<glob> and friends to git shortlog

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 21, 2011, 10:22 UTC
Message-ID
<20110421102241.GA16185@elie>
Hi,

While looking over the setup_revisions code to work on an interesting request from Josh Triplett[1] (that happens to coincide with a longstanding wish of my own), I got distracted by a few things. The nominal subject of this series is to teach "git shortlog" to handle commands like

	git shortlog --glob=remotes/charon/notes/*

Patch 1 makes the code clearer about something I had been confused by for a long time --- the --no-walk option invented for "git show"'s benefit has global effect. So tricks like[2]

	git rev-list ^HEAD --no-walk commit1 commit2 ...
to list branches not contained in HEAD will not work, alas.
Patch 2 unindents the code a little.

Patch 3 is the title piece --- it adds --glob=, --tag=, and so forth to the whitelist in handle_revision_opt so commands like "git shortlog" that parse revision listing options in two stages will queue them correctly.

While working on this I was struck by how close the setup_revisions code has been to parseoptification all these years. Maybe some weekend.

Thoughts and improvements welcome, of course.
Jonathan Nieder (3):
  revisions: clarify handling of --no-walk and --do-walk
  revisions: split out handle_revision_pseudo_opt function
  revisions: allow --glob and friends in parse_options-enabled commands
 revision.c               |  138 ++++++++++++++++++++++++----------------------
 t/t6018-rev-list-glob.sh |   50 +++++++++++++++++
 2 files changed, 122 insertions(+), 66 deletions(-)

[1] http://bugs.debian.org/621601 [2] http://thread.gmane.org/gmane.comp.version-control.git/138109/focus=138124

Next: Jonathan Nieder
Message 1 of 11 in “teaching log's --glob=<glob> and friends to git shortlog”
  1. 0/3 teaching log's --glob=<glob> and friends to git shortlogJonathan Nieder, Apr 21, 2011
  2. 1/3 revisions: clarify handling of --no-walk and --do-walkJonathan Nieder, Apr 21, 2011
  3. Michael J GruberApr 21, 2011
  4. Jonathan NiederApr 21, 2011
  5. Michael J GruberApr 24, 2011
  6. Jonathan NiederApr 25, 2011
  7. Michael J GruberApr 26, 2011
  8. 2/3 revisions: split out handle_revision_pseudo_opt functionJonathan Nieder, Apr 21, 2011
  9. 3/3 revisions: allow --glob and friends in parse_options-enabled commandsJonathan Nieder, Apr 21, 2011
  10. Junio C HamanoApr 21, 2011
  11. Jonathan NiederApr 21, 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.