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); } }