Skip to content

Commit 5e40e41

Browse files
committed
Merge branch 'zk/log-graph-showsig'
The "--show-signature" option did not pay much attention to "--graph". * zk/log-graph-showsig: log: fix indentation for --graph --show-signature
2 parents efbef3f + cf3983d commit 5e40e41

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

log-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ static void show_sig_lines(struct rev_info *opt, int status, const char *bol)
365365
eol = strchrnul(bol, '\n');
366366
printf("%s%.*s%s%s", color, (int)(eol - bol), bol, reset,
367367
*eol ? "\n" : "");
368+
graph_show_oneline(opt->graph);
368369
bol = (*eol) ? (eol + 1) : eol;
369370
}
370371
}

t/t4202-log.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
test_description='git log'
44

55
. ./test-lib.sh
6+
. "$TEST_DIRECTORY/lib-gpg.sh"
67

78
test_expect_success setup '
89
@@ -841,4 +842,34 @@ test_expect_success 'dotdot is a parent directory' '
841842
test_cmp expect actual
842843
'
843844

845+
test_expect_success GPG 'log --graph --show-signature' '
846+
test_when_finished "git reset --hard && git checkout master" &&
847+
git checkout -b signed master &&
848+
echo foo >foo &&
849+
git add foo &&
850+
git commit -S -m signed_commit &&
851+
git log --graph --show-signature -n1 signed >actual &&
852+
grep "^| gpg: Signature made" actual &&
853+
grep "^| gpg: Good signature" actual
854+
'
855+
856+
test_expect_success GPG 'log --graph --show-signature for merged tag' '
857+
test_when_finished "git reset --hard && git checkout master" &&
858+
git checkout -b plain master &&
859+
echo aaa >bar &&
860+
git add bar &&
861+
git commit -m bar_commit &&
862+
git checkout -b tagged master &&
863+
echo bbb >baz &&
864+
git add baz &&
865+
git commit -m baz_commit &&
866+
git tag -s -m signed_tag_msg signed_tag &&
867+
git checkout plain &&
868+
git merge --no-ff -m msg signed_tag &&
869+
git log --graph --show-signature -n1 plain >actual &&
870+
grep "^|\\\ merged tag" actual &&
871+
grep "^| | gpg: Signature made" actual &&
872+
grep "^| | gpg: Good signature" actual
873+
'
874+
844875
test_done

0 commit comments

Comments
 (0)