Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  git-svn: Fix git svn log --show-commit
  • Loading branch information
Junio C Hamano committed May 21, 2011
2 parents 11bc3e9 + 9963e02 commit 391b142
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -5765,7 +5765,7 @@ sub cmd_show_log {
my (@k, $c, $d, $stat);
my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
while (<$log>) {
if (/^${esc_color}commit (- )?($::sha1_short)/o) {
if (/^${esc_color}commit (?:- )?($::sha1_short)/o) {
my $cmt = $1;
if ($c && cmt_showable($c) && $c->{r} != $r_last) {
$r_last = $c->{r};
Expand Down
15 changes: 15 additions & 0 deletions t/t9116-git-svn-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ test_expect_success 'test ascending revision range' "
git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
"

test_expect_success 'test ascending revision range with --show-commit' "
git reset --hard trunk &&
git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
"

test_expect_success 'test ascending revision range with --show-commit (sha1)' "
git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
git reset --hard trunk &&
git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
git rev-parse \$(cat out) >actual &&
test_cmp expected-range-r1-r2-r4-sha1 actual
"

printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1

test_expect_success 'test descending revision range' "
Expand Down

0 comments on commit 391b142

Please sign in to comment.