惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
D
Docker
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
美团技术团队
V
V2EX
Last Week in AI
Last Week in AI
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
B
Blog RSS Feed
博客园_首页
B
Blog
博客园 - 叶小钗
I
InfoQ
WordPress大学
WordPress大学
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Latest news
Latest news
W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
C
CXSECURITY Database RSS Feed - CXSecurity.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
N
News and Events Feed by Topic
S
Secure Thoughts
The Hacker News
The Hacker News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News

Max Böck | Notes

18 Jan 2024 - 14:25 12 Jan 2024 - 16:23 11 Jan 2024 - 18:11 11 Jan 2024 - 16:51 04 Jan 2023 - 13:19 22 Nov 2021 - 20:55 15 Oct 2021 - 21:12 03 Sep 2021 - 16:56 03 Sep 2021 - 16:52 08 Jul 2021 - 10:04 07 Jul 2021 - 09:04 06 Jul 2021 - 20:03 07 Apr 2021 - 12:03 07 Nov 2020 - 20:11 27 Apr 2020 - 15:27 25 Apr 2020 - 19:28 08 Feb 2020 - 16:13 26 Dec 2019 - 19:47 20 Dec 2019 - 15:23 14 Dec 2019 - 14:50 10 Dec 2019 - 11:32 22 Nov 2019 - 15:36 21 Nov 2019 - 16:37 11 Nov 2019 - 13:10 29 Sep 2019 - 14:30 12 Aug 2019 - 10:13 08 Aug 2019 - 12:46 04 Aug 2019 - 02:00 09 Jun 2019 - 02:00 01 Jun 2019 - 02:00 22 Apr 2019 - 02:00 30 Mar 2019 - 02:00 25 Mar 2019 - 02:00 04 Mar 2019 - 02:00 02 Mar 2019 - 02:00 11 Feb 2019 - 02:00 07 Feb 2019 - 02:00 31 Jan 2019 - 02:00 28 Jan 2019 - 02:00 24 Jan 2019 - 02:00 23 Jan 2019 - 02:00 Max Böck 11 Jan 2019 - 02:00 04 Jan 2019 - 02:00 30 Dec 2018 - 02:00 13 Dec 2018 - 02:00 04 Dec 2018 - 02:00 Max Böck
15 May 2019 - 02:00
Max Böck · 2019-05-15 · via Max Böck | Notes

We use gitlab issues at work, which supports tagging commit messages with an issue number, to make that commit appear in the issue thread. I often forget to tag my messages though, and then remember a second after committing.

So I wrote a little helper function as a custom git command:

#!/bin/sh

OLD_MSG=$(git log --format=%B -n1)
git commit --amend -m "$OLD_MSG, #$1"

It’s just a simple shell script that fetches the last commit message and appends the issue number. So I can do this:

$ git commit -m "add css grid support"
# ah fuck, forgot that this is related to an issue!
$ git append-issue 27
# commit msg is now: "add css grid support, #27"

To make it work:

  • Name the shell script git-append-issue (no extension)
  • save it in a folder in your home directory, i.e. ~/git-commands
  • make it executable with chmod 555
  • add that folder to your $PATH
  • git now recognizes your custom command!