diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-12-15 01:41:17 +0300 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-16 09:31:01 +0300 |
commit | 0bee59186976b1d9e6b2dd77332480c9480131d5 (patch) | |
tree | a25546c23cf5b49c4251f606f58ead8070b30d6c /t | |
parent | ef0a89a604acb7fc2e3c08566641b95b23d87fd6 (diff) |
Enable reflogs by default in any repository with a working directory.
New and experienced Git users alike are finding out too late that
they forgot to enable reflogs in the current repository, and cannot
use the information stored within it to recover from an incorrectly
entered command such as `git reset --hard HEAD^^^` when they really
meant HEAD^^ (aka HEAD~2).
So enable reflogs by default in all future versions of Git, unless
the user specifically disables it with:
[core]
logAllRefUpdates = false
in their .git/config or ~/.gitconfig.
We only enable reflogs in repositories that have a working directory
associated with them, as shared/bare repositories do not have
an easy means to prune away old log entries, or may fail logging
entirely if the user's gecos information is not valid during a push.
This heuristic was suggested on the mailing list by Junio.
Documentation was also updated to indicate the new default behavior.
We probably should start to teach usuing the reflog to recover
from mistakes in some of the tutorial material, as new users are
likely to make a few along the way and will feel better knowing
they can recover from them quickly and easily, without fsck-objects'
lost+found features.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-x | t/t1400-update-ref.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 6a917f2ff4..5637cb5eac 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -63,8 +63,8 @@ test_expect_failure \ "test $B"' = $(cat .git/'"$m"')' rm -f .git/$m -mkdir -p .git/logs/refs/heads -touch .git/logs/refs/heads/master +: a repository with working tree always has reflog these days... +: >.git/logs/refs/heads/master test_expect_success \ "create $m (logged by touch)" \ 'GIT_COMMITTER_DATE="2005-05-26 23:30" \ |