summaryrefslogtreecommitdiff
path: root/builtin-revert.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2008-07-31 12:22:23 +0200
committerJunio C Hamano <gitster@pobox.com>2008-07-31 11:35:17 -0700
commit0fe8c1381043ef64fce1b8372df19046a4b1518e (patch)
tree34400ed45bc9ae4a59ad0abbfdca429bbc8406df /builtin-revert.c
parentb3123f9802989d9c8184e2265a6176a6f5aeed71 (diff)
downloadgit-0fe8c1381043ef64fce1b8372df19046a4b1518e.tar.gz
Allow "non-option" revision options in parse_option-enabled commands
Commands which use parse_options() but also call setup_revisions() must do their parsing in a two step process: 1. first, they parse all options. Anything unknown goes to parse_revision_opt() (which calls handle_revision_opt), which may claim the option or say "I don't recognize this" 2. the non-option remainder goes to setup_revisions() to actually get turned into revisions Some revision options are "non-options" in that they must be parsed in order with their revision counterparts in setup_revisions(). For example, "--all" functions as a pseudo-option expanding to all refs, and "--no-walk" affects refs after it on the command line, but not before. The revision option parser in step 1 recognizes such options and sets them aside for later parsing by setup_revisions(). However, the return value used from handle_revision_opt indicated "I didn't recognize this", which was wrong. It did, and it took appropriate action (even though that action was just deferring it for later parsing). Thus it should return "yes, I recognized this." Previously, these pseudo-options generated an error when used with parse_options parsers (currently just blame and shortlog). With this patch, they should work fine, enabling things like "git shortlog --all". Signed-off-by: Jeff King <peff@peff.net> Acked-By: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-revert.c')
0 files changed, 0 insertions, 0 deletions