: global sanitize_diff_raw := "'/^:/s/ '"\($_x40\)"' '"\($_x40\)"' \([A-Z]\)[0-9]* / \1 \2 \3# /"' proc compare_diff_raw { # When heuristics are improved, the score numbers would change. # Ignore them while comparing. # Also we do not check SHA1 hash generation in this test, which # is a job for t0000-basic.sh sed -e $sanitize_diff_raw <$1 >.tmp-1 sed -e $sanitize_diff_raw <$2 >.tmp-2 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 } global sanitize_diff_raw_z := "'/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]*$/ X X \1#/"' proc compare_diff_raw_z { # When heuristics are improved, the score numbers would change. # Ignore them while comparing. # Also we do not check SHA1 hash generation in this test, which # is a job for t0000-basic.sh perl -pe 'y/\000/\012/' <$1 | sed -e $sanitize_diff_raw_z >.tmp-1 perl -pe 'y/\000/\012/' <$2 | sed -e $sanitize_diff_raw_z >.tmp-2 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 } proc compare_diff_patch { # When heuristics are improved, the score numbers would change. # Ignore them while comparing. sed -e ' /^[dis]*imilarity index [0-9]*%$/d /^index [0-9a-f]*\.\.[0-9a-f]/d ' <$1 >.tmp-1 sed -e ' /^[dis]*imilarity index [0-9]*%$/d /^index [0-9a-f]*\.\.[0-9a-f]/d ' <$2 >.tmp-2 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 } (CommandList children: [ (C {(Lit_Other ":")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sanitize_diff_raw) op: Equal rhs: {(SQ <"/^:/s/ ">) (DQ (EscapedLiteralPart token:) ($ VSub_Name "$_x40") (EscapedLiteralPart token:) ) (SQ <" ">) (DQ (EscapedLiteralPart token:) ($ VSub_Name "$_x40") (EscapedLiteralPart token:) ) (SQ <" \\([A-Z]\\)[0-9]*\t/ \\1 \\2 \\3#\t/">) } spids: [3] ) ] spids: [3] ) (FuncDef name: compare_diff_raw body: (BraceGroup children: [ (SimpleCommand words: [{(sed)} {(-e)} {(DQ ($ VSub_Name "$sanitize_diff_raw"))}] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Number "$1"))} spids: [57] ) (Redir op_id:Redir_Great fd:-1 arg_word:{(.tmp-1)} spids:[62]) ] ) (SimpleCommand words: [{(sed)} {(-e)} {(DQ ($ VSub_Name "$sanitize_diff_raw"))}] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Number "$2"))} spids: [74] ) (Redir op_id:Redir_Great fd:-1 arg_word:{(.tmp-2)} spids:[79]) ] ) (AndOr children: [(C {(test_cmp)} {(.tmp-1)} {(.tmp-2)}) (C {(rm)} {(-f)} {(.tmp-1)} {(.tmp-2)})] op_id: Op_DAmp ) ] spids: [29] ) spids: [24 28] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sanitize_diff_raw_z) op: Equal rhs: {(SQ <"/^:/s/ ">) (DQ ($ VSub_Name "$_x40")) (SQ <" ">) (DQ ($ VSub_Name "$_x40")) (SQ <" \\([A-Z]\\)[0-9]*$/ X X \\1#/">) } spids: [102] ) ] spids: [102] ) (FuncDef name: compare_diff_raw_z body: (BraceGroup children: [ (Pipeline children: [ (SimpleCommand words: [{(perl)} {(-pe)} {(SQ <"y/\\000/\\012/">)}] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Number "$1"))} spids: [152] ) ] ) (SimpleCommand words: [{(sed)} {(-e)} {(DQ ($ VSub_Name "$sanitize_diff_raw_z"))}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(.tmp-1)} spids:[167])] ) ] negated: False ) (Pipeline children: [ (SimpleCommand words: [{(perl)} {(-pe)} {(SQ <"y/\\000/\\012/">)}] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Number "$2"))} spids: [179] ) ] ) (SimpleCommand words: [{(sed)} {(-e)} {(DQ ($ VSub_Name "$sanitize_diff_raw_z"))}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(.tmp-2)} spids:[194])] ) ] negated: False ) (AndOr children: [(C {(test_cmp)} {(.tmp-1)} {(.tmp-2)}) (C {(rm)} {(-f)} {(.tmp-1)} {(.tmp-2)})] op_id: Op_DAmp ) ] spids: [124] ) spids: [119 123] ) (FuncDef name: compare_diff_patch body: (BraceGroup children: [ (SimpleCommand words: [ {(sed)} {(-e)} { (SQ <"\n"> <"\t/^[dis]*imilarity index [0-9]*%$/d\n"> <"\t/^index [0-9a-f]*\\.\\.[0-9a-f]/d\n"> <" "> ) } ] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Number "$1"))} spids: [244] ) (Redir op_id:Redir_Great fd:-1 arg_word:{(.tmp-1)} spids:[249]) ] ) (SimpleCommand words: [ {(sed)} {(-e)} { (SQ <"\n"> <"\t/^[dis]*imilarity index [0-9]*%$/d\n"> <"\t/^index [0-9a-f]*\\.\\.[0-9a-f]/d\n"> <" "> ) } ] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Number "$2"))} spids: [264] ) (Redir op_id:Redir_Great fd:-1 arg_word:{(.tmp-2)} spids:[269]) ] ) (AndOr children: [(C {(test_cmp)} {(.tmp-1)} {(.tmp-2)}) (C {(rm)} {(-f)} {(.tmp-1)} {(.tmp-2)})] op_id: Op_DAmp ) ] spids: [222] ) spids: [217 221] ) ] )