{"thread":{"id":"594","subject":"[PATCH 1/3] Introduce \"rev-list --stop-at=<commit>\".","startedAt":"2005-05-13T00:15:15Z","lastAt":"2005-05-13T07:36:58Z","messageCount":4,"participants":["Junio C Hamano","Petr Baudis","Noel Grandin"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"3215","messageId":"7v3bssc770.fsf@assigned-by-dhcp.cox.net","threadId":"594","inReplyTo":null,"subject":"[PATCH 1/3] Introduce \"rev-list --stop-at=<commit>\".","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-13T00:15:15Z","receivedAt":"2005-05-13T00:15:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Additional option, --stop-at=<commit>, is introduced.  The\ngit-rev-list output stops just before showing the named commit.\n\nThis is based on Thoms Gleixner's patch but slightly reworked.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\nDocumentation/git-rev-list.txt |   18 +++++++++++++++++-\nrev-list.c                     |   20 ++++++++++++++++----\n2 files changed, 33 insertions(+), 5 deletions(-)\n\n--- a/Documentation/git-rev-list.txt\n+++ b/Documentation/git-rev-list.txt\n@@ -9,7 +9,10 @@\n \n SYNOPSIS\n --------\n-'git-rev-list' <commit>\n+'git-rev-list'\t[--max-count=<number>]\n+\t\t[--max-age=<unixtime>]\n+\t\t[--min-age=<unixtime>]\n+\t\t[--stop-at=<commit>] <commit>\n \n DESCRIPTION\n -----------\n@@ -17,6 +20,19 @@\n given commit, taking ancestry relationship into account.  This is\n useful to produce human-readable log output.\n \n+OPTIONS\n+-------\n+--max-count=<number>::\n+\tStop after showing <number> commits.\n+\n+--max-age=<unixtime>::\n+\tStop after showing commit made before <unixtime>.\n+\n+--min-age=<unixtime>::\n+\tSkip until commit made before <unixtime>.\n+\n+--stop-at=<commit>::\n+\tStop just before showing <commit>.\n \n Author\n ------\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -1,12 +1,21 @@\n #include \"cache.h\"\n #include \"commit.h\"\n \n+static const char *rev_list_usage = \n+\"usage: rev-list [OPTION] commit-id\\n\"\n+\"  --max-count=nr\\n\"\n+\"  --max-age=epoch\\n\"\n+\"  --min-age=epoch\\n\"\n+\"  --stop-at=commit\\n\";\n+\n int main(int argc, char **argv)\n {\n \tunsigned char sha1[20];\n \tstruct commit_list *list = NULL;\n \tstruct commit *commit;\n \tchar *commit_arg = NULL;\n+\tunsigned char stop_at[20];\n+\tint has_stop_at = 0;\n \tint i;\n \tunsigned long max_age = -1;\n \tunsigned long min_age = -1;\n@@ -21,16 +30,17 @@\n \t\t\tmax_age = atoi(arg + 10);\n \t\t} else if (!strncmp(arg, \"--min-age=\", 10)) {\n \t\t\tmin_age = atoi(arg + 10);\n+\t\t} else if (!strncmp(arg, \"--stop-at=\", 10)) {\n+\t\t\tif (get_sha1(arg + 10, stop_at))\n+\t\t\t\tusage(rev_list_usage);\n+\t\t\thas_stop_at = 1;\n \t\t} else {\n \t\t\tcommit_arg = arg;\n \t\t}\n \t}\n \n \tif (!commit_arg || get_sha1(commit_arg, sha1))\n-\t\tusage(\"usage: rev-list [OPTION] commit-id\\n\"\n-\t\t      \"  --max-count=nr\\n\"\n-\t\t      \"  --max-age=epoch\\n\"\n-\t\t      \"  --min-age=epoch\\n\");\n+\t\tusage(rev_list_usage);\n \n \tcommit = lookup_commit(sha1);\n \tif (!commit || parse_commit(commit) < 0)\n@@ -46,6 +56,8 @@\n \t\t\tbreak;\n \t\tif (max_count != -1 && !max_count--)\n \t\t\tbreak;\n+\t\tif (has_stop_at && !memcmp(stop_at, commit->object.sha1, 20))\n+\t\t\tbreak;\n \t\tprintf(\"%s\\n\", sha1_to_hex(commit->object.sha1));\n \t} while (list);\n \treturn 0;\n------------------------------------------------\n\n"},{"id":"3227","messageId":"20050513052901.GB16464@pasky.ji.cz","threadId":"594","inReplyTo":"7v3bssc770.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/3] Introduce \"rev-list --stop-at=<commit>\".","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-13T05:29:02Z","receivedAt":"2005-05-13T05:29:02Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, May 13, 2005 at 02:15:15AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> told me that...\n> Additional option, --stop-at=<commit>, is introduced.  The\n> git-rev-list output stops just before showing the named commit.\n> \n> This is based on Thoms Gleixner's patch but slightly reworked.\n> \n> Signed-off-by: Junio C Hamano <junkio@cox.net>\n\nWon't apply for now - as I already said in the relevant thread, this\nmakes no sense with the current git-rev-list output order, and even\nencourages using it in wrong way. It is ok when the merges are reported\nin a different way, but that's impossible without some repoid (I yet\nhave to catch up with that thread :-).\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"3230","messageId":"42844413.5020004@peralex.com","threadId":"594","inReplyTo":"20050513052901.GB16464@pasky.ji.cz","subject":"Re: [PATCH 1/3] Introduce \"rev-list --stop-at=<commit>\".","fromName":"Noel Grandin","fromEmail":"noel@peralex.com","sentAt":"2005-05-13T06:07:15Z","receivedAt":"2005-05-13T06:07:15Z","isPatch":true,"sender":{"key":"noel@peralex.com","avatar":null},"body":"Also, it should be called --stop-before given it's behaviour.\n--stop-at implies that it includes the given commit.\n\nPetr Baudis wrote:\n\n>Dear diary, on Fri, May 13, 2005 at 02:15:15AM CEST, I got a letter\n>where Junio C Hamano <junkio@cox.net> told me that...\n>  \n>\n>>Additional option, --stop-at=<commit>, is introduced.  The\n>>git-rev-list output stops just before showing the named commit.\n>>\n>>This is based on Thoms Gleixner's patch but slightly reworked.\n>>\n>>Signed-off-by: Junio C Hamano <junkio@cox.net>\n>>    \n>>\n>\n>Won't apply for now - as I already said in the relevant thread, this\n>makes no sense with the current git-rev-list output order, and even\n>encourages using it in wrong way. It is ok when the merges are reported\n>in a different way, but that's impossible without some repoid (I yet\n>have to catch up with that thread :-).\n>\n>  \n>\n\n\nNOTICE: Please note that this email, and the contents thereof, \nare subject to the standard Peralex email disclaimer, which may \nbe found at: http://www.peralex.com/disclaimer.html\n\nIf you cannot access the disclaimer through the URL attached \n and you wish to receive a copy thereof please send \n an email to email@peralex.com\n"},{"id":"3236","messageId":"7v3bsrbmqt.fsf@assigned-by-dhcp.cox.net","threadId":"594","inReplyTo":"20050513052901.GB16464@pasky.ji.cz","subject":"Re: [PATCH 1/3] Introduce \"rev-list --stop-at=<commit>\".","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-13T07:36:58Z","receivedAt":"2005-05-13T07:36:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"PB\" == Petr Baudis <pasky@ucw.cz> writes:\n\nPB> Won't apply for now -\n\nConsider it retracted.  It does not make sense to me either.\n\n"}]}