This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new files referenced by gitconfig
- Loading branch information
1 parent
64a0408
commit 187be6f
Showing
3 changed files
with
71 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,14 @@ | ||
#!/bin/bash | ||
|
||
cur_dir=$(pwd); | ||
branch_name="master"; | ||
|
||
if [[ $cur_dir == *-ee-* ]]; then | ||
repo_path=$(echo $cur_dir | sed -E 's#-ee-([^/]+)/.*#-ee-\1#') | ||
cur_dir="${cur_dir#*ee-}" | ||
cur_dir="ee-${cur_dir%%/*}" | ||
git show-ref --quiet "$cur_dir" && branch_name="$cur_dir" | ||
[[ -f "$repo_path/.git/refs/heads/$cur_dir" ]] && branch_name="$cur_dir" | ||
fi; | ||
|
||
echo $branch_name |
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,30 @@ | ||
#!/bin/bash | ||
|
||
file_types=${2:-"*.js *.css *.jsp* *.vm *.ftl"} | ||
|
||
ignore_folder="portal-web/test/" | ||
|
||
to_rev=${1:-"HEAD"}; | ||
old_head=${to_rev}^; | ||
new_head=$to_rev; | ||
|
||
if [[ $to_rev == *..* ]]; then | ||
old_head=${to_rev%%..*}; | ||
new_head=${to_rev#*..*}; | ||
fi | ||
|
||
ref_spec=$old_head..$new_head; | ||
|
||
entries=$(git log -M -C --name-only --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative $ref_spec -- $file_types | sed 's/^/ /') | ||
|
||
totalstat=$(git diff --numstat --pretty='%H' --no-renames $ref_spec | grep -v "\b$ignore_folder" | xargs -0n1 echo -n | awk '{{print $3}}' | sed -e 's/^.*\.\(.*\)$/\1/' | sort | uniq -c | tr '\n' ',' | sed 's/,$//') | ||
|
||
if [[ -z $entries ]]; then | ||
echo "There are no changes in ${file_types// /, } across $ref_spec" | ||
else | ||
echo "Changes in these file types: ${file_types// /, } that you might be interested in:" | ||
|
||
echo "$entries" | ||
echo "---" | ||
echo "$totalstat" | ||
fi |
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,27 @@ | ||
#!/bin/bash | ||
|
||
old_head=$(git rev-parse --short head | tr -d '\n') | ||
|
||
msg=$(git stash save) | ||
|
||
[[ $msg =~ ^'No local changes to save'$ ]] && stashed=0 || stashed=1 | ||
|
||
git fetch upstream && git merge upstream/$1 --ff-only && git push origin $1 | ||
|
||
new_head=$(git rev-parse --short head | tr -d '\n') | ||
|
||
[ $old_head != $new_head ] && updated=1 || updated=0 | ||
|
||
if [[ $stashed == 1 ]]; then | ||
git stash pop > /dev/null | ||
fi | ||
|
||
if [[ $updated == 1 ]]; then | ||
echo "Updated from $old_head to $new_head ($old_head..$new_head)" | ||
echo "---------------------------------------------------" | ||
|
||
git of-interest $old_head..$new_head | ||
|
||
echo "---------------------------------------------------" | ||
echo "Updated from $old_head to $new_head ($old_head..$new_head)" | ||
fi |