(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'verbose commit template'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (AndOr children: [ (SimpleCommand words: [{(write_script)} {(DQ (check-for-diff))}] redirects: [ (HereDoc op_id: Redir_DLess fd: 16777215 body: {('grep \'^diff --git\' "$1" >out\n') ('exit 0\n')} do_expansion: False here_end: EOF was_filled: True spids: [20] ) ] ) (C {(test_set_editor)} {(DQ ($ VSub_Name '$PWD') (/check-for-diff))}) ] op_id: Op_DAmp ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:16777215 arg_word:{(message)} spids:[36]) (HereDoc op_id: Redir_DLess fd: 16777215 body: {('subject\n') ('\n') ('body\n')} do_expansion: False here_end: EOF was_filled: True spids: [39] ) ] ) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\techo content >file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -F message\n'>) } ) (C {(test_expect_success)} {(SQ <'initial commit shows verbose diff'>)} {(SQ <'\n'> <'\tgit commit --amend -v &&\n'> <'\ttest_line_count = 1 out\n'>)} ) (C {(test_expect_success)} {(SQ <'second commit'>)} { (SQ <'\n'> <'\techo content modified >file &&\n'> <'\tgit add file &&\n'> <'\tgit commit -F message\n'> ) } ) (FuncDef name: check_message body: (BraceGroup children: [ (AndOr children: [ (SimpleCommand words: [ {(git)} {(log)} {(-1)} {(--pretty) (Lit_Other '=') (format) (Lit_Other ':') (Lit_Other '%') (s) (Lit_Other '%') (n) (Lit_Other '%') (n) (Lit_Other '%') (b) } ] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(actual)} spids:[112])] ) (C {(test_cmp)} {(DQ ($ VSub_Number '$1'))} {(actual)}) ] op_id: Op_DAmp ) ] spids: [90] ) spids: [86 89] ) (C {(test_expect_success)} {(SQ <'verbose diff is stripped out'>)} { (SQ <'\n'> <'\tgit commit --amend -v &&\n'> <'\tcheck_message message &&\n'> <'\ttest_line_count = 1 out\n'> ) } ) (C {(test_expect_success)} {(SQ <'verbose diff is stripped out (mnemonicprefix)'>)} { (SQ <'\n'> <'\tgit config diff.mnemonicprefix true &&\n'> <'\tgit commit --amend -v &&\n'> <'\tcheck_message message &&\n'> <'\ttest_line_count = 1 out\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:16777215 arg_word:{(diff)} spids:[160]) (HereDoc op_id: Redir_DLess fd: 16777215 body: {('This is an example commit message that contains a diff.\n') ('\n') ('diff --git c/file i/file\n') ('new file mode 100644\n') ('index 0000000..f95c11d\n') ('--- /dev/null\n') ('+++ i/file\n') ('@@ -0,0 +1 @@\n') ('+this is some content\n') } do_expansion: False here_end: EOF was_filled: True spids: [163] ) ] ) (C {(test_expect_success)} {(SQ <'diff in message is retained without -v'>)} {(SQ <'\n'> <'\tgit commit --amend -F diff &&\n'> <'\tcheck_message diff\n'>)} ) (C {(test_expect_success)} {(SQ <'diff in message is retained with -v'>)} {(SQ <'\n'> <'\tgit commit --amend -F diff -v &&\n'> <'\tcheck_message diff\n'>)} ) (C {(test_expect_success)} {(SQ <'submodule log is stripped out too with -v'>)} { (SQ <'\n'> <'\tgit config diff.submodule log &&\n'> <'\tgit submodule add ./. sub &&\n'> <'\tgit commit -m "sub added" &&\n'> <'\t(\n'> <'\t\tcd sub &&\n'> <'\t\techo "more" >>file &&\n'> <'\t\tgit commit -a -m "submodule commit"\n'> <'\t) &&\n'> <'\t(\n'> <'\t\tGIT_EDITOR=cat &&\n'> <'\t\texport GIT_EDITOR &&\n'> <'\t\ttest_must_fail git commit -a -v 2>err\n'> <'\t) &&\n'> <'\ttest_i18ngrep "Aborting commit due to empty commit message." err\n'> ) } ) (C {(test_expect_success)} {(SQ <'verbose diff is stripped out with set core.commentChar'>)} { (SQ <'\n'> <'\t(\n'> <'\t\tGIT_EDITOR=cat &&\n'> <'\t\texport GIT_EDITOR &&\n'> <'\t\ttest_must_fail git -c core.commentchar=";" commit -a -v 2>err\n'> <'\t) &&\n'> <'\ttest_i18ngrep "Aborting commit due to empty commit message." err\n'> ) } ) (C {(test_expect_success)} {(SQ <'status does not verbose without --verbose'>)} {(SQ <'\n'> <'\tgit status >actual &&\n'> <'\t! grep "^diff --git" actual\n'>)} ) (C {(test_expect_success)} {(SQ <'setup -v -v'>)} {(SQ <'\n'> <'\techo dirty >file\n'>)}) (ForEach iter_name: i iter_words: [{(true)} {(1)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ('commit.verbose=') ($ VSub_Name '$i') (' and --verbose omitted'))} { (DQ ('\n') ('\t\tgit -c commit.verbose=') ($ VSub_Name '$i') (' commit --amend &&\n') ('\t\ttest_line_count = 1 out\n') ('\t') ) } ) ] spids: [272 292] ) spids: [267 16777215] ) (ForEach iter_name: i iter_words: [{(false)} {(-2)} {(-1)} {(0)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ('commit.verbose=') ($ VSub_Name '$i') (' and --verbose omitted'))} { (DQ ('\n') ('\t\tgit -c commit.verbose=') ($ VSub_Name '$i') (' commit --amend &&\n') ('\t\ttest_line_count = 0 out\n') ('\t') ) } ) ] spids: [309 329] ) spids: [300 16777215] ) (ForEach iter_name: i iter_words: [{(2)} {(3)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ('commit.verbose=') ($ VSub_Name '$i') (' and --verbose omitted'))} { (DQ ('\n') ('\t\tgit -c commit.verbose=') ($ VSub_Name '$i') (' commit --amend &&\n') ('\t\ttest_line_count = 2 out\n') ('\t') ) } ) ] spids: [342 362] ) spids: [337 16777215] ) (ForEach iter_name: i iter_words: [{(true)} {(false)} {(-2)} {(-1)} {(0)} {(1)} {(2)} {(3)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ('commit.verbose=') ($ VSub_Name '$i') (' and --verbose'))} { (DQ ('\n') ('\t\tgit -c commit.verbose=') ($ VSub_Name '$i') (' commit --amend --verbose &&\n') ('\t\ttest_line_count = 1 out\n') ('\t') ) } ) (C {(test_expect_success)} {(DQ ('commit.verbose=') ($ VSub_Name '$i') (' and --no-verbose'))} { (DQ ('\n') ('\t\tgit -c commit.verbose=') ($ VSub_Name '$i') (' commit --amend --no-verbose &&\n') ('\t\ttest_line_count = 0 out\n') ('\t') ) } ) (C {(test_expect_success)} {(DQ ('commit.verbose=') ($ VSub_Name '$i') (' and -v -v'))} { (DQ ('\n') ('\t\tgit -c commit.verbose=') ($ VSub_Name '$i') (' commit --amend -v -v &&\n') ('\t\ttest_line_count = 2 out\n') ('\t') ) } ) ] spids: [387 445] ) spids: [370 16777215] ) (C {(test_expect_success)} {(DQ ('status ignores commit.verbose=true'))} { (SQ <'\n'> <'\tgit -c commit.verbose=true status >actual &&\n'> <'\t! grep "^diff --git actual"\n'> ) } ) (C {(test_done)}) ] )