Closed vvo closed 6 years ago
Instead of the first one? I think so.
It's currently not even inserting the first commit message inside the PR description. Only taking the first line as the PR subject.
Yeah, you are right. The description is always empty. I think it's a good and simple idea, just a way to give more information about the PR.
So what would happen when no title is given for a pull request?
Also, I have complains about using the last commit message.
If you guys can figure out a nice solution, I'd appreciate.
As for getting the first commit message to be displayed in the desc:
gh pr --submit algolia --branch v2 --description "$(git log -1 --pretty=%B | tail -n +3)"
I'll let the user see how to get the last commit that is not yet merged in base branch :D
@vvo Currently the title corresponds to the last commit message.
It seems kinda superfluous to me to have the description also default to the last commit message.
Also if there are multiple commits, and the last commit isn't descriptive of the overall pr (like if your last commit is "source formatting" or something like that) idk how helpful that would practically be.
Open for further discussion though. Thoughts?
It seems kinda superfluous to me to have the description also default to the last commit message.
Also if there are multiple commits, and the last commit isn't descriptive of the overall pr (like if your last commit is "source formatting" or something like that) idk how helpful that would practically be.
Open for further discussion though. Thoughts?
I think this is only based on my own way of doing commits, when I open PR usually my commit history is clean and so my description is nicely written and all. That's why. Thanks still!
Haha I see. I am the same way but I think that is a bit rare.
I've seen so many prs with a stack of commits that when using the last one as a description, it wouldn't be very helpful.
Personally, I solve it with an alias in my .zshrc
. So you could solve it with something like:
function gpr() {
gh pr -s $1 -b $2 -t $3 -D "$(git log -1 --pretty=%B | tail -n +3)"
}
Closing for now because it seems best to leave it up to the user to set their own default descriptions as in the alias above.
Thanks for your feedback and quick response!
Can it be that the default description for a PR is the latest commit message? Does it makes sense?
Thanks.