summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc9195a)
raw | patch | inline | side by side (parent: dc9195a)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 4 Feb 2007 07:31:47 +0000 (23:31 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 4 Feb 2007 07:34:22 +0000 (23:34 -0800) |
Now we have a separate reflog on HEAD, show-branch -g without an explicit
parameter defaults to the current branch, or HEAD when it is detached
from branches.
Signed-off-by: Junio C Hamano <junkio@cox.net>
parameter defaults to the current branch, or HEAD when it is detached
from branches.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-show-branch.txt | patch | blob | history | |
builtin-show-branch.c | patch | blob | history |
index b38633c3973a21860428a02ef3344110f65cec0f..ba5313d51f8ba8380bd5519bf0c15a491a9bc83a 100644 (file)
'git-show-branch' [--all] [--remotes] [--topo-order] [--current]
[--more=<n> | --list | --independent | --merge-base]
[--no-name | --sha1-name] [--topics] [<rev> | <glob>]...
-'git-show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] <ref>
+'git-show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
DESCRIPTION
-----------
will show the revisions given by "git rev-list {caret}master
topic1 topic2"
---reflog[=<n>[,<base>]] <ref>::
+--reflog[=<n>[,<base>]] [<ref>]::
Shows <n> most recent ref-log entries for the given
ref. If <base> is given, <n> entries going back from
that entry. <base> can be specified as count or date.
- `-g` can be used as a short-hand for this option.
+ `-g` can be used as a short-hand for this option. When
+ no explicit <ref> parameter is given, it defaults to the
+ current branch (or `HEAD` if it is detached).
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 fa62e487b186adc72ac41aacca31b4f4c8baefa9..0d94e40df893ee6ecf146e8987c0696cb4874a36 100644 (file)
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
if (ac == 0) {
static const char *fake_av[2];
- fake_av[0] = "HEAD";
+ const char *refname;
+
+ refname = resolve_ref("HEAD", sha1, 1, NULL);
+ fake_av[0] = xstrdup(refname);
fake_av[1] = NULL;
av = fake_av;
ac = 1;