Re: [RFC] move --show-cdup, --show-prefix, and --show-git-dir out of git-rev-parse.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Saturday, October 7, 2006 - 10:43 pm

Martin Waitz <tali@admingilde.org> writes:


Nothing to fear; legacy is about "version" vs "--version".

By the way, rev-parse is not about "refs" at all.  It is about
"revs".

A possibly useless comment for people unfamiliar with history I
should add is that git-rev-parse serves two completely different
purposes.  One is to separate command line parameters into four
category and output only specified kind.  Four categories come
from flags vs non-flags and arguments related to revision
traversal vs other arguments.  The "parse" in rev-parse actually
stands for this feature.  Many git Porcelainish were implemented
as shell scripts that pipes rev-list output into diff-tree, and
rev-parse was originally invented as a helper for them.

We made many "rev-list | diff-tree --stdin" pattern into
built-in commands, by introducing revision.c, so this first
feature of rev-parse has become less useful.

But as a side-feature, when showing "non-flag, revision
traversal argument", it is told how to show the object name, and
also it acquired --verify option to make sure "extended sha1
expression" (refname, refname followed by ^n, ~n etc.) are
valid.

These days, the command is used primarily to get the object name
from an extended sha1 expression.  But some commands (most
notably, bisect) still rely on the "parse" aspect of the
command.

However, in its history it has also become a kitchen sink
command.  I think it may make sense to move these kitchen-sink
features such as --show-cdup etc. out of it and give it the
direct options to git wrapper these days.  When these features
were added, git wrapper did not even exist.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC] move --show-cdup, --show-prefix, and --show-git- ..., Junio C Hamano, (Sat Oct 7, 10:43 pm)