From 18a2197e6d1be4b2a4a4b10cac34215fac5be5f9 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sun, 10 Aug 2008 15:04:34 +0200 Subject: [PATCH 1/4] Documentation: rev-list-options: Fix -g paragraph formatting - Add an escape to @{now}. Without the escape, the brace does something magic and eats half the sentence up to the closing brace at 'timestamp}'. - Join the last paragraph with a '+'. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- Documentation/rev-list-options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index f69260f4c..56e2eca25 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -260,10 +260,10 @@ With '\--pretty' format other than oneline (for obvious reasons), this causes the output to have two extra lines of information taken from the reflog. By default, 'commit@\{Nth}' notation is used in the output. When the starting commit is specified as -'commit@{now}', output also uses 'commit@\{timestamp}' notation +'commit@\{now}', output also uses 'commit@\{timestamp}' notation instead. Under '\--pretty=oneline', the commit message is prefixed with this information on the same line. - ++ Cannot be combined with '\--reverse'. See also linkgit:git-reflog[1]. From 38881a9066fcb3ce6e0438e6d7b20cce22ece411 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 10 Aug 2008 01:33:29 +0200 Subject: [PATCH 2/4] reflog test: add more tests for 'reflog delete' This adds more tests for 'reflog delete' and marks it as broken, as currently a call to 'git reflog delete HEAD@{1}' deletes entries in the currently checked out branch's log, not the HEAD log. Noticed by John Wiegley Signed-off-by: Pieter de Bie Signed-off-by: Junio C Hamano --- t/t1410-reflog.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 73f830db2..3b9860ea2 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -175,7 +175,7 @@ test_expect_success 'recover and check' ' ' -test_expect_success 'delete' ' +test_expect_failure 'delete' ' echo 1 > C && test_tick && git commit -m rat C && @@ -188,16 +188,30 @@ test_expect_success 'delete' ' test_tick && git commit -m tiger C && - test 5 = $(git reflog | wc -l) && + HEAD_entry_count=$(git reflog | wc -l) + master_entry_count=$(git reflog show master | wc -l) + + test $HEAD_entry_count = 5 && + test $master_entry_count = 5 && + git reflog delete master@{1} && git reflog show master > output && - test 4 = $(wc -l < output) && + test $(($master_entry_count - 1)) = $(wc -l < output) && + test $HEAD_entry_count = $(git reflog | wc -l) && ! grep ox < output && + master_entry_count=$(wc -l < output) + + git reflog delete HEAD@{1} && + test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) && + test $master_entry_count = $(git reflog show master | wc -l) && + + HEAD_entry_count=$(git reflog | wc -l) + git reflog delete master@{07.04.2005.15:15:00.-0700} && git reflog show master > output && - test 3 = $(wc -l < output) && + test $(($master_entry_count - 1)) = $(wc -l < output) && ! grep dragon < output ' From 55beff4f536011e5d7f17ae63911f1bb56308feb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 10 Aug 2008 23:21:25 -0700 Subject: [PATCH 3/4] Fix deleting reflog entries from HEAD reflog dwim_ref() used to resolve HEAD symbolic ref to its target (i.e. current branch). This incorrectly removed the reflog entry from the current branch when 'git reflog delete HEAD@{1}' was asked for. Signed-off-by: Junio C Hamano --- builtin-reflog.c | 4 ++-- t/t1410-reflog.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin-reflog.c b/builtin-reflog.c index 125d455b9..7d7047d79 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -604,8 +604,8 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix) continue; } - if (!dwim_ref(argv[i], spec - argv[i], sha1, &ref)) { - status |= error("%s points nowhere!", argv[i]); + if (!dwim_log(argv[i], spec - argv[i], sha1, &ref)) { + status |= error("no reflog for '%s'", argv[i]); continue; } diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 3b9860ea2..5b24f0557 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -175,7 +175,7 @@ test_expect_success 'recover and check' ' ' -test_expect_failure 'delete' ' +test_expect_success 'delete' ' echo 1 > C && test_tick && git commit -m rat C && From 4f80b27d48fee1c588810f3341ffe5d14558cea2 Mon Sep 17 00:00:00 2001 From: Ivan Stankovic Date: Sun, 10 Aug 2008 18:22:14 +0200 Subject: [PATCH 4/4] Documentation: fix invalid reference to 'mybranch' in user manual Signed-off-by: Ivan Stankovic Signed-off-by: Junio C Hamano --- Documentation/user-manual.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 64a820bf6..49a4a898d 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -2812,7 +2812,7 @@ $ git config remote.example.fetch +master:ref/remotes/example/master ------------------------------------------------- Don't do this unless you're sure you won't mind "git fetch" possibly -throwing away commits on mybranch. +throwing away commits on 'example/master'. Also note that all of the above configuration can be performed by directly editing the file .git/config instead of using