From: David Turner Date: Tue, 21 Jul 2015 21:04:53 +0000 (-0400) Subject: git-reflog: add exists command X-Git-Tag: v2.6.0-rc0~48^2~9 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=afcb2e7a3b855887e79d1ee6d70ec80ab6456a64;p=git-core%2Fgit.git git-reflog: add exists command This is necessary because alternate ref backends might store reflogs somewhere other than .git/logs. Code that now directly manipulates .git/logs should instead go through git-reflog. Signed-off-by: David Turner Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt index 5e7908e4f..44c736f1a 100644 --- a/Documentation/git-reflog.txt +++ b/Documentation/git-reflog.txt @@ -23,6 +23,7 @@ depending on the subcommand: [--dry-run] [--verbose] [--all | ...] 'git reflog delete' [--rewrite] [--updateref] [--dry-run] [--verbose] ref@\{specifier\}... +'git reflog exists' Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository. Reflogs are @@ -52,6 +53,9 @@ argument must be an _exact_ entry (e.g. "`git reflog delete master@{2}`"). This subcommand is also typically not used directly by end users. +The "exists" subcommand checks whether a ref has a reflog. It exits +with zero status if the reflog exists, and non-zero status if it does +not. OPTIONS ------- diff --git a/builtin/reflog.c b/builtin/reflog.c index c2eb8ff84..7ed0e8501 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -13,6 +13,8 @@ static const char reflog_expire_usage[] = "git reflog expire [--expire=