git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Flavio Poletti <flavio@polettix.it>
To: git@vger.kernel.org
Cc: normalperson@yhbt.net, Flavio Poletti <flavio@polettix.it>
Subject: [RFC/PATCH] git-instaweb: added logo and favicon
Date: Mon, 16 Jun 2008 04:46:31 +0200	[thread overview]
Message-ID: <1213584391-29903-1-git-send-email-flavio@polettix.it> (raw)

Eye candy: logo and favicon are now included in the standard
deployments for git-instaweb.

Signed-off-by: Flavio Poletti <flavio@polettix.it>
---

I probably need a little help here to figure out how to make this
"portable". I've modified Makefile, but what when configure is
called by the end user instead of relying on this streamline
Makefile? I need some hints about where to look to make this
patch more robust regarding this.

Any suggestion is welcome, of course.

 Makefile        |   17 +++++++++++++++--
 git-instaweb.sh |   28 ++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 1937507..1879a34 100644
--- a/Makefile
+++ b/Makefile
@@ -1104,8 +1104,16 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
 	chmod +x $@+ && \
 	mv $@+ $@
 
-git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
-	$(QUIET_GEN)$(RM) $@ $@+ && \
+git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/git-logo.png gitweb/git-favicon.png
+	$(QUIET_GEN)$(RM) $@ $@+ $@+logo $@+fav && \
+	'$(PERL_PATH_SQ)' <gitweb/git-logo.png >$@+logo -l \
+	    -e 'binmode STDIN;' \
+	    -e 'while(read(STDIN,$$x,16))' \
+	    -e '{print unpack"H*",$$x}' && \
+	'$(PERL_PATH_SQ)' <gitweb/git-favicon.png >$@+fav -l \
+	    -e 'binmode STDIN;' \
+	    -e 'while(read(STDIN,$$x,16))' \
+	    -e '{print unpack"H*",$$x}' && \
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
@@ -1113,8 +1121,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
 	    -e '/@@GITWEB_CGI@@/d' \
 	    -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
 	    -e '/@@GITWEB_CSS@@/d' \
+	    -e '/@@GITWEB_LOGO@@/r $@+logo' \
+	    -e '/@@GITWEB_LOGO@@/d' \
+	    -e '/@@GITWEB_FAVICON@@/r $@+fav' \
+	    -e '/@@GITWEB_FAVICON@@/d' \
 	    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
 	    $@.sh > $@+ && \
+	rm $@+logo $@+fav && \
 	chmod +x $@+ && \
 	mv $@+ $@
 
diff --git a/git-instaweb.sh b/git-instaweb.sh
index af0fde5..782256c 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -268,8 +268,32 @@ gitweb_css () {
 EOFGITWEB
 }
 
-gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
-gitweb_css "$GIT_DIR/gitweb/gitweb.css"
+hex2bin () {
+   "$PERL" -e '
+      binmode STDOUT;
+      while (<STDIN>) {
+         chomp;
+         print pack "H*", $_;
+      }
+   '
+}
+
+gitweb_favicon () {
+   hex2bin > "$1" <<\EOFGITFAVICON
+@@GITWEB_FAVICON@@
+EOFGITFAVICON
+}
+
+gitweb_logo () {
+   hex2bin > "$1" <<\EOFGITLOGO
+@@GITWEB_LOGO@@
+EOFGITLOGO
+}
+
+gitweb_cgi     "$GIT_DIR/gitweb/gitweb.cgi"
+gitweb_css     "$GIT_DIR/gitweb/gitweb.css"
+gitweb_favicon "$GIT_DIR/gitweb/git-favicon.png"
+gitweb_logo    "$GIT_DIR/gitweb/git-logo.png"
 
 case "$httpd" in
 *lighttpd*)
-- 
1.5.5.4

             reply	other threads:[~2008-06-16  2:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16  2:46 Flavio Poletti [this message]
2008-06-16  3:13 ` [RFC/PATCH] git-instaweb: added logo and favicon Eric Wong

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=1213584391-29903-1-git-send-email-flavio@polettix.it \
    --to=flavio@polettix.it \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).