> By the way, I'm not sure how the 'git' script is supposed to be used.
> I know that if there is a git-foo-script file in your path, you can
> run it as 'git foo'.  But what about e.g. git-init-db?  You can run
> that as 'git init-db' today.  And 'git read-cache' should work too.
> And 'git ls-files', and 'git rev-parse', and 'git merge-one-file' and
> 'git sh-setup-script' in decreasing order of usefulness...
>
> But running 'git' without arguments only list the -script commands as
> available.

You are correct.  I think 'git' showing only *-script was done
as an attempt to give a list of Porcelainish commands, excluding
the core commands that people are not supposed to be typing from
the command line.  It so happened that all of the Porcelainish
commands were scripts.

But what Linus wants *-script to mean is editability in the
source tree (his "grep" and "em" examples).  The command being
Porcelainish and the command being implemented as a script tend
to have strong correlations, but in principle they are
orthogonal.  As you mention, 'git merge-one-file' is not really
useful standalone, neither is 'git sh-setup'.  On the other
hand, 'git fsck-cache' is.

My proposal to have git-archimport.perl in the source tree and
install it as $(bindir)/git-archimport solves the editability
issues (sorry, Linus, you will have to say "em *.sh *.perl"
instead of "em *-script" if we did this) and simplifies the
first half of the 'git' wrapper (it just needs to attempt
running "git-$1"), but does not help what the latter half of
'git' wrapper does (to give you the list of Porcelainish
commands).

To make 'git' wrapper produce useful 'list of subcommands', we
need to come up with a list of Porcelainish commands, be they
written in C or sh or Perl, and tell 'git' about that list.
Current implementation cheats by assuming everything that ends
with *-script are such, but it does not have to stay that way.

I'd nominate all $(SCRIPTS) in Makefile and tools/Makefile
except *1*, plus *2* as the list of subcommands 'git' wrapper
would show.

List *1*: implemented as script but not Porcelainish.
        git
        git-merge-one-file-script
        git-sh-setup-script

List *2*: implemented in C but Porcelainish.
        git-init-db
        git-fsck-cache
        git-get-tar-commit-id
        git-apply
        git-patch-id
        git-pack-objects
        git-show-branch

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to