Skip to contentSkip to conversation

tig 0.7

ANNOUNCE In review Jonas Fonseca 3 participants 7 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello,

tig version 0.7 has been released into the wild. Apart from a few bug fixes, cleanups, and minor improvements, it has support for a very basic status view, which makes it possible to stage/unstage changes as well as add untracked files.

Thanks for the patches related to the build/packaging infrastructure.

Grab the tarball at http://jonas.nitro.dk/tig/releases/
or pull it from git://repo.or.cz/tig.git

Following is a slightly edited shortlog:

Greg KH (1):
Make it possible to install man pages and html files separately

Jakub Narebski (1):
Infrastructure for tig rpm builds

Jonas Fonseca (22):
Add TODO item about diff chunk staging/unstaging
Fix revision graph visualization during incremental updating Introduce add_line_text to simplify pager based rendering
move_view: fix view->offset overflow bug
Be more paranoid about paths when updating the tree view Improve management of view->ref and the title line
Move space separator from get_key to formatting in open_help_view Make keybinding reference more dynamic
Add string_copy_rev
Add notice about empty pager view
Add open method to view_ops
Refactor add_line_text parts into add_line_data; use it in main_read
main_read: cleanup and simplify
Add status view
Add manpage XSL from git and enhance with literallayout fixes Add version information to man pages
Move "static" version info to VERSION file
Update sync-docs target to use git porcelain instead of cogito Various random Makefile cleanups
Rename sync-docs to release-doc; add release-dist rule tig-0.7

Signature · 1 line
Jonas Fonseca
#1 lore raw

This doesn't build on OS X out of the box, FYI. It needs the following tweaks (which break the build on Linux, so I'm not suggesting you apply this -- looks like you might need a configure script or at least some conditionals in the Makefile.) The change to tig.c cleans up a compiler warning, but it does build fine without that change.

---

Makefile |    2 +-
tig.c    |    2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +0 -0
index 57196b0..db5844c 100644
@@ -19,7 +19,7 @@ endif
 

RPM_VERSION = $(subst -,.,$(VERSION))

-LDLIBS = -lcurses
+LDLIBS = -lcurses -liconv
CFLAGS = -Wall -O2 '-DVERSION="$(VERSION)"'
DFLAGS = -g -DDEBUG -Werror
PROGS = tig

tig.c +1 -1
index e918fe6..e94ef4b 100644
@@ -1913,7 +1913,7 @@ update_view(struct view *view)
                       line[linelen - 1] = 0;
 
               if (opt_iconv != ICONV_NONE) {
-                       char *inbuf = line;
+                       const char *inbuf = line;
                       size_t inlen = linelen;
 
                       char *outbuf = out_buffer;
Signature · 1 line
1.5.2.35.ga334
#2 lore raw

Steven Grimm <[email protected]> wrote Thu, May 31, 2007:

Quoted 5 lines

This doesn't build on OS X out of the box, FYI. It needs the following tweaks (which break the build on Linux, so I'm not suggesting you apply this -- looks like you might need a configure script or at least some conditionals in the Makefile.) The change to tig.c cleans up a compiler warning, but it does build fine without that change.

I am aware of this and your suggestion is already in the TODO file. However, for 0.7 I ended up needing the new status view feature more than working on fixing that.

Signature · 1 line
Jonas Fonseca
#3 lore raw
Quoted 10 lines · Jonas Fonseca

Steven Grimm <[email protected]> wrote Thu, May 31, 2007:

Quoted 5 lines

This doesn't build on OS X out of the box, FYI. It needs the following tweaks (which break the build on Linux, so I'm not suggesting you apply this -- looks like you might need a configure script or at least some conditionals in the Makefile.) The change to tig.c cleans up a compiler warning, but it does build fine without that change.

I am aware of this and your suggestion is already in the TODO file. However, for 0.7 I ended up needing the new status view feature more than working on fixing that.

Which is fricken nice to have, thank you very much for adding this, I'm already using it.

