author | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Feb 2008 06:54:37 +0000 (22:54 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Feb 2008 06:54:37 +0000 (22:54 -0800) |
* bc/reflog-fix: (1490 commits)
builtin-reflog.c: don't install new reflog on write failure
hash: fix lookup_hash semantics
gitweb: Better chopping in commit search results
builtin-tag.c: remove cruft
git-merge-index documentation: clarify synopsis
send-email: fix In-Reply-To regression
git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()
Teach git-grep --name-only as synonym for -l
diff: fix java funcname pattern for solaris
t3404: use configured shell instead of /bin/sh
git_config_*: don't assume we are parsing a config file
prefix_path: use is_absolute_path() instead of *orig == '/'
git-clean: handle errors if removing files fails
Clarified the meaning of git-add -u in the documentation
git-clone.sh: properly configure remote even if remote's head is dangling
git.el: Set process-environment instead of invoking env
Documentation/git-stash: document options for git stash list
send-email: squelch warning due to comparing undefined $_ to ""
cvsexportcommit: be graceful when "cvs status" reorders the arguments
Rename git-core rpm to just git and rename the meta-pacakge to git-all.
...
Conflicts:
Documentation/git-reflog.txt
t/t1410-reflog.sh
builtin-reflog.c: don't install new reflog on write failure
hash: fix lookup_hash semantics
gitweb: Better chopping in commit search results
builtin-tag.c: remove cruft
git-merge-index documentation: clarify synopsis
send-email: fix In-Reply-To regression
git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()
Teach git-grep --name-only as synonym for -l
diff: fix java funcname pattern for solaris
t3404: use configured shell instead of /bin/sh
git_config_*: don't assume we are parsing a config file
prefix_path: use is_absolute_path() instead of *orig == '/'
git-clean: handle errors if removing files fails
Clarified the meaning of git-add -u in the documentation
git-clone.sh: properly configure remote even if remote's head is dangling
git.el: Set process-environment instead of invoking env
Documentation/git-stash: document options for git stash list
send-email: squelch warning due to comparing undefined $_ to ""
cvsexportcommit: be graceful when "cvs status" reorders the arguments
Rename git-core rpm to just git and rename the meta-pacakge to git-all.
...
Conflicts:
Documentation/git-reflog.txt
t/t1410-reflog.sh
1 | 2 | |||
---|---|---|---|---|
Documentation/git-reflog.txt | patch | | diff1 | | diff2 | | blob | history |
builtin-reflog.c | patch | | diff1 | | diff2 | | blob | history |
t/t1410-reflog.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/git-reflog.txt
index a0c7ceead2174eb7d9498f1575ee0df4065da433,f9bba36c2309d5b4a9587d0f4a406cf57fcd8348..5719039841679926a7cf10845fdc83efbcf85612
git reflog expire [--dry-run] [--stale-fix] [--verbose]
[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...
- git reflog [show] [log-options]
+git reflog delete ref@\{specifier\}...
+
+ git reflog [show] [log-options] [<ref>]
Reflog is a mechanism to record when the tip of branches are
updated. This command is to manage the information recorded in it.
The subcommand "show" (which is also the default, in the absence of any
subcommands) will take all the normal log options, and show the log of
- `HEAD`, which will cover all recent actions, including branch switches.
- It is basically an alias for 'git log -g --abbrev-commit
- --pretty=oneline', see gitlink:git-log[1].
+ the reference provided in the command-line (or `HEAD`, by default).
+ The reflog will cover all recent actions (HEAD reflog records branch switching
+ as well). It is an alias for 'git log -g --abbrev-commit --pretty=oneline';
+ see linkgit:git-log[1].
+
+ The reflog is useful in various git commands, to specify the old value
+ of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be
+ two moves ago", `master@\{one.week.ago\}` means "where master used to
+ point to one week ago", and so on. See linkgit:git-rev-parse[1] for
+ more details.
+To delete single entries from the reflog, use the subcommand "delete"
+and specify the _exact_ entry (e.g. ``git reflog delete master@\{2\}'').
+
OPTIONS
-------
diff --cc builtin-reflog.c
Simple merge
diff --cc t/t1410-reflog.sh
index 12a53edfdc189cd27924e38ab7158f595c873af4,f959aae84630ddbb68304868b1a025b7c2d33d10..24476bede5ce8f8720bf3d9eba7f7a944182dbf4
--- 1/t/t1410-reflog.sh
--- 2/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
'
+test_expect_success 'delete' '
+ echo 1 > C &&
+ test_tick &&
+ git commit -m rat C &&
+
+ echo 2 > C &&
+ test_tick &&
+ git commit -m ox C &&
+
+ echo 3 > C &&
+ test_tick &&
+ git commit -m tiger C &&
+
+ test 5 = $(git reflog | wc -l) &&
+
+ git reflog delete master@{1} &&
+ git reflog show master > output &&
+ test 4 = $(wc -l < output) &&
+ ! grep ox < output &&
+
+ git reflog delete master@{07.04.2005.15:15:00.-0700} &&
+ git reflog show master > output &&
+ test 3 = $(wc -l < output) &&
+ ! grep dragon < output
++
++'
++
+ test_expect_success 'prune --expire' '
+
+ before=$(git count-objects | sed "s/ .*//") &&
+ BLOB=$(echo aleph | git hash-object -w --stdin) &&
+ BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
+ test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+ test -f $BLOB_FILE &&
+ git reset --hard &&
+ git prune --expire=1.hour.ago &&
+ test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+ test -f $BLOB_FILE &&
+ test-chmtime -86500 $BLOB_FILE &&
+ git prune --expire 1.day &&
+ test $before = $(git count-objects | sed "s/ .*//") &&
+ ! test -f $BLOB_FILE
+
'
test_done