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

Re: [PATCH/RFC] git-remote-mediawiki: new tool to preview local changes without pushing

From
BPBenoît Person <benoit.person@ensimag.fr>
Date
Jun 11, 2013, 21:31 UTC
Message-ID
<CAETqRCiJmnz_1yjwvyWx+=kPkt3M+vKk--CnS=rnQcDA4wMSmg@mail.gmail.com>
In-Reply-To
<20130609060807.GA8906@sigill.intra.peff.net>

The V2 is on the launchpad but I am still struggling with the code factoring between git-mw.perl and git-remote-mediawiki.perl :/ .

On 9 June 2013 08:08, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
>
> You could make a Git::MediaWiki.pm module, but installing that would
> significantly complicate the build procedure, and potentially be
> annoying for users. One trick I have done in the past is to concatenate
> bits of perl script together in the Makefile, like this:
>
>   foo: common.pl foo.pl
>           { \
>             echo '$(PERL_PATH_SQ)' && \
>             for i in $^; do \
>               echo "#line 1 $src" && \
>                 cat $src \
>             done \
>           } >$@+
>           mv $@+ $@
>
> That would conflict a bit with the way we chain to git's Makefile,
> though. I suspect you could do something complicated like build "foo.pl"
> from "common.pl" and "foo-main.pl", then chain to git's Makefile to
> build "foo" from "foo.pl".

I've implemented this one for now but after a real-life meeting with Matthieu Moy we discussed the possibility to build a GitMediawiki.pm module. It seems more "clean" than the concatenation of perl scripts. Plus, it would force people to limit side effects inside the functions used in this package/utils file (I have in mind the mw_connect_maybe function here and a couple of others which directly *hope* for global vars to be set to a nice value before being called).

What I find bad in the concatenating-thingy is the mandatory rename of git-mw.perl into something like git-mw.unmerged.perl and git-remote-mediawiki.perl into git-remote-mediawiki.unmerged.perl. Otherwise, like you said, it would be hard to chain to git's Makefile after the merge.

For now, I have really no idea which one is the best. If I may ask, what did you have in mind while saying:

> You could make a Git::MediaWiki.pm module, but installing that would
> significantly complicate the build procedure, and potentially be
> annoying for users.
?

Since my previous commit (ea07ec1 in next - use Git.pm functions for credentials), git-remote-mediawiki.perl already depends on the proper installation of the Git.pm package. In what ways the need for the installation of yet another package (GitMediawiki.pm) would annoy a user ?

Thank you for your time,
Benoit
Previous: Jeff KingNext: Jeff King
Message 11 of 14 in “git-remote-mediawiki: new tool to preview local changes without pushing”
  1. git-remote-mediawiki: new tool to preview local changes without pushingbenoit.person@ensimag.fr, Jun 7, 2013
  2. Matthieu MoyJun 8, 2013
  3. Jeff KingJun 9, 2013
  4. Jeff KingJun 9, 2013
  5. Matthieu MoyJun 9, 2013
  6. Benoît PersonJun 9, 2013
  7. Jeff KingJun 9, 2013
  8. Benoît PersonJun 9, 2013
  9. Matthieu MoyJun 9, 2013
  10. Jeff KingJun 9, 2013
  11. Benoît PersonJun 11, 2013
  12. Jeff KingJun 11, 2013
  13. Matthieu MoyJun 12, 2013
  14. Jeff KingJun 12, 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.