greg "welded to the command line" k-h

#4 lore raw

PATCH 1/1 Add autoconf-based build infrastructure for tig

In reply to Jonas Fonseca

---
This is a first cut at building tig using autoconf. I'm including a script to run the various autoconf tools rather than packaging up a finished configure script. With this patch, tig configures and builds on both Linux (FC4) and OS X. I left a lot of the code from the original Makefile intact so as to (hopefully) not mess up building release tarballs, etc.

 INSTALL                 |    8 +++---
 Makefile => Makefile.am |   44 +++++--------------------------------
 autoconf.sh             |   24 ++++++++++++++++++++
 configure.ac            |   55 +++++++++++++++++++++++++++++++++++++++++++++++
 tig.c                   |   14 ++++++-----
 version.sh              |   23 +++++++++++++++++++
 6 files changed, 120 insertions(+), 48 deletions(-)
 rename Makefile => Makefile.am (75%)
 create mode 100755 autoconf.sh
 create mode 100644 configure.ac
 create mode 100644 version.sh
INSTALL +4 -4
index 586878e..db7dcbf 100644
@@ -8,16 +8,16 @@ available either in the tarballs or in the above repository in the branch named
 
 To install tig simply run:
 
+	$ sh autoconf.sh
+	$ ./configure
 	$ make install
 
 To install documentation run:
 
 	$ make install-doc
 
-Edit the Makefile if you need to configure specific compiler or linker flags.
-On FreeBSD for example the c library does not support the iconv interface and
-to compile tig you need to append `-L/usr/local/lib -liconv` to `LDLIBS` and
-`-I/usr/local/include` to the `CFLAGS` variable.
+If you had to install your own copy of libiconv, you'll probably want to pass
+the "--with-libiconv" option to the "configure" script to tell it where to look.
 
 The following tools and packages are needed:
 
Makefile.am renamed from Makefile +6 -38

62 lines not on this page · raw message

autoconf.sh new file +24 -0
new file mode 100755
index 0000000..5492de0
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "aclocal..."
+ACLOCAL=${ACLOCAL:-aclocal-1.9}
+$ACLOCAL || aclocal-1.7 || aclocal-1.5 || aclocal || exit 1
+
+echo "autoheader..."
+AUTOHEADER=${AUTOHEADER:-autoheader}
+$AUTOHEADER || exit 1
+
+echo "automake..."
+# shut automake up about missing files
+touch missing NEWS AUTHORS ChangeLog
+AUTOMAKE=${AUTOMAKE:-automake-1.9}
+$AUTOMAKE --add-missing --foreign || 
+	automake-1.7 --add-missing --foreign || 
+	automake --add-missing --foreign || 
+	exit 1
+rm missing NEWS AUTHORS ChangeLog
+
+echo "autoconf..."
+AUTOCONF=${AUTOCONF:-autoconf}
+$AUTOCONF || exit 1
+
configure.ac new file +55 -0

55 lines not on this page · raw message

tig.c +8 -6
index 6adfb33..6648c4e 100644
@@ -11,8 +11,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef VERSION
-#define VERSION "unknown-version"
+#ifndef TIG_VERSION
+#define TIG_VERSION "unknown-version"
 #endif
 
 #ifndef DEBUG
@@ -40,6 +40,8 @@
 
 #include <curses.h>
 
+#include "config.h"
+
 #if __GNUC__ >= 3
 #define __NORETURN __attribute__((__noreturn__))
 #else
@@ -388,7 +390,7 @@ get_request(const char *name)
  */
 
 static const char usage[] =
-"tig " VERSION " (" __DATE__ ")\n"
+"tig " TIG_VERSION " (" __DATE__ ")\n"
 "\n"
 "Usage: tig [options]\n"
 "   or: tig [options] [--] [git log options]\n"
@@ -513,7 +515,7 @@ parse_options(int argc, char *argv[])
 		}
 
 		if (check_option(opt, 'v', "version", OPT_NONE)) {
-			printf("tig version %s\n", VERSION);
+			printf("tig version %s\n", TIG_VERSION);
 			return FALSE;
 		}
 
