git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 2/5] git-remote-mediawiki: new git bin-wrapper for developement

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 27, 2013, 17:57 UTC
Message-ID
<7vr4fnsafy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1372354652-4147-3-git-send-email-benoit.person@ensimag.fr>
benoit.person@ensimag.fr writes:
Show 12 quoted lines
> diff --git a/contrib/mw-to-git/bin-wrapper/git b/contrib/mw-to-git/bin-wrapper/git
> new file mode 100755
> index 0000000..aa714a5
> --- /dev/null
> +++ b/contrib/mw-to-git/bin-wrapper/git
> @@ -0,0 +1,27 @@
> +#!/bin/sh
> +
> +# git executable wrapper script for Git-Mediawiki to run tests without
> +# installing all the scripts and perl packages.
> +
> +# based on $GIT_ROOT_DIR/wrap-for-bin.sh
I really do not like the smell of this.

As far as I can tell, the only real reason why you need this and cannot use ../../bin-wrappers/git directly is because the GITPERLLIB it gives you only points at ../../perl/blib/lib and not this directory.

Two possible alternatives:
 - Is there a reason you would not want to "install" whatever Perl
   modules you want to "use" via GITPERLLIB mechanism to
   ../../perl/blib/lib?  Perhaps it will interfere with the real
   installation step in ../../perl/Makefile?  If that is the case,
   then it is not a good idea, but otherwise, that would let you use
   ../../bin-wrappers/git as-is.
 - Perhaps we could do:
	GITPERLLIB="${GPLEXTRA+$GPLEXTRA:}@@BUILD_DIR@@/perl/blib/lib"
   in wrap-for-bin.sh, so that your instruction can become
	GPLEXTRA=$(pwd) ../../bin-wrappers/git whatever-mw-thing
   and you do not have to have this file?  We would also need to
   "unset GPLEXTRA" at the beginning of test-lib.sh if we were to do
   this.

How does a developer (or user) use this script? From your Makefile (e.g. "make test")? Manually following some written instruction? In either case, the latter option feels a lot more sensible alternative without having to maintain this extra copy of wrap-for-bin that can easily go out of sync.

Show 21 quoted lines
> +
> +
> +GIT_ROOT_DIR=../../..
> +GIT_EXEC_PATH=$(cd "$(dirname "$0")" && cd ${GIT_ROOT_DIR} && pwd)
> +
> +echo $GIT_EXEC_PATH
> +
> +if test -n "$NO_SET_GIT_TEMPLATE_DIR"
> +then
> +	unset GIT_TEMPLATE_DIR
> +else
> +	GIT_TEMPLATE_DIR="$GIT_EXEC_PATH"'/templates/blt'
> +	export GIT_TEMPLATE_DIR
> +fi
> +# Hack to make the `use lib` call works with multiple paths
> +GITPERLLIB="$GIT_EXEC_PATH"'/contrib/mw-to-git:'"$GIT_EXEC_PATH"'/perl/blib/lib'
> +GIT_TEXTDOMAINDIR="$GIT_EXEC_PATH"'/po/build/locale'
> +PATH="$GIT_EXEC_PATH"'/contrib/mw-to-git:'"$GIT_EXEC_PATH"'/bin-wrappers:'"$PATH"
> +export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
> +
> +exec "${GIT_EXEC_PATH}/git" "$@"
Previous: benoit.person@ensimag.frNext: Matthieu Moy
Message 4 of 12 in “git-remote-mediawiki: new tool to preview local changes without pushing”
  1. 0/5 git-remote-mediawiki: new tool to preview local changes without pushingbenoit.person@ensimag.fr, Jun 27, 2013
  2. 1/5 git-remote-mediawiki: Introduction of Git::Mediawiki.pmbenoit.person@ensimag.fr, Jun 27, 2013
  3. 2/5 git-remote-mediawiki: new git bin-wrapper for developementbenoit.person@ensimag.fr, Jun 27, 2013
  4. Junio C HamanoJun 27, 2013
  5. Matthieu MoyJun 27, 2013
  6. Benoît PersonJun 27, 2013
  7. Matthieu MoyJun 27, 2013
  8. Benoît PersonJun 29, 2013
  9. Matthieu MoyJul 1, 2013
  10. 3/5 git-remote-mediawiki: factoring code between git-remote-mediawiki and Git::Mediawikibenoit.person@ensimag.fr, Jun 27, 2013
  11. 4/5 git-remote-mediawiki: Adding git-mw commandbenoit.person@ensimag.fr, Jun 27, 2013
  12. 5/5 git-remote-mediawiki: Add preview subcommand into git mw.benoit.person@ensimag.fr, Jun 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.