diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt index 5a90f65b5e..1e6dbd93b1 100644 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -49,6 +49,7 @@ include::pretty-options.txt[] -g, \--walk-reflogs:: Show commits as they were recorded in the reflog. The log contains a record about how the tip of a reference was changed. + Cannot be combined with --reverse. See also gitlink:git-reflog[1]. --decorate:: diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt index 1c1978140f..cbbc234549 100644 --- a/Documentation/git-rev-list.txt +++ b/Documentation/git-rev-list.txt @@ -298,6 +298,8 @@ used in the output. When the starting commit is specified as '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. --merge:: @@ -373,6 +375,7 @@ By default, the commits are shown in reverse chronological order. --reverse:: Output the commits in reverse order. + Cannot be combined with --walk-reflogs. Object Traversal ~~~~~~~~~~~~~~~~ diff --git a/revision.c b/revision.c index 7d32a89b0e..51fff0ec50 100644 --- a/revision.c +++ b/revision.c @@ -1277,6 +1277,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch compile_grep_patterns(revs->grep_filter); } + if (revs->reverse && revs->reflog_info) + die("cannot combine --reverse with --walk-reflogs"); + return left; }