Advertisement
eacousineau

Git Submodule - Tests for--post-order and --include-super

Mar 4th, 2013
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.45 KB | None | 0 0
  1. for dir in a b c d
  2. do
  3.         git init $dir
  4.         pushd $dir
  5.                 touch test
  6.                 echo $dir > bob
  7.                 git add -A
  8.                 git commit -m "Init"
  9.         popd
  10. done
  11.  
  12. pushd b
  13.         git submodule add ../d
  14.         git commit -m "Subbed"
  15. popd
  16.  
  17. pushd a
  18.         git submodule add ../b
  19.         git submodule add ../c
  20.         git submodule update --init --recursive
  21.         git commit -a -m "Double subbed"
  22.        
  23.         # Testing each of the iteration types
  24.         echo "Normal"
  25.         git submodule foreach "echo \"'ello \$name\""
  26.         echo
  27.        
  28.         echo "Normal, Recursive"
  29.         git submodule foreach --recursive "echo \"'ello \$name\""
  30.         echo
  31.        
  32.         echo "Normal, Including Super"
  33.         git submodule foreach --include-super "echo \"'ello \$name\""
  34.         echo
  35.        
  36.         echo "Normal, Recursive, Including Super"
  37.         git submodule foreach --recursive --include-super "echo \"'ello \$name\""
  38.         echo
  39.        
  40.         echo "Post-order (exactly the same on its own - disable this?)"
  41.         git submodule foreach --post-order "echo \"'ello \$name\""
  42.         echo
  43.        
  44.         echo "Post-order, Recursive"
  45.         git submodule foreach --post-order --recursive "echo \"'ello \$name\""
  46.         echo
  47.        
  48.         echo "Post-order, Including Super"
  49.         git submodule foreach --post-order --include-super "echo \"'ello \$name\""
  50.         echo
  51.        
  52.         echo "Post-Order, Recursive, Including Super"
  53.         git submodule foreach --post-order --recursive --include-super "echo \"'ello \$name\""
  54.         echo
  55. popd
  56.  
  57. echo <<COMMENT
  58. Normal
  59. Entering 'b'
  60. 'ello b
  61. Entering 'c'
  62. 'ello c
  63.  
  64. Normal, Recursive
  65. Entering 'b'
  66. 'ello b
  67. Entering 'b/d'
  68. 'ello d
  69. Entering 'c'
  70. 'ello c
  71.  
  72. Normal, Including Super
  73. Entering 'a'
  74. 'ello a
  75. Entering 'b'
  76. 'ello b
  77. Entering 'c'
  78. 'ello c
  79.  
  80. Normal, Recursive, Including Super
  81. Entering 'a'
  82. 'ello a
  83. Entering 'b'
  84. 'ello b
  85. Entering 'b/d'
  86. 'ello d
  87. Entering 'c'
  88. 'ello c
  89.  
  90. Post-order (exactly the same on its own - disable this?)
  91. Entering 'b'
  92. 'ello b
  93. Entering 'c'
  94. 'ello c
  95.  
  96. Post-order, Recursive
  97. Entering 'b/d'
  98. 'ello d
  99. Entering 'b'
  100. 'ello b
  101. Entering 'c'
  102. 'ello c
  103.  
  104. Post-order, Including Super
  105. Entering 'b'
  106. 'ello b
  107. Entering 'c'
  108. 'ello c
  109. Entering 'a'
  110. 'ello a
  111.  
  112. Post-Order, Recursive, Including Super
  113. Entering 'b/d'
  114. 'ello d
  115. Entering 'b'
  116. 'ello b
  117. Entering 'c'
  118. 'ello c
  119. Entering 'a'
  120. 'ello a
  121. COMMENT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement