{"thread":{"id":"1835","subject":"Fix \"git-rev-list\" revision range parsing","startedAt":"2005-09-17T00:53:19Z","lastAt":"2005-09-17T00:53:19Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"8740","messageId":"Pine.LNX.4.58.0509161750420.26803@g5.osdl.org","threadId":"1835","inReplyTo":null,"subject":"Fix \"git-rev-list\" revision range parsing","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-09-17T00:53:19Z","receivedAt":"2005-09-17T00:53:19Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThere were two bugs in there:\n - if the range didn't end up working, we restored the '.' character in \n   the wrong place.\n - an empty end-of-range should be interpreted as HEAD.\n\nSee rev-parse.c for the reference implementation of this.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n---\ndiff --git a/rev-list.c b/rev-list.c\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -561,6 +561,8 @@ int main(int argc, char **argv)\n \t\t\tstruct commit *exclude = NULL;\n \t\t\tstruct commit *include = NULL;\n \t\t\t*dotdot = 0;\n+\t\t\tif (!*next)\n+\t\t\t\tnext = \"HEAD\";\n \t\t\texclude = get_commit_reference(arg, UNINTERESTING);\n \t\t\tinclude = get_commit_reference(next, 0);\n \t\t\tif (exclude && include) {\n@@ -569,7 +571,7 @@ int main(int argc, char **argv)\n \t\t\t\thandle_one_commit(include, &list);\n \t\t\t\tcontinue;\n \t\t\t}\n-\t\t\t*next = '.';\n+\t\t\t*dotdot = '.';\n \t\t}\n \t\tif (*arg == '^') {\n \t\t\tflags = UNINTERESTING;\n"}]}