#!/bin/sh global test_description := ''--reverse combines with --parents'' source ./test-lib.sh proc commit { test_tick && echo $1 > foo && git add foo && git commit -m $1 } test_expect_success 'set up --reverse example' ' commit one && git tag root && commit two && git checkout -b side HEAD^ && commit three && git checkout master && git merge -s ours side && commit five ' test_expect_success '--reverse --parents --full-history combines correctly' ' git rev-list --parents --full-history master -- foo | perl -e "print reverse <>" > expected && git rev-list --reverse --parents --full-history master -- foo \ > actual && test_cmp actual expected ' test_expect_success '--boundary does too' ' git rev-list --boundary --parents --full-history master ^root -- foo | perl -e "print reverse <>" > expected && git rev-list --boundary --reverse --parents --full-history \ master ^root -- foo > actual && test_cmp actual expected ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"--reverse combines with --parents">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: commit body: (BraceGroup children: [ (AndOr children: [ (C {(test_tick)}) (AndOr children: [ (SimpleCommand words: [{(echo)} {($ VSub_Number "$1")}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo)} spids:[33])] ) (AndOr children: [ (C {(git)} {(add)} {(foo)}) (C {(git)} {(commit)} {(-m)} {(DQ ($ VSub_Number "$1"))}) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [21] ) spids: [16 20] ) (C {(test_expect_success)} {(SQ <"set up --reverse example">)} { (SQ <"\n"> <"\tcommit one &&\n"> <"\tgit tag root &&\n"> <"\tcommit two &&\n"> <"\tgit checkout -b side HEAD^ &&\n"> <"\tcommit three &&\n"> <"\tgit checkout master &&\n"> <"\tgit merge -s ours side &&\n"> <"\tcommit five\n"> <"\t"> ) } ) (C {(test_expect_success)} {(SQ <"--reverse --parents --full-history combines correctly">)} { (SQ <"\n"> <"\tgit rev-list --parents --full-history master -- foo |\n"> <"\t\tperl -e \"print reverse <>\" > expected &&\n"> <"\tgit rev-list --reverse --parents --full-history master -- foo \\\n"> <"\t\t> actual &&\n"> <"\ttest_cmp actual expected\n"> <"\t"> ) } ) (C {(test_expect_success)} {(SQ <"--boundary does too">)} { (SQ <"\n"> <"\tgit rev-list --boundary --parents --full-history master ^root -- foo |\n"> <"\t\tperl -e \"print reverse <>\" > expected &&\n"> <"\tgit rev-list --boundary --reverse --parents --full-history \\\n"> <"\t\tmaster ^root -- foo > actual &&\n"> <"\ttest_cmp actual expected\n"> <"\t"> ) } ) (C {(test_done)}) ] )