-1

We are using Bitbucket at work, here is the UI for creating a new commit message/description when doing a merge via pull request:

enter image description here

as you can see in the screenshot, the question is: where does the data from the description text box go?

In other words, I am using this command to capture select data from the git log:

git log -30 --pretty=format:'{"commit":"%H","sanitized_subject_line":"%f","commit_notes":"%N","author":"%aN","date":"%aD"}'

Is there a way to capture the data from the description textbox in the UI? What is that textbox for?

FeRD
  • 1,699
  • 15
  • 24
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

2 Answers2

3

I believe this Title and Description, is specific to the Pull Request itself. It has nothing to do with a commit so it won't appear in the git log.

Jamie Bisotti
  • 2,605
  • 19
  • 23
  • 1
    Unless it's 1 commit, then the description will be whatever is after the first sentence in the commit message. – dimwittedanimal Mar 13 '18 at 20:38
  • My answer still stands. In that case, BitBucket is just taking the Title and Description from the single commit and pre-populating the Title and Description of the Pull Request with it, as a matter of convenience. – Jamie Bisotti Mar 13 '18 at 20:44
  • @JamieBisotti thanks for your answer - do you know if there is any way whatsover to alter/create a git commit message or the commit_notes field in the git log via the Bitbucket UI? I want my team to create their "important" commit messages through the UI when they submit a PR. – Alexander Mills Mar 13 '18 at 20:46
  • 1
    Looks like you cannot currently specify a PR template -- https://bitbucket.org/site/master/issues/11571/custom-pull-request-description-template. However, you can specify a commit template for Git clients to use -- https://stackoverflow.com/questions/21998728/how-to-specify-a-git-commit-message-template-for-a-repository-in-a-file-at-a-rel -- not sure if that helps or not. – Jamie Bisotti Mar 13 '18 at 20:52
  • n.b. that screenshot is from Bitbucket Server, not Bitbucket Cloud. – Jim Redmond Mar 13 '18 at 20:58
  • I just added an answer, as I hope, it looks like you can add / update the git commit message for the PR, it was just in a later stage of the process in the UI. – Alexander Mills Mar 14 '18 at 01:49
  • As has been pointed out a couple of different times, there is no "git commit message for the PR". Git commits have messages, which can be formatted as a subject line, followed by a space, followed by a body. PRs have titles and descriptions. PRs are not commits; their title/description does not become part of Git's history. When you merge, a "merge commit" is created; this is an actual Git commit; it has nothing to do with a PR. – Jamie Bisotti Mar 25 '18 at 14:22
-1

Looks like you add to the commit message after you click the merge button on the Bitbucket UI:

enter image description here

This should be the place in the UI where you can craft a specific git message that matches some pattern so that you can search for that pattern later with git log etc.

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817