{"thread":{"id":"8374","subject":"[ANNOUNCE] tig 0.7","startedAt":"2007-05-31T12:38:08Z","lastAt":"2007-06-09T17:47:08Z","messageCount":7,"participants":["Jonas Fonseca","Steven Grimm","Greg KH"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"43683","messageId":"20070531123808.GA25719@diku.dk","threadId":"8374","inReplyTo":null,"subject":"[ANNOUNCE] tig 0.7","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-05-31T12:38:08Z","receivedAt":"2007-05-31T12:38:08Z","isPatch":false,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Hello,\n\ntig version 0.7 has been released into the wild. Apart from a few bug\nfixes, cleanups, and minor improvements, it has support for a very basic\nstatus view, which makes it possible to stage/unstage changes as well as\nadd untracked files.\n\nThanks for the patches related to the build/packaging infrastructure.\n\nGrab the tarball at http://jonas.nitro.dk/tig/releases/\nor pull it from git://repo.or.cz/tig.git\n\nFollowing is a slightly edited shortlog:\n\nGreg KH (1):\n      Make it possible to install man pages and html files separately\n\nJakub Narebski (1):\n      Infrastructure for tig rpm builds\n\nJonas Fonseca (22):\n      Add TODO item about diff chunk staging/unstaging\n      Fix revision graph visualization during incremental updating\n      Introduce add_line_text to simplify pager based rendering\n      move_view: fix view->offset overflow bug\n      Be more paranoid about paths when updating the tree view\n      Improve management of view->ref and the title line\n      Move space separator from get_key to formatting in open_help_view\n      Make keybinding reference more dynamic\n      Add string_copy_rev\n      Add notice about empty pager view\n      Add open method to view_ops\n      Refactor add_line_text parts into add_line_data; use it in main_read\n      main_read: cleanup and simplify\n      Add status view\n      Add manpage XSL from git and enhance with literallayout fixes\n      Add version information to man pages\n      Move \"static\" version info to VERSION file\n      Update sync-docs target to use git porcelain instead of cogito\n      Various random Makefile cleanups\n      Rename sync-docs to release-doc; add release-dist rule\n      tig-0.7\n\n-- \nJonas Fonseca\n"},{"id":"43693","messageId":"465F2731.2080707@midwinter.com","threadId":"8374","inReplyTo":"20070531123808.GA25719@diku.dk","subject":"Re: [ANNOUNCE] tig 0.7","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-05-31T19:51:13Z","receivedAt":"2007-05-31T19:51:13Z","isPatch":false,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"This doesn't build on OS X out of the box, FYI. It needs the following \ntweaks (which break the build on Linux, so I'm not suggesting you apply \nthis -- looks like you might need a configure script or at least some \nconditionals in the Makefile.) The change to tig.c cleans up a compiler \nwarning, but it does build fine without that change.\n\n---\n Makefile |    2 +-\n tig.c    |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 57196b0..db5844c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -19,7 +19,7 @@ endif\n \n RPM_VERSION = $(subst -,.,$(VERSION))\n \n-LDLIBS = -lcurses\n+LDLIBS = -lcurses -liconv\n CFLAGS = -Wall -O2 '-DVERSION=\"$(VERSION)\"'\n DFLAGS = -g -DDEBUG -Werror\n PROGS  = tig\ndiff --git a/tig.c b/tig.c\nindex e918fe6..e94ef4b 100644\n--- a/tig.c\n+++ b/tig.c\n@@ -1913,7 +1913,7 @@ update_view(struct view *view)\n                        line[linelen - 1] = 0;\n \n                if (opt_iconv != ICONV_NONE) {\n-                       char *inbuf = line;\n+                       const char *inbuf = line;\n                        size_t inlen = linelen;\n \n                        char *outbuf = out_buffer;\n-- \n1.5.2.35.ga334\n"},{"id":"43696","messageId":"20070531215508.GB9260@diku.dk","threadId":"8374","inReplyTo":"465F2731.2080707@midwinter.com","subject":"Re: [ANNOUNCE] tig 0.7","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-05-31T21:55:08Z","receivedAt":"2007-05-31T21:55:08Z","isPatch":false,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Steven Grimm <koreth@midwinter.com> wrote Thu, May 31, 2007:\n> This doesn't build on OS X out of the box, FYI. It needs the following \n> tweaks (which break the build on Linux, so I'm not suggesting you apply \n> this -- looks like you might need a configure script or at least some \n> conditionals in the Makefile.) The change to tig.c cleans up a compiler \n> warning, but it does build fine without that change.\n\nI am aware of this and your suggestion is already in the TODO file.\nHowever, for 0.7 I ended up needing the new status view feature more\nthan working on fixing that.\n\n-- \nJonas Fonseca\n"},{"id":"43711","messageId":"20070601012936.GA28845@kroah.com","threadId":"8374","inReplyTo":"20070531215508.GB9260@diku.dk","subject":"Re: [ANNOUNCE] tig 0.7","fromName":"Greg KH","fromEmail":"greg@kroah.com","sentAt":"2007-06-01T01:29:36Z","receivedAt":"2007-06-01T01:29:36Z","isPatch":false,"sender":{"key":"greg@kroah.com","avatar":"https://gravatar.com/avatar/5bb5aa0cc2e01c00ec899d11130c07796bc186e465bae57bc34873b13b72c7c8?d=mp&s=160"},"body":"On Thu, May 31, 2007 at 11:55:08PM +0200, Jonas Fonseca wrote:\n> Steven Grimm <koreth@midwinter.com> wrote Thu, May 31, 2007:\n> > This doesn't build on OS X out of the box, FYI. It needs the following \n> > tweaks (which break the build on Linux, so I'm not suggesting you apply \n> > this -- looks like you might need a configure script or at least some \n> > conditionals in the Makefile.) The change to tig.c cleans up a compiler \n> > warning, but it does build fine without that change.\n> \n> I am aware of this and your suggestion is already in the TODO file.\n> However, for 0.7 I ended up needing the new status view feature more\n> than working on fixing that.\n\nWhich is fricken nice to have, thank you very much for adding this, I'm\nalready using it.\n\ngreg \"welded to the command line\" k-h\n"},{"id":"43901","messageId":"20070603193521.GA10161@midwinter.com","threadId":"8374","inReplyTo":"20070531215508.GB9260@diku.dk","subject":"[PATCH] Add autoconf-based build infrastructure for tig","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-06-03T19:35:21Z","receivedAt":"2007-06-03T19:35:21Z","isPatch":true,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"---\n\tThis is a first cut at building tig using autoconf. I'm including\n\ta script to run the various autoconf tools rather than packaging\n\tup a finished configure script. With this patch, tig configures\n\tand builds on both Linux (FC4) and OS X. I left a lot of the code\n\tfrom the original Makefile intact so as to (hopefully) not mess\n\tup building release tarballs, etc.\n\n INSTALL                 |    8 +++---\n Makefile => Makefile.am |   44 +++++--------------------------------\n autoconf.sh             |   24 ++++++++++++++++++++\n configure.ac            |   55 +++++++++++++++++++++++++++++++++++++++++++++++\n tig.c                   |   14 ++++++-----\n version.sh              |   23 +++++++++++++++++++\n 6 files changed, 120 insertions(+), 48 deletions(-)\n rename Makefile => Makefile.am (75%)\n create mode 100755 autoconf.sh\n create mode 100644 configure.ac\n create mode 100644 version.sh\n\ndiff --git a/INSTALL b/INSTALL\nindex 586878e..db7dcbf 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -8,16 +8,16 @@ available either in the tarballs or in the above repository in the branch named\n \n To install tig simply run:\n \n+\t$ sh autoconf.sh\n+\t$ ./configure\n \t$ make install\n \n To install documentation run:\n \n \t$ make install-doc\n \n-Edit the Makefile if you need to configure specific compiler or linker flags.\n-On FreeBSD for example the c library does not support the iconv interface and\n-to compile tig you need to append `-L/usr/local/lib -liconv` to `LDLIBS` and\n-`-I/usr/local/include` to the `CFLAGS` variable.\n+If you had to install your own copy of libiconv, you'll probably want to pass\n+the \"--with-libiconv\" option to the \"configure\" script to tell it where to look.\n \n The following tools and packages are needed:\n \ndiff --git a/Makefile b/Makefile.am\nsimilarity index 75%\nrename from Makefile\nrename to Makefile.am\nindex 91cb097..9f146f9 100644\n--- a/Makefile\n+++ b/Makefile.am\n@@ -1,48 +1,18 @@\n-prefix\t= $(HOME)\n-bindir\t= $(prefix)/bin\n-mandir\t= $(prefix)/man\n-docdir\t= $(prefix)/share/doc\n-# DESTDIR=\n-\n-# Get version either via git or from VERSION file. Allow either\n-# to be overwritten by setting DIST_VERSION on the command line.\n-ifneq (,$(wildcard .git))\n-GITDESC\t= $(subst tig-,,$(shell git describe))\n-WTDIRTY\t= $(if $(shell git-diff-index HEAD 2>/dev/null),-dirty)\n-VERSION\t= $(GITDESC)$(WTDIRTY)\n-else\n-VERSION\t= $(shell test -f VERSION && cat VERSION || echo \"unknown-version\")\n-endif\n-ifdef DIST_VERSION\n-VERSION = $(DIST_VERSION)\n-endif\n-\n-RPM_VERSION = $(subst -,.,$(VERSION))\n-\n-LDLIBS\t= -lcurses\n-CFLAGS\t= -Wall -O2\n-DFLAGS\t= -g -DDEBUG -Werror\n-PROGS\t= tig\n+AM_CPPFLAGS = -DTIG_VERSION=\\\"`sh version.sh`\\\"\n+AM_CFLAGS = -Wall -O2\n+\n+bin_PROGRAMS = tig\n+tig_SOURCES = tig.c\n+\n MANDOC\t= tig.1 tigrc.5\n HTMLDOC = tig.1.html tigrc.5.html manual.html README.html\n ALLDOC\t= $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf\n TARNAME\t= tig-$(RPM_VERSION)\n \n-override CFLAGS += '-DVERSION=\"$(VERSION)\"'\n-\n-all: $(PROGS)\n-all-debug: $(PROGS)\n-all-debug: CFLAGS += $(DFLAGS)\n doc: $(ALLDOC)\n doc-man: $(MANDOC)\n doc-html: $(HTMLDOC)\n \n-install: all\n-\tmkdir -p $(DESTDIR)$(bindir) && \\\n-\tfor prog in $(PROGS); do \\\n-\t\tinstall -p -m 0755 $$prog $(DESTDIR)$(bindir); \\\n-\tdone\n-\n install-doc-man: doc-man\n \tmkdir -p $(DESTDIR)$(mandir)/man1 \\\n \t\t $(DESTDIR)$(mandir)/man5\n@@ -107,8 +77,6 @@ release-dist: release-doc\n tig.spec: tig.spec.in\n \tsed -e 's/@@VERSION@@/$(RPM_VERSION)/g' < $< > $@\n \n-tig: tig.c\n-\n manual.html: manual.toc\n manual.toc: manual.txt\n \tsed -n '/^\\[\\[/,/\\(---\\|~~~\\)/p' < $< | while read line; do \\\ndiff --git a/autoconf.sh b/autoconf.sh\nnew file mode 100755\nindex 0000000..5492de0\n--- /dev/null\n+++ b/autoconf.sh\n@@ -0,0 +1,24 @@\n+#!/bin/sh\n+\n+echo \"aclocal...\"\n+ACLOCAL=${ACLOCAL:-aclocal-1.9}\n+$ACLOCAL || aclocal-1.7 || aclocal-1.5 || aclocal || exit 1\n+\n+echo \"autoheader...\"\n+AUTOHEADER=${AUTOHEADER:-autoheader}\n+$AUTOHEADER || exit 1\n+\n+echo \"automake...\"\n+# shut automake up about missing files\n+touch missing NEWS AUTHORS ChangeLog\n+AUTOMAKE=${AUTOMAKE:-automake-1.9}\n+$AUTOMAKE --add-missing --foreign || \n+\tautomake-1.7 --add-missing --foreign || \n+\tautomake --add-missing --foreign || \n+\texit 1\n+rm missing NEWS AUTHORS ChangeLog\n+\n+echo \"autoconf...\"\n+AUTOCONF=${AUTOCONF:-autoconf}\n+$AUTOCONF || exit 1\n+\ndiff --git a/configure.ac b/configure.ac\nnew file mode 100644\nindex 0000000..2cdb320\n--- /dev/null\n+++ b/configure.ac\n@@ -0,0 +1,55 @@\n+AC_INIT([tig], [0],\n+\t[Jonas Fonesca <fonesca@diku.dk>],\n+\t[tig])\n+AC_LANG([C])\n+AM_CONFIG_HEADER(config.h)\n+AC_CONFIG_SRCDIR(tig.c)\n+AM_INIT_AUTOMAKE([no-dist])\n+\n+AC_ARG_WITH(libiconv,\n+        AC_HELP_STRING([--with-libiconv=DIRECTORY],[base directory for libiconv]))\n+if test \"$with_libiconv\" != \"\"\n+then\n+\tCFLAGS=\"$CFLAGS -I$with_libiconv/include\"\n+\tLDFLAGS=\"$LDFLAGS -L$with_libiconv/lib\"\n+fi\n+\n+dnl\n+dnl See if we need to link with -liconv to get the iconv() function.\n+dnl\n+AC_SEARCH_LIBS([iconv], [iconv])\n+AC_SEARCH_LIBS([wclear], [ncurses])\n+\n+if test \"$ac_cv_search_iconv\" = \"no\"\n+then\n+\tAC_MSG_FAILURE([iconv() not found. Please install libiconv.],[1])\n+fi\n+\n+dnl\n+dnl See if iconv() requires a const char ** for the input buffer.\n+dnl\n+if test \"$GCC\" = \"yes\"\n+then\n+\tOLD_CFLAGS=\"$CFLAGS\"\n+\tCFLAGS=\"$CFLAGS -Werror\"\n+\tAC_MSG_CHECKING([whether iconv needs const char **])\n+\tAC_COMPILE_IFELSE(\n+\t\t[AC_LANG_PROGRAM([[#include <iconv.h>]],\n+\t\t\t\t [[char **buf;\n+\t\t\t\t   size_t *size;\n+\t\t\t\t   iconv_t cd;\n+\t\t\t\t   iconv(cd, buf, size, buf, size);]])],\n+\t\t[AC_DEFINE([ICONV_INBUF_TYPE],[char *],\n+\t\t\t   [Type of iconv() input buffer])\n+\t\t AC_MSG_RESULT([no])],\n+\t\t[AC_DEFINE([ICONV_INBUF_TYPE],[const char *],\n+\t\t\t   [Type of iconv() input buffer])\n+\t\t AC_MSG_RESULT([yes])])\n+\tCFLAGS=\"$OLD_CFLAGS\"\n+fi\n+\n+AC_PROG_CC\n+AC_PROG_INSTALL\n+\n+AC_CONFIG_FILES([Makefile])\n+AC_OUTPUT\ndiff --git a/tig.c b/tig.c\nindex 6adfb33..6648c4e 100644\n--- a/tig.c\n+++ b/tig.c\n@@ -11,8 +11,8 @@\n  * GNU General Public License for more details.\n  */\n \n-#ifndef VERSION\n-#define VERSION \"unknown-version\"\n+#ifndef TIG_VERSION\n+#define TIG_VERSION \"unknown-version\"\n #endif\n \n #ifndef DEBUG\n@@ -40,6 +40,8 @@\n \n #include <curses.h>\n \n+#include \"config.h\"\n+\n #if __GNUC__ >= 3\n #define __NORETURN __attribute__((__noreturn__))\n #else\n@@ -388,7 +390,7 @@ get_request(const char *name)\n  */\n \n static const char usage[] =\n-\"tig \" VERSION \" (\" __DATE__ \")\\n\"\n+\"tig \" TIG_VERSION \" (\" __DATE__ \")\\n\"\n \"\\n\"\n \"Usage: tig [options]\\n\"\n \"   or: tig [options] [--] [git log options]\\n\"\n@@ -513,7 +515,7 @@ parse_options(int argc, char *argv[])\n \t\t}\n \n \t\tif (check_option(opt, 'v', \"version\", OPT_NONE)) {\n-\t\t\tprintf(\"tig version %s\\n\", VERSION);\n+\t\t\tprintf(\"tig version %s\\n\", TIG_VERSION);\n \t\t\treturn FALSE;\n \t\t}\n \n@@ -1918,7 +1920,7 @@ update_view(struct view *view)\n \t\t\tline[linelen - 1] = 0;\n \n \t\tif (opt_iconv != ICONV_NONE) {\n-\t\t\tchar *inbuf = line;\n+\t\t\tICONV_INBUF_TYPE inbuf = line;\n \t\t\tsize_t inlen = linelen;\n \n \t\t\tchar *outbuf = out_buffer;\n@@ -2245,7 +2247,7 @@ view_driver(struct view *view, enum request request)\n \t\tbreak;\n \n \tcase REQ_SHOW_VERSION:\n-\t\treport(\"tig-%s (built %s)\", VERSION, __DATE__);\n+\t\treport(\"tig-%s (built %s)\", TIG_VERSION, __DATE__);\n \t\treturn TRUE;\n \n \tcase REQ_SCREEN_RESIZE:\ndiff --git a/version.sh b/version.sh\nnew file mode 100644\nindex 0000000..2519876\n--- /dev/null\n+++ b/version.sh\n@@ -0,0 +1,23 @@\n+#!/bin/sh\n+if [ -n \"$DIST_VERSION\" ]\n+then\n+\techo \"$DIST_VERSION\"\n+\texit 0\n+else\n+\tif [ -d .git ]\n+\tthen\n+\t\tGITDESC=\"`git describe | sed s/tig-//`\"\n+\t\tif git-diff-index HEAD 2> /dev/null > /dev/null\n+\t\tthen\n+\t\t\tWTDIRTY=\"-dirty\"\n+\t\tfi\n+\t\techo $GITDESC$WTDIRTY\n+\telse\n+\t\tif [ -f VERSION ]\n+\t\tthen\n+\t\t\tcat VERSION\n+\t\telse\n+\t\t\techo \"unknown-version\"\n+\t\tfi\n+\tfi\n+fi\n-- \n1.5.2.35.ga334\n"},{"id":"44441","messageId":"20070609093101.GA25039@diku.dk","threadId":"8374","inReplyTo":"20070603193521.GA10161@midwinter.com","subject":"Re: [PATCH] Add autoconf-based build infrastructure for tig","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-06-09T09:31:01Z","receivedAt":"2007-06-09T09:31:01Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Hi Steven,\n\nSteven Grimm <koreth@midwinter.com> wrote Sun, Jun 03, 2007:\n> ---\n> \tThis is a first cut at building tig using autoconf. I'm including\n> \ta script to run the various autoconf tools rather than packaging\n> \tup a finished configure script. With this patch, tig configures\n> \tand builds on both Linux (FC4) and OS X. I left a lot of the code\n> \tfrom the original Makefile intact so as to (hopefully) not mess\n> \tup building release tarballs, etc.\n\nFirst of all, thank you for starting this work!\n\nI've only played little with this patch, but overall I like most of the\nchanges. I would, however, want to look into making the dependency on\nautoconf optional (like it is for git) and avoid using automake at all.\nIt would make the autoconf.sh bootstrap script obsolete, since the\nMakefile can just take care of it, and it would keep the build system\nsimple.\n\nSo the idea is for configure to also generate a Makefile.config that can\nbe sourced by the Makefile. Then of course inclusion of the config.h\nfile should depend on some -DHAVE_CONFIG_H flag for the compiler.\n\nWhat do you think? You are of course welcome to come up with a patch for\nthis proposal, but else I would like to get your permission/sign-off to\ninclude the configure.ac script and the tig.c changes you made.\n\n-- \nJonas Fonseca\n"},{"id":"44460","messageId":"466AE79C.4050605@midwinter.com","threadId":"8374","inReplyTo":"20070609093101.GA25039@diku.dk","subject":"Re: [PATCH] Add autoconf-based build infrastructure for tig","fromName":"Steven Grimm","fromEmail":"koreth@midwinter.com","sentAt":"2007-06-09T17:47:08Z","receivedAt":"2007-06-09T17:47:08Z","isPatch":true,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"Jonas Fonseca wrote:\n> I've only played little with this patch, but overall I like most of the\n> changes. I would, however, want to look into making the dependency on\n> autoconf optional (like it is for git) and avoid using automake at all.\n> It would make the autoconf.sh bootstrap script obsolete, since the\n> Makefile can just take care of it, and it would keep the build system\n> simple.\n>\n> So the idea is for configure to also generate a Makefile.config that can\n> be sourced by the Makefile. Then of course inclusion of the config.h\n> file should depend on some -DHAVE_CONFIG_H flag for the compiler.\n>\n> What do you think? You are of course welcome to come up with a patch for\n> this proposal, but else I would like to get your permission/sign-off to\n> include the configure.ac script and the tig.c changes you made.\n\nThat sounds perfectly sensible to me. Not sure when I'll have time to \nwork on that proposal, but in the meantime you can use whatever bits of \nmy original patch you like. Sorry about the lack of a Signed-off-by line \nin the original post -- I use git for private stuff at work 99% of the \ntime and it sometimes slips my mind to add that extra header line for \npublic changes. So, retroactively (though if you like I can resend the \nwhole patch with this line):\n\nSigned-off-by: Steven Grimm <koreth@midwinter.com>\n\n-Steve\n"}]}