| OLD | NEW |
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 . demo_repo.sh | 2 . git-drover.demo.common.sh |
| 3 | 3 |
| 4 silent git push origin refs/remotes/origin/master:refs/branch-heads/9999 | 4 drover_c "This change needs to go to branch 9999" |
| 5 silent git config --add remote.origin.fetch \ | |
| 6 +refs/branch-heads/*:refs/remotes/branch-heads/* | |
| 7 silent git fetch origin | |
| 8 | |
| 9 silent git checkout -b master origin/master | |
| 10 add modified_file | |
| 11 set_user some.committer | |
| 12 c "This change needs to go to branch 9999" | |
| 13 silent git tag pick_commit | |
| 14 | |
| 15 comment Before working with branches, you must \'gclient sync \ | |
| 16 --with_branch_heads\' at least once to fetch the branches. | |
| 17 | |
| 18 set_user branch.maintainer | |
| 19 tick 1000 | |
| 20 | 5 |
| 21 echo "# Make sure we have the most up-to-date branch sources." | 6 echo "# Make sure we have the most up-to-date branch sources." |
| 22 run git fetch | 7 run git fetch |
| 23 echo | 8 echo |
| 24 echo "# Here's the commit we want to 'drover'." | 9 echo "# Here's the commit we want to 'drover'." |
| 25 run git log -n 1 --pretty=fuller | 10 run git log -n 1 --pretty=fuller |
| 26 echo | 11 echo |
| 27 echo "# Checkout the branch we want to 'drover' to." | 12 echo "# Checkout the branch we want to 'drover' to." |
| 28 run git checkout -b drover_9999 branch-heads/9999 | 13 run git checkout -b drover_9999 branch-heads/9999 |
| 29 echo | 14 echo |
| 30 echo "# Now do the 'drover'." | 15 echo "# Now do the 'drover'." |
| 31 echo "# IMPORTANT!!! Do Not leave off the '-x' flag" | 16 echo "# IMPORTANT!!! Do Not leave off the '-x' flag" |
| 32 run git cherry-pick -x $(git show-ref -s pick_commit) | 17 run git cherry-pick -x $(git show-ref -s pick_commit) |
| 33 echo | 18 echo |
| 34 echo "# That took the code authored by some.commiter and commited it to the" | 19 echo "# That took the code authored by some.commiter and commited it to the" |
| 35 echo "# branch by branch.maintainer (us)." | 20 echo "# branch by branch.maintainer (us)." |
| 36 run git log -n 1 --pretty=fuller | 21 run git log -n 1 --pretty=fuller |
| 37 echo | 22 echo |
| 38 echo "# Looks good. Ship it!" | 23 echo "# Looks good. Ship it!" |
| 39 pcommand git cl upload | 24 pcommand git cl upload |
| 40 echo "# Get LGTM or TBR." | 25 echo "# Wait for LGTM or TBR it." |
| 41 run git cl land | 26 run git cl land |
| 42 echo "# Or skip the LGTM/TBR and just 'git cl land --bypass-hooks'" | 27 echo "# Or skip the LGTM/TBR and just 'git cl land --bypass-hooks'" |
| OLD | NEW |