1
0
mirror of https://github.com/git/git.git synced 2024-09-29 01:32:20 +02:00

core.logallrefupdates create new log file only for branch heads.

It used to mean "create log file for any ref that is updated",
but now it creates new log files only for branch heads.

The old behaviour made this configuration less useful than
otherwise it would be; automatically creating log file for tags
is almost always not useful.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-10-08 01:35:18 -07:00
parent 26e5fc3415
commit 4057deb5de
2 changed files with 12 additions and 7 deletions

@ -71,12 +71,16 @@ core.preferSymlinkRefs::
expect HEAD to be a symbolic link. expect HEAD to be a symbolic link.
core.logAllRefUpdates:: core.logAllRefUpdates::
If true, `git-update-ref` will append a line to Updates to a ref <ref> is logged to the file
"$GIT_DIR/logs/<ref>" listing the new SHA1 and the date/time "$GIT_DIR/logs/<ref>", by appending the new and old
of the update. If the file does not exist it will be SHA1, the date/time and the reason of the update, but
created automatically. This information can be used to only when the file exists. If this configuration
determine what commit was the tip of a branch "2 days ago". variable is set to true, missing "$GIT_DIR/logs/<ref>"
This value is false by default (no logging). file is automatically created for branch heads.
This information can be used to determine what commit
was the tip of a branch "2 days ago". This value is
false by default (no automated creation of log files).
core.repositoryFormatVersion:: core.repositoryFormatVersion::
Internal variable identifying the repository format and layout Internal variable identifying the repository format and layout

3
refs.c

@ -721,7 +721,8 @@ static int log_ref_write(struct ref_lock *lock,
char *logrec; char *logrec;
const char *committer; const char *committer;
if (log_all_ref_updates) { if (log_all_ref_updates &&
!strncmp(lock->ref_name, "refs/heads/", 11)) {
if (safe_create_leading_directories(lock->log_file) < 0) if (safe_create_leading_directories(lock->log_file) < 0)
return error("unable to create directory for %s", return error("unable to create directory for %s",
lock->log_file); lock->log_file);