(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USAGE) op: Equal rhs: {(SQ <"[--mixed | --soft | --hard] [<commit-ish>] [ [--] <paths>...]">)} spids: [12] ) ] spids: [12] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:SUBDIRECTORY_OK) op:Equal rhs:{(Yes)} spids:[17])] spids: [17] ) (C {(.)} {(git-sh-setup)}) (C {(set_reflog_action)} {(DQ ("reset ") ($ VSub_Star "$*"))}) (C {(require_work_tree)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs:(LhsName name:update) op:Equal rhs:{(SQ )} spids:[34]) (assign_pair lhs:(LhsName name:reset_type) op:Equal rhs:{(--mixed)} spids:[36]) ] spids: [34] ) (C {(unset)} {(rev)}) (While cond: [(C {(test)} {($ VSub_Pound "$#")} {(KW_Bang "!") (Lit_Other "=")} {(0)})] body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(--mixed)} {(--soft)} {(--hard)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:reset_type) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [79] ) ] spids: [79] ) ] spids: [67 76 85 -1] ) (case_arm pat_list: [{(--)}] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [88 89 95 -1] ) (case_arm pat_list: [{(-) (Lit_Other "*")}] action: [(C {(usage)})] spids: [98 100 106 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rev) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(--verify)} {(DQ ($ VSub_Number "$1"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [114 124] ) } spids: [113] ) ] spids: [113] ) (C {(exit)}) ] op_id: Op_DPipe ) (C {(shift)}) (ControlFlow token:<ControlFlow_Break break>) ] spids: [109 110 137 -1] ) ] spids: [58 64 140] ) (C {(shift)}) ] spids: [55 145] ) ) (C {(Lit_Other ":")} { (BracedVarSub token: <VSub_Name rev> suffix_op: (StringUnary op_id:VTest_Equals arg_word:{(HEAD)}) spids: [150 154] ) } ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rev) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(--verify)} {($ VSub_Name "$rev") (Lit_Other "^") (0)} ) ] ) left_token: <Left_CommandSub "$("> spids: [157 167] ) } spids: [156] ) ] spids: [156] ) (C {(exit)}) ] op_id: Op_DPipe ) (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [(case_arm pat_list:[{(--)}] action:[(C {(shift)})] spids:[185186190-1])] spids: [177 183 192] ) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound "$#")} {(KW_Bang "!") (Lit_Other "=")} {(0)})] action: [ (AndOr children: [ (C {(test)} {(DQ ($ VSub_Name "$reset_type"))} {(Lit_Other "=")} {(DQ (--mixed))}) (C {(die)} {(DQ ("Cannot do partial ") ($ VSub_Name "$reset_type") (" reset."))}) ] op_id: Op_DPipe ) (AndOr children: [ (Pipeline children: [ (C {(git)} {(diff-index)} {(--cached)} {($ VSub_Name "$rev")} {(--)} {(DQ ($ VSub_At "$@"))} ) (C {(sed)} {(-e)} { (SQ < "s/^:\\([0-7][0-7]*\\) [0-7][0-7]* \\([0-9a-f][0-9a-f]*\\) [0-9a-f][0-9a-f]* [A-Z]\t\\(.*\\)$/\\1 \\2\t\\3/" > ) } ) (C {(git)} {(update-index)} {(--add)} {(--remove)} {(--index-info)}) ] negated: False ) (C {(exit)}) ] op_id: Op_DPipe ) (C {(git)} {(update-index)} {(--refresh)}) (C {(exit)}) ] spids: [-1 215] ) ] spids: [-1 295] ) (C {(cd_to_toplevel)}) (If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Name "$reset_type"))} {(Lit_Other "=")} {(DQ (--hard))})] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:update) op:Equal rhs:{(-u)} spids:[318])] spids: [318] ) ] spids: [-1 315] ) ] spids: [-1 321] ) (If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Name "$reset_type"))} {(Lit_Other "=")} {(DQ (--soft))})] action: [ (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/MERGE_HEAD))}) (C {(test)} {(DQ )} {(KW_Bang "!") (Lit_Other "=")} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(git)} {(ls-files)} {(--unmerged)})] ) left_token: <Left_CommandSub "$("> spids: [373 379] ) ) } ) ] op_id: Op_DPipe ) ] action: [(C {(die)} {(DQ ("Cannot do a soft reset in the middle of a merge."))})] spids: [-1 383] ) ] spids: [-1 393] ) ] spids: [-1 347] ) ] else_action: [ (AndOr children: [ (C {(git)} {(read-tree)} {(-v)} {(--reset)} {($ VSub_Name "$update")} {(DQ ($ VSub_Name "$rev"))} ) (C {(exit)}) ] op_id: Op_DPipe ) ] spids: [395 416] ) (If arms: [ (if_arm cond: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:orig) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(git)} {(rev-parse)} {(--verify)} {(HEAD)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [434] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [425 436] ) } spids: [424] ) ] spids: [424] ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$orig"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/ORIG_HEAD))} spids: [447] ) ] ) ] spids: [-1 438] ) ] else_action: [(C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/ORIG_HEAD))})] spids: [453 465] ) (C {(git)} {(update-ref)} {(-m)} {(DQ ($ VSub_Name "$GIT_REFLOG_ACTION"))} {(HEAD)} {(DQ ($ VSub_Name "$rev"))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:update_ref_status) op: Equal rhs: {($ VSub_QMark "$?")} spids: [483] ) ] spids: [483] ) (Case to_match: {(DQ ($ VSub_Name "$reset_type"))} arms: [ (case_arm pat_list: [{(--hard)}] action: [ (AndOr children: [ (C {(test)} {($ VSub_Name "$update_ref_status")} {(Lit_Other "=")} {(0)}) (BraceGroup children: [ (C {(printf)} {(DQ ("HEAD is now at "))}) (SimpleCommand words: [ {(git)} {(log)} {(--max-count) (Lit_Other "=") (1)} {(--pretty) (Lit_Other "=") (oneline)} {(--abbrev-commit)} {(HEAD)} ] more_env: [(env_pair name:GIT_PAGER val:{(SQ )} spids:[520])] ) ] spids: [510] ) ] op_id: Op_DAmp ) ] spids: [495 497 544 -1] ) (case_arm pat_list:[{(--soft)}] spids:[546548551-1]) (case_arm pat_list: [{(--mixed)}] action: [(C {(git)} {(update-index)} {(--refresh)})] spids: [556 558 572 -1] ) ] spids: [487 493 574] ) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/MERGE_HEAD))} {(DQ ($ VSub_Name "$GIT_DIR") (/rr-cache/MERGE_RR))} {(DQ ($ VSub_Name "$GIT_DIR") (/SQUASH_MSG))} {(DQ ($ VSub_Name "$GIT_DIR") (/MERGE_MSG))} ) (C {(exit)} {($ VSub_Name "$update_ref_status")}) ] )