Last active
August 29, 2015 14:13
-
-
Save dkubb/fbb28209884ce70de1cc to your computer and use it in GitHub Desktop.
Revisions
-
dkubb renamed this gist
Feb 13, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dkubb revised this gist
Feb 13, 2015 . 4 changed files with 1 addition and 61 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Moved to https://github.com/dkubb/git-tools This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +0,0 @@ -
dkubb revised this gist
Feb 13, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" COMMAND # Rebase the current branch on top of the parent git rebase --keep-empty -- $parent # Rewrite all commits against the current commit git filter-branch --force --env-filter "$command" -- "$parent..HEAD" -
dkubb renamed this gist
Feb 10, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Fix branch commit data to be the same as author data set -euo pipefail IFS=$'\n\t' -
dkubb created this gist
Jan 9, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/usr/bin/env bash # Prune all merged local and remote branches set -euo pipefail IFS=$'\n\t' branch=$(git rev-parse --abbrev-ref HEAD) remote=$(git config "branch.${branch}.remote") git remote update > /dev/null git remote prune "$remote" git branch --remotes --merged "$remote/$branch" \ | awk -F\"/\" "!/(>|$branch)/ {print \$2}" \ | xargs --no-run-if-empty --max-lines 1 git push "$remote" --delete This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/usr/bin/env bash # Push commits individually to trigger CI builds for each set -euo pipefail IFS=$'\n\t' parent=${1-master} branch=$(git rev-parse --abbrev-ref HEAD) remote=$(git config "branch.${branch}.remote") # Commits in the local branch not in the remote branch commits=$( comm -13 \ <(git rev-list "$remote/$parent..$remote/$branch" --reverse) \ <(git rev-list "$parent..$branch" --reverse) ) # Push all commits not in the parent branch for commit in $commits do # Trigger CI for each commit by pushing them individually git push --force "$remote" "$commit:$branch" done This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/usr/bin/env bash # Rebase a branch on a parent branch, preserving commit metadata set -euo pipefail IFS=$'\n\t' parent=${1-master} # The command to execute for each commit read -r -d '' command <<-'COMMAND' || true export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" COMMAND # Rebase the current branch on top of the parent git rebase $parent # Rewrite all commits against the current commit git filter-branch --force --env-filter "$command" -- "$parent..HEAD"