Yen-Kuan Wu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Git commit message 撰寫和改進實例: [mini-arm-os](https://github.com/jserv/mini-arm-os) ###### tags: `git`, `commit` ## [如何寫一個 Git Commit Message - Louie譯](https://blog.louie.lu/2017/03/21/%E5%A6%82%E4%BD%95%E5%AF%AB%E4%B8%80%E5%80%8B-git-commit-message/) * 重新建立一段程式碼的脈絡是非常浪費的事情。我們無法避免這件事情的複雜性,因此我們應將心力放在儘可能的降低複雜度。Commit messages 正可以做到這點,而我們可以從 commit message 看出一個開發者是不是一位好的合作對象。 * 一個精心撰寫的 log 是漂亮以及有用的。`git blame`、`revert`、`rebase`、`log`、`shortlog` 以及其他相關的指令會進入到你的生活中。 * 一個 `diff` 可以告訴你什麼改變了,但是只有 commit message 可以正確的告訴你為什麼 * 文中提到為什麼我們會不注意 `git commit` 原因總歸沒有花很多時間使用 `git log` 以及相關的指令 * 團隊之間撰寫 commit log 的方式應該要相同。為了建立一個有用的修訂紀錄,團隊應該要先統一其 commit message 的風格,並且至少定義以下三件事情: * 風格. Markup syntax,wrap margins,文法,大寫慣例,符號慣例。定義這些事情,不要用猜的,並且讓它愈簡單愈好。最後的結果會得到一個非常一致的 log,不僅讓人們可以閱讀體會閱讀的樂趣,還能讓人定期的去閱讀它們。 * 內容. 什麼樣的資訊需要放置在 commit message body 中?什麼不需要? * Metadata. issue tracking IDs, pull request 號碼等等的資料該如何被參照? 重要的七大規則 * ==用一行空白行分隔標題與內容== * 限制標題最多只有 50 字元 * 標題開頭要大寫 * 標題不以句點結尾 * ==以祈使句撰寫標題== * ==內文每行最多 72 字== * ==用內文解釋 what 以及 why vs. how== ## 用一行空白行分隔標題與內容 :::warning **`$ git log --oneline -5 <branch> `** :::danger 我的版本 --- ```shell= a998d57 Omit unnecessary mode switch The same problem on commit c7f9356. The implementation of context switch in "06-Preemptive" is different from previous version. It separates condition of `create_task()` into different block, so we can omit annoying checking that would trigger exception return or not and manipulate saving register on PSP directly. b7751bc Fix unexpected exception return behavior This problem is the similar with commit c7f9356. Change the operation of `activate()` to omit unnecessary state switched. c1e3bae Merge pull request #16 from yenWu/master afb79b9 Fix unexpected intial content in user thread stack After creation of first user-level thread, the next thread is likely triggered by exception return. However, unexpected behavior occurs while the load of xPSR due to incorrect configuration on enabling carry flags in APSR at the initial stage. 684c4b7 update author list: Yen-Kuan Wu ``` > 這就是沒有空行的壞處[name=Yen-Kwan Wu] Jserv 修改過的版本 --- ```shell= b4c7473 Eliminate unnecessary mode switching 42e8415 Eliminate unnecessary state switching 3543bb9 Fix unexpected intial content in user thread stack 228f93c update author list: Yen-Kuan Wu 120ee61 Fix unexpected exception return behavior ``` ::: :::warning **`$ git shortlog -5 fix_exp_ret_behavior`** :::danger 我的版本 --- ```shell= Jim Huang (2): update author list: Yen-Kuan Wu Merge pull request #16 from yenWu/master yenWu (3): Fix unexpected intial content in user thread stack After creation of first user-level thread, the next thread is likely triggered by exception return. However, unexpected behavior occurs while the load of xPSR due to incorrect configuration on enabling carry flags in APSR at the initial stage. Fix unexpected exception return behavior This problem is the similar with commit c7f9356. Change the operation of `activate()` to omit unnecessary state switched. Omit unnecessary mode switch The same problem on commit c7f9356. The implementation of context switch in "06-Preemptive" is different from previous version. It separates condition of `create_task()` into different block, so we can omit annoying checking that would trigger exception return or not and manipulate saving register on PSP directly. ``` Jserv 修改過的版本 --- ```shell= Jim Huang (1): update author list: Yen-Kuan Wu yenWu (4): Fix unexpected exception return behavior Fix unexpected intial content in user thread stack Eliminate unnecessary state switching Eliminate unnecessary mode switching ``` ::: ## 內文每行最多 72 字 排版上會比較好看、整潔 :::danger 我的版本 --- ![](https://i.imgur.com/KSBhERN.png) Jserv 修改過的版本 --- ![](https://i.imgur.com/gnETrN4.png) ::: ## 用內文解釋 what 以及 why vs. how :::warning Good Example --- ```= Summarize changes in around 50 characters or less More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of the commit and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); various tools like `log`, `shortlog` and `rebase` can get confused if you run the two together. Explain the problem that this commit is solving. Focus on why you are making this change as opposed to how (the code explains that). Are there side effects or other unintuitive consequences of this change? Here's the place to explain them. Further paragraphs come after blank lines. - Bullet points are okay, too - Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here If you use an issue tracker, put references to them at the bottom, like this: Resolves: #123 See also: #456, #789 ``` 我原本的commit --- ```= Author: yenWu <c14006078@gmail.com> Date: Wed Mar 29 02:13:31 2017 +0800 Omit unnecessary mode switch The same problem on commit c7f9356. The implementation of context switch in "06-Preemptive" is different from previous version. It separates condition of `create_task()` into different block, so we can omit annoying checking that would trigger exception return or not and manipulate saving register on PSP directly. ``` 修改過後的 --- ```= Author: yenWu <c14006078@gmail.com> Date: Wed Mar 29 02:13:31 2017 +0800 Eliminate unnecessary mode switching The implementation of context switch in "06-Preemptive" is different from "04-MutiTasking". The operation of context switch would depend on the current state in "04". In this case,"06", it split different situations into different blocks. Thus, the implemetation would not be the same with "04". More percisely, we can eliminate the operation checking the current state in this patch. Therefore, we can eliminate unexpected mode switching without checking state and just manipulate PSP to store registers within context switch. Resolves: #14 See also: #15 ``` :::

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully