@matheusbsbs / matheus-bagliano / commits / 4057deb5de
Fork 0

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>

Junio C Hamano committed Oct 8, 2006 at 01:35 UTC 4057deb5de110176ac19519177654108607b685c
2 files changed +12 -7
Documentation/config.txt
+10 -6
@@ -71,12 +71,16 @@ core.preferSymlinkRefs::
71 expect HEAD to be a symbolic link.
72
73 core.logAllRefUpdates::
74 - If true, `git-update-ref` will append a line to
75 - "$GIT_DIR/logs/<ref>" listing the new SHA1 and the date/time
76 - of the update. If the file does not exist it will be
77 - created automatically. This information can be used to
78 - determine what commit was the tip of a branch "2 days ago".
79 - This value is false by default (no logging).
74 + Updates to a ref <ref> is logged to the file
75 + "$GIT_DIR/logs/<ref>", by appending the new and old
76 + SHA1, the date/time and the reason of the update, but
77 + only when the file exists. If this configuration
78 + variable is set to true, missing "$GIT_DIR/logs/<ref>"
79 + file is automatically created for branch heads.
80 +
81 + This information can be used to determine what commit
82 + was the tip of a branch "2 days ago". This value is
83 + false by default (no automated creation of log files).
84
85 core.repositoryFormatVersion::
86 Internal variable identifying the repository format and layout
refs.c
+2 -1
@@ -721,7 +721,8 @@ static int log_ref_write(struct ref_lock *lock,
721 char *logrec;
722 const char *committer;
723
724 - if (log_all_ref_updates) {
724 + if (log_all_ref_updates &&
725 + !strncmp(lock->ref_name, "refs/heads/", 11)) {
726 if (safe_create_leading_directories(lock->log_file) < 0)
727 return error("unable to create directory for %s",
728 lock->log_file);