Re: RFC: a plugin architecture for git extensions?
- From
Jon Seymour <jon.seymour@gmail.com>
- Date
- Apr 28, 2011, 00:06 UTC
- Message-ID
- <BANLkTin0=1LdvHgLebuSyUGmFRVzNGoVtg@mail.gmail.com>
- In-Reply-To
- <7vsjt35l84.fsf@alter.siamese.dyndns.org>
On Thu, Apr 28, 2011 at 9:27 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes: > >> Junio C Hamano wrote: > > I was thinking it, and the location git-work binary gets installed, should > depend on where "git" and its subcommand binaries are installed. The word > plug-in mentioned in the thread implied that whatever plugs in is not by > itself full fledged thing that is useful standalone, so it seemed a very > natural thing to do. >
You are correct about this - the ~/.git-pm/activation was, um, a horrible idea.
Show 21 quoted lines
>> In the $prefix >> case, the same snippet in .profile that adds $prefix/bin to the $PATH >> would also say >> >> MANPATH=$prefix/man:$(manpath) > > You are correct only if "git" the user is building is _not_ changed to > look for other places for its own manpages. If "git" was built to look at > somewhere else, the relationship between the output of "git --exec-path" > and that location shouldn't be assumed to be ../../share/man or anything. > > The layout should be discoverable, by exposing system_path(GIT_MAN_PATH) > and friends (see builtin/help.c), just like we expose GIT_EXEC_PATH. > >> Or is the idea to blindly install (a symlink to) git-work to $(git >> --exec-path)/ rather than a place on the $PATH? > > You can call it _blindly_ if you like, but that is what I meant. "git" > tells where the binary and help material for a "plugin" to be installed, > so that it can find them where it expects to. >
Show 5 quoted lines
> After all, I am not interested at all in adding "git pm" or other crap. I > am just trying to help people write their own "make install" of a plugin > project, like "git work". And writing "make uninstall" for that project > should be doable with the same information I am trying to give in this > thread, no?
Ok, how about this?
plugins/
gitwork/
git-work.sh
git-work.1libexec/
plugins/
git-work -> ../../plugins/gitwork/git-work.shshare/
man/
man1/
git-work.1 -> ../../../plugins/git-work.1The function of a:
git plugin activate git-work
would simply be to establish the symlinks.
gitwork would get into plugins/ by your existing platform manager or make install do some minimal validation of conflicts, etc.
jon.