Recently, my manager assigned me a rather unusual task --- to manually
collect every commit ID related to a Jira card.
While Git already provides tools to automate this, I still had to gather
all commit hashes one by one.
I was working on feature updates when suddenly my manager pinged me: > "Please list down all commit IDs for Jira card J2667."
At first, I thought it was a joke.
But no --- the request was real.
Instead of checking Git logs automatically, the expectation was that I manually: - Search all related commits\
- Copy each commit hash\
- Paste them into a document
A task that Git can solve in one command:
git log --all --grep="J2667" --pretty=format:"%H"
$ git log --all --grep="J2667" --pretty=format:"%H"
b5bd938386dc31eee8b9f2d20550d7132a629e31
3022080cdf721e2e9f1825f3c30b0b08207eb7ca
c4d4b0e9542dd5e0f907e68b4df4fe7bb6723291
728357d521b922c030eb8d2ce54f4a403895b5af
5b2f4742db5616182b5bc982d54cc8d945545006