@matheusbsbs / matheus-bagliano / commits / 7dccadf363
Fork 0

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 <gitster@pobox.com>

Junio C Hamano committed Jan 21, 2010 at 14:57 UTC 7dccadf363f9d9ff564ad34117266b2d557a2bc8
3 files changed +7 -4
Documentation/pretty-options.txt
+2 -2
@@ -34,5 +34,5 @@ people using 80-column terminals.
34 Show the notes (see linkgit:git-notes[1]) that annotate the
35 commit, when showing the commit log message. This is the default
36 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
+1
@@ -1176,6 +1176,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
1176 } else if (!strcmp(arg, "--oneline")) {
1177 revs->verbose_header = 1;
1178 get_commit_format("oneline", revs);
1179 + revs->pretty_given = 1;
1180 revs->abbrev_commit = 1;
1181 } else if (!strcmp(arg, "--graph")) {
1182 revs->topo_order = 1;
t/t3301-notes.sh
+4 -2
@@ -192,11 +192,13 @@ test_expect_success 'git format-patch --show-notes does show notes' '
192 grep spam output
193 '
194
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
198 do
199 case "$pretty" in
200 "") p= not= negate="" ;;
199 - ?*) p="--pretty=$pretty" not=" not" negate="!" ;;
201 + ?*) p="$pretty" not=" not" negate="!" ;;
202 esac
203 test_expect_success "git show $pretty does$not show notes" '
204 git show $p >output &&