Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
ref=${1-HEAD} | ||
cur_branch=$(git symbolic-ref $ref 2>/dev/null) | ||
cur_branch=${cur_branch##refs/heads/} | ||
|
||
echo $cur_branch |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
branches=$(git branch | awk '{print $NF}' | grep "^fd\.") | ||
|
||
for dbr in $branches; do | ||
|
||
fbr=f.${dbr:3} | ||
echo $dbr $fbr | ||
|
||
base=$(git merge-base $dbr $fbr) | ||
|
||
feature_hash=$(git rev-parse $fbr) | ||
|
||
if [ "$base" != "$feature_hash" ]; then | ||
echo divert branch | ||
git log --color --graph --decorate --pretty=oneline \ | ||
--simplify-by-decoration \ | ||
--abbrev-commit -M --first-parent \ | ||
$dbr $fbr | ||
fi | ||
|
||
done |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
|
||
branches=$(git branch -r | awk '{print $1}' | grep -v 'origin/HEAD' | awk -F/ '{print $2}') | ||
|
||
for b in $branches; do | ||
echo $b | ||
git checkout $b | ||
done |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
commit_mes=$1 | ||
|
||
if [ ".$commit_mes" = "." ]; then | ||
echo "usage: $0 <commit-message>" | ||
exit 1 | ||
fi | ||
|
||
|
||
src_branch=mix | ||
dst_branch=dev | ||
|
||
cur_hash=$(git log -n1 --format="%H") | ||
cur_branch=$(./_script/_git_branch) | ||
if [ ".$cur_branch" = "." ]; then | ||
echo "not on a branch" | ||
exit 1 | ||
fi | ||
|
||
src_tree_hash=$(git cat-file -p $src_branch | head -n1 | awk '{print $2}') | ||
|
||
changelog="$(./_script/build-d/make-change-log)" | ||
|
||
mes="$commit_mes | ||
$changelog | ||
x-update-from: $src_branch $cur_hash" | ||
|
||
new_commit_hash=$(echo "$mes" | git commit-tree $src_tree_hash -p $dst_branch) | ||
git checkout $dst_branch \ | ||
&& \ | ||
if [ ".$changelog" = "." ]; then | ||
all_changelog="$(cat changelog.md 2>/dev/null)" | ||
else | ||
all_changelog="$changelog | ||
$(cat changelog.md 2>/dev/null)" | ||
fi \ | ||
&& git merge --ff-only $new_commit_hash \ | ||
&& echo "$all_changelog" >changelog.md \ | ||
&& git add changelog.md \ | ||
&& git commit --amend --no-edit -m "$mes" \ | ||
|| git reset HEAD^ | ||
|
||
git checkout $cur_branch |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
branches= | ||
branches="$branches $(git branch | awk '{print $NF}' | grep "^f\.")" | ||
branches="$branches $(git branch | awk '{print $NF}' | grep "^t\.")" | ||
branches="$branches $(git branch | awk '{print $NF}' | grep "^snp\.")" | ||
|
||
cur_branch=$(./_script/_git_branch) | ||
[ "$cur_branch" = "mix" ] \ | ||
&& git tag -f mixbkp \ | ||
&& git reset --hard root \ | ||
&& git mc --no-edit --commit internal \ | ||
&& git merge \ | ||
--no-edit \ | ||
--commit \ | ||
--no-ff \ | ||
-m 'merge f.* t.* snp.*' \ | ||
$branches \ | ||
&& vim -c "helptags ./doc" -c "qa!" \ | ||
&& git commit --amend -a --no-edit \ | ||
&& git tag -f mixdoc |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
src="$(pwd)" | ||
cur_hash=$(git log -n1 --format="%H") | ||
n=xpt-$cur_hash | ||
|
||
( | ||
rm -rf /tmp/$n | ||
cd /tmp/ \ | ||
&& mkdir $n \ | ||
&& git clone --bare "$src" "$n" \ | ||
&& cd $n \ | ||
&& git remote add b git@gitcafe.com:drmingdrmer/xptemplate.git \ | ||
&& git push b --all --force | ||
) |