Log ref updates to logs/refs/<ref>

If config parameter core.logAllRefUpdates is true or the log
file already exists then append a line to ".git/logs/refs/<ref>"
whenever git-update-ref <ref> is executed.  Each log line contains
the following information:

  oldsha1 <SP> newsha1 <SP> committer <LF>

where committer is the current user, date, time and timezone in
the standard GIT ident format.  If the caller is unable to append
to the log file then git-update-ref will fail without updating <ref>.

An optional message may be included in the log line with the -m flag.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Shawn Pearce
2006-05-17 05:55:40 -04:00
committed by Junio C Hamano
parent 5b16b09021
commit 6de08ae688
8 changed files with 210 additions and 0 deletions

1
refs.h
View File

@ -4,6 +4,7 @@
struct ref_lock {
char *ref_file;
char *lock_file;
char *log_file;
unsigned char old_sha1[20];
int lock_fd;
};