This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Make it easier to copy the commit SHA and subject #2270
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This adds 'Copy Commit SHA' and 'Copy Commit Subject' to the right-click
menu of the recent commits list.
This was suggested in #1453
Screenshot/Gif
Alternate Designs
I started solving #1533 instead- I often create 'fixup' and 'squash' commits a lot to be used with auto-squashing. I decided that this could be too niche a use case because auto-squashing is off in git by default and could be confusing to people that haven't used auto-squashing before. I thought that making it easier to copy commit details would go some way to make creating auto-squashing commits from Atom easier and bring other benefits.
Benefits
This is intended to make it easier to:
Currently to copy the commit SHA or subject you have to click on the commit to open it, select the text you want to copy, then copy it, then close the commit.
Note that I find it better to use the commit subjects rather than the SHAs for fixup commits since SHAs may change when performing a non-interactive rebase on a branch (and auto-squash commits only apply during interactive rebases).
Possible Drawbacks
None that I can think of - it's an isolated change and the ability is in a context menu so doesn't change the layout of the commit view.
Applicable Issues
Metrics
N/A
Tests
Tested on Atom 1.42.0-nightly6 on OSX
Can Copy SHA by right-clicking on commit
git log
Can Copy Commit Subject by right-clicking on commit
git log
fixup!
in a commit message triggers auto-squashing when rebasingI've added unit tests for the two copy actions in the recent commits view test file.
Documentation
Please let me know if this should be documented.
Release Notes