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

推荐订阅源

罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
V
Visual Studio Blog
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
月光博客
月光博客

WMI

How to Activate MySQL for Multiple Devices - WMI ESLint Flat Config for JS, TS, React, and Prettier - WMI Yarn NPM Registry Configuration - WMI Yarn Guides - WMI Set Up ADB Wireless Debugging on Android: A Full Guide - WMI How to Fill Tax Information on Google Adsense - WMI Migrate ESLint v9 for prettier typescript javascript - WMI PySide6 button click open new window - WMI PySide6 autocomplete input text - WMI Mobile Legends To The Stars Event Clue - WMI [PHP] generate random proxy IP:PORT from CIDR - WMI [PHP] generate big text file for testing purpose - WMI List of Chrome Driver command line arguments - WMI Happy eid mubarak - WMI Install markdown engine on vite ESM typescript - WMI Android Activity lifecycle - WMI OkHttp cookie handling on android (webview supported) - WMI enable automatic memory heap resizing of android studio - WMI is defining screen density can reduce build time ? - WMI
Turn git log history into markdown - WMI
Dimas Lanjaka · 2024-03-15 · via WMI
#!/bin/bash

echo "writing github commit history"

git log --pretty=format:"%ad%n%h %s%n%b" --date=format:"%Y-%m-%d %H:%M:%S" | while IFS= read -r line; do
  trimmed_line="${line#"${line%%[![:space:]]*}"}"
  trimmed_line="${trimmed_line%"${trimmed_line##*[![:space:]]}"}"

  if [ -n "$trimmed_line" ]; then
    if [[ "$trimmed_line" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}\ [0-9]{2}:[0-9]{2}:[0-9]{2}$ ]]; then
      echo -e "**$trimmed_line**\n"
    elif [ "$first_line" = true ]; then
      first_line=false
    else
      echo -e "  $trimmed_line\n"
    fi
  fi
done > release-repo/changelog-commit.md

# Wait for 3 seconds
sleep 3

the format markdown like

**2024-03-07 18:41:29**

- 39d989ee chore: round double value

**2024-03-07 18:38:32**

- 0586bd98 chore: improve performance

above script also works with multiline commits, looks like below:

**2024-03-07 18:37:53**

- 064c3b79 chore: update preparation activity UI

  improve performance stability