Skip to content

blurb: get BPO# from branch, add commit template - update the PR #308

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

Closed
wants to merge 3 commits into from

Conversation

matrixise
Copy link
Member

@matrixise matrixise commented Feb 15, 2019

Update of the pull request of @tiran

Co-authored-by: Christian Heimes [email protected]

tiran and others added 2 commits February 15, 2019 13:11
blurb now gets the branch name from git and auto-fills the bpo number if
the branch name looks like "bpo-1234-whatever". "bpo1234" or
"bpo_1234_whatever" are also supported.

Further more blurb now writes .git/blurb commit template. The first line
of the template is "bpo-{bpo}: suffix of branch name". The body of the
template is the blurb text.

$ git config commit.template .git/blurb

$ git checkout -b bpo-1234-confuse-a-cat
$ blurb
git ci
---
bpo-1234: confuse a cat

blurb text
---

Signed-off-by: Christian Heimes <[email protected]>
@matrixise matrixise changed the title Pr 184 blurb: get BPO# from branch, add commit template - update the PR Feb 15, 2019
@matrixise
Copy link
Member Author

Updated and rebased with the master branch.

@matrixise
Copy link
Member Author

Thanks @Mariatta


init_tmp_with_template()
with open(tmp_path, "wt", encoding="utf-8") as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be

Suggested change
with open(tmp_path, "wt", encoding="utf-8") as f:
pathlib.Path(tmp_path).write_text(template.format(bpo=branch_bpo))

@larryhastings
Copy link
Contributor

So, in general I don't like this approach. I propose an alternate approach, which you can see in #312 . In short: add "--bpo" and "--section" flags to "blurb add", letting you specify those fields on the command-line. This will let @tiran automate the problem the way he likes, and presumably @matrixise and everybody else too. If #312 is accepted I plan to close this PR without accepting it.

@matrixise
Copy link
Member Author

matrixise commented Mar 28, 2019 via email

@hugovk
Copy link
Member

hugovk commented Mar 26, 2022

Closing this in favour of the other solution at #312.

@hugovk hugovk closed this Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants