git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jon Seymour <jon.seymour@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	David Aguilar <davvid@gmail.com>, Andreas Ericsson <ae@op5.se>,
	Joey Hess <joey@kitenet.net>,
	Git Mailing List <git@vger.kernel.org>,
	"david@lang.hm" <david@lang.hm>,
	Pau Garcia i Quiles <pgquiles@elpauer.org>
Subject: Re: RFC: a plugin architecture for git extensions?
Date: Fri, 6 May 2011 01:56:01 -0500	[thread overview]
Message-ID: <20110506065601.GB13351@elie> (raw)
In-Reply-To: <BANLkTi=zrWR0GAm6n1Gs9XDCR6kXtjDW0A@mail.gmail.com>

Jon Seymour wrote:

> I would appreciate any feedback you (or others) have about:
>
>     http://permalink.gmane.org/gmane.comp.version-control.git/172419
>
> In particular, I would be interested in feedback about how to best support:
>
> - multiple extensions - do we want support installing extensions in
> their own directories, per Pau's suggestion or simply allow them to
> write to a common directory?
> - multiple extension directories - how to support Jonathan's
> requirement to allow user specific extension directories?

Well, let's step back for a moment.  What problem are we solving?
I still don't even know the answer to that!

Once upon a time, all git commands lived on the $PATH (typically in
/usr/bin, $HOME/bin, or some similar place) and could even be
invoked directly as git-commandname.  At some point someone noticed
that by running

	git-<TAB>

it was possible to read the list of all git commands.  Unfortunately
the list was very long, and this seemed like a much worse introduction
to git than the shorter list shown by "git --help".

There were also some related minor problems --- for example, git was
putting more pressure than necessary on filesystems and other
facilities to keep track of all the files in $bindir, and providing
the dashed forms of commands provides a temptation to use them
exclusively, making features (like aliases) of the git wrapper less
discoverable.  But the main thing was the tab completion.

The fix was to tuck away the individual commands somewhere under
libexecdir, outside $PATH.

Now at some point in this discussion I thought you were solving a
related problem.  If a person were to install 100 new commands for
git, or a single package with 100 commands in it, then

	git-<TAB>

would be daunting again.  So the task becomes to find a place to tuck
away these new commands without placing them on the $PATH.

But now I am less sure.  The motivating example has less than 10
commands; that doesn't seem worth all the fuss at all.  Why not just
install the command on the $PATH?  "git help work" _would_ work on all
the systems I have easy access to.  For example, if I write:

	install:
		install -m0755 git-work $(prefix)/bin
		install -d -m0755 $(prefix)/share/man/man1
		gzip -9 <git-work.1 >git-work.1.gz
		install -m0644 git-work.1.gz $(prefix)/share/man/man1/
		install -d -m0755 $(prefix)/bin

and the user runs

	make install
	PATH=$HOME/bin:$PATH

then "man git-work" will just work.  Similarly, "git work --help"
(which the git wrapper transforms to "git help work") would just work.

I see only a few potential problems remaining:

 1. There is no automatically generated documentation page pointing
    to the documentation for all new commands of this kind.  So
    I can run "git help -a" to learn about installed commands, but
    I cannot run "man git" to do so.  Likewise for info.

 2. On platforms like Windows that do not use manpages, my "git work"
    documentation will not show up with "git work --help".  For this,
    it would certainly be useful to have a GIT_HTML_PATH environment
    variable (or some similar name) that could be used to point to a
    list of directories with additional documentation.  The default
    could be something along the lines of the default library search
    path (but simpler), like:

	/usr/local/share/git/help:/usr/share/git/help

    Users installing new commands under $HOME might want to prepend
    something like

	$HOME/share/git/help:

    or whatever directory names suit their tastes.

    Even better might be a way for "git help" to ask the command
    where it puts its documentation, so "git help work" would
    internally run "git work --html-path".

 3. On a machine with multiple installations of git, my new command
    is not tied to any particular installation but shared by all of
    them.  This is a feature, not a bug.

 4. My command is visible with git-<TAB>, as mentioned above.

My comments about unprivileged users installing new commands were to
explain why an alternative solution to (2) that uses a single
directory where "git help" always looks would be inadequate.  I still
think that but luckily there is a large space of possible designs
without that problem; two are mentioned in the description of (2)
above.

