Skip to content

Commit

Permalink
Merge branch 'internal' into mix
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Mar 5, 2015
2 parents 7f59f00 + 3ef2b5c commit 26868d6
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _script/_git_branch
@@ -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
22 changes: 22 additions & 0 deletions _script/check-devel-branch
@@ -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
9 changes: 9 additions & 0 deletions _script/checkout-all-remote
@@ -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
47 changes: 47 additions & 0 deletions make-dev
@@ -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
21 changes: 21 additions & 0 deletions make-mix
@@ -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
15 changes: 15 additions & 0 deletions to-gitcafe
@@ -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
)

0 comments on commit 26868d6

Please sign in to comment.