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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin Waitz <tali@xxxxxxxxxxxxxx> writes:

> I thought doing the same for these commands as for --help and --version
> but wanted to hear some opinions first...
>
> After all, the comment in front of --version talked about legacy,
> so I was afraid to add more legacy ;-)

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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]