@matheusbsbs / matheus-bagliano / commits / 084ae0a7bd
Fork 0

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 <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Jan 24, 2007 at 15:05 UTC 084ae0a7bd8a13dea7731dd7b6bf37f08c1cfc77
4 files changed +9 -6
Documentation/git-rev-list.txt
+1 -1
@@ -191,7 +191,7 @@ limiting may be applied.
191 In addition to the '<commit>' listed on the command
192 line, read them from the standard input.
193
194 ---walk-reflogs::
194 +-g, --walk-reflogs::
195
196 Instead of walking the commit ancestry chain, walk
197 reflog entries from the most recent one to older ones.
Documentation/git-show-branch.txt
+3 -3
@@ -11,7 +11,7 @@ SYNOPSIS
11 'git-show-branch' [--all] [--remotes] [--topo-order] [--current]
12 [--more=<n> | --list | --independent | --merge-base]
13 [--no-name | --sha1-name] [--topics] [<rev> | <glob>]...
14 -'git-show-branch' --reflog[=<n>[,<base>]] [--list] <ref>
14 +'git-show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] <ref>
15
16 DESCRIPTION
17 -----------
@@ -100,8 +100,8 @@ OPTIONS
100 --reflog[=<n>[,<base>]] <ref>::
101 Shows <n> most recent ref-log entries for the given
102 ref. If <base> is given, <n> entries going back from
103 - that entry. <base> can be specified as count or date
104 -
103 + that entry. <base> can be specified as count or date.
104 + `-g` can be used as a short-hand for this option.
105
106 Note that --more, --list, --independent and --merge-base options
107 are mutually exclusive.
builtin-show-branch.c
+3 -1
@@ -649,11 +649,13 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
649 dense = 0;
650 else if (!strcmp(arg, "--date-order"))
651 lifo = 0;
652 - else if (!strcmp(arg, "--reflog")) {
652 + else if (!strcmp(arg, "--reflog") || !strcmp(arg, "-g")) {
653 reflog = DEFAULT_REFLOG;
654 }
655 else if (!strncmp(arg, "--reflog=", 9))
656 parse_reflog_param(arg + 9, &reflog, &reflog_base);
657 + else if (!strncmp(arg, "-g=", 3))
658 + parse_reflog_param(arg + 3, &reflog, &reflog_base);
659 else
660 usage(show_branch_usage);
661 ac--; av++;
revision.c
+2 -1
@@ -868,7 +868,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
868 handle_reflog(revs, flags);
869 continue;
870 }
871 - if (!strcmp(arg, "--walk-reflogs")) {
871 + if (!strcmp(arg, "-g") ||
872 + !strcmp(arg, "--walk-reflogs")) {
873 init_reflog_walk(&revs->reflog_info);
874 continue;
875 }