Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Merge: put log tags into commits #2

wants to merge 1 commit into from

Conversation

adekmaulana
Copy link

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.

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.
@nathanchance
Copy link
Member

I have this in my personal script but I haven't really wanted to force this on people, some people prefer the default Merge tag 'v<version>' into <branch>. I will consider it!

Copy link
Member

@nathanchance nathanchance left a 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)
Copy link
Member

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
Copy link
Member

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.

Copy link
Author

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

Copy link
Member

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!

Copy link
Member

@nathanchance nathanchance left a 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() {
Copy link
Member

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}
Copy link
Member

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}

@adekmaulana
Copy link
Author

also the calculated number of commits should be this

git rev-list v${CURRENT_VERSION}..v${TARGET_VERSION} --count

it's more cleaner ways

@nathanchance
Copy link
Member

Yes, I noticed that after the second review and decided against a third review comment haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants