From 084ae0a7bd8a13dea7731dd7b6bf37f08c1cfc77 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Jan 2007 15:05:16 +0100 Subject: [PATCH] reflog inspection: introduce shortcut "-g" A short-hand "-g" for "git log --walk-reflogs" and "git show-branch --reflog" makes it easier to access the reflog info. [jc: added -g to show-branch for symmetry] Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/git-rev-list.txt | 2 +- Documentation/git-show-branch.txt | 6 +++--- builtin-show-branch.c | 4 +++- revision.c | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt index a996f6cb1e..c742117595 100644 --- a/Documentation/git-rev-list.txt +++ b/Documentation/git-rev-list.txt @@ -191,7 +191,7 @@ limiting may be applied. In addition to the '' listed on the command line, read them from the standard input. ---walk-reflogs:: +-g, --walk-reflogs:: Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones. diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt index 529f3a648a..b38633c397 100644 --- a/Documentation/git-show-branch.txt +++ b/Documentation/git-show-branch.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git-show-branch' [--all] [--remotes] [--topo-order] [--current] [--more= | --list | --independent | --merge-base] [--no-name | --sha1-name] [--topics] [ | ]... -'git-show-branch' --reflog[=[,]] [--list] +'git-show-branch' (-g|--reflog)[=[,]] [--list] DESCRIPTION ----------- @@ -100,8 +100,8 @@ OPTIONS --reflog[=[,]] :: Shows most recent ref-log entries for the given ref. If is given, entries going back from - that entry. can be specified as count or date - + that entry. can be specified as count or date. + `-g` can be used as a short-hand for this option. Note that --more, --list, --independent and --merge-base options are mutually exclusive. diff --git a/builtin-show-branch.c b/builtin-show-branch.c index b54c410e14..536245e7d3 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -649,11 +649,13 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) dense = 0; else if (!strcmp(arg, "--date-order")) lifo = 0; - else if (!strcmp(arg, "--reflog")) { + else if (!strcmp(arg, "--reflog") || !strcmp(arg, "-g")) { reflog = DEFAULT_REFLOG; } else if (!strncmp(arg, "--reflog=", 9)) parse_reflog_param(arg + 9, &reflog, &reflog_base); + else if (!strncmp(arg, "-g=", 3)) + parse_reflog_param(arg + 3, &reflog, &reflog_base); else usage(show_branch_usage); ac--; av++; diff --git a/revision.c b/revision.c index ebd025064c..5bcd155e21 100644 --- a/revision.c +++ b/revision.c @@ -868,7 +868,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch handle_reflog(revs, flags); continue; } - if (!strcmp(arg, "--walk-reflogs")) { + if (!strcmp(arg, "-g") || + !strcmp(arg, "--walk-reflogs")) { init_reflog_walk(&revs->reflog_info); continue; } -- 2.11.4.GIT