1. Stefan Saasen
  2. git


Shawn O. Pearce  committed d56651c

Don't allow combination of -g and --reverse as it doesn't work

The --walk-reflogs logic and the --reverse logic are completely
incompatible with one another. Attempting to use both at the same
time leads to confusing results that sometimes violates the user's
formatting options or ignores the user's request to see the reflog
message and timestamp.

Unfortunately the implementation of both of these features is glued
onto the side of the revision walking machinary in such a way that
they are probably not going to be easy to make them compatible with
each other. Rather than offering the user confusing results we are
better off bailing out with an error message until such a time as
the implementations can be refactored to be compatible.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

  • Participants
  • Parent commits 14cd560
  • Branches master

Comments (0)

Files changed (3)

File Documentation/git-log.txt

View file
 -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].

File Documentation/git-rev-list.txt

View file
 '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.
 	Output the commits in reverse order.
+	Cannot be combined with --walk-reflogs.
 Object Traversal

File revision.c

View file
+	if (revs->reverse && revs->reflog_info)
+		die("cannot combine --reverse with --walk-reflogs");
 	return left;