Skip to content

Commit 7dccadf

Browse files
committed
Fix "log --oneline" not to show notes
This option should be treated pretty much the same as --format="%h %s". Signed-off-by: Junio C Hamano <[email protected]>
1 parent 66b2ed0 commit 7dccadf

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Documentation/pretty-options.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ people using 80-column terminals.
3434
Show the notes (see linkgit:git-notes[1]) that annotate the
3535
commit, when showing the commit log message. This is the default
3636
for `git log`, `git show` and `git whatchanged` commands when
37-
there is no `--pretty` nor `--format` option is given on the
38-
command line.
37+
there is no `--pretty`, `--format` nor `--oneline` option is
38+
given on the command line.

revision.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
11761176
} else if (!strcmp(arg, "--oneline")) {
11771177
revs->verbose_header = 1;
11781178
get_commit_format("oneline", revs);
1179+
revs->pretty_given = 1;
11791180
revs->abbrev_commit = 1;
11801181
} else if (!strcmp(arg, "--graph")) {
11811182
revs->topo_order = 1;

t/t3301-notes.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,13 @@ test_expect_success 'git format-patch --show-notes does show notes' '
192192
grep spam output
193193
'
194194

195-
for pretty in "" raw short medium full fuller format:%s
195+
for pretty in \
196+
"" --pretty --pretty=raw --pretty=short --pretty=medium \
197+
--pretty=full --pretty=fuller --pretty=format:%s --oneline
196198
do
197199
case "$pretty" in
198200
"") p= not= negate="" ;;
199-
?*) p="--pretty=$pretty" not=" not" negate="!" ;;
201+
?*) p="$pretty" not=" not" negate="!" ;;
200202
esac
201203
test_expect_success "git show $pretty does$not show notes" '
202204
git show $p >output &&

0 commit comments

Comments
 (0)