{"thread":{"id":"3040","subject":"[PATCH 2/2] git-describe: Ignore argument ordering.","startedAt":"2006-01-11T20:42:36Z","lastAt":"2006-01-11T20:42:36Z","messageCount":1,"participants":["Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"14501","messageId":"20060111204236.247D45BEC1@nox.op5.se","threadId":"3040","inReplyTo":null,"subject":"[PATCH 2/2] git-describe: Ignore argument ordering.","fromName":"Andreas Ericsson","fromEmail":"exon@op5.se","sentAt":"2006-01-11T20:42:36Z","receivedAt":"2006-01-11T20:42:36Z","isPatch":true,"sender":{"key":"exon@op5.se","avatar":"https://gravatar.com/avatar/b948c4f759e868f8e721e545e37afe2cf89cfa8e2ee8b70a432f0d76aee39891?d=mp&s=160"},"body":"Use the simple stacking code to do so.\n\nSigned-off-by: Andreas Ericsson <ae@op5.se>\n\n---\n\n describe.c |   15 ++++++++++-----\n 1 files changed, 10 insertions(+), 5 deletions(-)\n\n9d03987889b62405be7b3fe09fb5dfa81245af00\ndiff --git a/describe.c b/describe.c\nindex fda4102..bd4b591 100644\n--- a/describe.c\n+++ b/describe.c\n@@ -141,10 +141,12 @@ static void describe(const char *ref)\n \n int main(int argc, char **argv)\n {\n-\tint i, desc = 0;\n+\tint i;\n+\tstruct stack *st = NULL;\n+\tconst char *arg;\n \n \tfor (i = 1; i < argc; i++) {\n-\t\tconst char *arg = argv[i];\n+\t\targ = argv[i];\n \n \t\tif (!strcmp(arg, \"--all\")) {\n \t\t\tall = 1;\n@@ -160,12 +162,15 @@ int main(int argc, char **argv)\n \t\t\t\tabbrev = DEFAULT_ABBREV;\n \t\t\tcontinue;\n \t\t}\n-\t\tdescribe(arg);\n-\t\tdesc++;\n+\n+\t\tst = stack_push(st, arg);\n \t}\n \n-\tif (!desc)\n+\tif (!st)\n \t\tdescribe(\"HEAD\");\n \n+\twhile ((arg = stack_pull(st)))\n+\t\tdescribe(arg);\n+\n \treturn 0;\n }\n-- \n1.1.0\n"}]}