-
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?
Conversation
Instead of 'This is {tags} the stable released' this will input tag logs into merge-commits. * but not sure this will works on others, but mine works well.
I have this in my personal script but I haven't really wanted to force this on people, some people prefer the default |
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.
Also, please run your changes through shellcheck.net!
@@ -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) |
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
@@ -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 comment
The 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 (create_merge_message
, append_conflicts
).
The git aliases can be viewed here for translation.
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.
didn't check your personal scripts before, i just saw your commits on als repo xD, almost exact same
thanks
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.
Yeah didn't expect you to :P if you feel like adapting it for here, by all means feel free!
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.
sorry, I thought I saved these in the last one :/
@@ -232,6 +233,9 @@ function generate_versions() { | |||
echo | |||
} | |||
|
|||
function tag_logs() { |
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.
I like this!
@@ -232,6 +233,9 @@ function generate_versions() { | |||
echo | |||
} | |||
|
|||
function tag_logs() { | |||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
v${CURRENT_VERSION}..v${TARGET_VERSION}
= ${RANGE}
also the calculated number of commits should be this
it's more cleaner ways |
Yes, I noticed that after the second review and decided against a third review comment haha |
Instead of 'This is {tags} the stable released'
this will input tag logs into merge-commits.