查看提交历史使用git log命令,默认情况下git log命令会按时间倒序输出所有提交历史记录,每次提交历史都有个SHA-1校验、作者、emali和提交的简短说明,例如:
$git log commit b61eb154298e46e9bac3735ee29c7bb006c44932 Author: artprogramming <[email protected]> Date: Mon Oct 28 14:13:17 2013 +0800 Update d12.c for change the variable name commit 385614be5ca1de8232352cf2dc4bfb9c4d15ed38 Author: artprogramming <[email protected]> Date: Mon Oct 28 00:08:19 2013 +0800 Create keycodes.h
使用-p选项展开显示每次提交的差异,使用-2则仅显示最近两条提交历史记录,例如:
$git log -p -2 commit b61eb154298e46e9bac3735ee29c7bb006c44932 Author: artprogramming <[email protected]> Date: Mon Oct 28 14:13:17 2013 +0800 Update d12.c for change the variable name diff --git a/drivers/d12.c b/drivers/d12.c index 4109bfb..252a752 100644 --- a/drivers/d12.c +++ b/drivers/d12.c @@ -18,21 +18,21 @@ static void d12_write_command(unsigned char cmd) static unsigned char d12_read_data(void) { - unsigned char tmp; + unsigned char val; D12_A0 = 0; D12_RD_N = 0; tmp = D12_DATA_PORT; D12_RD_N = 1; - return tmp; + return val; } -static void d12_write_data(unsigned char tmp) +static void d12_write_data(unsigned char val) { D12_A0 = 0; D12_WR_N = 0; - D12_DATA_PORT = tmp; + D12_DATA_PORT = val; D12_WR_N = 1; } commit 385614be5ca1de8232352cf2dc4bfb9c4d15ed38 Author: artprogramming <[email protected]> Date: Mon Oct 28 00:08:19 2013 +0800 Create keycodes.h diff --git a/include/keycodes.h b/include/keycodes.h new file mode 100644 index 0000000..6e5d3b7 --- /dev/null +++ b/include/keycodes.h @@ -0,0 +1,108 @@ +#ifndef __KEYCODES_H +#define __KEYCODES_H + +#define KEY_A 0x04 +#define KEY_B 0x05 +#define KEY_C 0x06 +#define KEY_D 0x07 +#define KEY_E 0x08 +#define KEY_F 0x09 +#define KEY_G 0x0A
$git log --stat commit b61eb154298e46e9bac3735ee29c7bb006c44932 Author: artprogramming <[email protected]> Date: Mon Oct 28 14:13:17 2013 +0800 Update d12.c for change the variable name drivers/d12.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) commit 385614be5ca1de8232352cf2dc4bfb9c4d15ed38 Author: artprogramming <[email protected]> Date: Mon Oct 28 00:08:19 2013 +0800 Create keycodes.h include/keycodes.h | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 108 insertions(+), 0 deletions(-) commit a1a0e21f35ffef2fe8731ac602180a2ecef6b42e Author: artprogramming <[email protected]> Date: Thu Oct 24 23:19:26 2013 +0800 remove error