[go: up one dir, main page]

Skip to content

Add ability to quickly copy commit message from existing commit

Problem to solve

I often need to copy the commit message of an existing commit. Currently, this isn't a super smooth process - I have to open up the commit details, copy the commit summary ("Add reusable project_selector component" in the screenshot below), and then separately copy the commit body ("This commit adds a reusable UI component..."). The commit summary is also hard to select without also selecting my avatar picture.

Screen_Shot_2019-02-26_at_3.00.48_PM

It would be great to be able to copy this message with a single click, similar to how one can copy a commit SHA:

Screen_Shot_2019-02-26_at_3.06.12_PM

Target audience

Further details

I would use this feature as part of my workflow when force pushing to a branch:

  • I create an MR and ask for feedback.
  • Someone takes a look and leaves some suggestions.
  • I update my branch with the suggestions, but I want to roll my updates into my previous commit. So, I do the following:
    • Make my changes on my branch
    • "Undo" the last commit: git reset --soft HEAD~1
    • Copy the commit message from GitLab.com using the somewhat painful process described in the Problem to solve section
    • Re-commit my changes with the same message as before: git add --all, git commit -m "<previous commit message here>"
    • Rebase my branch to incorporate any new changes: git fetch, git rebase origin/master
    • Update the remote branch: git push --force

Whether or not this is a best practice is debatable 😄, but there may also be other use cases for copying a commit's message.

Proposal

Add a button that allows the entire commit message to be copied with a single click.