-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge: put log tags into commits #2
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ GRN="\033[01;32m" | |
RED="\033[01;31m" | ||
RST="\033[0m" | ||
YLW="\033[01;33m" | ||
branch=$(git branch | grep \* | cut -d ' ' -f2) | ||
|
||
|
||
# Alias for echo to handle escape codes like colors | ||
|
@@ -232,6 +233,9 @@ function generate_versions() { | |
echo | ||
} | ||
|
||
function tag_logs() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this! |
||
git log --oneline --pretty=format:' %s' v${CURRENT_VERSION}..v${TARGET_VERSION} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
function update_to_target_version() { | ||
case ${UPDATE_METHOD} in | ||
|
@@ -245,12 +249,14 @@ git add . && git cherry-pick --continue" | |
fi ;; | ||
|
||
"merge") | ||
if ! GIT_MERGE_VERBOSITY=1 git merge --no-edit "v${TARGET_VERSION}"; then | ||
if ! GIT_MERGE_VERBOSITY=1 git merge --edit -m "Merge ${TARGET_VERSION} into ${branch}" -m "Changes in ${TARGET_VERSION}: ($(git status | grep commits | cut -d ' ' -f8-9 | head -n1 | sed 's/commits./commits/'))" -m "$(tag_logs)" "v${TARGET_VERSION}" --no-edit; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kill the boilerplate (this exact same message is used in both places) and make a function like in my own script ( The git aliases can be viewed here for translation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't check your personal scripts before, i just saw your commits on als repo xD, almost exact same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah didn't expect you to :P if you feel like adapting it for here, by all means feel free! |
||
die "Merge needs manual intervention! | ||
|
||
Resolve conflicts then run git merge --continue!" | ||
else | ||
header "${TARGET_VERSION} MERGED CLEANLY!" "${GRN}" | ||
git commit -q --amend -m "Merge ${TARGET_VERSION} into ${branch}" -m "Changes in ${TARGET_VERSION}: ($(git status | grep commits | cut -d ' ' -f8-9 | head -n1 | sed 's/commits./commits/'))" -m "$(tag_logs)" --no-edit | ||
|
||
fi ;; | ||
esac | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git rev-parse --abbrev-ref HEAD
is a cleaner way to do this