Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t6013-rev-list-reverse-parents.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t6013-rev-list-reverse-parents.sh` 47 lines ยท 1065 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='--reverse combines with --parents' 4 5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main 6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 7 8 . ./test-lib.sh 9 10 11 commit () { 12 test_tick && 13 echo $1 > foo && 14 git add foo && 15 git commit -m "$1" 16 } 17 18 test_expect_success 'set up --reverse example' ' 19 commit one && 20 git tag root && 21 commit two && 22 git checkout -b side HEAD^ && 23 commit three && 24 git checkout main && 25 git merge -s ours side && 26 commit five 27 ' 28 29 reverse () { 30 awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' 31 } 32 33 test_expect_success '--reverse --parents --full-history combines correctly' ' 34 git rev-list --parents --full-history main -- foo | reverse >expected && 35 git rev-list --reverse --parents --full-history main -- foo \ 36 > actual && 37 test_cmp expected actual 38 ' 39 40 test_expect_success '--boundary does too' ' 41 git rev-list --boundary --parents --full-history main ^root -- foo | reverse >expected && 42 git rev-list --boundary --reverse --parents --full-history \ 43 main ^root -- foo > actual && 44 test_cmp expected actual 45 ' 46 47 test_done