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

Re: git-rev-parse question.

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 23, 2005, 17:07 UTC
Message-ID
<Pine.LNX.4.58.0508231004180.3317@g5.osdl.org>
In-Reply-To
<7v7jedulli.fsf@assigned-by-dhcp.cox.net>
On Tue, 23 Aug 2005, Junio C Hamano wrote:
>
> I have been looking at what git-rev-parse does and could not
> figure out a way to convince it to give me only arguments with
> a '-' prefix.
Gaah. Understandable. It got broken during some cleanup.
Try this trivial patch, it should work better.

NOTE! The behaviour of "--" for git-rev-parse is somewhat unclear. Right now it prints it out with "--flags", which is probably wrong.

		Linus
---
Subject: Fix git-rev-parse --default and --flags handling

This makes the argument to --default and any --flags arguments should up correctly.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/rev-parse.c b/rev-parse.c
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -107,7 +107,7 @@ static void show_arg(char *arg)
 	if (do_rev_argument && is_rev_argument(arg))
 		show_rev_arg(arg);
 	else
-		show_norev(arg);
+		show(arg);
 }
 
 static void show_default(void)
@@ -122,7 +122,7 @@ static void show_default(void)
 			show_rev(NORMAL, sha1, s);
 			return;
 		}
-		show_arg(s);
+		show(s);
 	}
 }
 
Previous: Junio C HamanoNext: Linus Torvalds
Message 2 of 3 in “git-rev-parse question.”
  1. Junio C HamanoAug 23, 2005
  2. Linus TorvaldsAug 23, 2005
  3. Linus TorvaldsAug 23, 2005

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.