git-describe: Ignore argument ordering.
PATCH 2/2 git-describe: Ignore argument ordering.
Use the simple stacking code to do so.
Signed-off-by Andreas Ericsson <[email protected]>
---
describe.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-)
9d03987889b62405be7b3fe09fb5dfa81245af00
describe.c +10 -5
@@ -141,10 +141,12 @@ static void describe(const char *ref)int main (int argc,char **argv) { -int i, desc =0 ; +int i; +struct stack *st =NULL ; +const char *arg;for (i =1 ; i < argc; i++) { -const char *arg = argv[i]; + arg = argv[i];if (!strcmp (arg,"--all" )) { all =1 ;
@@ -160,12 +162,15 @@ int main(int argc, char **argv) abbrev =DEFAULT_ABBREV ;continue ; } -describe (arg); - desc++; + + st =stack_push (st, arg); } -if (!desc) +if (!st)describe ("HEAD" ); +while ((arg =stack_pull (st))) +describe (arg); +return 0 ; }
Signature · 1 line
1.1.0