@@ -1918,7 +1920,7 @@ update_view(struct view *view)
 			line[linelen - 1] = 0;
 
 		if (opt_iconv != ICONV_NONE) {
-			char *inbuf = line;
+			ICONV_INBUF_TYPE inbuf = line;
 			size_t inlen = linelen;
 
 			char *outbuf = out_buffer;
@@ -2245,7 +2247,7 @@ view_driver(struct view *view, enum request request)
 		break;
 
 	case REQ_SHOW_VERSION:
-		report("tig-%s (built %s)", VERSION, __DATE__);
+		report("tig-%s (built %s)", TIG_VERSION, __DATE__);
 		return TRUE;
 
 	case REQ_SCREEN_RESIZE:
version.sh new file +23 -0
new file mode 100644
index 0000000..2519876
@@ -0,0 +1,23 @@
+#!/bin/sh
+if [ -n "$DIST_VERSION" ]
+then
+	echo "$DIST_VERSION"
+	exit 0
+else
+	if [ -d .git ]
+	then
+		GITDESC="`git describe | sed s/tig-//`"
+		if git-diff-index HEAD 2> /dev/null > /dev/null
+		then
+			WTDIRTY="-dirty"
+		fi
+		echo $GITDESC$WTDIRTY
+	else
+		if [ -f VERSION ]
+		then
+			cat VERSION
+		else
+			echo "unknown-version"
+		fi
+	fi
+fi
Signature · 1 line
1.5.2.35.ga334
#5 lore raw

Re: [PATCH] Add autoconf-based build infrastructure for tig

Hi Steven,

Steven Grimm <[email protected]> wrote Sun, Jun 03, 2007:

Quoted 7 lines

---
This is a first cut at building tig using autoconf. I'm including a script to run the various autoconf tools rather than packaging up a finished configure script. With this patch, tig configures and builds on both Linux (FC4) and OS X. I left a lot of the code from the original Makefile intact so as to (hopefully) not mess up building release tarballs, etc.

First of all, thank you for starting this work!

I've only played little with this patch, but overall I like most of the changes. I would, however, want to look into making the dependency on autoconf optional (like it is for git) and avoid using automake at all. It would make the autoconf.sh bootstrap script obsolete, since the Makefile can just take care of it, and it would keep the build system simple.

So the idea is for configure to also generate a Makefile.config that can be sourced by the Makefile. Then of course inclusion of the config.h file should depend on some -DHAVE_CONFIG_H flag for the compiler.

What do you think? You are of course welcome to come up with a patch for this proposal, but else I would like to get your permission/sign-off to include the configure.ac script and the tig.c changes you made.

Signature · 1 line
Jonas Fonseca
#6 lore raw

Re: [PATCH] Add autoconf-based build infrastructure for tig

Quoted 7 lines · Jonas Fonseca

I've only played little with this patch, but overall I like most of the changes. I would, however, want to look into making the dependency on autoconf optional (like it is for git) and avoid using automake at all. It would make the autoconf.sh bootstrap script obsolete, since the Makefile can just take care of it, and it would keep the build system simple.

Quoted 7 lines

So the idea is for configure to also generate a Makefile.config that can be sourced by the Makefile. Then of course inclusion of the config.h file should depend on some -DHAVE_CONFIG_H flag for the compiler.

What do you think? You are of course welcome to come up with a patch for this proposal, but else I would like to get your permission/sign-off to include the configure.ac script and the tig.c changes you made.

That sounds perfectly sensible to me. Not sure when I'll have time to work on that proposal, but in the meantime you can use whatever bits of my original patch you like. Sorry about the lack of a Signed-off-by line in the original post -- I use git for private stuff at work 99% of the time and it sometimes slips my mind to add that extra header line for public changes. So, retroactively (though if you like I can resend the whole patch with this line):

-Steve