Now problems 2 and 4 can be solved at the same time by introducing
something like a GIT_PLUGINS_PATH variable that could be shared for
both uses.  I'm not so convinced that's a good idea (I prefer to see
decoupled solutions to independent problems when it's simple to do)
but it could very well turn out okay.

  reply	other threads:[~2011-05-06  6:56 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27  3:36 RFC: a plugin architecture for git extensions? Jon Seymour
2011-04-27  3:58 ` Jonathan Nieder
2011-04-27  5:06   ` Jon Seymour
2011-04-27  5:07 ` Junio C Hamano
2011-04-27  5:10   ` Jon Seymour
2011-04-27  5:17     ` Junio C Hamano
2011-04-27  5:33       ` Jon Seymour
2011-04-27  5:37         ` Jon Seymour
2011-04-27  5:39         ` Junio C Hamano
2011-04-27  5:42           ` Jon Seymour
2011-04-27  7:15           ` Jon Seymour
2011-04-27  7:57             ` Michael J Gruber
2011-04-27  8:15               ` Jon Seymour
2011-04-27  8:40                 ` Jon Seymour
2011-04-27  9:36                   ` Motiejus Jakštys
2011-04-27  9:59                     ` Jon Seymour
2011-04-27 10:48                       ` Motiejus Jakštys
2011-04-27 10:21             ` Carlos Martín Nieto
2011-04-27 10:44               ` Jon Seymour
2011-04-27 11:38         ` Fredrik Gustafsson
2011-04-27 11:57           ` Jon Seymour
2011-04-27 22:32         ` Pau Garcia i Quiles
2011-04-27 22:47           ` Jon Seymour
2011-04-27 11:01 ` Ævar Arnfjörð Bjarmason
2011-04-27 11:42   ` Jon Seymour
2011-05-13 19:32     ` Enrico Weigelt
2011-04-27 12:08 ` Andreas Ericsson
2011-04-27 12:50   ` Jon Seymour
2011-04-27 13:07     ` Felipe Contreras
2011-04-27 13:59       ` Jon Seymour
2011-04-27 14:52     ` Andreas Ericsson
2011-04-27 15:36       ` Jon Seymour
2011-04-27 16:13         ` Jon Seymour
2011-04-27 17:07           ` A Large Angry SCM
2011-04-28  3:07             ` Jon Seymour
2011-04-28  3:26               ` Jon Seymour
2011-04-28  5:04                 ` Jon Seymour
2011-04-28  6:15                   ` Jon Seymour
2011-04-28 16:16               ` david
2011-04-29  3:35                 ` Jon Seymour
2011-04-27 19:16           ` Motiejus Jakštys
2011-04-27 19:19             ` Motiejus Jakštys
2011-04-27 17:34       ` Junio C Hamano
2011-04-27 18:28         ` Junio C Hamano
2011-04-27 18:49           ` Drew Northup
2011-04-27 19:42             ` Joey Hess
2011-04-27 20:16               ` Drew Northup
2011-04-27 21:38               ` Junio C Hamano
2011-04-27 22:08                 ` Jonathan Nieder
2011-04-27 22:32                   ` Jon Seymour
2011-04-28  9:07                     ` Andreas Ericsson
2011-04-27 23:27                   ` Junio C Hamano
2011-04-27 23:42                     ` Jonathan Nieder
2011-04-28  0:10                       ` Junio C Hamano
2011-04-28  0:50                         ` Jon Seymour
2011-04-28  0:54                           ` Jon Seymour
2011-04-28  0:55                           ` david
2011-04-28  2:08                             ` Jon Seymour
2011-04-28  2:15                               ` Jon Seymour
2011-04-28  2:49                                 ` Jon Seymour
2011-04-28  9:25                                   ` Andreas Ericsson
2011-04-28 10:56                                     ` Jon Seymour
2011-04-28 11:11                                       ` Jonathan Nieder
2011-04-28 11:20                                         ` Jon Seymour
2011-05-05 21:41                                       ` David Aguilar
2011-05-05 21:53                                         ` Junio C Hamano
2011-05-05 23:51                                           ` Jon Seymour
2011-05-06  4:47                                             ` Junio C Hamano
2011-05-06  6:20                                               ` Jon Seymour
2011-05-06  6:56                                                 ` Jonathan Nieder [this message]
2011-05-06  7:03                                                   ` Jonathan Nieder
2011-05-06 14:07                                                   ` Jon Seymour
2011-05-06 14:17                                                     ` Jonathan Nieder
2011-05-06 14:29                                                       ` Jon Seymour
2011-05-06 14:50                                                         ` Jonathan Nieder
2011-05-08  4:28                                                           ` Jon Seymour
2011-05-08  6:49                                                             ` Jonathan Nieder
2011-05-08  7:42                                                               ` Jon Seymour
2011-05-06 17:23                                                     ` Jeff King
2011-05-07  8:24                                                       ` John Szakmeister
2011-05-08  4:44                                                       ` Jon Seymour
2011-05-09  7:35                                                         ` Jeff King
2011-05-09  7:49                                                           ` Jon Seymour
2011-05-09  8:12                                                             ` Jeff King
2011-05-09  8:45                                                               ` Jon Seymour
2011-05-09 10:44                                                                 ` Jeff King
2011-05-09 11:07                                                                   ` Jon Seymour
2011-05-09 11:13                                                                     ` Jon Seymour
2011-05-09 11:24                                                                     ` Jeff King
2011-05-09 11:28                                                                       ` Jon Seymour
2011-05-09 12:21                                                                         ` Jeff King
2011-05-09 22:50                                                                           ` Jon Seymour
2011-05-08 13:13                                                   ` Jon Seymour
2011-05-09  4:36                                           ` Miles Bader
2011-05-14 12:51                                             ` David Aguilar
2011-04-28  9:11                                 ` Andreas Ericsson
2011-04-28 10:38                                   ` Jon Seymour
2011-04-28  7:40                               ` Pau Garcia i Quiles
2011-04-28  8:09                                 ` Jon Seymour
2011-04-28  9:11                                   ` Pau Garcia i Quiles
2011-04-28  9:42                                     ` Jon Seymour
2011-04-28  0:06                     ` Jon Seymour
2011-04-28  0:08                       ` Jon Seymour
2011-04-27 21:29 ` Motiejus Jakštys
2011-04-27 21:47   ` Jon Seymour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110506065601.GB13351@elie \
    --to=jrnieder@gmail.com \
    --cc=ae@op5.se \
    --cc=david@lang.hm \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=joey@kitenet.net \
    --cc=jon.seymour@gmail.com \
    --cc=pgquiles@elpauer.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).