git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] git-describe: Ignore argument ordering.

From
Andreas Ericsson <exon@op5.se>
Date
Jan 11, 2006, 20:42 UTC
Message-ID
<20060111204236.247D45BEC1@nox.op5.se>
Use the simple stacking code to do so.
Signed-off-by: Andreas Ericsson <ae@op5.se>
---
 describe.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
9d03987889b62405be7b3fe09fb5dfa81245af00
diff --git a/describe.c b/describe.c
index fda4102..bd4b591 100644
--- a/describe.c
+++ b/describe.c
@@ -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;
 }
-- 
1.1.0
Message 1 of 1 in “git-describe: Ignore argument ordering.”
  1. 2/2 git-describe: Ignore argument ordering.Andreas Ericsson, Jan 11, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.