{"thread":{"id":"9583","subject":"[PATCH] Don't allow combination of -g and --reverse as it doesn't work","startedAt":"2007-08-20T02:33:43Z","lastAt":"2007-08-20T02:33:43Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"51038","messageId":"20070820023343.GA16229@spearce.org","threadId":"9583","inReplyTo":null,"subject":"[PATCH] Don't allow combination of -g and --reverse as it doesn't work","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-08-20T02:33:43Z","receivedAt":"2007-08-20T02:33:43Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"The --walk-reflogs logic and the --reverse logic are completely\nincompatible with one another.  Attempting to use both at the same\ntime leads to confusing results that sometimes violates the user's\nformatting options or ignores the user's request to see the reflog\nmessage and timestamp.\n\nUnfortunately the implementation of both of these features is glued\nonto the side of the revision walking machinary in such a way that\nthey are probably not going to be easy to make them compatible with\neach other.  Rather than offering the user confusing results we are\nbetter off bailing out with an error message until such a time as\nthe implementations can be refactored to be compatible.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n This addresses the \"log -g --reverse horribly insane\" issue I posted\n about earlier today.  Based on Junio's reply I'm not trying to fix\n it for 1.5.3 but instead just tell the user it is not currently\n supported by the implementation.\n\n\n Documentation/git-log.txt      |    1 +\n Documentation/git-rev-list.txt |    3 +++\n revision.c                     |    3 +++\n 3 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 5a90f65..1e6dbd9 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -49,6 +49,7 @@ include::pretty-options.txt[]\n -g, \\--walk-reflogs::\n \tShow commits as they were recorded in the reflog. The log contains\n \ta record about how the tip of a reference was changed.\n+\tCannot be combined with --reverse.\n \tSee also gitlink:git-reflog[1].\n \n --decorate::\ndiff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt\nindex 1c19781..cbbc234 100644\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -298,6 +298,8 @@ used in the output.  When the starting commit is specified as\n 'commit@{now}', output also uses 'commit@\\{timestamp}' notation\n instead.  Under '\\--pretty=oneline', the commit message is\n prefixed with this information on the same line.\n++\n+Cannot be combined with --reverse.\n \n --merge::\n \n@@ -373,6 +375,7 @@ By default, the commits are shown in reverse chronological order.\n --reverse::\n \n \tOutput the commits in reverse order.\n+\tCannot be combined with --walk-reflogs.\n \n Object Traversal\n ~~~~~~~~~~~~~~~~\ndiff --git a/revision.c b/revision.c\nindex 7d32a89..51fff0e 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1277,6 +1277,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch\n \t\tcompile_grep_patterns(revs->grep_filter);\n \t}\n \n+\tif (revs->reverse && revs->reflog_info)\n+\t\tdie(\"cannot combine --reverse with --walk-reflogs\");\n+\n \treturn left;\n }\n \n-- \n1.5.3.rc5.40.g2f82\n"}]}