node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Feature: default description for PR should be the commit message? #412

Closed vvo closed 6 years ago

vvo commented 9 years ago

Can it be that the default description for a PR is the latest commit message? Does it makes sense?

Thanks.

brunocoelho commented 9 years ago

Instead of the first one? I think so.

vvo commented 9 years ago

It's currently not even inserting the first commit message inside the PR description. Only taking the first line as the PR subject.

brunocoelho commented 9 years ago

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.

henvic commented 9 years ago

So what would happen when no title is given for a pull request?

henvic commented 9 years ago

Also, I have complains about using the last commit message.

Related: https://github.com/node-gh/gh/issues/405

henvic commented 9 years ago

If you guys can figure out a nice solution, I'd appreciate.

vvo commented 8 years ago

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

protoEvangelion commented 6 years ago

@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?

vvo commented 6 years ago

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!

protoEvangelion commented 6 years ago

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!