Hans
Hans

Reputation: 2832

VSTS: Different merge commit message

I am not sure if this is because of git or VSTS: I get different messages when I complete a pull request from a branch into master.

If the source branch (new-dev) had only one commit (new dev/1) the merge commit message would be Merged PR ##: < commit-message> like Merged PR 84: new dev/1.

If the source branch (dev) had more than one commit (dev/1, dev/2, dev/3) the merge commit message would be Merged PR ##: Merge < branch-name> to master like Merged PR 83: Merge dev to master.

enter image description here What's the difference for?

Upvotes: 2

Views: 403

Answers (2)

Fabian S.
Fabian S.

Reputation: 977

This is a feature of vsts. This has nothing to do with git.

If there is only one commit, that commit (and therefore it's message) is the most specific description of the merge.

If there is more than one commit, the most specific description is the branch name. Therefore the difference.

In vsts when creating a PR you can name that PR any way you want. Then that name will be used in the merge commit message.

Upvotes: 1

Mark Adelsberger
Mark Adelsberger

Reputation: 45659

git knows nothing of "pull requests", and the messages you're seeing are not standard git merge messages, so I'd say it's VSTS that's creating them.

Why the difference? Presumably because (a) when it's just a one-commit merge they assume copying that commit's message gives the most detailed/useful description of what the merge does to the mainline, but (b) when there are multiple merges it isn't generally practical to include the details from every commit on the branch, so it gives a summary (merged such-and-such branch)

Upvotes: 1

Related Questions