(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: { (SQ (Token id:Id.Lit_Chars val:'merge-recursive space options\n' span_id:6) (Token id:Id.Lit_Chars val:'\n' span_id:7) (Token id:Id.Lit_Chars val:'* [master] Clarify\n' span_id:8) (Token id:Id.Lit_Chars val:' ! [remote] Remove cruft\n' span_id:9) (Token id:Id.Lit_Chars val:'--\n' span_id:10) (Token id:Id.Lit_Chars val:' + [remote] Remove cruft\n' span_id:11) (Token id:Id.Lit_Chars val:'* [master] Clarify\n' span_id:12) (Token id: Id.Lit_Chars val: '*+ [remote^] Initial revision\n' span_id: 13 ) (Token id:Id.Lit_Chars val:'* ok 1: setup\n' span_id:14) ) } spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(test_have_prereq)} {(SED_STRIPS_CR)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SED_OPTIONS) op: assign_op.Equal rhs: {(-b)} spids: [29] ) ] ) ] ) (command.If arms: [ (if_arm cond: [(C {(test_have_prereq)} {(GREP_STRIPS_CR)})] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GREP_OPTIONS) op: assign_op.Equal rhs: {(-U)} spids: [41] ) ] ) (C {(export)} {(GREP_OPTIONS)}) ] spids: [32 38] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:55))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:59) (Token id:Id.Lit_Chars val:'\tconflict_hunks () {\n' span_id:60) (Token id:Id.Lit_Chars val:'\t\tsed $SED_OPTIONS -n -e "\n' span_id:61) (Token id:Id.Lit_Chars val:'\t\t\t/^<<<</ b conflict\n' span_id:62) (Token id:Id.Lit_Chars val:'\t\t\tb\n' span_id:63) (Token id:Id.Lit_Chars val:'\t\t\t: conflict\n' span_id:64) (Token id:Id.Lit_Chars val:'\t\t\tp\n' span_id:65) (Token id:Id.Lit_Chars val:'\t\t\t/^>>>>/ b\n' span_id:66) (Token id:Id.Lit_Chars val:'\t\t\tn\n' span_id:67) (Token id:Id.Lit_Chars val:'\t\t\tb conflict\n' span_id:68) (Token id:Id.Lit_Chars val:'\t\t" "$@"\n' span_id:69) (Token id:Id.Lit_Chars val:'\t} &&\n' span_id:70) (Token id:Id.Lit_Chars val:'\n' span_id:71) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >text.txt &&\n' span_id:72) (Token id: Id.Lit_Chars val: '\t Hope, he says, cherishes the soul of him who lives in\n' span_id: 73 ) (Token id: Id.Lit_Chars val: '\t justice and holiness and is the nurse of his age and the\n' span_id: 74 ) (Token id: Id.Lit_Chars val: '\t companion of his journey;--hope which is mightiest to sway\n' span_id: 75 ) (Token id:Id.Lit_Chars val:'\t the restless soul of man.\n' span_id:76) (Token id:Id.Lit_Chars val:'\n' span_id:77) (Token id: Id.Lit_Chars val: '\tHow admirable are his words! And the great blessing of riches, I do\n' span_id: 78 ) (Token id: Id.Lit_Chars val: '\tnot say to every man, but to a good man, is, that he has had no\n' span_id: 79 ) (Token id: Id.Lit_Chars val: '\toccasion to deceive or to defraud others, either intentionally or\n' span_id: 80 ) (Token id: Id.Lit_Chars val: '\tunintentionally; and when he departs to the world below he is not in\n' span_id: 81 ) (Token id: Id.Lit_Chars val: '\tany apprehension about offerings due to the gods or debts which he owes\n' span_id: 82 ) (Token id: Id.Lit_Chars val: '\tto men. Now to this peace of mind the possession of wealth greatly\n' span_id: 83 ) (Token id: Id.Lit_Chars val: '\tcontributes; and therefore I say, that, setting one thing against\n' span_id: 84 ) (Token id: Id.Lit_Chars val: '\tanother, of the many advantages which wealth has to give, to a man of\n' span_id: 85 ) (Token id:Id.Lit_Chars val:'\tsense this is in my opinion the greatest.\n' span_id:86) (Token id:Id.Lit_Chars val:'\n' span_id:87) (Token id: Id.Lit_Chars val: '\tWell said, Cephalus, I replied; but as concerning justice, what is\n' span_id: 88 ) (Token id: Id.Lit_Chars val: '\tit?--to speak the truth and to pay your debts--no more than this? And\n' span_id: 89 ) (Token id: Id.Lit_Chars val: '\teven to this are there not exceptions? Suppose that a friend when in\n' span_id: 90 ) (Token id: Id.Lit_Chars val: '\this right mind has deposited arms with me and he asks for them when he\n' span_id: 91 ) (Token id: Id.Lit_Chars val: '\tis not in his right mind, ought I to give them back to him? No one\n' span_id: 92 ) (Token id: Id.Lit_Chars val: '\twould say that I ought or that I should be right in doing so, any more\n' span_id: 93 ) (Token id: Id.Lit_Chars val: '\tthan they would say that I ought always to speak the truth to one who\n' span_id: 94 ) (Token id:Id.Lit_Chars val:'\tis in his condition.\n' span_id:95) (Token id:Id.Lit_Chars val:'\n' span_id:96) (Token id:Id.Lit_Chars val:'\tYou are quite right, he replied.\n' span_id:97) (Token id:Id.Lit_Chars val:'\n' span_id:98) (Token id: Id.Lit_Chars val: '\tBut then, I said, speaking the truth and paying your debts is not a\n' span_id: 99 ) (Token id:Id.Lit_Chars val:'\tcorrect definition of justice.\n' span_id:100) (Token id:Id.Lit_Chars val:'\n' span_id:101) (Token id:Id.Lit_Chars val:'\tCEPHALUS - SOCRATES - POLEMARCHUS\n' span_id:102) (Token id:Id.Lit_Chars val:'\n' span_id:103) (Token id: Id.Lit_Chars val: '\tQuite correct, Socrates, if Simonides is to be believed, said\n' span_id: 104 ) (Token id:Id.Lit_Chars val:'\tPolemarchus interposing.\n' span_id:105) (Token id:Id.Lit_Chars val:'\n' span_id:106) (Token id: Id.Lit_Chars val: '\tI fear, said Cephalus, that I must go now, for I have to look after the\n' span_id: 107 ) (Token id: Id.Lit_Chars val: '\tsacrifices, and I hand over the argument to Polemarchus and the company.\n' span_id: 108 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:109) (Token id:Id.Lit_Chars val:'\tgit add text.txt &&\n' span_id:110) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:111) (Token id:Id.Lit_Chars val:'\tgit commit -m "Initial revision" &&\n' span_id:112) (Token id:Id.Lit_Chars val:'\n' span_id:113) (Token id:Id.Lit_Chars val:'\tgit checkout -b remote &&\n' span_id:114) (Token id:Id.Lit_Chars val:'\tsed -e "\n' span_id:115) (Token id:Id.Lit_Chars val:'\t\t\ts/\\. /\\. /g\n' span_id:116) (Token id:Id.Lit_Chars val:'\t\t\ts/[?] /? /g\n' span_id:117) (Token id:Id.Lit_Chars val:'\t\t\ts/ /\t/g\n' span_id:118) (Token id:Id.Lit_Chars val:'\t\t\ts/--/---/g\n' span_id:119) (Token id: Id.Lit_Chars val: '\t\t\ts/but as concerning/but as con cerning/\n' span_id: 120 ) (Token id:Id.Lit_Chars val:'\t\t\t/CEPHALUS - SOCRATES - POLEMARCHUS/ d\n' span_id:121) (Token id:Id.Lit_Chars val:'\t\t" text.txt >text.txt+ &&\n' span_id:122) (Token id:Id.Lit_Chars val:'\tmv text.txt+ text.txt &&\n' span_id:123) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "Remove cruft" &&\n' span_id:124) (Token id:Id.Lit_Chars val:'\n' span_id:125) (Token id:Id.Lit_Chars val:'\tgit checkout master &&\n' span_id:126) (Token id:Id.Lit_Chars val:'\tsed -e "\n' span_id:127) (Token id: Id.Lit_Chars val: '\t\t\ts/\\(not in his right mind\\),\\(.*\\)/\\1;\\2Q/\n' span_id: 128 ) (Token id:Id.Lit_Chars val:'\t\t\ts/Quite correct\\(.*\\)/It is too correct\\1Q/\n' span_id:129) (Token id: Id.Lit_Chars val: '\t\t\ts/unintentionally/un intentionally/\n' span_id: 130 ) (Token id:Id.Lit_Chars val:'\t\t\t/un intentionally/ s/$/Q/\n' span_id:131) (Token id: Id.Lit_Chars val: '\t\t\ts/Polemarchus interposing./Polemarchus, interposing.Q/\n' span_id: 132 ) (Token id:Id.Lit_Chars val:'\t\t\t/justice and holiness/ s/$/Q/\n' span_id:133) (Token id:Id.Lit_Chars val:'\t\t\t/pay your debts/ s/$/Q/\n' span_id:134) (Token id:Id.Lit_Chars val:'\t\t" text.txt | q_to_cr >text.txt+ &&\n' span_id:135) (Token id:Id.Lit_Chars val:'\tmv text.txt+ text.txt &&\n' span_id:136) (Token id:Id.Lit_Chars val:'\tgit commit -a -m "Clarify" &&\n' span_id:137) (Token id:Id.Lit_Chars val:'\tgit show-branch --all\n' span_id:138) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'naive merge fails' span_id:145))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:149) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:150) (Token id: Id.Lit_Chars val: '\ttest_must_fail git merge-recursive HEAD^ -- HEAD remote &&\n' span_id: 151 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git update-index --refresh &&\n' span_id:152) (Token id:Id.Lit_Chars val:'\tgrep "<<<<<<" text.txt\n' span_id:153) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--ignore-space-change makes merge succeed' span_id:160))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:164) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:165) (Token id: Id.Lit_Chars val: '\tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote\n' span_id: 166 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'naive cherry-pick fails' span_id:173))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:177) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:178) (Token id:Id.Lit_Chars val:'\ttest_must_fail git cherry-pick --no-commit remote &&\n' span_id:179) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:180) (Token id:Id.Lit_Chars val:'\ttest_must_fail git cherry-pick remote &&\n' span_id:181) (Token id: Id.Lit_Chars val: '\ttest_must_fail git update-index --refresh &&\n' span_id: 182 ) (Token id:Id.Lit_Chars val:'\tgrep "<<<<<<" text.txt\n' span_id:183) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'-Xignore-space-change makes cherry-pick succeed' span_id:190))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:194) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:195) (Token id: Id.Lit_Chars val: '\tgit cherry-pick --no-commit -Xignore-space-change remote\n' span_id: 196 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--ignore-space-change: our w/s-only change wins' span_id:203))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:207) (Token id:Id.Lit_Chars val:'\tq_to_cr <<-\\EOF >expected &&\n' span_id:208) (Token id: Id.Lit_Chars val: '\t justice and holiness and is the nurse of his age and theQ\n' span_id: 209 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:210) (Token id:Id.Lit_Chars val:'\n' span_id:211) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:212) (Token id: Id.Lit_Chars val: '\tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n' span_id: 213 ) (Token id:Id.Lit_Chars val:'\tgrep "justice and holiness" text.txt >actual &&\n' span_id:214) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:215) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--ignore-space-change: their real change wins over w/s' span_id: 222 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:226) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >expected &&\n' span_id:227) (Token id: Id.Lit_Chars val: '\tit?---to speak the truth and to pay your debts---no more than this? And\n' span_id: 228 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:229) (Token id:Id.Lit_Chars val:'\n' span_id:230) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:231) (Token id: Id.Lit_Chars val: '\tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n' span_id: 232 ) (Token id:Id.Lit_Chars val:'\tgrep "pay your debts" text.txt >actual &&\n' span_id:233) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:234) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--ignore-space-change: does not ignore new spaces' span_id: 241 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:245) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >expected1 &&\n' span_id:246) (Token id: Id.Lit_Chars val: '\tWell said, Cephalus, I replied; but as con cerning justice, what is\n' span_id: 247 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:248) (Token id:Id.Lit_Chars val:'\tq_to_cr <<-\\EOF >expected2 &&\n' span_id:249) (Token id: Id.Lit_Chars val: '\tun intentionally; and when he departs to the world below he is not inQ\n' span_id: 250 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:251) (Token id:Id.Lit_Chars val:'\n' span_id:252) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:253) (Token id: Id.Lit_Chars val: '\tgit merge-recursive --ignore-space-change HEAD^ -- HEAD remote &&\n' span_id: 254 ) (Token id:Id.Lit_Chars val:'\tgrep "Well said" text.txt >actual1 &&\n' span_id:255) (Token id: Id.Lit_Chars val: '\tgrep "when he departs" text.txt >actual2 &&\n' span_id: 256 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expected1 actual1 &&\n' span_id:257) (Token id:Id.Lit_Chars val:'\ttest_cmp expected2 actual2\n' span_id:258) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--ignore-all-space drops their new spaces' span_id:265))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:269) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >expected &&\n' span_id:270) (Token id: Id.Lit_Chars val: '\tWell said, Cephalus, I replied; but as concerning justice, what is\n' span_id: 271 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:272) (Token id:Id.Lit_Chars val:'\n' span_id:273) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:274) (Token id: Id.Lit_Chars val: '\tgit merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&\n' span_id: 275 ) (Token id:Id.Lit_Chars val:'\tgrep "Well said" text.txt >actual &&\n' span_id:276) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:277) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--ignore-all-space keeps our new spaces' span_id:284))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:288) (Token id:Id.Lit_Chars val:'\tq_to_cr <<-\\EOF >expected &&\n' span_id:289) (Token id: Id.Lit_Chars val: '\tun intentionally; and when he departs to the world below he is not inQ\n' span_id: 290 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:291) (Token id:Id.Lit_Chars val:'\n' span_id:292) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:293) (Token id: Id.Lit_Chars val: '\tgit merge-recursive --ignore-all-space HEAD^ -- HEAD remote &&\n' span_id: 294 ) (Token id:Id.Lit_Chars val:'\tgrep "when he departs" text.txt >actual &&\n' span_id:295) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:296) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:--ignore-space-at-eol span_id:303))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:307) (Token id:Id.Lit_Chars val:'\tq_to_cr <<-\\EOF >expected &&\n' span_id:308) (Token id:Id.Lit_Chars val:'\t<<<<<<< HEAD\n' span_id:309) (Token id: Id.Lit_Chars val: '\tis not in his right mind; ought I to give them back to him? No oneQ\n' span_id: 310 ) (Token id:Id.Lit_Chars val:'\t=======\n' span_id:311) (Token id: Id.Lit_Chars val: '\tis not in his right mind, ought I to give them back to him? No one\n' span_id: 312 ) (Token id:Id.Lit_Chars val:'\t>>>>>>> remote\n' span_id:313) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:314) (Token id:Id.Lit_Chars val:'\n' span_id:315) (Token id:Id.Lit_Chars val:'\tgit read-tree --reset -u HEAD &&\n' span_id:316) (Token id: Id.Lit_Chars val: '\ttest_must_fail git merge-recursive --ignore-space-at-eol \\\n' span_id: 317 ) (Token id:Id.Lit_Chars val:'\t\t\t\t\t\t HEAD^ -- HEAD remote &&\n' span_id:318) (Token id:Id.Lit_Chars val:'\tconflict_hunks text.txt >actual &&\n' span_id:319) (Token id:Id.Lit_Chars val:'\ttest_cmp expected actual\n' span_id:320) ) } ) (C {(test_done)}) ] )