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/t8008-blame-formats.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 / t8008-blame-formats.sh` 110 lines ยท 2265 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='blame output in various formats on a simple case' 4 5 . ./test-lib.sh 6 7 test_expect_success 'setup' ' 8 echo a >file && 9 git add file && 10 test_tick && 11 git commit -m one && 12 echo b >>file && 13 echo c >>file && 14 echo d >>file && 15 test_tick && 16 git commit -a -m two && 17 ID1=$(git rev-parse HEAD^) && 18 shortID1="^$(git rev-parse HEAD^ |cut -c 1-17)" && 19 ID2=$(git rev-parse HEAD) && 20 shortID2="$(git rev-parse HEAD |cut -c 1-18)" 21 ' 22 23 cat >expect <actual && 31 test_cmp expect actual 32 ' 33 34 COMMIT1="author A U Thor 35 author-mail 36 author-time `1112911993` 37 author-tz -0700 38 committer C O Mitter 39 committer-mail 40 committer-time `1112911993` 41 committer-tz -0700 42 summary one 43 boundary 44 filename file" 45 COMMIT2="author A U Thor 46 author-mail 47 author-time `1112912053` 48 author-tz -0700 49 committer C O Mitter 50 committer-mail 51 committer-time `1112912053` 52 committer-tz -0700 53 summary two 54 previous $ID1 file 55 filename file" 56 57 cat >expect <actual && 71 test_cmp expect actual 72 ' 73 74 cat >expect <actual && 90 test_cmp expect actual 91 ' 92 93 test_expect_success '--porcelain detects first non-blank line as subject' ' 94 ( 95 GIT_INDEX_FILE=.git/tmp-index && 96 export GIT_INDEX_FILE && 97 echo "This is it" >single-file && 98 git add single-file && 99 tree=$(git write-tree) && 100 commit=$(printf "%s\n%s\n%s\n\n\n \noneline\n\nbody\n" \ 101 "tree $tree" \ 102 "author A `123456789` +0000" \ 103 "committer C `123456789` +0000" | 104 git hash-object -w -t commit --stdin) && 105 git blame --porcelain $commit -- single-file >output && 106 test_grep "^summary oneline$" output 107 ) 108 ' 109 110 test_done