diff -Nru tig-2.2/acinclude.m4 tig-2.3.0/acinclude.m4 --- tig-2.2/acinclude.m4 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/acinclude.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -dnl From Bruno Haible. -AC_DEFUN([AM_ICONV], -[ - dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable GNU libiconv installed). - - AC_ARG_WITH([libiconv], -[ --with-libiconv=DIR search for libiconv in DIR/include and DIR/lib], [ - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi - if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi - done - ]) - - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], [[iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);]])],[am_cv_func_iconv=yes],[]) - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS -liconv" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], [[iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);]])],[am_cv_lib_iconv=yes - am_cv_func_iconv=yes],[]) - LIBS="$am_save_LIBS" - fi - ]) - if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -]], [[]])],[am_cv_proto_iconv_arg1=""],[am_cv_proto_iconv_arg1="const"]) - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, - [Define as const if the declaration of iconv() needs const.]) - else - AC_MSG_FAILURE([iconv() not found. Please install libiconv and use --with-libiconv=/path/to/dir.],[1]) - fi - if test "$am_cv_lib_iconv" = yes; then - LIBS="$LIBS -liconv" - fi -]) diff -Nru tig-2.2/aclocal.m4 tig-2.3.0/aclocal.m4 --- tig-2.2/aclocal.m4 2016-08-11 02:39:02.000000000 +0000 +++ tig-2.3.0/aclocal.m4 2017-09-29 15:15:29.000000000 +0000 @@ -12,6 +12,282 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. @@ -63,6 +339,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) m4_include([tools/ax_lib_readline.m4]) +m4_include([tools/ax_require_defined.m4]) m4_include([tools/ax_with_curses.m4]) m4_include([tools/gcov.m4]) -m4_include([acinclude.m4]) +m4_include([tools/iconv.m4]) diff -Nru tig-2.2/.bookignore tig-2.3.0/.bookignore --- tig-2.2/.bookignore 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/.bookignore 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,16 @@ +# Blacklist most files since documentation is co-located with the rest +# of the source to avoid that GitBook copies them to the output +# directory. +*.* +*-* +COPYING +Makefile +tigrc + +## Whitelist AsciiDoc and GitBook files +!*.adoc +!*.md +!*.json + +# ... except the manual man-page +doc/tigmanual.7.adoc diff -Nru tig-2.2/book.json tig-2.3.0/book.json --- tig-2.2/book.json 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/book.json 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,22 @@ +{ + "gitbook": "3.2.x", + "title": "Tig - Text-mode interface for Git", + "structure": { + "readme": "README.adoc", + "summary": "book.md" + }, + "links": { + "sharing": { + "twitter": false, + "facebook": false, + "google": false, + "all": false + } + }, + "plugins": ["ga"], + "pluginsConfig": { + "ga": { + "token": "UA-7492166-1" + } + } +} diff -Nru tig-2.2/book.md tig-2.3.0/book.md --- tig-2.2/book.md 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/book.md 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,10 @@ +# Summary + + - [Installation](INSTALL.adoc) + - [Release notes](NEWS.adoc) + - [tig(1)](doc/tig.1.adoc) + - [tigrc(5)](doc/tigrc.5.adoc) + - [Manual](doc/manual.adoc) + - [Screenshots](https://www.flickr.com/photos/jonasfonseca/albums/72157614470764617) + - Developer Documentation + - [Testing](test/README.adoc) diff -Nru tig-2.2/compat/compat.h tig-2.3.0/compat/compat.h --- tig-2.2/compat/compat.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/compat/compat.h 2017-09-29 15:15:26.000000000 +0000 @@ -24,6 +24,7 @@ #define HAVE_STRING_H #define HAVE_SYS_TIME_H #define HAVE_UNISTD_H +#define HAVE_WORDEXP_H #endif /* @@ -46,6 +47,20 @@ char *compat_strndup(const char *s, size_t n); #endif +#ifdef NO_WORDEXP +#define wordexp compat_wordexp +#define wordfree compat_wordfree +#define WRDE_NOCMD 4 +typedef struct +{ + char **we_wordv; +} wordexp_t; +int compat_wordexp (const char *words, wordexp_t *pwordexp, int flags); +void compat_wordfree (wordexp_t *pwordexp); +#else +#include +#endif + #endif /* vim: set ts=8 sw=8 noexpandtab: */ diff -Nru tig-2.2/compat/hashtab.h tig-2.3.0/compat/hashtab.h --- tig-2.2/compat/hashtab.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/compat/hashtab.h 2017-09-29 15:15:26.000000000 +0000 @@ -1,4 +1,4 @@ -/* An expandable hash tables datatype. +/* An expandable hash tables datatype. Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2009, 2010 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). @@ -61,7 +61,7 @@ /* Cleanup function called whenever a live element is removed from the hash table. */ typedef void (*htab_del) (void *); - + /* Function called by htab_traverse for each live element. The first arg is the slot of the element (which can be passed to htab_clear_slot if desired), the second arg is the auxiliary pointer handed to diff -Nru tig-2.2/compat/wcwidth.c tig-2.3.0/compat/wcwidth.c --- tig-2.2/compat/wcwidth.c 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/compat/wcwidth.c 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,709 @@ +/* $XTermId: wcwidth.c,v 1.39 2017/06/20 20:35:34 tom Exp $ */ + +/* $XFree86: xc/programs/xterm/wcwidth.c,v 1.9 2006/06/19 00:36:52 dickey Exp $ */ + +/* + * Copyright 2002-2016,2017 by Thomas E. Dickey + * + * All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + *----------------------------------------------------------------------------- + * This is an updated version of Markus Kuhn's implementation of wcwidth. + * + * Originally added to xterm in 2000 (patch #141), there were a couple of + * updates from Kuhn until 2005 (patch #202), renaming entrypoints and applying + * data from Unicode.org (e.g., 3.2, 4.0, 4.1.0). The Unicode data is + * transformed into tables in this file by a script "uniset" written by Kuhn. + * + * While Kuhn implemented the original CJK variant, it was unused by xterm + * until Jungshik Shin used it in 2002 to implement the -cjk_width command-line + * option. + * + * Kuhn added a check for the vertical forms block (double-width) in 2007; + * other updates were derived from the Unicode.org data (release 5.0). + * + * Since then, additional updates have been made: + * + data-type fixes + * + new Unicode releases (6.2.0, 9.0.0), + * + additional special symbol blocks have been added to the special cases. + * + soft-hyphen behavior has been made configurable. + * + added table shows when a character is not part of Unicode. + * + * Kuhn's original header follows giving the design information: + *----------------------------------------------------------------------------- + * This is an implementation of wcwidth() and wcswidth() (defined in + * IEEE Std 1002.1-2001) for Unicode. + * + * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html + * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html + * + * In fixed-width output devices, Latin characters all occupy a single + * "cell" position of equal width, whereas ideographic CJK characters + * occupy two such cells. Interoperability between terminal-line + * applications and (teletype-style) character terminals using the + * UTF-8 encoding requires agreement on which character should advance + * the cursor by how many cell positions. No established formal + * standards exist at present on which Unicode character shall occupy + * how many cell positions on character terminals. These routines are + * a first attempt of defining such behavior based on simple rules + * applied to data provided by the Unicode Consortium. + * + * For some graphical characters, the Unicode standard explicitly + * defines a character-cell width via the definition of the East Asian + * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. + * In all these cases, there is no ambiguity about which width a + * terminal shall use. For characters in the East Asian Ambiguous (A) + * class, the width choice depends purely on a preference of backward + * compatibility with either historic CJK or Western practice. + * Choosing single-width for these characters is easy to justify as + * the appropriate long-term solution, as the CJK practice of + * displaying these characters as double-width comes from historic + * implementation simplicity (8-bit encoded characters were displayed + * single-width and 16-bit ones double-width, even for Greek, + * Cyrillic, etc.) and not any typographic considerations. + * + * Much less clear is the choice of width for the Not East Asian + * (Neutral) class. Existing practice does not dictate a width for any + * of these characters. It would nevertheless make sense + * typographically to allocate two character cells to characters such + * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be + * represented adequately with a single-width glyph. The following + * routines at present merely assign a single-cell width to all + * neutral characters, in the interest of simplicity. This is not + * entirely satisfactory and should be reconsidered before + * establishing a formal standard in this area. At the moment, the + * decision which Not East Asian (Neutral) characters should be + * represented by double-width glyphs cannot yet be answered by + * applying a simple rule from the Unicode database content. Setting + * up a proper standard for the behavior of UTF-8 character terminals + * will require a careful analysis not only of each Unicode character, + * but also of each presentation form, something the author of these + * routines has avoided to do so far. + * + * http://www.unicode.org/unicode/reports/tr11/ + * + * Markus Kuhn -- 2007-05-25 (Unicode 5.0) + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted. The author + * disclaims all warranties with regard to this software. + * + * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + */ + +#include "wcwidth.h" + +struct interval { + unsigned long first; + unsigned long last; +}; + +static int use_latin1 = 1; + +/* auxiliary function for binary search in interval table */ +static int bisearch(unsigned long ucs, const struct interval *table, int max) { + + if (ucs >= table[0].first && ucs <= table[max].last) { + int min = 0; + + while (max >= min) { + int mid; + + mid = (min + max) / 2; + if (ucs > table[mid].last) + min = mid + 1; + else if (ucs < table[mid].first) + max = mid - 1; + else + return 1; + } + } + + return 0; +} + +/* + * Provide a way to change the behavior of soft-hyphen. + */ +void +mk_wcwidth_init(int mode) +{ + use_latin1 = (mode == 0); +} + +/* The following two functions define the column width of an ISO 10646 + * character as follows: + * + * - The null character (U+0000) has a column width of 0. + * + * - Other C0/C1 control characters and DEL will lead to a return + * value of -1. + * + * - Non-spacing and enclosing combining characters (general + * category code Mn or Me in the Unicode database) have a + * column width of 0. + * + * - SOFT HYPHEN (U+00AD) has a column width of 1 in Latin-1, 0 in Unicode. + * An initialization function is used to switch between the two. + * + * - Other format characters (general category code Cf in the Unicode + * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. + * + * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) + * have a column width of 0. + * + * - Spacing characters in the East Asian Wide (W) or East Asian + * Full-width (F) category as defined in Unicode Technical + * Report #11 have a column width of 2. In that report, some codes + * were unassigned. Characters in these blocks use a column width of 1: + * 4DC0..4DFF; Yijing Hexagram Symbols + * A960..A97F; Hangul Jamo Extended-A + * + * - All remaining characters (including all printable + * ISO 8859-1 and WGL4 characters, Unicode control characters, + * etc.) have a column width of 1. + * + * - Codes which do not correspond to a Unicode character have a column + * width of -1. + * + * This implementation assumes that wchar_t characters are encoded + * in ISO 10646. + */ + +int mk_wcwidth(wchar_t ucs) +{ + unsigned long cmp = (unsigned long) ucs; + + /* sorted list of non-overlapping intervals of non-spacing characters */ + /* generated by + * uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c + */ + static const struct interval combining[] = { + { 0x0300, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD }, + { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, + { 0x05C7, 0x05C7 }, { 0x0600, 0x0605 }, { 0x0610, 0x061A }, + { 0x061C, 0x061C }, { 0x064B, 0x065F }, { 0x0670, 0x0670 }, + { 0x06D6, 0x06DD }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 }, + { 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 }, + { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, + { 0x0816, 0x0819 }, { 0x081B, 0x0823 }, { 0x0825, 0x0827 }, + { 0x0829, 0x082D }, { 0x0859, 0x085B }, { 0x08D4, 0x0902 }, + { 0x093A, 0x093A }, { 0x093C, 0x093C }, { 0x0941, 0x0948 }, + { 0x094D, 0x094D }, { 0x0951, 0x0957 }, { 0x0962, 0x0963 }, + { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, + { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, + { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, + { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A70, 0x0A71 }, + { 0x0A75, 0x0A75 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, { 0x0AFA, 0x0AFF }, { 0x0B01, 0x0B01 }, + { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B44 }, + { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56 }, { 0x0B62, 0x0B63 }, + { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, + { 0x0C00, 0x0C00 }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 }, + { 0x0C81, 0x0C81 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, + { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CE2, 0x0CE3 }, + { 0x0D00, 0x0D01 }, { 0x0D3B, 0x0D3C }, { 0x0D41, 0x0D44 }, + { 0x0D4D, 0x0D4D }, { 0x0D62, 0x0D63 }, { 0x0DCA, 0x0DCA }, + { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, + { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, + { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, + { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, + { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, + { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC }, + { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1037 }, + { 0x1039, 0x103A }, { 0x103D, 0x103E }, { 0x1058, 0x1059 }, + { 0x105E, 0x1060 }, { 0x1071, 0x1074 }, { 0x1082, 0x1082 }, + { 0x1085, 0x1086 }, { 0x108D, 0x108D }, { 0x109D, 0x109D }, + { 0x1160, 0x11FF }, { 0x135D, 0x135F }, { 0x1712, 0x1714 }, + { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, + { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, + { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180E }, + { 0x1885, 0x1886 }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, { 0x1A1B, 0x1A1B }, { 0x1A56, 0x1A56 }, + { 0x1A58, 0x1A5E }, { 0x1A60, 0x1A60 }, { 0x1A62, 0x1A62 }, + { 0x1A65, 0x1A6C }, { 0x1A73, 0x1A7C }, { 0x1A7F, 0x1A7F }, + { 0x1AB0, 0x1ABE }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, { 0x1B80, 0x1B81 }, { 0x1BA2, 0x1BA5 }, + { 0x1BA8, 0x1BA9 }, { 0x1BAB, 0x1BAD }, { 0x1BE6, 0x1BE6 }, + { 0x1BE8, 0x1BE9 }, { 0x1BED, 0x1BED }, { 0x1BEF, 0x1BF1 }, + { 0x1C2C, 0x1C33 }, { 0x1C36, 0x1C37 }, { 0x1CD0, 0x1CD2 }, + { 0x1CD4, 0x1CE0 }, { 0x1CE2, 0x1CE8 }, { 0x1CED, 0x1CED }, + { 0x1CF4, 0x1CF4 }, { 0x1CF8, 0x1CF9 }, { 0x1DC0, 0x1DF9 }, + { 0x1DFB, 0x1DFF }, { 0x200B, 0x200F }, { 0x202A, 0x202E }, + { 0x2060, 0x2064 }, { 0x2066, 0x206F }, { 0x20D0, 0x20F0 }, + { 0x2CEF, 0x2CF1 }, { 0x2D7F, 0x2D7F }, { 0x2DE0, 0x2DFF }, + { 0x302A, 0x302D }, { 0x3099, 0x309A }, { 0xA66F, 0xA672 }, + { 0xA674, 0xA67D }, { 0xA69E, 0xA69F }, { 0xA6F0, 0xA6F1 }, + { 0xA802, 0xA802 }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, { 0xA8C4, 0xA8C5 }, { 0xA8E0, 0xA8F1 }, + { 0xA926, 0xA92D }, { 0xA947, 0xA951 }, { 0xA980, 0xA982 }, + { 0xA9B3, 0xA9B3 }, { 0xA9B6, 0xA9B9 }, { 0xA9BC, 0xA9BC }, + { 0xA9E5, 0xA9E5 }, { 0xAA29, 0xAA2E }, { 0xAA31, 0xAA32 }, + { 0xAA35, 0xAA36 }, { 0xAA43, 0xAA43 }, { 0xAA4C, 0xAA4C }, + { 0xAA7C, 0xAA7C }, { 0xAAB0, 0xAAB0 }, { 0xAAB2, 0xAAB4 }, + { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF }, { 0xAAC1, 0xAAC1 }, + { 0xAAEC, 0xAAED }, { 0xAAF6, 0xAAF6 }, { 0xABE5, 0xABE5 }, + { 0xABE8, 0xABE8 }, { 0xABED, 0xABED }, { 0xFB1E, 0xFB1E }, + { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE2F }, { 0xFEFF, 0xFEFF }, + { 0xFFF9, 0xFFFB }, { 0x101FD, 0x101FD }, { 0x102E0, 0x102E0 }, + { 0x10376, 0x1037A }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, + { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, + { 0x10AE5, 0x10AE6 }, { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, + { 0x1107F, 0x11081 }, { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, + { 0x110BD, 0x110BD }, { 0x11100, 0x11102 }, { 0x11127, 0x1112B }, + { 0x1112D, 0x11134 }, { 0x11173, 0x11173 }, { 0x11180, 0x11181 }, + { 0x111B6, 0x111BE }, { 0x111CA, 0x111CC }, { 0x1122F, 0x11231 }, + { 0x11234, 0x11234 }, { 0x11236, 0x11237 }, { 0x1123E, 0x1123E }, + { 0x112DF, 0x112DF }, { 0x112E3, 0x112EA }, { 0x11300, 0x11301 }, + { 0x1133C, 0x1133C }, { 0x11340, 0x11340 }, { 0x11366, 0x1136C }, + { 0x11370, 0x11374 }, { 0x11438, 0x1143F }, { 0x11442, 0x11444 }, + { 0x11446, 0x11446 }, { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, + { 0x114BF, 0x114C0 }, { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, + { 0x115BC, 0x115BD }, { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, + { 0x11633, 0x1163A }, { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, + { 0x116AB, 0x116AB }, { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, + { 0x116B7, 0x116B7 }, { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, + { 0x11727, 0x1172B }, { 0x11A01, 0x11A06 }, { 0x11A09, 0x11A0A }, + { 0x11A33, 0x11A38 }, { 0x11A3B, 0x11A3E }, { 0x11A47, 0x11A47 }, + { 0x11A51, 0x11A56 }, { 0x11A59, 0x11A5B }, { 0x11A8A, 0x11A96 }, + { 0x11A98, 0x11A99 }, { 0x11C30, 0x11C36 }, { 0x11C38, 0x11C3D }, + { 0x11C3F, 0x11C3F }, { 0x11C92, 0x11CA7 }, { 0x11CAA, 0x11CB0 }, + { 0x11CB2, 0x11CB3 }, { 0x11CB5, 0x11CB6 }, { 0x11D31, 0x11D36 }, + { 0x11D3A, 0x11D3A }, { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, + { 0x11D47, 0x11D47 }, { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 }, + { 0x16F8F, 0x16F92 }, { 0x1BC9D, 0x1BC9E }, { 0x1BCA0, 0x1BCA3 }, + { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, + { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0x1DA00, 0x1DA36 }, + { 0x1DA3B, 0x1DA6C }, { 0x1DA75, 0x1DA75 }, { 0x1DA84, 0x1DA84 }, + { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 }, + { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, + { 0x1E026, 0x1E02A }, { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A }, + { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF } + }; + + /* sorted list of non-overlapping intervals of non-characters */ + /* generated by + * uniset +0000..DFFF -4e00..9fd5 +F900..10FFFD unknown +2028..2029 c + */ + static const struct interval unknowns[] = { + { 0x0378, 0x0379 }, { 0x0380, 0x0383 }, { 0x038B, 0x038B }, + { 0x038D, 0x038D }, { 0x03A2, 0x03A2 }, { 0x0530, 0x0530 }, + { 0x0557, 0x0558 }, { 0x0560, 0x0560 }, { 0x0588, 0x0588 }, + { 0x058B, 0x058C }, { 0x0590, 0x0590 }, { 0x05C8, 0x05CF }, + { 0x05EB, 0x05EF }, { 0x05F5, 0x05FF }, { 0x061D, 0x061D }, + { 0x070E, 0x070E }, { 0x074B, 0x074C }, { 0x07B2, 0x07BF }, + { 0x07FB, 0x07FF }, { 0x082E, 0x082F }, { 0x083F, 0x083F }, + { 0x085C, 0x085D }, { 0x085F, 0x085F }, { 0x086B, 0x089F }, + { 0x08B5, 0x08B5 }, { 0x08BE, 0x08D3 }, { 0x0984, 0x0984 }, + { 0x098D, 0x098E }, { 0x0991, 0x0992 }, { 0x09A9, 0x09A9 }, + { 0x09B1, 0x09B1 }, { 0x09B3, 0x09B5 }, { 0x09BA, 0x09BB }, + { 0x09C5, 0x09C6 }, { 0x09C9, 0x09CA }, { 0x09CF, 0x09D6 }, + { 0x09D8, 0x09DB }, { 0x09DE, 0x09DE }, { 0x09E4, 0x09E5 }, + { 0x09FE, 0x0A00 }, { 0x0A04, 0x0A04 }, { 0x0A0B, 0x0A0E }, + { 0x0A11, 0x0A12 }, { 0x0A29, 0x0A29 }, { 0x0A31, 0x0A31 }, + { 0x0A34, 0x0A34 }, { 0x0A37, 0x0A37 }, { 0x0A3A, 0x0A3B }, + { 0x0A3D, 0x0A3D }, { 0x0A43, 0x0A46 }, { 0x0A49, 0x0A4A }, + { 0x0A4E, 0x0A50 }, { 0x0A52, 0x0A58 }, { 0x0A5D, 0x0A5D }, + { 0x0A5F, 0x0A65 }, { 0x0A76, 0x0A80 }, { 0x0A84, 0x0A84 }, + { 0x0A8E, 0x0A8E }, { 0x0A92, 0x0A92 }, { 0x0AA9, 0x0AA9 }, + { 0x0AB1, 0x0AB1 }, { 0x0AB4, 0x0AB4 }, { 0x0ABA, 0x0ABB }, + { 0x0AC6, 0x0AC6 }, { 0x0ACA, 0x0ACA }, { 0x0ACE, 0x0ACF }, + { 0x0AD1, 0x0ADF }, { 0x0AE4, 0x0AE5 }, { 0x0AF2, 0x0AF8 }, + { 0x0B00, 0x0B00 }, { 0x0B04, 0x0B04 }, { 0x0B0D, 0x0B0E }, + { 0x0B11, 0x0B12 }, { 0x0B29, 0x0B29 }, { 0x0B31, 0x0B31 }, + { 0x0B34, 0x0B34 }, { 0x0B3A, 0x0B3B }, { 0x0B45, 0x0B46 }, + { 0x0B49, 0x0B4A }, { 0x0B4E, 0x0B55 }, { 0x0B58, 0x0B5B }, + { 0x0B5E, 0x0B5E }, { 0x0B64, 0x0B65 }, { 0x0B78, 0x0B81 }, + { 0x0B84, 0x0B84 }, { 0x0B8B, 0x0B8D }, { 0x0B91, 0x0B91 }, + { 0x0B96, 0x0B98 }, { 0x0B9B, 0x0B9B }, { 0x0B9D, 0x0B9D }, + { 0x0BA0, 0x0BA2 }, { 0x0BA5, 0x0BA7 }, { 0x0BAB, 0x0BAD }, + { 0x0BBA, 0x0BBD }, { 0x0BC3, 0x0BC5 }, { 0x0BC9, 0x0BC9 }, + { 0x0BCE, 0x0BCF }, { 0x0BD1, 0x0BD6 }, { 0x0BD8, 0x0BE5 }, + { 0x0BFB, 0x0BFF }, { 0x0C04, 0x0C04 }, { 0x0C0D, 0x0C0D }, + { 0x0C11, 0x0C11 }, { 0x0C29, 0x0C29 }, { 0x0C3A, 0x0C3C }, + { 0x0C45, 0x0C45 }, { 0x0C49, 0x0C49 }, { 0x0C4E, 0x0C54 }, + { 0x0C57, 0x0C57 }, { 0x0C5B, 0x0C5F }, { 0x0C64, 0x0C65 }, + { 0x0C70, 0x0C77 }, { 0x0C84, 0x0C84 }, { 0x0C8D, 0x0C8D }, + { 0x0C91, 0x0C91 }, { 0x0CA9, 0x0CA9 }, { 0x0CB4, 0x0CB4 }, + { 0x0CBA, 0x0CBB }, { 0x0CC5, 0x0CC5 }, { 0x0CC9, 0x0CC9 }, + { 0x0CCE, 0x0CD4 }, { 0x0CD7, 0x0CDD }, { 0x0CDF, 0x0CDF }, + { 0x0CE4, 0x0CE5 }, { 0x0CF0, 0x0CF0 }, { 0x0CF3, 0x0CFF }, + { 0x0D04, 0x0D04 }, { 0x0D0D, 0x0D0D }, { 0x0D11, 0x0D11 }, + { 0x0D45, 0x0D45 }, { 0x0D49, 0x0D49 }, { 0x0D50, 0x0D53 }, + { 0x0D64, 0x0D65 }, { 0x0D80, 0x0D81 }, { 0x0D84, 0x0D84 }, + { 0x0D97, 0x0D99 }, { 0x0DB2, 0x0DB2 }, { 0x0DBC, 0x0DBC }, + { 0x0DBE, 0x0DBF }, { 0x0DC7, 0x0DC9 }, { 0x0DCB, 0x0DCE }, + { 0x0DD5, 0x0DD5 }, { 0x0DD7, 0x0DD7 }, { 0x0DE0, 0x0DE5 }, + { 0x0DF0, 0x0DF1 }, { 0x0DF5, 0x0E00 }, { 0x0E3B, 0x0E3E }, + { 0x0E5C, 0x0E80 }, { 0x0E83, 0x0E83 }, { 0x0E85, 0x0E86 }, + { 0x0E89, 0x0E89 }, { 0x0E8B, 0x0E8C }, { 0x0E8E, 0x0E93 }, + { 0x0E98, 0x0E98 }, { 0x0EA0, 0x0EA0 }, { 0x0EA4, 0x0EA4 }, + { 0x0EA6, 0x0EA6 }, { 0x0EA8, 0x0EA9 }, { 0x0EAC, 0x0EAC }, + { 0x0EBA, 0x0EBA }, { 0x0EBE, 0x0EBF }, { 0x0EC5, 0x0EC5 }, + { 0x0EC7, 0x0EC7 }, { 0x0ECE, 0x0ECF }, { 0x0EDA, 0x0EDB }, + { 0x0EE0, 0x0EFF }, { 0x0F48, 0x0F48 }, { 0x0F6D, 0x0F70 }, + { 0x0F98, 0x0F98 }, { 0x0FBD, 0x0FBD }, { 0x0FCD, 0x0FCD }, + { 0x0FDB, 0x0FFF }, { 0x10C6, 0x10C6 }, { 0x10C8, 0x10CC }, + { 0x10CE, 0x10CF }, { 0x1249, 0x1249 }, { 0x124E, 0x124F }, + { 0x1257, 0x1257 }, { 0x1259, 0x1259 }, { 0x125E, 0x125F }, + { 0x1289, 0x1289 }, { 0x128E, 0x128F }, { 0x12B1, 0x12B1 }, + { 0x12B6, 0x12B7 }, { 0x12BF, 0x12BF }, { 0x12C1, 0x12C1 }, + { 0x12C6, 0x12C7 }, { 0x12D7, 0x12D7 }, { 0x1311, 0x1311 }, + { 0x1316, 0x1317 }, { 0x135B, 0x135C }, { 0x137D, 0x137F }, + { 0x139A, 0x139F }, { 0x13F6, 0x13F7 }, { 0x13FE, 0x13FF }, + { 0x169D, 0x169F }, { 0x16F9, 0x16FF }, { 0x170D, 0x170D }, + { 0x1715, 0x171F }, { 0x1737, 0x173F }, { 0x1754, 0x175F }, + { 0x176D, 0x176D }, { 0x1771, 0x1771 }, { 0x1774, 0x177F }, + { 0x17DE, 0x17DF }, { 0x17EA, 0x17EF }, { 0x17FA, 0x17FF }, + { 0x180F, 0x180F }, { 0x181A, 0x181F }, { 0x1878, 0x187F }, + { 0x18AB, 0x18AF }, { 0x18F6, 0x18FF }, { 0x191F, 0x191F }, + { 0x192C, 0x192F }, { 0x193C, 0x193F }, { 0x1941, 0x1943 }, + { 0x196E, 0x196F }, { 0x1975, 0x197F }, { 0x19AC, 0x19AF }, + { 0x19CA, 0x19CF }, { 0x19DB, 0x19DD }, { 0x1A1C, 0x1A1D }, + { 0x1A5F, 0x1A5F }, { 0x1A7D, 0x1A7E }, { 0x1A8A, 0x1A8F }, + { 0x1A9A, 0x1A9F }, { 0x1AAE, 0x1AAF }, { 0x1ABF, 0x1AFF }, + { 0x1B4C, 0x1B4F }, { 0x1B7D, 0x1B7F }, { 0x1BF4, 0x1BFB }, + { 0x1C38, 0x1C3A }, { 0x1C4A, 0x1C4C }, { 0x1C89, 0x1CBF }, + { 0x1CC8, 0x1CCF }, { 0x1CFA, 0x1CFF }, { 0x1DFA, 0x1DFA }, + { 0x1F16, 0x1F17 }, { 0x1F1E, 0x1F1F }, { 0x1F46, 0x1F47 }, + { 0x1F4E, 0x1F4F }, { 0x1F58, 0x1F58 }, { 0x1F5A, 0x1F5A }, + { 0x1F5C, 0x1F5C }, { 0x1F5E, 0x1F5E }, { 0x1F7E, 0x1F7F }, + { 0x1FB5, 0x1FB5 }, { 0x1FC5, 0x1FC5 }, { 0x1FD4, 0x1FD5 }, + { 0x1FDC, 0x1FDC }, { 0x1FF0, 0x1FF1 }, { 0x1FF5, 0x1FF5 }, + { 0x1FFF, 0x1FFF }, { 0x2028, 0x2029 }, { 0x2065, 0x2065 }, + { 0x2072, 0x2073 }, { 0x208F, 0x208F }, { 0x209D, 0x209F }, + { 0x20C0, 0x20CF }, { 0x20F1, 0x20FF }, { 0x218C, 0x218F }, + { 0x2427, 0x243F }, { 0x244B, 0x245F }, { 0x2B74, 0x2B75 }, + { 0x2B96, 0x2B97 }, { 0x2BBA, 0x2BBC }, { 0x2BC9, 0x2BC9 }, + { 0x2BD3, 0x2BEB }, { 0x2BF0, 0x2BFF }, { 0x2C2F, 0x2C2F }, + { 0x2C5F, 0x2C5F }, { 0x2CF4, 0x2CF8 }, { 0x2D26, 0x2D26 }, + { 0x2D28, 0x2D2C }, { 0x2D2E, 0x2D2F }, { 0x2D68, 0x2D6E }, + { 0x2D71, 0x2D7E }, { 0x2D97, 0x2D9F }, { 0x2DA7, 0x2DA7 }, + { 0x2DAF, 0x2DAF }, { 0x2DB7, 0x2DB7 }, { 0x2DBF, 0x2DBF }, + { 0x2DC7, 0x2DC7 }, { 0x2DCF, 0x2DCF }, { 0x2DD7, 0x2DD7 }, + { 0x2DDF, 0x2DDF }, { 0x2E4A, 0x2E7F }, { 0x2E9A, 0x2E9A }, + { 0x2EF4, 0x2EFF }, { 0x2FD6, 0x2FEF }, { 0x2FFC, 0x2FFF }, + { 0x3040, 0x3040 }, { 0x3097, 0x3098 }, { 0x3100, 0x3104 }, + { 0x312F, 0x3130 }, { 0x318F, 0x318F }, { 0x31BB, 0x31BF }, + { 0x31E4, 0x31EF }, { 0x321F, 0x321F }, { 0x32FF, 0x32FF }, + { 0x4DB6, 0x4DBF }, { 0x9FD6, 0x9FFF }, { 0xA48D, 0xA48F }, + { 0xA4C7, 0xA4CF }, { 0xA62C, 0xA63F }, { 0xA6F8, 0xA6FF }, + { 0xA7AF, 0xA7AF }, { 0xA7B8, 0xA7F6 }, { 0xA82C, 0xA82F }, + { 0xA83A, 0xA83F }, { 0xA878, 0xA87F }, { 0xA8C6, 0xA8CD }, + { 0xA8DA, 0xA8DF }, { 0xA8FE, 0xA8FF }, { 0xA954, 0xA95E }, + { 0xA97D, 0xA97F }, { 0xA9CE, 0xA9CE }, { 0xA9DA, 0xA9DD }, + { 0xA9FF, 0xA9FF }, { 0xAA37, 0xAA3F }, { 0xAA4E, 0xAA4F }, + { 0xAA5A, 0xAA5B }, { 0xAAC3, 0xAADA }, { 0xAAF7, 0xAB00 }, + { 0xAB07, 0xAB08 }, { 0xAB0F, 0xAB10 }, { 0xAB17, 0xAB1F }, + { 0xAB27, 0xAB27 }, { 0xAB2F, 0xAB2F }, { 0xAB66, 0xAB6F }, + { 0xABEE, 0xABEF }, { 0xABFA, 0xABFF }, { 0xD7A4, 0xD7AF }, + { 0xD7C7, 0xD7CA }, { 0xD7FC, 0xDFFF }, { 0xFA6E, 0xFA6F }, + { 0xFADA, 0xFAFF }, { 0xFB07, 0xFB12 }, { 0xFB18, 0xFB1C }, + { 0xFB37, 0xFB37 }, { 0xFB3D, 0xFB3D }, { 0xFB3F, 0xFB3F }, + { 0xFB42, 0xFB42 }, { 0xFB45, 0xFB45 }, { 0xFBC2, 0xFBD2 }, + { 0xFD40, 0xFD4F }, { 0xFD90, 0xFD91 }, { 0xFDC8, 0xFDEF }, + { 0xFDFE, 0xFDFF }, { 0xFE1A, 0xFE1F }, { 0xFE53, 0xFE53 }, + { 0xFE67, 0xFE67 }, { 0xFE6C, 0xFE6F }, { 0xFE75, 0xFE75 }, + { 0xFEFD, 0xFEFE }, { 0xFF00, 0xFF00 }, { 0xFFBF, 0xFFC1 }, + { 0xFFC8, 0xFFC9 }, { 0xFFD0, 0xFFD1 }, { 0xFFD8, 0xFFD9 }, + { 0xFFDD, 0xFFDF }, { 0xFFE7, 0xFFE7 }, { 0xFFEF, 0xFFF8 }, + { 0xFFFE, 0xFFFF }, { 0x1000C, 0x1000C }, { 0x10027, 0x10027 }, + { 0x1003B, 0x1003B }, { 0x1003E, 0x1003E }, { 0x1004E, 0x1004F }, + { 0x1005E, 0x1007F }, { 0x100FB, 0x100FF }, { 0x10103, 0x10106 }, + { 0x10134, 0x10136 }, { 0x1018F, 0x1018F }, { 0x1019C, 0x1019F }, + { 0x101A1, 0x101CF }, { 0x101FE, 0x1027F }, { 0x1029D, 0x1029F }, + { 0x102D1, 0x102DF }, { 0x102FC, 0x102FF }, { 0x10324, 0x1032C }, + { 0x1034B, 0x1034F }, { 0x1037B, 0x1037F }, { 0x1039E, 0x1039E }, + { 0x103C4, 0x103C7 }, { 0x103D6, 0x103FF }, { 0x1049E, 0x1049F }, + { 0x104AA, 0x104AF }, { 0x104D4, 0x104D7 }, { 0x104FC, 0x104FF }, + { 0x10528, 0x1052F }, { 0x10564, 0x1056E }, { 0x10570, 0x105FF }, + { 0x10737, 0x1073F }, { 0x10756, 0x1075F }, { 0x10768, 0x107FF }, + { 0x10806, 0x10807 }, { 0x10809, 0x10809 }, { 0x10836, 0x10836 }, + { 0x10839, 0x1083B }, { 0x1083D, 0x1083E }, { 0x10856, 0x10856 }, + { 0x1089F, 0x108A6 }, { 0x108B0, 0x108DF }, { 0x108F3, 0x108F3 }, + { 0x108F6, 0x108FA }, { 0x1091C, 0x1091E }, { 0x1093A, 0x1093E }, + { 0x10940, 0x1097F }, { 0x109B8, 0x109BB }, { 0x109D0, 0x109D1 }, + { 0x10A04, 0x10A04 }, { 0x10A07, 0x10A0B }, { 0x10A14, 0x10A14 }, + { 0x10A18, 0x10A18 }, { 0x10A34, 0x10A37 }, { 0x10A3B, 0x10A3E }, + { 0x10A48, 0x10A4F }, { 0x10A59, 0x10A5F }, { 0x10AA0, 0x10ABF }, + { 0x10AE7, 0x10AEA }, { 0x10AF7, 0x10AFF }, { 0x10B36, 0x10B38 }, + { 0x10B56, 0x10B57 }, { 0x10B73, 0x10B77 }, { 0x10B92, 0x10B98 }, + { 0x10B9D, 0x10BA8 }, { 0x10BB0, 0x10BFF }, { 0x10C49, 0x10C7F }, + { 0x10CB3, 0x10CBF }, { 0x10CF3, 0x10CF9 }, { 0x10D00, 0x10E5F }, + { 0x10E7F, 0x10FFF }, { 0x1104E, 0x11051 }, { 0x11070, 0x1107E }, + { 0x110C2, 0x110CF }, { 0x110E9, 0x110EF }, { 0x110FA, 0x110FF }, + { 0x11135, 0x11135 }, { 0x11144, 0x1114F }, { 0x11177, 0x1117F }, + { 0x111CE, 0x111CF }, { 0x111E0, 0x111E0 }, { 0x111F5, 0x111FF }, + { 0x11212, 0x11212 }, { 0x1123F, 0x1127F }, { 0x11287, 0x11287 }, + { 0x11289, 0x11289 }, { 0x1128E, 0x1128E }, { 0x1129E, 0x1129E }, + { 0x112AA, 0x112AF }, { 0x112EB, 0x112EF }, { 0x112FA, 0x112FF }, + { 0x11304, 0x11304 }, { 0x1130D, 0x1130E }, { 0x11311, 0x11312 }, + { 0x11329, 0x11329 }, { 0x11331, 0x11331 }, { 0x11334, 0x11334 }, + { 0x1133A, 0x1133B }, { 0x11345, 0x11346 }, { 0x11349, 0x1134A }, + { 0x1134E, 0x1134F }, { 0x11351, 0x11356 }, { 0x11358, 0x1135C }, + { 0x11364, 0x11365 }, { 0x1136D, 0x1136F }, { 0x11375, 0x113FF }, + { 0x1145A, 0x1145A }, { 0x1145C, 0x1145C }, { 0x1145E, 0x1147F }, + { 0x114C8, 0x114CF }, { 0x114DA, 0x1157F }, { 0x115B6, 0x115B7 }, + { 0x115DE, 0x115FF }, { 0x11645, 0x1164F }, { 0x1165A, 0x1165F }, + { 0x1166D, 0x1167F }, { 0x116B8, 0x116BF }, { 0x116CA, 0x116FF }, + { 0x1171A, 0x1171C }, { 0x1172C, 0x1172F }, { 0x11740, 0x1189F }, + { 0x118F3, 0x118FE }, { 0x11900, 0x119FF }, { 0x11A48, 0x11A4F }, + { 0x11A84, 0x11A85 }, { 0x11A9D, 0x11A9D }, { 0x11AA3, 0x11ABF }, + { 0x11AF9, 0x11BFF }, { 0x11C09, 0x11C09 }, { 0x11C37, 0x11C37 }, + { 0x11C46, 0x11C4F }, { 0x11C6D, 0x11C6F }, { 0x11C90, 0x11C91 }, + { 0x11CA8, 0x11CA8 }, { 0x11CB7, 0x11CFF }, { 0x11D07, 0x11D07 }, + { 0x11D0A, 0x11D0A }, { 0x11D37, 0x11D39 }, { 0x11D3B, 0x11D3B }, + { 0x11D3E, 0x11D3E }, { 0x11D48, 0x11D4F }, { 0x11D5A, 0x11FFF }, + { 0x1239A, 0x123FF }, { 0x1246F, 0x1246F }, { 0x12475, 0x1247F }, + { 0x12544, 0x12FFF }, { 0x1342F, 0x143FF }, { 0x14647, 0x167FF }, + { 0x16A39, 0x16A3F }, { 0x16A5F, 0x16A5F }, { 0x16A6A, 0x16A6D }, + { 0x16A70, 0x16ACF }, { 0x16AEE, 0x16AEF }, { 0x16AF6, 0x16AFF }, + { 0x16B46, 0x16B4F }, { 0x16B5A, 0x16B5A }, { 0x16B62, 0x16B62 }, + { 0x16B78, 0x16B7C }, { 0x16B90, 0x16EFF }, { 0x16F45, 0x16F4F }, + { 0x16F7F, 0x16F8E }, { 0x16FA0, 0x16FDF }, { 0x16FE2, 0x187FF }, + { 0x18AF3, 0x1AFFF }, { 0x1B11F, 0x1B16F }, { 0x1B2FC, 0x1BBFF }, + { 0x1BC6B, 0x1BC6F }, { 0x1BC7D, 0x1BC7F }, { 0x1BC89, 0x1BC8F }, + { 0x1BC9A, 0x1BC9B }, { 0x1BCA4, 0x1CFFF }, { 0x1D0F6, 0x1D0FF }, + { 0x1D127, 0x1D128 }, { 0x1D1E9, 0x1D1FF }, { 0x1D246, 0x1D2FF }, + { 0x1D357, 0x1D35F }, { 0x1D372, 0x1D3FF }, { 0x1D455, 0x1D455 }, + { 0x1D49D, 0x1D49D }, { 0x1D4A0, 0x1D4A1 }, { 0x1D4A3, 0x1D4A4 }, + { 0x1D4A7, 0x1D4A8 }, { 0x1D4AD, 0x1D4AD }, { 0x1D4BA, 0x1D4BA }, + { 0x1D4BC, 0x1D4BC }, { 0x1D4C4, 0x1D4C4 }, { 0x1D506, 0x1D506 }, + { 0x1D50B, 0x1D50C }, { 0x1D515, 0x1D515 }, { 0x1D51D, 0x1D51D }, + { 0x1D53A, 0x1D53A }, { 0x1D53F, 0x1D53F }, { 0x1D545, 0x1D545 }, + { 0x1D547, 0x1D549 }, { 0x1D551, 0x1D551 }, { 0x1D6A6, 0x1D6A7 }, + { 0x1D7CC, 0x1D7CD }, { 0x1DA8C, 0x1DA9A }, { 0x1DAA0, 0x1DAA0 }, + { 0x1DAB0, 0x1DFFF }, { 0x1E007, 0x1E007 }, { 0x1E019, 0x1E01A }, + { 0x1E022, 0x1E022 }, { 0x1E025, 0x1E025 }, { 0x1E02B, 0x1E7FF }, + { 0x1E8C5, 0x1E8C6 }, { 0x1E8D7, 0x1E8FF }, { 0x1E94B, 0x1E94F }, + { 0x1E95A, 0x1E95D }, { 0x1E960, 0x1EDFF }, { 0x1EE04, 0x1EE04 }, + { 0x1EE20, 0x1EE20 }, { 0x1EE23, 0x1EE23 }, { 0x1EE25, 0x1EE26 }, + { 0x1EE28, 0x1EE28 }, { 0x1EE33, 0x1EE33 }, { 0x1EE38, 0x1EE38 }, + { 0x1EE3A, 0x1EE3A }, { 0x1EE3C, 0x1EE41 }, { 0x1EE43, 0x1EE46 }, + { 0x1EE48, 0x1EE48 }, { 0x1EE4A, 0x1EE4A }, { 0x1EE4C, 0x1EE4C }, + { 0x1EE50, 0x1EE50 }, { 0x1EE53, 0x1EE53 }, { 0x1EE55, 0x1EE56 }, + { 0x1EE58, 0x1EE58 }, { 0x1EE5A, 0x1EE5A }, { 0x1EE5C, 0x1EE5C }, + { 0x1EE5E, 0x1EE5E }, { 0x1EE60, 0x1EE60 }, { 0x1EE63, 0x1EE63 }, + { 0x1EE65, 0x1EE66 }, { 0x1EE6B, 0x1EE6B }, { 0x1EE73, 0x1EE73 }, + { 0x1EE78, 0x1EE78 }, { 0x1EE7D, 0x1EE7D }, { 0x1EE7F, 0x1EE7F }, + { 0x1EE8A, 0x1EE8A }, { 0x1EE9C, 0x1EEA0 }, { 0x1EEA4, 0x1EEA4 }, + { 0x1EEAA, 0x1EEAA }, { 0x1EEBC, 0x1EEEF }, { 0x1EEF2, 0x1EFFF }, + { 0x1F02C, 0x1F02F }, { 0x1F094, 0x1F09F }, { 0x1F0AF, 0x1F0B0 }, + { 0x1F0C0, 0x1F0C0 }, { 0x1F0D0, 0x1F0D0 }, { 0x1F0F6, 0x1F0FF }, + { 0x1F10D, 0x1F10F }, { 0x1F12F, 0x1F12F }, { 0x1F16C, 0x1F16F }, + { 0x1F1AD, 0x1F1E5 }, { 0x1F203, 0x1F20F }, { 0x1F23C, 0x1F23F }, + { 0x1F249, 0x1F24F }, { 0x1F252, 0x1F25F }, { 0x1F266, 0x1F2FF }, + { 0x1F6D5, 0x1F6DF }, { 0x1F6ED, 0x1F6EF }, { 0x1F6F9, 0x1F6FF }, + { 0x1F774, 0x1F77F }, { 0x1F7D5, 0x1F7FF }, { 0x1F80C, 0x1F80F }, + { 0x1F848, 0x1F84F }, { 0x1F85A, 0x1F85F }, { 0x1F888, 0x1F88F }, + { 0x1F8AE, 0x1F8FF }, { 0x1F90C, 0x1F90F }, { 0x1F93F, 0x1F93F }, + { 0x1F94D, 0x1F94F }, { 0x1F96C, 0x1F97F }, { 0x1F998, 0x1F9BF }, + { 0x1F9C1, 0x1F9CF }, { 0x1F9E7, 0x1FFFF }, { 0x2A6D7, 0x2F7FF }, + { 0x2FA1E, 0xE0000 }, { 0xE0002, 0xE001F }, { 0xE0080, 0xE00FF }, + { 0xE01F0, 0x10FFFD } + }; + + int result; + +#define Lookup(cmp, table) \ + bisearch(cmp, table, \ + (int) (sizeof(table) / sizeof(struct interval) - 1)) + + /* test for 8-bit control characters */ + if (cmp == 0) { + result = 0; + } else if (cmp < 32 || (cmp >= 0x7f && cmp < 0xa0)) { + result = -1; + } else if (cmp == 0xad) { + result = use_latin1; + } else if (Lookup(cmp, combining)) { + /* binary search in table of non-spacing characters */ + result = 0; + } else { + /* if we arrive here, cmp is not a combining or C0/C1 control character */ + result = 1; + + if (cmp >= 0x1100 && + (cmp <= 0x115f || /* Hangul Jamo init. consonants */ + cmp == 0x2329 || + cmp == 0x232a || + (cmp >= 0x2e80 && cmp <= 0x4dbf && + cmp != 0x303f) || /* CJK ... Yi */ + (cmp >= 0x4e00 && cmp <= 0xa4cf) || /* CJK Unified Ideographs, Yi */ + (cmp >= 0xa960 && cmp <= 0xa97f) || /* Hangul Jamo Extended-A */ + (cmp >= 0xac00 && cmp <= 0xd7a3) || /* Hangul Syllables */ + (cmp >= 0xf900 && cmp <= 0xfaff) || /* CJK Compatibility Ideographs */ + (cmp >= 0xfe10 && cmp <= 0xfe19) || /* Vertical forms */ + (cmp >= 0xfe30 && cmp <= 0xfe6f) || /* CJK Compatibility Forms */ + (cmp >= 0xff00 && cmp <= 0xff60) || /* Fullwidth Forms */ + (cmp >= 0xffe0 && cmp <= 0xffe6) || + (cmp >= 0x20000 && cmp <= 0x2fffd) || + (cmp >= 0x30000 && cmp <= 0x3fffd))) { + result = 2; + } + if (cmp >= unknowns[0].first && Lookup(cmp, unknowns)) { + result = -1; + } + } + return result; +} + + +int mk_wcswidth(const wchar_t *pwcs, size_t n) +{ + int width = 0; + + for (;*pwcs && n-- > 0; pwcs++) { + int w; + + if ((w = mk_wcwidth(*pwcs)) < 0) + return -1; + else + width += w; + } + + return width; +} + + +/* + * The following functions are the same as mk_wcwidth() and + * mk_wcwidth_cjk(), except that spacing characters in the East Asian + * Ambiguous (A) category as defined in Unicode Technical Report #11 + * have a column width of 2. This variant might be useful for users of + * CJK legacy encodings who want to migrate to UCS without changing + * the traditional terminal character-width behaviour. It is not + * otherwise recommended for general use. + */ +int mk_wcwidth_cjk(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of East Asian Ambiguous + * characters, generated by + * + * uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf \ + * +E000..F8FF \ + * +F0000..FFFFD \ + * +100000..10FFFD c + * + * "WIDTH-A" is a file extracted from EastAsianWidth.txt by selecting + * only those with width "A", and omitting: + * + * 0xAD + * all lines with "COMBINING" + * + * (uniset does not recognize the range expressions in WIDTH-A). + */ + static const struct interval ambiguous[] = { + { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, + { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B2 }, + { 0x00B4, 0x00B4 }, { 0x00B6, 0x00B6 }, { 0x00B8, 0x00BA }, + { 0x00BC, 0x00BC }, { 0x00BF, 0x00BF }, { 0x00C6, 0x00C6 }, + { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00DE }, + { 0x00E6, 0x00E6 }, { 0x00E8, 0x00E8 }, { 0x00EC, 0x00EC }, + { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F2 }, { 0x00F7, 0x00F8 }, + { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, + { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, + { 0x0126, 0x0126 }, { 0x012B, 0x012B }, { 0x0131, 0x0131 }, + { 0x0138, 0x0138 }, { 0x013F, 0x013F }, { 0x0144, 0x0144 }, + { 0x0148, 0x0148 }, { 0x014D, 0x014D }, { 0x0152, 0x0152 }, + { 0x0166, 0x0166 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, + { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, + { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, + { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, + { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02C9 }, + { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02D8 }, + { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x0391 }, + { 0x03A3, 0x03A3 }, { 0x03B1, 0x03B1 }, { 0x03C3, 0x03C3 }, + { 0x0401, 0x0401 }, { 0x0410, 0x0410 }, { 0x0451, 0x0451 }, + { 0x2010, 0x2010 }, { 0x2013, 0x2013 }, { 0x2016, 0x2016 }, + { 0x2018, 0x2019 }, { 0x201C, 0x201D }, { 0x2020, 0x2020 }, + { 0x2024, 0x2024 }, { 0x2030, 0x2030 }, { 0x2032, 0x2032 }, + { 0x2035, 0x2035 }, { 0x203B, 0x203B }, { 0x203E, 0x203E }, + { 0x2074, 0x2074 }, { 0x207F, 0x207F }, { 0x2081, 0x2081 }, + { 0x20AC, 0x20AC }, { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, + { 0x2109, 0x2109 }, { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, + { 0x2121, 0x2121 }, { 0x2126, 0x2126 }, { 0x212B, 0x212B }, + { 0x2153, 0x2153 }, { 0x215B, 0x215B }, { 0x2160, 0x2160 }, + { 0x2170, 0x2170 }, { 0x2189, 0x2189 }, { 0x2190, 0x2190 }, + { 0x2195, 0x2195 }, { 0x21B8, 0x21B8 }, { 0x21D2, 0x21D2 }, + { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 }, + { 0x2202, 0x2202 }, { 0x2207, 0x2207 }, { 0x220B, 0x220B }, + { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, + { 0x221A, 0x221A }, { 0x221D, 0x221D }, { 0x2223, 0x2223 }, + { 0x2225, 0x2225 }, { 0x2227, 0x2227 }, { 0x222E, 0x222E }, + { 0x2234, 0x2234 }, { 0x223C, 0x223C }, { 0x2248, 0x2248 }, + { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2260 }, + { 0x2264, 0x2264 }, { 0x226A, 0x226A }, { 0x226E, 0x226E }, + { 0x2282, 0x2282 }, { 0x2286, 0x2286 }, { 0x2295, 0x2295 }, + { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF }, + { 0x2312, 0x2312 }, { 0x2460, 0x2460 }, { 0x249C, 0x249C }, + { 0x24EB, 0x24EB }, { 0x2500, 0x2500 }, { 0x2550, 0x2550 }, + { 0x2580, 0x2580 }, { 0x2592, 0x2592 }, { 0x25A0, 0x25A0 }, + { 0x25A3, 0x25A3 }, { 0x25B2, 0x25B2 }, { 0x25B6, 0x25B7 }, + { 0x25BC, 0x25BC }, { 0x25C0, 0x25C1 }, { 0x25C6, 0x25C6 }, + { 0x25CB, 0x25CB }, { 0x25CE, 0x25CE }, { 0x25E2, 0x25E2 }, + { 0x25EF, 0x25EF }, { 0x2605, 0x2605 }, { 0x2609, 0x2609 }, + { 0x260E, 0x260E }, { 0x261C, 0x261C }, { 0x261E, 0x261E }, + { 0x2640, 0x2640 }, { 0x2642, 0x2642 }, { 0x2660, 0x2660 }, + { 0x2663, 0x2663 }, { 0x2667, 0x2667 }, { 0x266C, 0x266C }, + { 0x266F, 0x266F }, { 0x269E, 0x269E }, { 0x26BF, 0x26BF }, + { 0x26C6, 0x26C6 }, { 0x26CF, 0x26CF }, { 0x26D5, 0x26D5 }, + { 0x26E3, 0x26E3 }, { 0x26E8, 0x26E8 }, { 0x26EB, 0x26EB }, + { 0x26F4, 0x26F4 }, { 0x26F6, 0x26F6 }, { 0x26FB, 0x26FB }, + { 0x26FE, 0x26FE }, { 0x273D, 0x273D }, { 0x2776, 0x2776 }, + { 0x2B56, 0x2B56 }, { 0x3248, 0x3248 }, { 0xE000, 0xF8FF }, + { 0xFFFD, 0xFFFD }, { 0x1F100, 0x1F100 }, { 0x1F110, 0x1F110 }, + { 0x1F130, 0x1F130 }, { 0x1F170, 0x1F170 }, { 0x1F18F, 0x1F18F }, + { 0x1F19B, 0x1F19B }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } + }; + + /* binary search in table of non-spacing characters */ + if (Lookup((unsigned long) ucs, ambiguous)) + return 2; + + return mk_wcwidth(ucs); +} + + +int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) +{ + int width = 0; + + for (;*pwcs && n-- > 0; pwcs++) { + int w; + + if ((w = mk_wcwidth_cjk(*pwcs)) < 0) + return -1; + else + width += w; + } + + return width; +} diff -Nru tig-2.2/compat/wcwidth.h tig-2.3.0/compat/wcwidth.h --- tig-2.2/compat/wcwidth.h 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/compat/wcwidth.h 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,47 @@ +/* $XTermId: wcwidth.h,v 1.14 2017/06/18 17:56:35 tom Exp $ */ + +/* $XFree86: xc/programs/xterm/wcwidth.h,v 1.5 2005/05/03 00:38:25 dickey Exp $ */ + +/* + * Copyright 2000-2005,2017 by Thomas E. Dickey + * + * All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + */ +#ifndef included_wcwidth_h +#define included_wcwidth_h 1 + +#include + +extern void mk_wcwidth_init(int mode); + +extern int mk_wcswidth(const wchar_t * pwcs, size_t n); +extern int mk_wcswidth_cjk(const wchar_t * pwcs, size_t n); +extern int mk_wcwidth(wchar_t ucs); +extern int mk_wcwidth_cjk(wchar_t ucs); +extern int wcswidth_cjk(const wchar_t * pwcs, size_t n); + +#endif /* included_wcwidth_h */ diff -Nru tig-2.2/compat/wordexp.c tig-2.3.0/compat/wordexp.c --- tig-2.2/compat/wordexp.c 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/compat/wordexp.c 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,60 @@ +/* Copyright (c) 2006-2013 Jonas Fonseca + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "compat.h" +#include "stddef.h" +#include +#include +#include + +void +compat_wordfree (wordexp_t *pwordexp) +{ + free(pwordexp->we_wordv[0]); + free(pwordexp->we_wordv); +} + +int +compat_wordexp (const char *words, wordexp_t *pwordexp, int flags) +{ + char *expanded = NULL; + const char *home = getenv("HOME"); + + if (home && words[0] == '~' && (words[1] == '/' || words[1] == 0)) { + size_t len = strlen(home) + strlen(words + 1) + 1; + if ((expanded = malloc(len)) && !snprintf(expanded, len, "%s%s", home, words + 1)) { + free(expanded); + return -1; + } + } else { + expanded = strdup(words); + } + + if (!expanded) + return -1; + + pwordexp->we_wordv = calloc(2, sizeof(*pwordexp->we_wordv)); + if (!pwordexp->we_wordv) { + free(expanded); + return -1; + } + pwordexp->we_wordv[0] = expanded; + + return 0; +} + +/* vim: set ts=8 sw=8 noexpandtab: */ diff -Nru tig-2.2/config.h.in tig-2.3.0/config.h.in --- tig-2.2/config.h.in 2016-08-11 02:39:02.000000000 +0000 +++ tig-2.3.0/config.h.in 2017-09-29 15:15:29.000000000 +0000 @@ -23,6 +23,9 @@ */ #undef HAVE_DECL_ERRNO +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY @@ -95,6 +98,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `wordexp' function. */ +#undef HAVE_WORDEXP + +/* Define to 1 if you have the header file. */ +#undef HAVE_WORDEXP_H + /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST diff -Nru tig-2.2/config.make.in tig-2.3.0/config.make.in --- tig-2.2/config.make.in 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/config.make.in 2017-09-29 15:15:26.000000000 +0000 @@ -12,7 +12,7 @@ CFLAGS = @CFLAGS@ @COVERAGE_CFLAGS@ CPPFLAGS = @CPPFLAGS@ -DHAVE_CONFIG_H LDFLAGS = @LDFLAGS@ -LDLIBS = @LIBS@ @CURSES_LIB@ +LDLIBS = @LIBS@ @CURSES_LIBS@ ASCIIDOC = @ASCIIDOC@ XMLTO = @XMLTO@ @@ -25,6 +25,7 @@ @NO_MKSTEMPS@ NO_MKSTEMPS = y @NO_SETENV@ NO_SETENV = y @NO_STRNDUP@ NO_STRNDUP = y +@NO_WORDEXP@ NO_WORDEXP = y # Add config.h as a dependency for all object files CONFIG_H = config.h diff -Nru tig-2.2/configure tig-2.3.0/configure --- tig-2.2/configure 2016-08-11 02:39:02.000000000 +0000 +++ tig-2.3.0/configure 2017-09-29 15:15:29.000000000 +0000 @@ -638,7 +638,12 @@ RL_MINOR RL_MAJOR RL_VERSION -CURSES_LIB +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +CURSES_CFLAGS +CURSES_LIBS +NO_WORDEXP NO_STRNDUP NO_SETENV NO_MKSTEMPS @@ -708,7 +713,11 @@ LIBS CPPFLAGS CPP -CURSES_LIB' +CURSES_LIBS +CURSES_CFLAGS +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR' # Initialize some variables set by options. @@ -1337,7 +1346,14 @@ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor - CURSES_LIB linker library for Curses, e.g. -lcurses + CURSES_LIBS linker library for Curses, e.g. -lcurses + CURSES_CFLAGS + preprocessor flags for Curses, e.g. -I/usr/include/ncursesw + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -3370,7 +3386,7 @@ done -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +for ac_header in execinfo.h stdint.h stdlib.h string.h sys/time.h unistd.h wordexp.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -3454,6 +3470,139 @@ fi done +for ac_func in wordexp +do : + ac_fn_c_check_func "$LINENO" "wordexp" "ac_cv_func_wordexp" +if test "x$ac_cv_func_wordexp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WORDEXP 1 +_ACEOF + NO_WORDEXP="#" + +fi +done + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi @@ -3475,6 +3624,8 @@ ax_saved_LIBS=$LIBS + ax_saved_CPPFLAGS=$CPPFLAGS + if test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes; then : ax_with_plaincurses=no else @@ -3484,17 +3635,68 @@ ax_cv_curses_which=no # Test for NcursesW + if test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncursesw via pkg-config" >&5 +$as_echo_n "checking for ncursesw via pkg-config... " >&6; } + + - if test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno; then : + if test -n "$_ax_cv_ncursesw_libs"; then + pkg_cv__ax_cv_ncursesw_libs="$_ax_cv_ncursesw_libs" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncursesw\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncursesw") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv__ax_cv_ncursesw_libs=`$PKG_CONFIG --libs "ncursesw" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + if test -n "$_ax_cv_ncursesw_cppflags"; then + pkg_cv__ax_cv_ncursesw_cppflags="$_ax_cv_ncursesw_cppflags" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncursesw\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncursesw") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv__ax_cv_ncursesw_cppflags=`$PKG_CONFIG --cflags "ncursesw" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi - LIBS="$ax_saved_LIBS -lncursesw" + if test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NcursesW wide-character library" >&5 -$as_echo_n "checking for NcursesW wide-character library... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + # No suitable .pc file found, have to find flags via fallback + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncursesw via fallback" >&5 +$as_echo_n "checking for ncursesw via fallback... " >&6; } if ${ax_cv_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else + $as_echo + pkg_cv__ax_cv_ncursesw_libs="-lncursesw" + pkg_cv__ax_cv_ncursesw_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS" + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_ncursesw_libs" + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_ncursesw_cppflags" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr() with $pkg_cv__ax_cv_ncursesw_libs" >&5 +$as_echo_n "checking for initscr() with $pkg_cv__ax_cv_ncursesw_libs... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3514,9 +3716,80 @@ } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ax_cv_ncursesw=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nodelay() with $pkg_cv__ax_cv_ncursesw_libs" >&5 +$as_echo_n "checking for nodelay() with $pkg_cv__ax_cv_ncursesw_libs... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nodelay (); +int +main () +{ +return nodelay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + ax_cv_ncursesw=yes + else - ax_cv_ncursesw=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + pkg_cv__ax_cv_ncursesw_libs="$pkg_cv__ax_cv_ncursesw_libs -ltinfow" + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_ncursesw_libs" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nodelay() with $pkg_cv__ax_cv_ncursesw_libs" >&5 +$as_echo_n "checking for nodelay() with $pkg_cv__ax_cv_ncursesw_libs... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nodelay (); +int +main () +{ +return nodelay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + ax_cv_ncursesw=yes + +else + + ax_cv_ncursesw=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +else + + ax_cv_ncursesw=no + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -3524,6 +3797,19 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ncursesw" >&5 $as_echo "$ax_cv_ncursesw" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + # Found .pc file, using its information + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_ncursesw_libs" + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_ncursesw_cppflags" + ax_cv_ncursesw=yes + +fi + + if test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes; then : as_fn_error $? "--with-ncursesw specified but could not find NcursesW library" "$LINENO" 5 @@ -3534,7 +3820,8 @@ ax_cv_curses=yes ax_cv_curses_which=ncursesw - CURSES_LIB="-lncursesw" + CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs" + CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags" $as_echo "#define HAVE_NCURSESW 1" >>confdefs.h @@ -3744,19 +4031,72 @@ fi fi + unset pkg_cv__ax_cv_ncursesw_libs + unset pkg_cv__ax_cv_ncursesw_cppflags # Test for Ncurses + if test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncurses via pkg-config" >&5 +$as_echo_n "checking for ncurses via pkg-config... " >&6; } - if test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno; then : - LIBS="$ax_saved_LIBS -lncurses" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ncurses library" >&5 -$as_echo_n "checking for Ncurses library... " >&6; } + if test -n "$_ax_cv_ncurses_libs"; then + pkg_cv__ax_cv_ncurses_libs="$_ax_cv_ncurses_libs" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv__ax_cv_ncurses_libs=`$PKG_CONFIG --libs "ncurses" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + if test -n "$_ax_cv_ncurses_cppflags"; then + pkg_cv__ax_cv_ncurses_cppflags="$_ax_cv_ncurses_cppflags" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ncurses\""; } >&5 + ($PKG_CONFIG --exists --print-errors "ncurses") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv__ax_cv_ncurses_cppflags=`$PKG_CONFIG --cflags "ncurses" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + if test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + # No suitable .pc file found, have to find flags via fallback + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ncurses via fallback" >&5 +$as_echo_n "checking for ncurses via fallback... " >&6; } if ${ax_cv_ncurses+:} false; then : $as_echo_n "(cached) " >&6 else + $as_echo + pkg_cv__ax_cv_ncurses_libs="-lncurses" + pkg_cv__ax_cv_ncurses_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS" + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_ncurses_libs" + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_ncurses_cppflags" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr() with $pkg_cv__ax_cv_ncurses_libs" >&5 +$as_echo_n "checking for initscr() with $pkg_cv__ax_cv_ncurses_libs... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3776,9 +4116,81 @@ } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ax_cv_ncurses=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nodelay() with $pkg_cv__ax_cv_ncurses_libs" >&5 +$as_echo_n "checking for nodelay() with $pkg_cv__ax_cv_ncurses_libs... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nodelay (); +int +main () +{ +return nodelay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + ax_cv_ncurses=yes + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + pkg_cv__ax_cv_ncurses_libs="$pkg_cv__ax_cv_ncurses_libs -ltinfo" + + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_ncurses_libs" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nodelay() with $pkg_cv__ax_cv_ncurses_libs" >&5 +$as_echo_n "checking for nodelay() with $pkg_cv__ax_cv_ncurses_libs... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nodelay (); +int +main () +{ +return nodelay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + ax_cv_ncurses=yes + else - ax_cv_ncurses=no + + ax_cv_ncurses=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +else + + ax_cv_ncurses=no + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -3786,6 +4198,19 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ncurses" >&5 $as_echo "$ax_cv_ncurses" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + # Found .pc file, using its information + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_ncurses_libs" + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_ncurses_cppflags" + ax_cv_ncurses=yes + +fi + + if test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes; then : as_fn_error $? "--with-ncurses specified but could not find Ncurses library" "$LINENO" 5 @@ -3796,7 +4221,8 @@ ax_cv_curses=yes ax_cv_curses_which=ncurses - CURSES_LIB="-lncurses" + CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs" + CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags" $as_echo "#define HAVE_NCURSES 1" >>confdefs.h @@ -3922,14 +4348,15 @@ fi fi + unset pkg_cv__ax_cv_ncurses_libs + unset pkg_cv__ax_cv_ncurses_cppflags - # Test for plain Curses (or if CURSES_LIB was set by user) - + # Test for plain Curses (or if CURSES_LIBS was set by user) if test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno; then : - if test "x$CURSES_LIB" != x; then : + if test "x$CURSES_LIBS" != x; then : - LIBS="$ax_saved_LIBS $CURSES_LIB" + LIBS="$ax_saved_LIBS $CURSES_LIBS" else @@ -3977,9 +4404,9 @@ ax_cv_curses=yes ax_cv_curses_which=plaincurses - if test "x$CURSES_LIB" = x; then : + if test "x$CURSES_LIBS" = x; then : - CURSES_LIB="-lcurses" + CURSES_LIBS="-lcurses" fi @@ -4211,6 +4638,10 @@ fi LIBS=$ax_saved_LIBS + CPPFLAGS=$ax_saved_CPPFLAGS + + unset ax_saved_LIBS + unset ax_saved_CPPFLAGS case "$ax_cv_ncurses" in "no") as_fn_error $? "ncurses not found" "$LINENO" 5 @@ -4243,13 +4674,14 @@ if test "x$ac_cv_func_tgetent" = xyes; then : bash_cv_termcap_lib=libc else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 -$as_echo_n "checking for tgetent in -ltermcap... " >&6; } -if ${ac_cv_lib_termcap_tgetent+:} false; then : + if test "$ax_cv_curses_which" = "ncursesw"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncursesw" >&5 +$as_echo_n "checking for tgetent in -lncursesw... " >&6; } +if ${ac_cv_lib_ncursesw_tgetent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermcap $LIBS" +LIBS="-lncursesw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4269,26 +4701,26 @@ } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_termcap_tgetent=yes + ac_cv_lib_ncursesw_tgetent=yes else - ac_cv_lib_termcap_tgetent=no + ac_cv_lib_ncursesw_tgetent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5 -$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } -if test "x$ac_cv_lib_termcap_tgetent" = xyes; then : - bash_cv_termcap_lib=libtermcap +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_tgetent" >&5 +$as_echo "$ac_cv_lib_ncursesw_tgetent" >&6; } +if test "x$ac_cv_lib_ncursesw_tgetent" = xyes; then : + bash_cv_termcap_lib=libncursesw else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5 -$as_echo_n "checking for tgetent in -ltinfo... " >&6; } -if ${ac_cv_lib_tinfo_tgetent+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfow" >&5 +$as_echo_n "checking for tgetent in -ltinfow... " >&6; } +if ${ac_cv_lib_tinfow_tgetent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ltinfo $LIBS" +LIBS="-ltinfow $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4308,28 +4740,31 @@ } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_tinfo_tgetent=yes + ac_cv_lib_tinfow_tgetent=yes else - ac_cv_lib_tinfo_tgetent=no + ac_cv_lib_tinfow_tgetent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5 -$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; } -if test "x$ac_cv_lib_tinfo_tgetent" = xyes; then : - bash_cv_termcap_lib=libtinfo -else - bash_cv_termcap_lib=gnutermcap -if test "$ax_cv_curses_which" = "ncursesw"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncursesw" >&5 -$as_echo_n "checking for tgetent in -lncursesw... " >&6; } -if ${ac_cv_lib_ncursesw_tgetent+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfow_tgetent" >&5 +$as_echo "$ac_cv_lib_tinfow_tgetent" >&6; } +if test "x$ac_cv_lib_tinfow_tgetent" = xyes; then : + bash_cv_termcap_lib=libtinfow +fi + + +fi + +elif test "$ax_cv_curses_which" = "ncurses"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 +$as_echo_n "checking for tgetent in -lncurses... " >&6; } +if ${ac_cv_lib_ncurses_tgetent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lncursesw $LIBS" +LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4349,28 +4784,26 @@ } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ncursesw_tgetent=yes + ac_cv_lib_ncurses_tgetent=yes else - ac_cv_lib_ncursesw_tgetent=no + ac_cv_lib_ncurses_tgetent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_tgetent" >&5 -$as_echo "$ac_cv_lib_ncursesw_tgetent" >&6; } -if test "x$ac_cv_lib_ncursesw_tgetent" = xyes; then : - bash_cv_termcap_lib=libncursesw -fi - -elif test "$ax_cv_curses_which" = "ncurses"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 -$as_echo_n "checking for tgetent in -lncurses... " >&6; } -if ${ac_cv_lib_ncurses_tgetent+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5 +$as_echo "$ac_cv_lib_ncurses_tgetent" >&6; } +if test "x$ac_cv_lib_ncurses_tgetent" = xyes; then : + bash_cv_termcap_lib=libncurses +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5 +$as_echo_n "checking for tgetent in -ltinfo... " >&6; } +if ${ac_cv_lib_tinfo_tgetent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" +LIBS="-ltinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4390,22 +4823,25 @@ } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ncurses_tgetent=yes + ac_cv_lib_tinfo_tgetent=yes else - ac_cv_lib_ncurses_tgetent=no + ac_cv_lib_tinfo_tgetent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5 -$as_echo "$ac_cv_lib_ncurses_tgetent" >&6; } -if test "x$ac_cv_lib_ncurses_tgetent" = xyes; then : - bash_cv_termcap_lib=libncurses +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5 +$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; } +if test "x$ac_cv_lib_tinfo_tgetent" = xyes; then : + bash_cv_termcap_lib=libtinfo +fi + + fi elif test "$ax_cv_curses_which" = "plaincurses"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5 $as_echo_n "checking for tgetent in -lcurses... " >&6; } if ${ac_cv_lib_curses_tgetent+:} false; then : $as_echo_n "(cached) " >&6 @@ -4445,7 +4881,47 @@ bash_cv_termcap_lib=libcurses fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 +$as_echo_n "checking for tgetent in -ltermcap... " >&6; } +if ${ac_cv_lib_termcap_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_termcap_tgetent=yes +else + ac_cv_lib_termcap_tgetent=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5 +$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } +if test "x$ac_cv_lib_termcap_tgetent" = xyes; then : + bash_cv_termcap_lib=libtermcap +else + bash_cv_termcap_lib=gnutermcap fi @@ -4465,19 +4941,22 @@ LDFLAGS="$LDFLAGS -L./lib/termcap" TERMCAP_LIB="./lib/termcap/libtermcap.a" TERMCAP_DEP="./lib/termcap/libtermcap.a" -elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +elif test X$bash_cv_termcap_lib = Xlibtermcap && test -z "$prefer_curses"; then TERMCAP_LIB=-ltermcap TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libtinfo; then +elif test X$bash_cv_termcap_lib = Xlibtinfow; then +TERMCAP_LIB=-ltinfow +TERMCAP_DEP= +elif test X$bash_cv_termcap_lib = Xlibtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libncursesw; then +elif test X$bash_cv_termcap_lib = Xlibncursesw; then TERMCAP_LIB=-lncursesw TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libncurses; then +elif test X$bash_cv_termcap_lib = Xlibncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libc; then +elif test X$bash_cv_termcap_lib = Xlibc; then TERMCAP_LIB= TERMCAP_DEP= else diff -Nru tig-2.2/configure.ac tig-2.3.0/configure.ac --- tig-2.2/configure.ac 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/configure.ac 2017-09-29 15:15:26.000000000 +0000 @@ -11,7 +11,7 @@ AC_PROG_CC -AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) +AC_CHECK_HEADERS([execinfo.h stdint.h stdlib.h string.h sys/time.h unistd.h wordexp.h]) AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_DECLS([environ]) AC_CHECK_DECLS([errno], [], [], [#include ]) @@ -20,6 +20,7 @@ AC_CHECK_FUNCS([mkstemps], [AC_SUBST([NO_MKSTEMPS], ["#"])]) AC_CHECK_FUNCS([setenv], [AC_SUBST([NO_SETENV], ["#"])]) AC_CHECK_FUNCS([strndup], [AC_SUBST([NO_STRNDUP], ["#"])]) +AC_CHECK_FUNCS([wordexp], [AC_SUBST([NO_WORDEXP], ["#"])]) AX_WITH_CURSES case "$ax_cv_ncurses" in "no") @@ -29,7 +30,7 @@ AC_MSG_WARN([The found ncurses library does not support wide-char.]) AC_MSG_WARN([This means that tig will not correctly render UTF-8.]) esac -AC_SUBST(CURSES_LIB) +AC_SUBST(CURSES_LIBS) AX_LIB_READLINE(6.2) diff -Nru tig-2.2/contrib/config.make tig-2.3.0/contrib/config.make --- tig-2.2/contrib/config.make 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/contrib/config.make 2017-09-29 15:15:26.000000000 +0000 @@ -17,6 +17,9 @@ # Uncomment to enable work-around for missing mkstemps(). #NO_MKSTEMPS=y +# Uncomment to enable work-around for missing wordexp(). +#NO_WORDEXP=y + # Uncomment to not include built-in tigrc inside the binary. #NO_BUILTIN_TIGRC=y diff -Nru tig-2.2/contrib/config.make-CYGWIN_NT-6.1 tig-2.3.0/contrib/config.make-CYGWIN_NT-6.1 --- tig-2.2/contrib/config.make-CYGWIN_NT-6.1 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/contrib/config.make-CYGWIN_NT-6.1 2017-09-29 15:15:26.000000000 +0000 @@ -2,7 +2,7 @@ # # Use ncursesw. -NCURSESW_LIBS = $(shell ncursesw5-config --libs 2>/dev/null) +NCURSESW_LIBS = $(shell ncursesw5-config --libs 2>/dev/null) HAS_ICONV = $(shell test -e "/usr/include/iconv.h" && echo true) ifeq ($(NCURSESW_LIBS),) diff -Nru tig-2.2/contrib/config.make-Darwin tig-2.3.0/contrib/config.make-Darwin --- tig-2.2/contrib/config.make-Darwin 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/contrib/config.make-Darwin 2017-09-29 15:15:26.000000000 +0000 @@ -3,6 +3,7 @@ # Work-around for Homebrew-based xmlto. export XML_CATALOG_FILES=/usr/local/etc/xml/catalog +TIG_CFLAGS += -DHAVE_EXECINFO_H TIG_LDLIBS = -liconv NCURSES_DIR = $(wildcard /usr/local/opt/ncurses) diff -Nru tig-2.2/contrib/tig-completion.bash tig-2.3.0/contrib/tig-completion.bash --- tig-2.2/contrib/tig-completion.bash 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/contrib/tig-completion.bash 2017-09-29 15:15:26.000000000 +0000 @@ -115,8 +115,8 @@ -W "$(git --git-dir="$(__tigdir)" ls-tree "$ls" \ | sed '/^100... blob /s,^.* ,, /^040000 tree /{ - s,^.* ,, - s,$,/, + s,^.* ,, + s,$,/, } s/^.* //')" \ -- "$cur")) @@ -287,5 +287,5 @@ # when the user has tab-completed the executable name and consequently # included the '.exe' suffix. if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then -complete -o default -o nospace -F _tig tig.exe + complete -o default -o nospace -F _tig tig.exe fi diff -Nru tig-2.2/contrib/tig-pick tig-2.3.0/contrib/tig-pick --- tig-2.2/contrib/tig-pick 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/contrib/tig-pick 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,48 @@ +#!/bin/sh +# +# 'tig-pick' is a wrapper script that uses 'tig' to pick a Git commit from the +# history. On success, The script prints the ID of the commit to standard +# output, so that it can be used as a parameter for subsequent commands, e.g. +# 'git rebase -i $(tig-pick)' +# +# In order to be able to display the interface and to catch the commit ID +# (easily) at the same time, 'tig' has to be run with the standard and error +# output channels swapped. +# +# All parameters passed to the script will be forwarded to 'tig'. +# + + +set -e + +CONFIG=$(mktemp) +trap "rm -f '$CONFIG'" EXIT + +# Prepare config file: source user config, if present +if [ ! -z "$TIGRC_USER" ]; then + echo "source $TIGRC_USER" >> $CONFIG +elif [ -f "$HOME/.tigrc" ]; then + echo "source $HOME/.tigrc" >> $CONFIG +fi + +# Bind Enter to print the selected commit ID to error output and exit after +# that. +echo 'bind main &2"' >> $CONFIG + + +# Run tig with the standard and error output channels swapped. +export TIGRC_USER=$CONFIG +stderr=$(tig "$@" 3>&2 2>&1 1>&3 3>&-) || { + status=$? + echo "$stderr" >&2 + exit $status +} +commit=$(echo "$stderr" | tail -n1) + +# Check return value for valid commit ID +if ! echo -n "$commit" | grep -iqE '^[0-9a-f]{40}$'; then + echo "$stderr" >&2 + exit 1 +fi + +echo "$commit" diff -Nru tig-2.2/contrib/tig.spec.in tig-2.3.0/contrib/tig.spec.in --- tig-2.2/contrib/tig.spec.in 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/contrib/tig.spec.in 2017-09-29 15:15:26.000000000 +0000 @@ -8,8 +8,8 @@ License: GPL Group: Development/Tools Vendor: Jonas Fonseca -URL: http://jonas.nitro.dk/tig/ -Source: http://jonas.nitro.dk/tig/releases/%{name}-%{version}.tar.gz +URL: https://jonas.github.io/tig +Source: https://github.com/jonas/tig/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz BuildRequires: ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: git-core, ncurses diff -Nru tig-2.2/contrib/vim.tigrc tig-2.3.0/contrib/vim.tigrc --- tig-2.2/contrib/vim.tigrc 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/contrib/vim.tigrc 2017-09-29 15:15:26.000000000 +0000 @@ -19,8 +19,8 @@ bind generic gP back bind generic gn view-next -bind main G none -bind generic G move-last-line +bind main G move-last-line +bind generic G move-last-line bind generic move-page-down bind generic move-page-up diff -Nru tig-2.2/debian/changelog tig-2.3.0/debian/changelog --- tig-2.2/debian/changelog 2016-09-24 13:48:31.000000000 +0000 +++ tig-2.3.0/debian/changelog 2017-10-22 13:38:27.000000000 +0000 @@ -1,3 +1,11 @@ +tig (2.3.0-1) unstable; urgency=medium + + * New upstream release. + - Updated debian/watch to point to the new Github location. + * Update standards version to 4.1.1; no changes. + + -- Sebastian Harl Sun, 22 Oct 2017 15:38:27 +0200 + tig (2.2-1) experimental; urgency=medium [ Sebastian Harl ] diff -Nru tig-2.2/debian/control tig-2.3.0/debian/control --- tig-2.2/debian/control 2016-09-24 13:48:31.000000000 +0000 +++ tig-2.3.0/debian/control 2017-10-22 13:38:27.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Sebastian Harl Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.14.6), libncursesw5-dev, libreadline-dev, asciidoc (>= 8.4), xmlto, docbook-utils -Standards-Version: 3.9.8 +Standards-Version: 4.1.1 Homepage: http://jonas.nitro.dk/tig/ Vcs-Git: git://git.tokkee.org/pkg-tig.git Vcs-Browser: http://git.tokkee.org/?p=pkg-tig.git diff -Nru tig-2.2/debian/copyright tig-2.3.0/debian/copyright --- tig-2.2/debian/copyright 2016-09-24 13:48:31.000000000 +0000 +++ tig-2.3.0/debian/copyright 2017-10-22 13:38:27.000000000 +0000 @@ -6,8 +6,16 @@ Upstream Author: Jonas Fonseca -Copyright Holder: +Copyright Holders: + Damian Pietras + Drew Northup + Free Software Foundation, Inc. + John Zaitseff Jonas Fonseca + Mark Pulford + Mike Frysinger + Reuben Thomas + Thomas E. Dickey License: @@ -71,6 +79,48 @@ On Debian systems, the complete text of the GNU Library General Public License, version 2, can be found in `/usr/share/common-licenses/LGPL-2'. + Files: compat/wcwidth.c + compat/wcwidth.h + + Copyright © 2002-2017, Thomas E. Dickey + + All Rights Reserved + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above copyright + holders shall not be used in advertising or otherwise to promote the + sale, use or other dealings in this Software without prior written + authorization. + + This is an updated version of Markus Kuhn's implementation of wcwidth. + + Files: tools/ax_require_defined.m4 + + Copyright © 2014 Mike Frysinger + + Copying and distribution of this file, with or without modification, are + permitted in any medium without royalty provided the copyright notice + and this notice are preserved. This file is offered as-is, without any + warranty. + Files: compat/compat.h Copyright © 2006-2013 Jonas Fonseca diff -Nru tig-2.2/debian/watch tig-2.3.0/debian/watch --- tig-2.2/debian/watch 2016-09-24 13:48:31.000000000 +0000 +++ tig-2.3.0/debian/watch 2017-10-22 13:34:02.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -http://jonas.nitro.dk/tig/releases/ tig-(.*)\.tar\.gz - +https://github.com/jonas/tig/releases .*/download/tig-.*/tig-(\d\S+)\.tar\.gz diff -Nru tig-2.2/doc/manual.adoc tig-2.3.0/doc/manual.adoc --- tig-2.2/doc/manual.adoc 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/manual.adoc 2017-09-29 15:15:26.000000000 +0000 @@ -174,7 +174,7 @@ |%(fileargs) |The file arguments passed on the command line. |%(cmdlineargs) |All other options passed on the command line. |%(diffargs) |Options from 'diff-options' or 'TIG_DIFF_OPTS' used - used by the diff view. + by the diff and stage view. |%(blameargs) |Options from 'blame-options' used by the blame view. |%(logargs) |Options from 'log-options' used by the log view. |%(mainargs) |Options from 'main-options' used by the main view. @@ -249,8 +249,9 @@ Upon startup, Tig first reads the system wide configuration file (`{sysconfdir}/tigrc` by default) and then proceeds to read the user's -configuration file (`~/.tigrc` by default). The paths to either of these files -can be overridden through the following environment variables: +configuration file (`~/.tigrc` or `$XDG_CONFIG_HOME/tig/config` by default). +The paths to either of these files can be overridden through the following +environment variables: TIGRC_USER:: Path of the user configuration file. @@ -258,6 +259,13 @@ TIGRC_SYSTEM:: Path of the system wide configuration file. +[[history-files]] +History Files +~~~~~~~~~~~~~~~~~~~ + +If compiled with readline support, Tig writes a persistent command and search +history to `~/.tig_history` or `$XDG_DATA_HOME/tig/history`. + [[repo-refs]] Repository References ~~~~~~~~~~~~~~~~~~~~~ @@ -283,9 +291,8 @@ TIG_LS_REMOTE:: - Set command for retrieving all repository references. The command - should output data in the same format as git-ls-remote(1). Defaults - to: + Command for retrieving all repository references. The command should + output data in the same format as git-ls-remote(1). Defaults to: ----------------------------------------------------------------------------- git ls-remote . ----------------------------------------------------------------------------- @@ -353,7 +360,9 @@ line up. However, if you opened a diff view from the main view (split- or full-screen) it will change the cursor to point to the previous commit in the main view and update the diff view - to display it. + to display it. If you prefer this key to move the cursor or + scroll within the diff view instead, use `bind diff move-up` + or `bind diff scroll-line-up`, respectively. |Down |Similar to 'Up' but will move down. |, |Move to parent. In the tree view, this means switch to the parent directory. In the blame view it will load blame for the parent @@ -404,14 +413,14 @@ [frame="none",grid="none",cols="2<,8<",options="header"] |============================================================================= -|Key |Action -|Insert |Scroll view one line up. -|Delete |Scroll view one line down. -|ScrBack|Scroll view one page up. -|ScrFwd |Scroll view one page down. -|Left |Scroll view one column left. -|Right |Scroll view one column right. -|\| |Scroll view to the first column. +|Key |Action +|Insert |Scroll view one line up. +|Delete |Scroll view one line down. +|ScrollBack |Scroll view one page up. +|ScrollFwd |Scroll view one page down. +|Left |Scroll view one column left. +|Right |Scroll view one column right. +|\| |Scroll view to the first column. |============================================================================= [[searching]] @@ -452,7 +461,8 @@ |% |Toggle file filtering in order to see the full diff instead of only the diff concerning the currently selected file. |$ |Toggle highlighting of commit title overflow. -|: |Open prompt. This allows you to specify what command to run. +|: |Open prompt. This allows you to specify what command to run and also to + jump to a specific line, e.g. `:23` |e |Open file in editor. |============================================================================= @@ -474,9 +484,11 @@ branch `some/branch`. |:save-display |Save current display to ``. |:save-options |Save current options to ``. +|:save-view |Save view info to `` (for testing purposes). |:script |Execute commands from ``. |:exec |Execute command using `` with external user-defined command option flags defined in ``. +|:echo |Display text in the status bar. |============================================================================= [[external-commands]] @@ -617,7 +629,7 @@ More Information ---------------- -Please visit Tig's http://jonas.nitro.dk/tig[home page] or +Please visit Tig's https://jonas.github.io/tig[home page] or https://github.com/jonas/tig[main Git repository] for information about new releases and how to report bugs and feature requests. diff -Nru tig-2.2/doc/manual.html tig-2.3.0/doc/manual.html --- tig-2.2/doc/manual.html 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/manual.html 2017-09-29 15:15:26.000000000 +0000 @@ -800,6 +800,11 @@
  • +History Files +

    +
  • +
  • +

    Repository References

  • @@ -1174,7 +1179,7 @@

    %(diffargs)

    Options from diff-options or TIG_DIFF_OPTS used - used by the diff view.

    + by the diff and stage view.

    %(blameargs)

    @@ -1308,8 +1313,9 @@

    3.1. Configuration Files

    Upon startup, Tig first reads the system wide configuration file ({sysconfdir}/tigrc by default) and then proceeds to read the user’s -configuration file (~/.tigrc by default). The paths to either of these files -can be overridden through the following environment variables:

    +configuration file (~/.tigrc or $XDG_CONFIG_HOME/tig/config by default). +The paths to either of these files can be overridden through the following +environment variables:

    TIGRC_USER @@ -1328,9 +1334,15 @@

    - -
    -

    3.2. Repository References

    +

    History Files

    +
    +
    +
    If compiled with readline support, Tig writes a persistent command and search
    +history to `~/.tig_history` or `$XDG_DATA_HOME/tig/history`.
    +
    +[[repo-refs]]
    +Repository References
    +

    Commits that are referenced by tags and branch heads will be marked by the reference name surrounded by [ and ]:

    @@ -1353,9 +1365,8 @@

    - Set command for retrieving all repository references. The command - should output data in the same format as git-ls-remote(1). Defaults - to: + Command for retrieving all repository references. The command should + output data in the same format as git-ls-remote(1). Defaults to:

    @@ -1366,7 +1377,7 @@
    -

    3.3. Diff options

    +

    3.2. Diff options

    It is possible to alter how diffs are shown by the diff view. If for example you prefer to have commit and author dates shown as relative dates, use:

    @@ -1500,7 +1511,9 @@ line up. However, if you opened a diff view from the main view (split- or full-screen) it will change the cursor to point to the previous commit in the main view and update the diff view - to display it.

    + to display it. If you prefer this key to move the cursor or + scroll within the diff view instead, use bind diff <Up> move-up + or bind diff <Up> scroll-line-up, respectively.

    Down

    @@ -1626,7 +1639,7 @@ -Key +Key Action @@ -1640,11 +1653,11 @@

    Scroll view one line down.

    -

    ScrBack

    +

    ScrollBack

    Scroll view one page up.

    -

    ScrFwd

    +

    ScrollFwd

    Scroll view one page down.

    @@ -1780,7 +1793,8 @@

    :

    -

    Open prompt. This allows you to specify what command to run.

    +

    Open prompt. This allows you to specify what command to run and also to + jump to a specific line, e.g. :23

    e

    @@ -1842,6 +1856,10 @@

    Save current options to <file>.

    +

    :save-view <file>

    +

    Save view info to <file> (for testing purposes).

    + +

    :script <file>

    Execute commands from <file>.

    @@ -1850,6 +1868,10 @@

    Execute command using <args> with external user-defined command option flags defined in <flags>.

    + +

    :echo <args…>

    +

    Display text in the status bar.

    +
    @@ -2005,7 +2027,7 @@

    6. More Information

    -

    Please visit Tig’s home page or +

    Please visit Tig’s home page or main Git repository for information about new releases and how to report bugs and feature requests.

    @@ -2042,7 +2064,7 @@

    diff -Nru tig-2.2/doc/tig.1 tig-2.3.0/doc/tig.1 --- tig-2.2/doc/tig.1 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/tig.1 2017-09-29 15:15:26.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: tig .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 -.\" Date: 08/10/2016 +.\" Date: 09/29/2017 .\" Manual: Tig Manual -.\" Source: Tig 2.2 +.\" Source: Tig 2.3.0 .\" Language: English .\" -.TH "TIG" "1" "08/10/2016" "Tig 2\&.2" "Tig Manual" +.TH "TIG" "1" "09/29/2017" "Tig 2\&.3\&.0" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -48,7 +48,7 @@ Tig is an ncurses\-based text\-mode interface for git(1)\&. It functions mainly as a Git repository browser, but can also assist in staging changes for commit at chunk level and act as a pager for output from various Git commands\&. .SH "OPTIONS" .sp -Command line options recognized by Tig include all valid git\-log(1) and git\-diff(1) options, as well as the following subcommands and Tig specific options\&. The first command line parameter not starting with "\-" is interpreted as being either a revision specification or a path and will end the option parsing\&. All additional options will be passed to the underlying Git command\&. +Command line options recognized by Tig include all valid git\-log(1) and git\-diff(1) options, as well as the following subcommands and Tig\-specific options\&. The first command line parameter not starting with "\-" is interpreted as being either a revision specification or a path and will end the option parsing\&. All additional options will be passed to the underlying Git command\&. .PP show .RS 4 @@ -219,7 +219,7 @@ .\} .sp .sp -Display all branches: +Pretend as if all the refs in refs/ are listed on the command line: .sp .if n \{\ .RS 4 @@ -355,7 +355,9 @@ TIGRC_USER .RS 4 Path of the user configuration file (defaults to -~/\&.tigrc)\&. +~/\&.tigrc +or +$XDG_CONFIG_HOME/tig/config)\&. .RE .PP TIGRC_SYSTEM @@ -366,7 +368,7 @@ .PP TIG_LS_REMOTE .RS 4 -Set command for retrieving all repository references\&. The command should output data in the same format as git\-ls\-remote(1)\&. +Command for retrieving all repository references\&. The command should output data in the same format as git\-ls\-remote(1)\&. .RE .PP TIG_DIFF_OPTS @@ -392,7 +394,7 @@ .RE .SH "FILES" .PP -\*(Aq$XDG_CONFIG_HOME/tig/config, \fI~/\&.config/tig/config\fR, \fI~/\&.tigrc\fR +\fI$XDG_CONFIG_HOME/tig/config\fR, \fI~/\&.config/tig/config\fR, \fI~/\&.tigrc\fR .RS 4 The Tig user configuration file is loaded in the following way\&. If $XDG_CONFIG_HOME @@ -413,10 +415,28 @@ System wide configuration file\&. .RE .PP -\fI$GIT_DIR/config\fR, \*(Aq~/\&.gitconfig, \*(Aq++SYSCONFDIR++/gitconfig +\fI$GIT_DIR/config\fR, \fI~/\&.gitconfig\fR, \fI++SYSCONFDIR++/gitconfig\fR .RS 4 Git configuration files\&. Read on start\-up with the help of git\-config(1)\&. .RE +.PP +\fI$XDG_DATA_HOME/tig/history\fR, \fI~/\&.local/share/tig/history\fR, \fI~/\&.tig_history\fR +.RS 4 +When compiled with readline support, Tig writes a persistent command and search history\&. The location of the history file is determined in the following way\&. If +$XDG_DATA_HOME +is set and +$XDG_DATA_HOME/tig/ +exists, store history to +$XDG_DATA_HOME/tig/history\&. If +$XDG_CONFIG_HOME +is empty or undefined, store history to +~/\&.local/share/tig/history +if the directory +~/\&.local/share/tig/ +exists, and fall back to +~/\&.tig_history +if it does not exist\&. +.RE .SH "BUGS" .sp Please visit Tig\(cqs \m[blue]\fBhome page\fR\m[]\&\s-2\u[1]\d\s+2 or \m[blue]\fBmain Git repository\fR\m[]\&\s-2\u[2]\d\s+2 for information about new releases and how to report bugs or feature request\&. @@ -432,7 +452,7 @@ .IP " 1." 4 home page .RS 4 -\%http://jonas.nitro.dk/tig +\%https://jonas.github.io/tig .RE .IP " 2." 4 main Git repository diff -Nru tig-2.2/doc/tig.1.adoc tig-2.3.0/doc/tig.1.adoc --- tig-2.2/doc/tig.1.adoc 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/tig.1.adoc 2017-09-29 15:15:26.000000000 +0000 @@ -34,7 +34,7 @@ ------- Command line options recognized by Tig include all valid git-log(1) and -git-diff(1) options, as well as the following subcommands and Tig specific +git-diff(1) options, as well as the following subcommands and Tig-specific options. The first command line parameter not starting with "-" is interpreted as being either a revision specification or a path and will end the option parsing. All additional options will be passed to the underlying Git command. @@ -126,7 +126,7 @@ $ tig test master ----------------------------------------------------------------------------- -Display all branches: +Pretend as if all the refs in `refs/` are listed on the command line: ----------------------------------------------------------------------------- $ tig --all ----------------------------------------------------------------------------- @@ -191,7 +191,8 @@ endif::version[] TIGRC_USER:: - Path of the user configuration file (defaults to `~/.tigrc`). + Path of the user configuration file (defaults to `~/.tigrc` or + `$XDG_CONFIG_HOME/tig/config`). TIGRC_SYSTEM:: Path of the system wide configuration file (defaults to @@ -199,7 +200,7 @@ configuration. TIG_LS_REMOTE:: - Set command for retrieving all repository references. The command + Command for retrieving all repository references. The command should output data in the same format as git-ls-remote(1). TIG_DIFF_OPTS:: @@ -222,7 +223,7 @@ FILES ----- -'$XDG_CONFIG_HOME/tig/config:: +'$XDG_CONFIG_HOME/tig/config':: '~/.config/tig/config':: '~/.tigrc':: The Tig user configuration file is loaded in the following way. If @@ -236,15 +237,26 @@ System wide configuration file. '$GIT_DIR/config':: -'~/.gitconfig:: -'{sysconfdir}/gitconfig:: +'~/.gitconfig':: +'{sysconfdir}/gitconfig':: Git configuration files. Read on start-up with the help of git-config(1). +'$XDG_DATA_HOME/tig/history':: +'~/.local/share/tig/history':: +'~/.tig_history':: + When compiled with readline support, Tig writes a persistent command and + search history. The location of the history file is determined in the + following way. If `$XDG_DATA_HOME` is set and `$XDG_DATA_HOME/tig/` + exists, store history to `$XDG_DATA_HOME/tig/history`. If + `$XDG_CONFIG_HOME` is empty or undefined, store history to + `~/.local/share/tig/history` if the directory `~/.local/share/tig/` + exists, and fall back to `~/.tig_history` if it does not exist. + BUGS ---- -Please visit Tig's http://jonas.nitro.dk/tig[home page] or +Please visit Tig's https://jonas.github.io/tig[home page] or https://github.com/jonas/tig[main Git repository] for information about new releases and how to report bugs or feature request. diff -Nru tig-2.2/doc/tig.1.html tig-2.3.0/doc/tig.1.html --- tig-2.2/doc/tig.1.html 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/tig.1.html 2017-09-29 15:15:26.000000000 +0000 @@ -774,7 +774,7 @@

    OPTIONS

    Command line options recognized by Tig include all valid git-log(1) and -git-diff(1) options, as well as the following subcommands and Tig specific +git-diff(1) options, as well as the following subcommands and Tig-specific options. The first command line parameter not starting with "-" is interpreted as being either a revision specification or a path and will end the option parsing. All additional options will be passed to the underlying Git command.

    @@ -933,7 +933,7 @@
    $ tig test master
    -

    Display all branches:

    +

    Pretend as if all the refs in refs/ are listed on the command line:

    $ tig --all
    @@ -999,7 +999,8 @@

    - Path of the user configuration file (defaults to ~/.tigrc). + Path of the user configuration file (defaults to ~/.tigrc or + $XDG_CONFIG_HOME/tig/config).

    @@ -1017,7 +1018,7 @@

    - Set command for retrieving all repository references. The command + Command for retrieving all repository references. The command should output data in the same format as git-ls-remote(1).

    @@ -1067,7 +1068,7 @@
    -'$XDG_CONFIG_HOME/tig/config +$XDG_CONFIG_HOME/tig/config
    ~/.config/tig/config @@ -1097,10 +1098,10 @@ $GIT_DIR/config
    -'~/.gitconfig +~/.gitconfig
    -'++SYSCONFDIR++/gitconfig +++SYSCONFDIR++/gitconfig

    @@ -1108,13 +1109,33 @@ git-config(1).

    +
    +$XDG_DATA_HOME/tig/history +
    +
    +~/.local/share/tig/history +
    +
    +~/.tig_history +
    +
    +

    + When compiled with readline support, Tig writes a persistent command and + search history. The location of the history file is determined in the + following way. If $XDG_DATA_HOME is set and $XDG_DATA_HOME/tig/ + exists, store history to $XDG_DATA_HOME/tig/history. If + $XDG_CONFIG_HOME is empty or undefined, store history to + ~/.local/share/tig/history if the directory ~/.local/share/tig/ + exists, and fall back to ~/.tig_history if it does not exist. +

    +

    BUGS

    -

    Please visit Tig’s home page or +

    Please visit Tig’s home page or main Git repository for information about new releases and how to report bugs or feature request.

    @@ -1141,7 +1162,7 @@

    diff -Nru tig-2.2/doc/tigmanual.7 tig-2.3.0/doc/tigmanual.7 --- tig-2.2/doc/tigmanual.7 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/tigmanual.7 2017-09-29 15:15:26.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: tigmanual .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 -.\" Date: 08/10/2016 +.\" Date: 09/29/2017 .\" Manual: Tig Manual -.\" Source: Tig 2.2 +.\" Source: Tig 2.3.0 .\" Language: English .\" -.TH "TIGMANUAL" "7" "08/10/2016" "Tig 2\&.2" "Tig Manual" +.TH "TIGMANUAL" "7" "09/29/2017" "Tig 2\&.3\&.0" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -324,7 +324,7 @@ %(diffargs) T}:T{ .sp -Options from \fIdiff\-options\fR or \fITIG_DIFF_OPTS\fR used used by the diff view\&. +Options from \fIdiff\-options\fR or \fITIG_DIFF_OPTS\fR used by the diff and stage view\&. T} T{ .sp @@ -551,7 +551,7 @@ Several options related to the interface with Git can be configured via environment options\&. .SS "Configuration Files" .sp -Upon startup, Tig first reads the system wide configuration file ({sysconfdir}/tigrc by default) and then proceeds to read the user\(cqs configuration file (~/\&.tigrc by default)\&. The paths to either of these files can be overridden through the following environment variables: +Upon startup, Tig first reads the system wide configuration file ({sysconfdir}/tigrc by default) and then proceeds to read the user\(cqs configuration file (~/\&.tigrc or $XDG_CONFIG_HOME/tig/config by default)\&. The paths to either of these files can be overridden through the following environment variables: .PP TIGRC_USER .RS 4 @@ -562,7 +562,23 @@ .RS 4 Path of the system wide configuration file\&. .RE -.SS "Repository References" +.sp +History Files +.sp +.if n \{\ +.RS 4 +.\} +.nf +If compiled with readline support, Tig writes a persistent command and search +history to `~/\&.tig_history` or `$XDG_DATA_HOME/tig/history`\&. + +[[repo\-refs]] +Repository References +.fi +.if n \{\ +.RE +.\} +.sp .sp Commits that are referenced by tags and branch heads will be marked by the reference name surrounded by \fI[\fR and \fI]\fR: .sp @@ -594,7 +610,7 @@ .PP TIG_LS_REMOTE .RS 4 -Set command for retrieving all repository references\&. The command should output data in the same format as git\-ls\-remote(1)\&. Defaults to: +Command for retrieving all repository references\&. The command should output data in the same format as git\-ls\-remote(1)\&. Defaults to: .RE .sp .if n \{\ @@ -800,7 +816,7 @@ Up T}:T{ .sp -This key is "context sensitive" and will move the cursor one line up\&. However, if you opened a diff view from the main view (split\- or full\-screen) it will change the cursor to point to the previous commit in the main view and update the diff view to display it\&. +This key is "context sensitive" and will move the cursor one line up\&. However, if you opened a diff view from the main view (split\- or full\-screen) it will change the cursor to point to the previous commit in the main view and update the diff view to display it\&. If you prefer this key to move the cursor or scroll within the diff view instead, use bind diff move\-up or bind diff scroll\-line\-up, respectively\&. T} T{ .sp @@ -979,14 +995,14 @@ T} T{ .sp -ScrBack +ScrollBack T}:T{ .sp Scroll view one page up\&. T} T{ .sp -ScrFwd +ScrollFwd T}:T{ .sp Scroll view one page down\&. @@ -1195,7 +1211,7 @@ : T}:T{ .sp -Open prompt\&. This allows you to specify what command to run\&. +Open prompt\&. This allows you to specify what command to run and also to jump to a specific line, e\&.g\&. :23 T} T{ .sp @@ -1225,6 +1241,8 @@ lt lt lt lt lt lt +lt lt +lt lt lt lt. T{ .sp @@ -1284,6 +1302,13 @@ T} T{ .sp +:save\-view +T}:T{ +.sp +Save view info to (for testing purposes)\&. +T} +T{ +.sp :script T}:T{ .sp @@ -1296,6 +1321,13 @@ .sp Execute command using with external user\-defined command option flags defined in \&. T} +T{ +.sp +:echo +T}:T{ +.sp +Display text in the status bar\&. +T} .TE .sp 1 .SS "External Commands" @@ -1525,7 +1557,7 @@ .IP " 1." 4 home page .RS 4 -\%http://jonas.nitro.dk/tig +\%https://jonas.github.io/tig .RE .IP " 2." 4 main Git repository diff -Nru tig-2.2/doc/tigrc.5 tig-2.3.0/doc/tigrc.5 --- tig-2.2/doc/tigrc.5 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/doc/tigrc.5 2017-09-29 15:15:26.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: tigrc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 -.\" Date: 08/10/2016 +.\" Date: 09/29/2017 .\" Manual: Tig Manual -.\" Source: Tig 2.2 +.\" Source: Tig 2.3.0 .\" Language: English .\" -.TH "TIGRC" "5" "08/10/2016" "Tig 2\&.2" "Tig Manual" +.TH "TIGRC" "5" "09/29/2017" "Tig 2\&.3\&.0" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,6 +45,8 @@ The hash mark (\fI#\fR) is used as a \fIcomment\fR character\&. All text after the comment character to the end of the line is ignored\&. You can use comments to annotate your initialization file\&. .sp Certain options can be manipulated at runtime via the option menu\&. In addition, options can also be toggled with the :toggle prompt command or by entering the configuration command into the prompt\&. +.sp +In some environments, a user\(cqs configuration will be stored in the alternate location $XDG_CONFIG_HOME/tig/config\&. For brevity, this document will refer only to ~/\&.tigrc\&. .SH "GIT CONFIGURATION" .sp Alternatively to using ~/\&.tigrc, Tig options can be set by putting them in one of the Git configuration files, which are read by Tig on startup\&. See \fIgit\-config(1)\fR for which files to use\&. The following example show the basic syntax to use for settings, bindings and colors\&. @@ -181,28 +183,28 @@ .PP \fIdiff\-options\fR (string) .RS 4 -A space separated string of diff options to use in the diff view\&. git\-show(1) is used for formatting and always passes \-\-patch\-with\-stat\&. This option overrides any options specified in the TIG_DIFF_OPTS environment variable (described in +A space\-separated string of diff options to use in the diff view\&. git\-show(1) is used for formatting and always passes \-\-patch\-with\-stat\&. This option overrides any options specified in the TIG_DIFF_OPTS environment variable (described in \fBtig\fR(1)), but is itself overridden by diff flags given on the command line invocation\&. .RE .PP \fIblame\-options\fR (string) .RS 4 -A space separated string of default blame options\&. Can be used for telling git\-blame(1) how to detect the origin of lines\&. The options are ignored when Tig is started in blame mode and given blame options on the command line\&. +A space\-separated string of default blame options\&. Can be used for telling git\-blame(1) how to detect the origin of lines\&. The options are ignored when Tig is started in blame mode and given blame options on the command line\&. .RE .PP \fIlog\-options\fR (string) .RS 4 -A space separated string of default options that should be passed to the git\-log(1) command used by the log view\&. Options can be overridden by command line options\&. Used internally override custom \(oqpretty\&.format\(cq settings that break the log view\&. +A space\-separated string of default options that should be passed to the git\-log(1) command used by the log view\&. Options can be overridden by command line options\&. Used internally override custom \(oqpretty\&.format\(cq settings that break the log view\&. .RE .PP \fImain\-options\fR (string) .RS 4 -A space separated string of default options that should be passed to the git\-log(1) command used by the main view\&. Options can be overridden by command line options\&. +A space\-separated string of default options that should be passed to the git\-log(1) command used by the main view\&. Options can be overridden by command line options\&. .RE .PP \fIreference\-format\fR (string) .RS 4 -A space separated string of format strings used for formatting reference names\&. Wrap the name of the reference type with the characters you would like to use for formatting, e\&.g\&. +A space\-separated string of format strings used for formatting reference names\&. Wrap the name of the reference type with the characters you would like to use for formatting, e\&.g\&. [tag] and \&. If no format is specified for @@ -300,6 +302,11 @@ What type of character graphics for line drawing\&. .RE .PP +\fItruncation\-delimiter\fR (mixed) [utf\-8|] +.RS 4 +A single character to draw where columns are truncated\&. The default is "~"\&. The special value "utf\-8" refers to the character "\&..." ("Midline Horizontal Ellipsis")\&. +.RE +.PP \fIhorizontal\-scroll\fR (mixed) .RS 4 Interval to scroll horizontally in each step\&. Can be specified either as the number of columns, e\&.g\&. @@ -311,7 +318,7 @@ .PP \fIgit\-colors\fR (list) .RS 4 -A space separated list of "key=value" pairs where the key is a Git color name and the value is a Tig color name, e\&.g\&. "branch\&.current=main\-head" and "grep\&.filename=grep\&.file"\&. Set to "no" to disable\&. +A space\-separated list of "key=value" pairs where the key is a Git color name and the value is a Tig color name, e\&.g\&. "branch\&.current=main\-head" and "grep\&.filename=grep\&.file"\&. Set to "no" to disable\&. .RE .PP \fIshow\-notes\fR (mixed) [|] @@ -346,13 +353,20 @@ \fI50%\fR\&. .RE .PP -\fIstatus\-untracked\-dirs\fR (bool) +\fIstatus\-show\-untracked\-dirs\fR (bool) .RS 4 Show untracked directories contents in the status view (analog to git ls\-files \-\-directory option)\&. On by default\&. .RE .PP +\fIstatus\-show\-untracked\-files\fR (bool) +.RS 4 +Show untracked files in the status view (mirrors Git\(cqs +status\&.showUntrackedFiles +option)\&. On by default\&. +.RE +.PP \fItab\-size\fR (int) .RS 4 Number of spaces per tab\&. The default is 8 spaces\&. @@ -363,12 +377,40 @@ Number of context lines to show for diffs\&. .RE .PP +\fIdiff\-highlight\fR (mixed) +.RS 4 +Whether to highlight diffs using Git\(cqs +\fIdiff\-highlight\fR +program\&. Defaults to false\&. When set to true then +\fIdiff\-highlight\fR +is used, else the option value is used as the path\&. When this option is in effect, highlighted regions are governed by +color diff\-add\-highlight +and +color diff\-del\-highlight\&. +.RE +.PP \fIignore\-space\fR (mixed) [no|all|some|at\-eol|] .RS 4 Ignore space changes in diff view\&. By default no space changes are ignored\&. Changing this to "all", "some" or "at\-eol" is equivalent to passing "\-\-ignore\-all\-space", "\-\-ignore\-space" or "\-\-ignore\-space\-at\-eol" respectively to git diff or git show\&. + + +\fBWarning:\fR +when +ignore\-space +is set to +some, +all +or +at\-eol, then the +\fBstatus\-update\fR +and +\fBstatus\-revert\fR +may fail when updating or reverting chunks containing lines with space changes\&. Similarly, +\fBstage\-update\-line\fR +may fail when updating a line adjacent to a line with space changes .RE .PP \fIcommit\-order\fR (enum) [auto|default|topo|date|author\-date|reverse] @@ -376,9 +418,9 @@ Commit ordering using the default (chronological reverse) order, topological order, date order or reverse order\&. When set to "auto" (which is the default), topological order is automatically used in the main view when the commit graph is enabled\&. In repositories with a long commit history it is advised to set this option to "default" to speed up loading of the main view\&. .RE .PP -\fIignore\-case\fR (bool) +\fIignore\-case\fR (enum) [no|yes|smart\-case] .RS 4 -Ignore case in searches\&. By default, the search is case sensitive\&. +Ignore case in searches\&. "smart\-case" ignores case if the search string doesn\(cqt contain any uppercase letters\&. By default, the search is case sensitive\&. .RE .PP \fImailmap\fR (bool) @@ -406,6 +448,13 @@ vim +10 tig\&.c .RE .PP +\fIhistory\-size\fR (int) +.RS 4 +Size of the persistent +~/\&.tig_history +file when compiled with readline support\&. Default is 500\&. Set to 0 to disable\&. +.RE +.PP \fImouse\fR (bool) .RS 4 Whether to enable mouse support\&. Off by default since it makes selecting text from the terminal less intuitive\&. When enabled hold down Shift (or Option on Mac) to select text\&. Mouse support requires that ncurses itself support mouse events\&. @@ -417,6 +466,13 @@ set mouse = true\&. .RE .PP +\fImouse\-wheel\-cursor\fR (bool) +.RS 4 +Whether to prefer moving the cursor to scrolling the view when using the mouse wheel\&. Off by default\&. Combines well with +set mouse\-scroll = 1\&. Mouse support requires that ncurses itself support mouse events and that you have enabled mouse support in ~/\&.tigrc with +set mouse = true\&. +.RE +.PP \fIrefresh\-mode\fR (mixed) [manual|auto|after\-command|periodic|] .RS 4 Configures how views are refreshed based on modifications to watched files in the repository\&. When set to @@ -449,7 +505,7 @@ .RE .SS "View settings" .sp -The view settings define the order and options for the different columns of a view\&. Each view setting expects a space separated list of column specifications\&. Column specifications starts with the column type, and can optionally be followed by a colon (:) and a list of column options\&. E\&.g\&. the following column specification defines an \fIauthor\fR column displaying the author email and with a maximum width of 20 characters: author:email,width=20\&. +The view settings define the order and options for the different columns of a view\&. Each view setting expects a space\-separated list of column specifications\&. Column specifications starts with the column type, and can optionally be followed by a colon (:) and a list of column options\&. E\&.g\&. the following column specification defines an \fIauthor\fR column displaying the author email and with a maximum width of 20 characters: author:email,width=20\&. .sp The first option value in a column specification is always the \fIdisplay\fR option\&. When no \fIdisplay\fR value is given, \fIyes\fR is assumed\&. For \fIdisplay\fR options expecting an enumerated value this will automatically resolve to the default enum value\&. For example, file\-name will automatically have its \fIdisplay\fR setting resolve to \fIauto\fR\&. .sp @@ -876,19 +932,6 @@ \fIdisplay\fR (mixed) [no|short|long|]: How to display the status label\&. .RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fIwidth\fR -(int): Width of the column\&. When set to zero, the width is automatically sized to fit the content\&. -.RE .RE .PP text @@ -968,6 +1011,8 @@ .sp .sp Keys are mapped by first searching the keybindings for the current view, then the keybindings for the \fBgeneric\fR keymap, and last the default keybindings\&. Thus, the view keybindings override the generic keybindings which override the built\-in keybindings\&. +.sp +Keybindings at the line\-entry prompt are typically governed by the readline library, and are configured separately in ~/\&.inputrc\&. See \fIreadline(1)\fR\&. Tig respects but does not require an $if tig section in ~/\&.inputrc\&. .PP Keymaps .RS 4 @@ -1006,7 +1051,7 @@ key\&. .RE .sp -\fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR\&. +\fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR or \fB\fR, \fB\fR, \fB\fR, \fB\fR \&... \fB\fR .sp To define key mappings with the Ctrl key, use \&. In addition, key combos consisting of an initial Escape key followed by a normal key value can be bound using key\&. .sp @@ -1020,18 +1065,109 @@ bind main next bind main scroll\-page\-down bind main o options +bind main parent .fi .if n \{\ .RE .\} .sp .sp -Note that due to the way ncurses encodes Ctrl key mappings, Ctrl\-m and Ctrl\-i cannot be bound as they conflict with \fIEnter\fR and \fITab\fR respectively\&. Furthermore, ncurses does not allow to distinguish between Ctrl\-f and Ctrl\-F\&. Finally, Ctrl\-z is automatically used for process control and will suspend Tig and open a subshell (use fg to reenter Tig)\&. +Notes +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Tig reads keystrokes via ncurses and is subject to various limitations\&. See +\fIncurses(3x)\fR +and +\fIterminfo(5)\fR +(or termcap)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} + +Ctrl\-m +and +Ctrl\-i +cannot be bound as they conflict with +\fIEnter\fR +and +\fITab\fR +respectively\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Case differences cannot be distinguished in control sequences such as +Ctrl\-f +and +Ctrl\-F\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} + +Ctrl\- +is typically translated to +Ctrl\-@, which is available for binding\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Only some subset of special symbolic keys such as + +will be available in any given terminal emulator\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} + +Ctrl\-z +is automatically used for process control and will suspend Tig and open a subshell (use +fg +to reenter Tig)\&. .PP Actions .RS 4 Actions are either specified as user\-defined commands (external or internal) or using action names as described in the following sections\&. .RE +.RE .SS "External user\-defined command" .sp These actions start with one or more of the following option flags followed by the command that should be executed\&. @@ -1040,6 +1176,7 @@ lt lt lt lt lt lt +lt lt lt lt. T{ .sp @@ -1057,6 +1194,13 @@ T} T{ .sp ++ +T}:T{ +.sp +Run the command synchronously, and echo the first line of output to the status bar\&. +T} +T{ +.sp ? T}:T{ .sp @@ -1215,7 +1359,7 @@ %(diffargs) T}:T{ .sp -Options from \fIdiff\-options\fR or \fITIG_DIFF_OPTS\fR used used by the diff view\&. +Options from \fIdiff\-options\fR or \fITIG_DIFF_OPTS\fR used by the diff and stage view\&. T} T{ .sp @@ -1310,12 +1454,15 @@ .RS 4 .\} .nf -# Save save the current commit as a patch file when the user selects a -# commit in the main view and presses \*(AqS\*(Aq\&. +# Save the current commit as a patch file when the user selects a commit +# in the main view and presses \*(AqS\*(Aq\&. bind main S !git format\-patch \-1 %(commit) # Create and checkout a new branch; specify custom prompt bind main B ?git checkout \-b "%(prompt Enter new branch name: )" + +# Show commit statistics for the author under the cursor +bind main U +sh \-c \*(Aqgit \-\-no\-pager shortlog \-s \-\-author="$(git show \-s \-\-format=%aE %(commit))" `. If no format is specified for `local-tag`, the format for `tag` is used. Similarly, if no @@ -190,6 +194,12 @@ What type of character graphics for line drawing. +'truncation-delimiter' (mixed) [utf-8|]:: + + A single character to draw where columns are truncated. The default is + "~". The special value "utf-8" refers to the character "⋯" + ("Midline Horizontal Ellipsis"). + 'horizontal-scroll' (mixed):: Interval to scroll horizontally in each step. Can be specified either @@ -200,7 +210,7 @@ 'git-colors' (list):: - A space separated list of "key=value" pairs where the key is a Git color + A space-separated list of "key=value" pairs where the key is a Git color name and the value is a Tig color name, e.g. "branch.current=main-head" and "grep.filename=grep.file". Set to "no" to disable. @@ -237,11 +247,16 @@ ensured that the smaller of the views is at least four columns wide. The default is '50%'. -'status-untracked-dirs' (bool):: +'status-show-untracked-dirs' (bool):: Show untracked directories contents in the status view (analog to `git ls-files --directory` option). On by default. +'status-show-untracked-files' (bool):: + + Show untracked files in the status view (mirrors Git's + `status.showUntrackedFiles` option). On by default. + 'tab-size' (int):: Number of spaces per tab. The default is 8 spaces. @@ -250,12 +265,26 @@ Number of context lines to show for diffs. +'diff-highlight' (mixed):: + + Whether to highlight diffs using Git's 'diff-highlight' program. Defaults + to false. When set to true then 'diff-highlight' is used, else the option + value is used as the path. When this option is in effect, highlighted + regions are governed by `color diff-add-highlight` and + `color diff-del-highlight`. + 'ignore-space' (mixed) [no|all|some|at-eol|]:: Ignore space changes in diff view. By default no space changes are ignored. Changing this to "all", "some" or "at-eol" is equivalent to passing "--ignore-all-space", "--ignore-space" or - "--ignore-space-at-eol" respectively to `git diff` or `git show`. + "--ignore-space-at-eol" respectively to `git diff` or `git show`. + + + + *Warning:* when `ignore-space` is set to `some`, `all` or `at-eol`, then + the *status-update* and *status-revert* may fail when updating or + reverting chunks containing lines with space changes. Similarly, + *stage-update-line* may fail when updating a line adjacent to a line + with space changes 'commit-order' (enum) [auto|default|topo|date|author-date|reverse]:: @@ -266,9 +295,11 @@ commit history it is advised to set this option to "default" to speed up loading of the main view. -'ignore-case' (bool):: +'ignore-case' (enum) [no|yes|smart-case]:: - Ignore case in searches. By default, the search is case sensitive. + Ignore case in searches. "smart-case" ignores case if the search string + doesn't contain any uppercase letters. By default, the search is case + sensitive. 'mailmap' (bool):: @@ -292,6 +323,11 @@ line number is passed as `+` in front of the file name. Example: `vim +10 tig.c` +'history-size' (int):: + + Size of the persistent `~/.tig_history` file when compiled with readline + support. Default is 500. Set to 0 to disable. + 'mouse' (bool):: Whether to enable mouse support. Off by default since it makes selecting @@ -305,6 +341,13 @@ Mouse support requires that ncurses itself support mouse events and that you have enabled mouse support in ~/.tigrc with `set mouse = true`. +'mouse-wheel-cursor' (bool):: + + Whether to prefer moving the cursor to scrolling the view when using the + mouse wheel. Off by default. Combines well with `set mouse-scroll = 1`. + Mouse support requires that ncurses itself support mouse events and that + you have enabled mouse support in ~/.tigrc with `set mouse = true`. + 'refresh-mode' (mixed) [manual|auto|after-command|periodic|]:: Configures how views are refreshed based on modifications to watched @@ -333,7 +376,7 @@ ~~~~~~~~~~~~~ The view settings define the order and options for the different columns of a -view. Each view setting expects a space separated list of column specifications. +view. Each view setting expects a space-separated list of column specifications. Column specifications starts with the column type, and can optionally be followed by a colon (`:`) and a list of column options. E.g. the following column specification defines an 'author' column displaying the author email and @@ -464,8 +507,6 @@ status:: - 'display' (mixed) [no|short|long|]: How to display the status label. - - 'width' (int): Width of the column. When set to zero, the width is - automatically sized to fit the content. text:: - 'commit-title-overflow' (bool or int): Whether to highlight commit @@ -525,6 +566,10 @@ Thus, the view keybindings override the generic keybindings which override the built-in keybindings. +Keybindings at the line-entry prompt are typically governed by the readline +library, and are configured separately in `~/.inputrc`. See 'readline(1)'. +Tig respects but does not require an `$if tig` section in `~/.inputrc`. + -- Keymaps:: @@ -545,8 +590,9 @@ **, **, **, **, ** or **, **, **, **, **, ** or **, ** or **, **, ** or **, **, **, ** or **, -** or **, **, **, **, **, **, **, -**, **, **, **, **, **. +** or **, ** or **, ** or +**, ** or **, **, **, +** or **, **, **, ** ... ** To define key mappings with the `Ctrl` key, use ``. In addition, key combos consisting of an initial `Escape` key followed by a normal key value can @@ -559,13 +605,28 @@ bind main next bind main scroll-page-down bind main o options +bind main parent -------------------------------------------------------------------------- -Note that due to the way ncurses encodes `Ctrl` key mappings, `Ctrl-m` and -`Ctrl-i` cannot be bound as they conflict with 'Enter' and 'Tab' respectively. -Furthermore, ncurses does not allow to distinguish between `Ctrl-f` and -`Ctrl-F`. Finally, `Ctrl-z` is automatically used for process control and will -suspend Tig and open a subshell (use `fg` to reenter Tig). +Notes + +- Tig reads keystrokes via ncurses and is subject to various limitations. See + 'ncurses(3x)' and 'terminfo(5)' (or termcap). + +- `Ctrl-m` and `Ctrl-i` cannot be bound as they conflict with 'Enter' and 'Tab' + respectively. + +- Case differences cannot be distinguished in control sequences such as + `Ctrl-f` and `Ctrl-F`. + +- `Ctrl-` is typically translated to `Ctrl-@`, which is available for + binding. + +- Only some subset of special symbolic keys such as `` will be + available in any given terminal emulator. + +- `Ctrl-z` is automatically used for process control and will suspend Tig and + open a subshell (use `fg` to reenter Tig). Actions:: @@ -584,6 +645,8 @@ |============================================================================= |! |Run the command in the foreground with output shown. |@ |Run the command in the background with no output. +|+ |Run the command synchronously, and echo the first line + of output to the status bar. |? |Prompt the user before executing the command. |< |Exit Tig after executing the command. |============================================================================= @@ -618,7 +681,7 @@ |%(fileargs) |The file arguments passed on the command line. |%(cmdlineargs) |All other options passed on the command line. |%(diffargs) |Options from 'diff-options' or 'TIG_DIFF_OPTS' used - used by the diff view. + by the diff and stage view. |%(blameargs) |Options from 'blame-options' used by the blame view. |%(logargs) |Options from 'log-options' used by the log view. |%(mainargs) |Options from 'main-options' used by the main view. @@ -642,12 +705,15 @@ Examples: // TEST: tigrc -------------------------------------------------------------------------- -# Save save the current commit as a patch file when the user selects a -# commit in the main view and presses 'S'. +# Save the current commit as a patch file when the user selects a commit +# in the main view and presses 'S'. bind main S !git format-patch -1 %(commit) # Create and checkout a new branch; specify custom prompt bind main B ?git checkout -b "%(prompt Enter new branch name: )" + +# Show commit statistics for the author under the cursor +bind main U +sh -c 'git --no-pager shortlog -s --author="$(git show -s --format=%aE %(commit))"

    Certain options can be manipulated at runtime via the option menu. In addition, options can also be toggled with the :toggle prompt command or by entering the configuration command into the prompt.

    +

    In some environments, a user’s configuration will be stored in the alternate +location $XDG_CONFIG_HOME/tig/config. For brevity, this document will +refer only to ~/.tigrc.

    @@ -920,7 +923,7 @@

    - A space separated string of diff options to use in the diff view. + A space-separated string of diff options to use in the diff view. git-show(1) is used for formatting and always passes --patch-with-stat. This option overrides any options specified in the TIG_DIFF_OPTS environment variable (described in tig(1)), but is itself @@ -932,7 +935,7 @@

    - A space separated string of default blame options. Can be used for + A space-separated string of default blame options. Can be used for telling git-blame(1) how to detect the origin of lines. The options are ignored when Tig is started in blame mode and given blame options on the command line. @@ -943,7 +946,7 @@

    - A space separated string of default options that should be passed to the + A space-separated string of default options that should be passed to the git-log(1) command used by the log view. Options can be overridden by command line options. Used internally override custom ‘pretty.format’ settings that break the log view. @@ -954,7 +957,7 @@

    - A space separated string of default options that should be passed to the + A space-separated string of default options that should be passed to the git-log(1) command used by the main view. Options can be overridden by command line options.

    @@ -964,7 +967,7 @@

    - A space separated string of format strings used for formatting reference + A space-separated string of format strings used for formatting reference names. Wrap the name of the reference type with the characters you would like to use for formatting, e.g. [tag] and <remote>. If no format is specified for local-tag, the format for tag is used. Similarly, if no @@ -1019,6 +1022,16 @@

    +truncation-delimiter (mixed) [utf-8|<string>] +
    +
    +

    + A single character to draw where columns are truncated. The default is + "~". The special value "utf-8" refers to the character "⋯" + ("Midline Horizontal Ellipsis"). +

    +
    +
    horizontal-scroll (mixed)
    @@ -1035,7 +1048,7 @@

    - A space separated list of "key=value" pairs where the key is a Git color + A space-separated list of "key=value" pairs where the key is a Git color name and the value is a Tig color name, e.g. "branch.current=main-head" and "grep.filename=grep.file". Set to "no" to disable.

    @@ -1094,7 +1107,7 @@

    -status-untracked-dirs (bool) +status-show-untracked-dirs (bool)

    @@ -1103,6 +1116,15 @@

    +status-show-untracked-files (bool) +
    +
    +

    + Show untracked files in the status view (mirrors Git’s + status.showUntrackedFiles option). On by default. +

    +
    +
    tab-size (int)
    @@ -1119,6 +1141,18 @@

    +diff-highlight (mixed) +
    +
    +

    + Whether to highlight diffs using Git’s diff-highlight program. Defaults + to false. When set to true then diff-highlight is used, else the option + value is used as the path. When this option is in effect, highlighted + regions are governed by color diff-add-highlight and + color diff-del-highlight. +

    +
    +
    ignore-space (mixed) [no|all|some|at-eol|<bool>]
    @@ -1126,7 +1160,13 @@ Ignore space changes in diff view. By default no space changes are ignored. Changing this to "all", "some" or "at-eol" is equivalent to passing "--ignore-all-space", "--ignore-space" or - "--ignore-space-at-eol" respectively to git diff or git show. + "--ignore-space-at-eol" respectively to git diff or git show.
    +
    + Warning: when ignore-space is set to some, all or at-eol, then + the status-update and status-revert may fail when updating or + reverting chunks containing lines with space changes. Similarly, + stage-update-line may fail when updating a line adjacent to a line + with space changes

    @@ -1143,11 +1183,13 @@

    -ignore-case (bool) +ignore-case (enum) [no|yes|smart-case]

    - Ignore case in searches. By default, the search is case sensitive. + Ignore case in searches. "smart-case" ignores case if the search string + doesn’t contain any uppercase letters. By default, the search is case + sensitive.

    @@ -1189,6 +1231,15 @@

    +history-size (int) +
    +
    +

    + Size of the persistent ~/.tig_history file when compiled with readline + support. Default is 500. Set to 0 to disable. +

    +
    +
    mouse (bool)
    @@ -1210,6 +1261,17 @@

    +mouse-wheel-cursor (bool) +
    +
    +

    + Whether to prefer moving the cursor to scrolling the view when using the + mouse wheel. Off by default. Combines well with set mouse-scroll = 1. + Mouse support requires that ncurses itself support mouse events and that + you have enabled mouse support in ~/.tigrc with set mouse = true. +

    +
    +
    refresh-mode (mixed) [manual|auto|after-command|periodic|<bool>]
    @@ -1254,7 +1316,7 @@

    View settings

    The view settings define the order and options for the different columns of a -view. Each view setting expects a space separated list of column specifications. +view. Each view setting expects a space-separated list of column specifications. Column specifications starts with the column type, and can optionally be followed by a colon (:) and a list of column options. E.g. the following column specification defines an author column displaying the author email and @@ -1577,12 +1639,6 @@ label.

    -
  • -

    -width (int): Width of the column. When set to zero, the width is - automatically sized to fit the content. -

    -
  • @@ -1652,6 +1708,9 @@ the keybindings for the generic keymap, and last the default keybindings. Thus, the view keybindings override the generic keybindings which override the built-in keybindings.

    +

    Keybindings at the line-entry prompt are typically governed by the readline +library, and are configured separately in ~/.inputrc. See readline(1). +Tig respects but does not require an $if tig section in ~/.inputrc.

    @@ -1682,8 +1741,9 @@

    <Enter>, <Space>, <Backspace>, <Tab>, <Escape> or <Esc>, <Left>, <Right>, <Up>, <Down>, <Insert> or <Ins>, <Delete> or <Del>, <Hash>, <LessThan> or <LT>, <Home>, <End>, <PageUp> or <PgUp>, -<PageDown> or <PgDown>, <F1>, <F2>, <F3>, <F4>, <F5>, <F6>, -<F7>, <F8>, <F9>, <F10>, <F11>, <F12>.

    +<PageDown> or <PgDown>, <ScrollBack> or <SBack>, <ScrollFwd> or +<SFwd>, <ShiftTab> or <BackTab>, <ShiftLeft>, <ShiftRight>, +<ShiftDelete> or <ShiftDel>, <ShiftHome>, <ShiftEnd>, <F1><F19>

    To define key mappings with the Ctrl key, use <Ctrl-key>. In addition, key combos consisting of an initial Escape key followed by a normal key value can be bound using <Esc>key.

    @@ -1693,13 +1753,46 @@
    bind main R             refresh
     bind main <Down>        next
     bind main <Ctrl-f>      scroll-page-down
    -bind main <Esc>o        options
    +bind main <Esc>o options +bind main <ShiftTab> parent
    -

    Note that due to the way ncurses encodes Ctrl key mappings, Ctrl-m and -Ctrl-i cannot be bound as they conflict with Enter and Tab respectively. -Furthermore, ncurses does not allow to distinguish between Ctrl-f and -Ctrl-F. Finally, Ctrl-z is automatically used for process control and will -suspend Tig and open a subshell (use fg to reenter Tig).

    +

    Notes

    +
      +
    • +

      +Tig reads keystrokes via ncurses and is subject to various limitations. See + ncurses(3x) and terminfo(5) (or termcap). +

      +
    • +
    • +

      +Ctrl-m and Ctrl-i cannot be bound as they conflict with Enter and Tab + respectively. +

      +
    • +
    • +

      +Case differences cannot be distinguished in control sequences such as + Ctrl-f and Ctrl-F. +

      +
    • +
    • +

      +Ctrl-<Space> is typically translated to Ctrl-@, which is available for + binding. +

      +
    • +
    • +

      +Only some subset of special symbolic keys such as <ShiftTab> will be + available in any given terminal emulator. +

      +
    • +
    • +

      +Ctrl-z is automatically used for process control and will suspend Tig and + open a subshell (use fg to reenter Tig). +

      Actions @@ -1711,6 +1804,8 @@

      +
    • +

    External user-defined command

    @@ -1733,6 +1828,11 @@

    Run the command in the background with no output.

    +

    +

    +

    Run the command synchronously, and echo the first line + of output to the status bar.

    + +

    ?

    Prompt the user before executing the command.

    @@ -1820,7 +1920,7 @@

    %(diffargs)

    Options from diff-options or TIG_DIFF_OPTS used - used by the diff view.

    + by the diff and stage view.

    %(blameargs)

    @@ -1881,12 +1981,15 @@

    Examples:

    -
    # Save save the current commit as a patch file when the user selects a
    -# commit in the main view and presses 'S'.
    +
    # Save the current commit as a patch file when the user selects a commit
    +# in the main view and presses 'S'.
     bind main S !git format-patch -1 %(commit)
     
     # Create and checkout a new branch; specify custom prompt
    -bind main B ?git checkout -b "%(prompt Enter new branch name: )"
    +bind main B ?git checkout -b "%(prompt Enter new branch name: )" + +# Show commit statistics for the author under the cursor +bind main U +sh -c 'git --no-pager shortlog -s --author="$(git show -s --format=%aE %(commit))" </dev/tty'
    @@ -2063,6 +2166,10 @@

    Close the current view

    +

    view-close-no-quit

    +

    Close the current view without quitting

    + +

    quit

    Close all views and quit

    @@ -2071,7 +2178,7 @@
    -

    View specific actions

    +

    View-specific actions

    move-last-line

    + + + + + + + +

    Move cursor to last line

    move-next-merge

    Move cursor to next merge commit

    move-prev-merge

    Move cursor to previous merge commit

    @@ -2288,7 +2403,7 @@ color diff-index blue default color diff-chunk magenta default color "Reported-by:" green default -# View specific color +# View-specific color color tree.date black cyan bold

    Or in the Git configuration files:

    @@ -2300,7 +2415,7 @@ # UI colors title-blur = white blue title-focus = white blue bold -# View specific color +# View-specific color [tig "color.tree"] date = cyan default bold @@ -2316,7 +2431,7 @@ Valid built-in area names are described below. Note, all names are case-insensitive, and you may use -, and _ interchangeably, e.g. "Diff-Header" and "DIFF_HEADER" are the same. - View specific colors can be defined by prefixing the view name to + View-specific colors can be defined by prefixing the view name to the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".

    @@ -2558,7 +2673,7 @@

    diff-header, diff-chunk, diff-add, diff-add2, diff-del, -diff-del2

    +diff-del2, diff-add-highlight, diff-del-highlight

    Enhanced Git diff markup @@ -2627,9 +2742,12 @@

    Source commands make it possible to read additional configuration files. Sourced files are included in-place, meaning when a source command is encountered the file will be immediately read. Any commands later in the -current configuration file will take precedence. The syntax is:

    +current configuration file will take precedence.

    +

    If the given path does not exist, tig will proceed with a warning. Give +the -q parameter to suppress the warning.

    +

    The syntax is:

    -
    source path
    +
    source [-q] path

    Examples:

    @@ -2662,7 +2780,7 @@

    diff -Nru tig-2.2/.gitignore tig-2.3.0/.gitignore --- tig-2.2/.gitignore 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/.gitignore 2017-09-29 15:15:26.000000000 +0000 @@ -5,7 +5,9 @@ *.swp *~ .deps +/_book /config.make +/node_modules/ aclocal.m4 autom4te.cache config.h @@ -31,3 +33,4 @@ tig-*.tar.gz.md5 tig.spec tools/doc-gen +tig.dSYM diff -Nru tig-2.2/include/tig/argv.h tig-2.3.0/include/tig/argv.h --- tig-2.2/include/tig/argv.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/argv.h 2017-09-29 15:15:26.000000000 +0000 @@ -21,8 +21,10 @@ */ #define SIZEOF_ARG 32 /* Default argument array size. */ +#define DIFF_ARGS "%(diffargs)" -bool argv_to_string(const char *argv[SIZEOF_ARG], char *buf, size_t buflen, const char *sep); +bool argv_to_string(const char *argv[], char *buf, size_t buflen, const char *sep); +char *argv_to_string_alloc(const char *argv[], const char *sep); bool argv_to_string_quoted(const char *argv[SIZEOF_ARG], char *buf, size_t buflen, const char *sep); bool argv_from_string_no_quotes(const char *argv[SIZEOF_ARG], int *argc, char *cmd); bool argv_from_string(const char *argv[SIZEOF_ARG], int *argc, char *cmd); @@ -30,6 +32,7 @@ void argv_free(const char *argv[]); size_t argv_size(const char **argv); bool argv_append(const char ***argv, const char *arg); +bool argv_appendn(const char ***argv, const char *arg, size_t arglen); bool argv_append_array(const char ***dst_argv, const char *src_argv[]); bool argv_copy(const char ***dst, const char *src[]); bool argv_contains(const char **argv, const char *arg); diff -Nru tig-2.2/include/tig/diff.h tig-2.3.0/include/tig/diff.h --- tig-2.2/include/tig/diff.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/diff.h 2017-09-29 15:15:26.000000000 +0000 @@ -22,9 +22,11 @@ bool reading_diff_stat; bool combined_diff; bool adding_describe_ref; + bool highlight; const char *file; unsigned int lineno; struct position pos; + struct io view_io; }; enum request diff_common_edit(struct view *view, enum request request, struct line *line); @@ -34,6 +36,8 @@ void diff_common_select(struct view *view, struct line *line, const char *changes_msg); void diff_save_line(struct view *view, struct diff_state *state, enum open_flags flags); void diff_restore_line(struct view *view, struct diff_state *state); +enum status_code diff_init_highlight(struct view *view, struct diff_state *state); +bool diff_done_highlight(struct diff_state *state); unsigned int diff_get_lineno(struct view *view, struct line *line); const char *diff_get_pathname(struct view *view, struct line *line); diff -Nru tig-2.2/include/tig/display.h tig-2.3.0/include/tig/display.h --- tig-2.2/include/tig/display.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/display.h 2017-09-29 15:15:26.000000000 +0000 @@ -22,9 +22,10 @@ extern WINDOW *status_win; -void update_status(const char *msg, ...); +void update_status(const char *msg, ...) PRINTF_LIKE(1, 2); +void update_status_with_context(const char *context, const char *msg, ...) PRINTF_LIKE(2, 3); void report(const char *msg, ...) PRINTF_LIKE(1, 2); -#define report_clear() report("%s", "") +void report_clear(void); /* * Display management. @@ -46,11 +47,12 @@ void resize_display(void); void redraw_display(bool clear); bool save_display(const char *path); +bool save_view(struct view *view, const char *path); bool vertical_split_is_enabled(enum vertical_split vsplit, int height, int width); int apply_vertical_split(int base_width); -bool open_external_viewer(const char *argv[], const char *dir, bool silent, bool confirm, bool refresh, const char *notice); +bool open_external_viewer(const char *argv[], const char *dir, bool silent, bool confirm, bool echo, bool refresh, const char *notice); void open_editor(const char *file, unsigned int lineno); void enable_mouse(bool enable); diff -Nru tig-2.2/include/tig/git.h tig-2.3.0/include/tig/git.h --- tig-2.2/include/tig/git.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/git.h 2017-09-29 15:15:26.000000000 +0000 @@ -27,12 +27,12 @@ #define GIT_DIFF_STAGED(encoding_arg, context_arg, space_arg, old_name, new_name) \ "git", "diff-index", (encoding_arg), "--root", "--patch-with-stat", "-C", "-M", \ - "--cached", "--diff-filter=ACDMRTXB", (context_arg), (space_arg), "HEAD", \ + "--cached", "--diff-filter=ACDMRTXB", DIFF_ARGS, (context_arg), (space_arg), "HEAD", \ "--", (old_name), (new_name), NULL #define GIT_DIFF_UNSTAGED(encoding_arg, context_arg, space_arg, old_name, new_name) \ "git", "diff-files", (encoding_arg), "--root", "--patch-with-stat", "-C", "-M", \ - (context_arg), (space_arg), "--", (old_name), (new_name), NULL + DIFF_ARGS, (context_arg), (space_arg), "--", (old_name), (new_name), NULL /* Don't show staged unmerged entries. */ #define GIT_DIFF_STAGED_FILES(output_arg) \ diff -Nru tig-2.2/include/tig/graph.h tig-2.3.0/include/tig/graph.h --- tig-2.2/include/tig/graph.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/graph.h 2017-09-29 15:15:26.000000000 +0000 @@ -39,6 +39,7 @@ const char *id, const char *parents, bool is_boundary); bool (*add_parent)(struct graph *graph, const char *parent); bool (*render_parents)(struct graph *graph, struct graph_canvas *canvas); + bool (*is_merge)(struct graph_canvas *canvas); void (*foreach_symbol)(const struct graph *graph, const struct graph_canvas *canvas, graph_symbol_iterator_fn fn, void *data); diff -Nru tig-2.2/include/tig/io.h tig-2.3.0/include/tig/io.h --- tig-2.2/include/tig/io.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/io.h 2017-09-29 15:15:26.000000000 +0000 @@ -38,6 +38,12 @@ extern struct encoding *default_encoding; /* + * Path manipulation. + */ + +bool expand_path(char *dst, size_t dstlen, const char *src); + +/* * Executing external commands. */ @@ -47,10 +53,10 @@ }; enum io_type { - IO_FD, /* File descriptor based IO. */ IO_BG, /* Execute command in the background. */ IO_FG, /* Execute command with same std{in,out,err}. */ IO_RD, /* Read only fork+exec IO. */ + IO_RP, /* Read only fork+exec IO with input pipe. */ IO_WR, /* Write only fork+exec IO. */ IO_AP, /* Append fork+exec output to file. */ }; @@ -64,7 +70,6 @@ size_t bufsize; /* Buffer content size. */ char *bufpos; /* Current buffer position. */ unsigned int eof:1; /* Has end of file been reached. */ - unsigned int span:1; /* Support commands spanning multiple lines. */ int status:8; /* Status exit code. */ }; @@ -88,7 +93,7 @@ bool io_write(struct io *io, const void *buf, size_t bufsize); bool io_printf(struct io *io, const char *fmt, ...) PRINTF_LIKE(2, 3); bool io_read_buf(struct io *io, char buf[], size_t bufsize, bool allow_empty); -bool io_run_buf(const char **argv, char buf[], size_t bufsize, bool allow_empty); +bool io_run_buf(const char **argv, char buf[], size_t bufsize, const char *dir, bool allow_empty); enum status_code io_load(struct io *io, const char *separators, io_read_fn read_property, void *data); enum status_code io_load_span(struct io *io, const char *separators, diff -Nru tig-2.2/include/tig/keys.h tig-2.3.0/include/tig/keys.h --- tig-2.2/include/tig/keys.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/keys.h 2017-09-29 15:15:26.000000000 +0000 @@ -56,6 +56,14 @@ : 0; } +static inline char +key_to_control(const struct key *key) +{ + return (key->modifiers.control && key->modifiers.multibytes && strlen(key->data.bytes) == 1) + ? key->data.bytes[0] + : 0; +} + struct keymap *get_keymap(const char *name, size_t namelen); const char *get_key_name(const struct key key[], size_t keys, bool quote_comma); @@ -74,6 +82,7 @@ bool confirm; bool exit; bool internal; + bool echo; }; struct run_request { diff -Nru tig-2.2/include/tig/line.h tig-2.3.0/include/tig/line.h --- tig-2.2/include/tig/line.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/line.h 2017-09-29 15:15:26.000000000 +0000 @@ -22,11 +22,11 @@ */ #define LINE_INFO(_) \ - _(DIFF_HEADER, "diff --"), \ - _(DIFF_DEL_FILE, "--- "), \ - _(DIFF_ADD_FILE, "+++ "), \ - _(DIFF_START, "---"), \ - _(DIFF_CHUNK, "@@"), \ + _(DIFF_HEADER, "diff --"), \ + _(DIFF_DEL_FILE, "--- "), \ + _(DIFF_ADD_FILE, "+++ "), \ + _(DIFF_START, "---"), \ + _(DIFF_CHUNK, "@@"), \ _(DIFF_ADD, "+"), \ _(DIFF_ADD2, " +"), \ _(DIFF_DEL, "-"), \ @@ -35,6 +35,8 @@ _(DIFF_OLDMODE, "old file mode "), \ _(DIFF_NEWMODE, "new file mode "), \ _(DIFF_SIMILARITY, "similarity "), \ + _(DIFF_ADD_HIGHLIGHT, ""), \ + _(DIFF_DEL_HIGHLIGHT, ""), \ _(PP_MERGE, "Merge: "), \ _(PP_REFS, "Refs: "), \ _(PP_REFLOG, "Reflog: "), \ @@ -48,13 +50,13 @@ _(CURSOR, ""), \ _(STATUS, ""), \ _(DELIMITER, ""), \ - _(DATE, ""), \ - _(MODE, ""), \ + _(DATE, ""), \ + _(MODE, ""), \ _(ID, ""), \ _(OVERFLOW, ""), \ - _(DIRECTORY, ""), \ - _(FILE, ""), \ - _(FILE_SIZE, ""), \ + _(DIRECTORY, ""), \ + _(FILE, ""), \ + _(FILE_SIZE, ""), \ _(LINE_NUMBER, ""), \ _(TITLE_BLUR, ""), \ _(TITLE_FOCUS, ""), \ @@ -116,6 +118,8 @@ enum line_type get_line_type(const char *line); enum line_type get_line_type_from_ref(const struct ref *ref); +const char *get_line_type_name(enum line_type type); + struct line_info *get_line_info(const char *prefix, enum line_type type); struct line_info *add_line_rule(const char *prefix, struct line_rule *rule); void init_colors(void); @@ -136,7 +140,6 @@ get_line_attr(const char *prefix, enum line_type type) { struct line_info *info = get_line_info(prefix, type); - return COLOR_PAIR(COLOR_ID(info->color_pair)) | info->attr; } diff -Nru tig-2.2/include/tig/options.h tig-2.3.0/include/tig/options.h --- tig-2.2/include/tig/options.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/options.h 2017-09-29 15:15:26.000000000 +0000 @@ -38,6 +38,7 @@ _(diff_context, int, VIEW_DIFF_LIKE) \ _(diff_noprefix, bool, VIEW_NO_FLAGS) \ _(diff_options, const char **, VIEW_DIFF_LIKE) \ + _(diff_highlight, const char *, VIEW_DIFF_LIKE) \ _(diff_view, view_settings, VIEW_NO_FLAGS) \ _(editor_line_number, bool, VIEW_NO_FLAGS) \ _(file_args, const char **, VIEW_NO_FLAGS) \ @@ -45,11 +46,12 @@ _(focus_child, bool, VIEW_NO_FLAGS) \ _(git_colors, const char **, VIEW_NO_FLAGS) \ _(grep_view, view_settings, VIEW_NO_FLAGS) \ + _(history_size, int, VIEW_NO_FLAGS) \ _(horizontal_scroll, double, VIEW_NO_FLAGS) \ _(id_width, int, VIEW_NO_FLAGS) \ - _(ignore_case, bool, VIEW_NO_FLAGS) \ + _(ignore_case, enum ignore_case, VIEW_NO_FLAGS) \ _(ignore_space, enum ignore_space, VIEW_DIFF_LIKE) \ - _(line_graphics, enum graphic, VIEW_NO_FLAGS) \ + _(line_graphics, enum graphic, VIEW_RESET_DISPLAY) \ _(log_options, const char **, VIEW_LOG_LIKE) \ _(log_view, view_settings, VIEW_NO_FLAGS) \ _(mailmap, bool, VIEW_DIFF_LIKE | VIEW_LOG_LIKE) \ @@ -57,6 +59,7 @@ _(main_view, view_settings, VIEW_NO_FLAGS) \ _(mouse, bool, VIEW_NO_FLAGS) \ _(mouse_scroll, int, VIEW_NO_FLAGS) \ + _(mouse_wheel_cursor, bool, VIEW_NO_FLAGS) \ _(pager_view, view_settings, VIEW_NO_FLAGS) \ _(reference_format, struct ref_format **, VIEW_NO_FLAGS) \ _(refresh_interval, int, VIEW_NO_FLAGS) \ @@ -69,10 +72,12 @@ _(split_view_width, double, VIEW_RESET_DISPLAY) \ _(stage_view, view_settings, VIEW_NO_FLAGS) \ _(stash_view, view_settings, VIEW_NO_FLAGS) \ - _(status_untracked_dirs, bool, VIEW_STATUS_LIKE) \ + _(status_show_untracked_dirs, bool, VIEW_STATUS_LIKE) \ + _(status_show_untracked_files, bool, VIEW_STATUS_LIKE) \ _(status_view, view_settings, VIEW_NO_FLAGS) \ _(tab_size, int, VIEW_NO_FLAGS) \ _(tree_view, view_settings, VIEW_NO_FLAGS) \ + _(truncation_delimiter, const char *, VIEW_NO_FLAGS) \ _(vertical_split, enum vertical_split, VIEW_RESET_DISPLAY | VIEW_DIFF_LIKE) \ _(wrap_lines, bool, VIEW_NO_FLAGS) \ _(wrap_search, bool, VIEW_NO_FLAGS) \ @@ -93,7 +98,6 @@ _(graph, enum graph_display, VIEW_LOG_LIKE) \ _(refs, bool, VIEW_NO_FLAGS) \ _(overflow, int, VIEW_NO_FLAGS) \ - _(width, int, VIEW_NO_FLAGS) \ #define DATE_COLUMN_OPTIONS(_) \ _(display, enum date, VIEW_NO_FLAGS) \ @@ -133,12 +137,10 @@ #define STATUS_COLUMN_OPTIONS(_) \ _(display, enum status_label, VIEW_NO_FLAGS) \ - _(width, int, VIEW_NO_FLAGS) \ #define TEXT_COLUMN_OPTIONS(_) \ _(display, bool, VIEW_NO_FLAGS) \ _(commit_title_overflow, int, VIEW_NO_FLAGS) \ - _(width, int, VIEW_NO_FLAGS) \ #define COLUMN_OPTIONS(_) \ _(author, AUTHOR, AUTHOR_COLUMN_OPTIONS) \ diff -Nru tig-2.2/include/tig/prompt.h tig-2.3.0/include/tig/prompt.h --- tig-2.2/include/tig/prompt.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/prompt.h 2017-09-29 15:15:26.000000000 +0000 @@ -41,6 +41,7 @@ bool allow_empty; void *data; char buf[SIZEOF_STR]; + char context[SIZEOF_STR]; }; enum input_status prompt_default_handler(struct input *input, struct key *key); diff -Nru tig-2.2/include/tig/request.h tig-2.3.0/include/tig/request.h --- tig-2.2/include/tig/request.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/request.h 2017-09-29 15:15:26.000000000 +0000 @@ -36,9 +36,10 @@ REQ_(REFRESH, "Reload and refresh view"), \ REQ_(MAXIMIZE, "Maximize the current view"), \ REQ_(VIEW_CLOSE, "Close the current view"), \ + REQ_(VIEW_CLOSE_NO_QUIT, "Close the current view without quitting"), \ REQ_(QUIT, "Close all views and quit"), \ \ - REQ_GROUP("View specific actions") \ + REQ_GROUP("View-specific actions") \ REQ_(STATUS_UPDATE, "Stage/unstage chunk or file changes"), \ REQ_(STATUS_REVERT, "Revert chunk or file changes"), \ REQ_(STATUS_MERGE, "Merge file using external tool"), \ @@ -54,6 +55,8 @@ REQ_(MOVE_HALF_PAGE_UP, "Move cursor one page up"), \ REQ_(MOVE_FIRST_LINE, "Move cursor to first line"), \ REQ_(MOVE_LAST_LINE, "Move cursor to last line"), \ + REQ_(MOVE_NEXT_MERGE, "Move cursor to next merge commit"), \ + REQ_(MOVE_PREV_MERGE, "Move cursor to previous merge commit"), \ \ REQ_GROUP("Scrolling") \ REQ_(SCROLL_LINE_UP, "Scroll one line up"), \ @@ -93,6 +96,8 @@ /* Internal requests. */ REQ_SCROLL_WHEEL_DOWN, REQ_SCROLL_WHEEL_UP, + REQ_MOVE_WHEEL_DOWN, + REQ_MOVE_WHEEL_UP, /* Start of the run request IDs */ REQ_RUN_REQUESTS diff -Nru tig-2.2/include/tig/search.h tig-2.3.0/include/tig/search.h --- tig-2.2/include/tig/search.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/search.h 2017-09-29 15:15:26.000000000 +0000 @@ -19,6 +19,7 @@ void reset_search(struct view *view); void search_view(struct view *view, enum request request); void find_next(struct view *view, enum request request); +void find_merge(struct view *view, enum request request); bool grep_text(struct view *view, const char *text[]); #endif diff -Nru tig-2.2/include/tig/string.h tig-2.3.0/include/tig/string.h --- tig-2.2/include/tig/string.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/string.h 2017-09-29 15:15:26.000000000 +0000 @@ -84,7 +84,8 @@ size_t string_expanded_length(const char *src, size_t srclen, size_t tabsize, size_t max_size); size_t string_expand(char *dst, size_t dstlen, const char *src, int srclen, int tabsize); -char *chomp_string(char *name); +char *string_trim_end(char *name); +char *string_trim(char *name); bool PRINTF_LIKE(4, 5) string_nformat(char *buf, size_t bufsize, size_t *bufpos, const char *fmt, ...); diff -Nru tig-2.2/include/tig/tig.h tig-2.3.0/include/tig/tig.h --- tig-2.2/include/tig/tig.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/tig.h 2017-09-29 15:15:26.000000000 +0000 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -59,6 +60,10 @@ #include #include +#ifdef HAVE_EXECINFO_H +#include +#endif + /* ncurses(3): Must be defined to have extended wide-character functions. */ #define _XOPEN_SOURCE_EXTENDED 1 @@ -109,6 +114,7 @@ #define SIZEOF_STR 1024 /* Default string size. */ #define SIZEOF_REF 256 /* Size of symbolic or SHA1 ID. */ #define SIZEOF_REV 41 /* Holds a SHA-1 and an ending NUL. */ +#define SIZEOF_CMD 8192 /* Default command string size. */ /* This color name can be used to refer to the default term colors. */ #define COLOR_DEFAULT (-1) diff -Nru tig-2.2/include/tig/types.h tig-2.3.0/include/tig/types.h --- tig-2.2/include/tig/types.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/types.h 2017-09-29 15:15:26.000000000 +0000 @@ -114,6 +114,11 @@ _(IGNORE_SPACE, SOME), \ _(IGNORE_SPACE, AT_EOL) +#define IGNORE_CASE_ENUM(_) \ + _(IGNORE_CASE, NO), \ + _(IGNORE_CASE, YES), \ + _(IGNORE_CASE, SMART_CASE) + #define COMMIT_ORDER_ENUM(_) \ _(COMMIT_ORDER, AUTO), \ _(COMMIT_ORDER, DEFAULT), \ @@ -143,18 +148,18 @@ _(REFERENCE, REMOTE), \ _(REFERENCE, TAG), \ _(REFERENCE, LOCAL_TAG), \ - _(REFERENCE, REPLACE), \ + _(REFERENCE, REPLACE) #define STATUS_LABEL_ENUM(_) \ _(STATUS_LABEL, NO), \ _(STATUS_LABEL, SHORT), \ - _(STATUS_LABEL, LONG), \ + _(STATUS_LABEL, LONG) #define REFRESH_MODE_ENUM(_) \ _(REFRESH_MODE, MANUAL), \ _(REFRESH_MODE, AUTO), \ _(REFRESH_MODE, AFTER_COMMAND), \ - _(REFRESH_MODE, PERIODIC), \ + _(REFRESH_MODE, PERIODIC), #define ENUM_INFO(_) \ _(author, AUTHOR_ENUM) \ @@ -164,6 +169,7 @@ _(filename, FILENAME_ENUM) \ _(graphic, GRAPHIC_ENUM) \ _(graph_display, GRAPH_DISPLAY_ENUM) \ + _(ignore_case, IGNORE_CASE_ENUM) \ _(ignore_space, IGNORE_SPACE_ENUM) \ _(vertical_split, VERTICAL_SPLIT_ENUM) \ _(view_column_type, VIEW_COLUMN_ENUM) \ diff -Nru tig-2.2/include/tig/util.h tig-2.3.0/include/tig/util.h --- tig-2.2/include/tig/util.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/util.h 2017-09-29 15:15:26.000000000 +0000 @@ -75,6 +75,7 @@ }; struct ident { + const char *key; const char *name; const char *email; }; @@ -115,5 +116,7 @@ return tmp; \ } +void sigsegv_handler(int sig); + #endif /* vim: set ts=8 sw=8 noexpandtab: */ diff -Nru tig-2.2/include/tig/view.h tig-2.3.0/include/tig/view.h --- tig-2.2/include/tig/view.h 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/include/tig/view.h 2017-09-29 15:15:26.000000000 +0000 @@ -218,7 +218,7 @@ /* Size of private data. */ size_t private_size; /* Open and reads in all view content. */ - bool (*open)(struct view *view, enum open_flags flags); + enum status_code (*open)(struct view *view, enum open_flags flags); /* Read one line; updates view->line. */ bool (*read)(struct view *view, struct buffer *buf, bool force_stop); /* Draw one line; @lineno must be < view->height. */ @@ -345,7 +345,7 @@ } void reset_view(struct view *view); -bool begin_update(struct view *view, const char *dir, const char **argv, enum open_flags flags); +enum status_code begin_update(struct view *view, const char *dir, const char **argv, enum open_flags flags); void end_update(struct view *view, bool force); bool update_view(struct view *view); void update_view_title(struct view *view); diff -Nru tig-2.2/INSTALL.adoc tig-2.3.0/INSTALL.adoc --- tig-2.2/INSTALL.adoc 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/INSTALL.adoc 2017-09-29 15:15:26.000000000 +0000 @@ -2,10 +2,16 @@ ========================= :docext: adoc -Download a tarball from http://jonas.nitro.dk/tig/releases[] or clone the Tig +Download a tarball from https://github.com/jonas/tig/releases[] or clone the Tig repository http://github.com/jonas/tig[git://github.com/jonas/tig.git]. -NB: Do not use tig-2.0.tar because it will fail to compile due to these issues https://github.com/jonas/tig/pull/283 and https://github.com/jonas/tig/issues/337 +The latest version is: +https://github.com/jonas/tig/releases/download/tig-2.3.0/tig-2.3.0.tar.gz[tig-2.3.0] +https://github.com/jonas/tig/releases/download/tig-2.3.0/tig-2.3.0.tar.gz.md5[(md5)] + +*Note:* Do not use the tar.gz file for version 2.0 because it will fail +to compile due to issue https://github.com/jonas/tig/pull/283[#283] and +https://github.com/jonas/tig/issues/337[#337] The quick and simple way to install Tig is: @@ -44,6 +50,12 @@ If your `iconv` library is not in the default library and include path, you need to pass the `--with-libiconv` option to `configure` to tell it where to look. +If you have installed ncurses with brew, run configure with the following +flags to have it properly detected (note this done out of the box if you +build without `configure`): + + $ ./configure LDFLAGS=-L/usr/local/opt/ncurses/lib CPPFLAGS=-I/usr/local/opt/ncurses/include + Note, if you are building from the Tig repository, you need to generate `configure` yourself. First, ensure that `autoconf` is installed on your system, and then run the following command: @@ -56,6 +68,23 @@ $ brew install tig +Note, for older installations of Tig, Homebrew does not automatically +update the system-wide `tigrc` file when upgrading Tig and the +link:https://github.com/Homebrew/homebrew-core/commit/5600463d68620d68c9745acc490af7f8a16a75cb[behavior] +was changed in 2015 to install the system-wide `tigrc` in the +`/usr/local/share/tig/examples` directory so Tig always uses the +defaults compiled into the binary. + +If you see warnings when starting Tig after upgrading, e.g.: + + tig warning: Errors while loading /usr/local/etc/tigrc + +It means you either need to manually update `/usr/local/etc/tigrc` with +changes from `/usr/local/share/tig/examples` rename the file if you +never made any changes to it. + + $ mv /usr/local/etc/tigrc{,.old} + Installation on Windows ----------------------- To run on Windows, you will need link:https://www.cygwin.com/[cygwin]. @@ -85,6 +114,8 @@ `setenv()`. - `NO_MKSTEMPS`: Define this variable to enable work-around for missing `mkstemps()`. + - `NO_WORDEXP`: Define this variable to enable work-around for missing + `wordexp()`. - `NO_BUILTIN_TIGRC`: Reduce the size of the binary by not including a built-in tigrc. The built-in tigrc is used as a fallback when no `tigrc` is found in the system configuration directory (e.g. `/etc`). @@ -134,9 +165,6 @@ |Tool |Description |readline |Adds support for completion and history in search and command prompts. -|gsed (i.e. GNU sed) |Required for running the test suite. - Can be installed with `brew install gnu-sed` - on OS X. |autoconf |Contains autoreconf for generating configure from configure.ac. |asciidoc (>= 8.4) |Generates HTML and (DocBook) XML from text. diff -Nru tig-2.2/INSTALL.html tig-2.3.0/INSTALL.html --- tig-2.2/INSTALL.html 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/INSTALL.html 2017-09-29 15:15:26.000000000 +0000 @@ -738,9 +738,14 @@
    -

    Download a tarball from http://jonas.nitro.dk/tig/releases or clone the Tig +

    Download a tarball from https://github.com/jonas/tig/releases or clone the Tig repository git://github.com/jonas/tig.git.

    -

    NB: Do not use tig-2.0.tar because it will fail to compile due to these issues https://github.com/jonas/tig/pull/283 and https://github.com/jonas/tig/issues/337

    +

    The latest version is: +tig-2.3.0 +(md5)

    +

    Note: Do not use the tar.gz file for version 2.0 because it will fail +to compile due to issue #283 and +#337

    The quick and simple way to install Tig is:

    @@ -783,6 +788,13 @@

    If your iconv library is not in the default library and include path, you need to pass the --with-libiconv option to configure to tell it where to look.

    +

    If you have installed ncurses with brew, run configure with the following +flags to have it properly detected (note this done out of the box if you +build without configure):

    +
    +
    +
    $ ./configure LDFLAGS=-L/usr/local/opt/ncurses/lib CPPFLAGS=-I/usr/local/opt/ncurses/include
    +

    Note, if you are building from the Tig repository, you need to generate configure yourself. First, ensure that autoconf is installed on your system, and then run the following command:

    @@ -800,6 +812,24 @@
    $ brew install tig
    +

    Note, for older installations of Tig, Homebrew does not automatically +update the system-wide tigrc file when upgrading Tig and the +behavior +was changed in 2015 to install the system-wide tigrc in the +/usr/local/share/tig/examples directory so Tig always uses the +defaults compiled into the binary.

    +

    If you see warnings when starting Tig after upgrading, e.g.:

    +
    +
    +
    tig warning: Errors while loading /usr/local/etc/tigrc
    +
    +

    It means you either need to manually update /usr/local/etc/tigrc with +changes from /usr/local/share/tig/examples rename the file if you +never made any changes to it.

    +
    +
    +
    $ mv /usr/local/etc/tigrc{,.old}
    +
    @@ -841,6 +871,12 @@
  • +NO_WORDEXP: Define this variable to enable work-around for missing + wordexp(). +

    +
  • +
  • +

    NO_BUILTIN_TIGRC: Reduce the size of the binary by not including a built-in tigrc. The built-in tigrc is used as a fallback when no tigrc is found in the system configuration directory (e.g. /etc). @@ -930,12 +966,6 @@ search and command prompts.

    -

    gsed (i.e. GNU sed)

    -

    Required for running the test suite. - Can be installed with brew install gnu-sed - on OS X.

    - -

    autoconf

    Contains autoreconf for generating configure from configure.ac.

    @@ -966,7 +996,7 @@

    diff -Nru tig-2.2/Makefile tig-2.3.0/Makefile --- tig-2.2/Makefile 2016-08-11 02:39:02.000000000 +0000 +++ tig-2.3.0/Makefile 2017-09-29 15:15:29.000000000 +0000 @@ -2,7 +2,7 @@ # The last tagged version. Can be overridden either by the version from # git or from the value of the DIST_VERSION environment variable. -VERSION = 2.2 +VERSION = 2.3.0 all: @@ -74,6 +74,11 @@ LCOV ?= lcov GENHTML ?= genhtml +ifneq (,$(shell which gsed 2>/dev/null)) +SED ?= gsed +else +SED ?= sed +endif all: $(EXE) $(TOOLS) all-debug: all @@ -128,12 +133,12 @@ $(QUIET_UNINSTALL_EACH)tools/uninstall.sh "$(DESTDIR)$(docdir)/tig/$(doc)";) clean: clean-test clean-coverage - $(Q)$(RM) -r $(TARNAME) *.spec tig-*.tar.gz tig-*.tar.gz.md5 .deps + $(Q)$(RM) -r $(TARNAME) *.spec tig-*.tar.gz tig-*.tar.gz.md5 .deps _book node_modules $(Q)$(RM) $(EXE) $(TOOLS) $(OBJS) core doc/*.xml src/builtin-config.c $(Q)$(RM) $(OBJS:%.o=%.gcda) $(OBJS:%.o=%.gcno) distclean: clean - $(RM) -r doc/manual.html-chunked autom4te.cache release-docs + $(RM) -r doc/manual.html-chunked autom4te.cache $(RM) doc/*.toc $(ALLDOC) aclocal.m4 configure $(RM) config.h config.log config.make config.status config.h.in @@ -149,7 +154,7 @@ update-headers: @for file in include/tig/*.h src/*.c tools/*.c test/tools/*.c; do \ grep -q '/* Copyright' "$$file" && \ - sed '0,/.*\*\//d' < "$$file" | \ + $(SED) '0,/.*\*\//d' < "$$file" | \ grep -v '/* vim: set' > "$$file.tmp"; \ { cat tools/header.h "$$file.tmp"; \ echo "/* vim: set ts=8 sw=8 noexpandtab: */"; } > "$$file"; \ @@ -159,15 +164,15 @@ update-docs: tools/doc-gen doc="doc/tigrc.5.adoc"; \ - sed -n '0,/ifndef::DOC_GEN_ACTIONS/p' < "$$doc" > "$$doc.gen"; \ + $(SED) -n '0,/ifndef::DOC_GEN_ACTIONS/p' < "$$doc" > "$$doc.gen"; \ ./tools/doc-gen actions >> "$$doc.gen"; \ - sed -n '/endif::DOC_GEN_ACTIONS/,$$p' < "$$doc" >> "$$doc.gen" ; \ + $(SED) -n '/endif::DOC_GEN_ACTIONS/,$$p' < "$$doc" >> "$$doc.gen" ; \ mv "$$doc.gen" "$$doc" dist: configure tig.spec $(Q)mkdir -p $(TARNAME) && \ cp Makefile tig.spec configure config.h.in aclocal.m4 $(TARNAME) && \ - sed -i "s/VERSION\s\+=\s\+[0-9]\+\([.][0-9]\+\)\+/VERSION = $(VERSION)/" $(TARNAME)/Makefile + $(SED) -i "s/VERSION\s\+=\s\+[0-9]\+\([.][0-9]\+\)\+/VERSION = $(VERSION)/" $(TARNAME)/Makefile git archive --format=tar --prefix=$(TARNAME)/ HEAD | \ tar --delete $(TARNAME)/Makefile > $(TARNAME).tar && \ tar rf $(TARNAME).tar `find $(TARNAME)/*` && \ @@ -207,6 +212,7 @@ test-address-sanitizer: export TIG_ADDRESS_SANITIZER_ENABLED=yes TESTS = $(sort $(shell find test -type f -name '*-test')) +TESTS_TODO = $(sort $(shell find test -type f -name '*-test' -exec grep -l '\(test_todo\|-todo=\)' {} \+)) clean-test: $(Q)$(RM) -r test/tmp @@ -214,17 +220,29 @@ test: clean-test $(TESTS) $(QUIET_SUMMARY)test/tools/show-results.sh -export TIG_TEST_OPTS = $(V:1=no-indent) +ifneq (,$(strip $(V:@=))) +export MAKE_TEST_OPTS = no-indent +else +export MAKE_TEST_OPTS = +endif $(TESTS): PATH := $(CURDIR)/test/tools:$(CURDIR)/src:$(PATH) $(TESTS): $(EXE) test/tools/test-graph $(QUIET_TEST)$(TEST_SHELL) $@ +test-todo: MAKE_TEST_OPTS += todo +test-todo: $(TESTS_TODO) + # Other autoconf-related rules are hidden in config.make.in so that # they don't confuse Make when we aren't actually using ./configure -configure: configure.ac acinclude.m4 tools/*.m4 +configure: configure.ac tools/*.m4 $(QUIET_GEN)./autogen.sh +site: + gitbook install + gitbook build + find _book -type f | grep -E -v '(gitbook|json|html)' | xargs rm + .PHONY: all all-coverage all-debug clean clean-coverage clean-test doc \ doc-man doc-html dist distclean install install-doc \ install-doc-man install-doc-html install-release-doc-html \ @@ -246,7 +264,12 @@ COMPAT_OBJS += compat/strndup.o endif -COMPAT_OBJS += compat/hashtab.o +ifdef NO_WORDEXP +COMPAT_CPPFLAGS += -DNO_WORDEXP +COMPAT_OBJS += compat/wordexp.o +endif + +COMPAT_OBJS += compat/hashtab.o compat/wcwidth.o override CPPFLAGS += $(COMPAT_CPPFLAGS) @@ -296,7 +319,7 @@ TEST_GRAPH_OBJS = test/tools/test-graph.o src/string.o src/util.o src/io.o $(GRAPH_OBJS) $(COMPAT_OBJS) test/tools/test-graph: $(TEST_GRAPH_OBJS) -DOC_GEN_OBJS = tools/doc-gen.o src/string.o src/types.o src/util.o src/request.o +DOC_GEN_OBJS = tools/doc-gen.o src/string.o src/types.o src/util.o src/request.o compat/wcwidth.o tools/doc-gen: $(DOC_GEN_OBJS) OBJS = $(sort $(TIG_OBJS) $(TEST_GRAPH_OBJS) $(DOC_GEN_OBJS)) @@ -316,19 +339,19 @@ $(QUIET_GEN)tools/make-builtin-config.sh $< > $@ tig.spec: contrib/tig.spec.in - $(QUIET_GEN)sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' \ + $(QUIET_GEN)$(SED) -e 's/@@VERSION@@/$(RPM_VERSION)/g' \ -e 's/@@RELEASE@@/$(RPM_RELEASE)/g' < $< > $@ doc/manual.html: doc/manual.toc doc/manual.html: ASCIIDOC_FLAGS += -ainclude-manual-toc %.toc: %.adoc - $(QUIET_GEN)sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \ + $(QUIET_GEN)$(SED) -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \ case "$$line" in \ "----"*) echo ". <<$$ref>>"; ref= ;; \ "~~~~"*) echo "- <<$$ref>>"; ref= ;; \ "[["*"]]") ref="$$line" ;; \ *) ref="$$ref, $$line" ;; \ - esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@ + esac; done | $(SED) 's/\[\[\(.*\)\]\]/\1/' > $@ README.html: README.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article -a readme $< diff -Nru tig-2.2/NEWS.adoc tig-2.3.0/NEWS.adoc --- tig-2.2/NEWS.adoc 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/NEWS.adoc 2017-09-29 15:15:26.000000000 +0000 @@ -1,6 +1,136 @@ Release notes ============= +tig-2.3.0 +--------- + +Incompatibilities: + + - The `width` setting on the `status`, `text` and `commit-title` columns was + never applied and has been removed. (GH #617) + +Improvements: + + - Improve load performance by throttling screen updates. (GH #622, #629) + - Speed up graph rendering. (GH #638) + - Enable scroll optimizations for Terminal.app and iTerm2. (GH #637) + - Improve the test suite portability to not depend on GNU sed. (GH #609, #614) + - Make build reproducible. (https://reproducible-builds.org/) (GH #613) + - Enable binding to more symbolic keys and keys with control modifier: + `F13`-`F19`, `ShiftLeft`, `ShiftRight`, `ShiftDel`, `ShiftHome`, `ShiftEnd`, + `ShiftTab`, `Ctrl-C`, `Ctrl-V`, `Ctrl-S`, and `Ctrl-@`. (GH #314, #619, #642) + - Persist readline history to `~/.tig_history` or `$XDG_DATA_HOME/tig/history`. + Use `history-size` to control the number of entries to save. (GH #620, #713, + #714, #718) + - Preload last search from persistent history. (GH #630) + - Add `view-close-no-quit` action, unbound by default. (GH #607) + - Add `mouse-wheel-cursor` option (off by default) when set to true causes + wheel actions to prefer moving the cursor instead of scrolling. (GH #608) + - Add `truncation-delimiter` option, set to `~` by default. (GH #646) + - Add `-q` parameter to `source` for "source-if-present". (GH #612) + - Add `:echo` prompt command to display text in the status bar. (GH #626, #636) + - Make `diff-highlight` colors configurable. (GH #625, #633) + - Let Ctrl-C exit Y/N dialog, menu prompts and the file finder. (GH #632, #648) + - Hide cursor unless at textual prompt. (GH #643) + - Expand tilde ('~') in `:script` paths. (GH #674) + - Show single-line output of external command in status bar. (GH #200, #557, + #678) + - Disable the graph when `--no-merges` is passed. (GH #687) + - Print backtraces on segfault in debug mode. + - Ignore script lines starting with `#` (comment). (GH #705) + - Complete `repo:*` variables when readline is enabled. (GH #702) + - Incorporate XTerm's `wcwidth.c` to find Unicode widths. (GH #691) + +Bug fixes: + + - Fix graph display issues. (GH #419, #638) + - Fix and improve rendering of Unicode characters. (GH #330, #621, #644, #682) + - Handle hyphenated directory names when listing content. (GH #602) + - Do not jump to next match when cancelling the search prompt. (GH #627) + - Fix clearing of the status line after `Ctrl-C`. (GH #623, #649) + - Fix handling of width on line-number and trimmed width of 1. (GH #617) + - Set cursor position when not updating prompt contents. (GH #647) + - Erase status line at exit time for users without altscreen-capable terminals. + (GH #589) + - Fix unexpected keys when restoring from suspend (`Ctrl-Z`). (GH #232) + - contrib/vim.tigrc: Also bind G in the main as a workaround for limitations of + the `none` action. (GH #594, #599) + - Only override `blame-options` when commands are given and fix parsing of + `-C`. (GH #597) + - Fix diff name discovery to better handle prefixes. + - Interpret button5 as wheel-down. (GH #321, #606) + - Fix `back` / `parent` in tree view. (GH #641) + - Fix memory corruption in `concat_argv` and file finder. (GH #634, #655) + - Fix reading from stdin for `tig show`. + - Document problem of outdated system-wide `tigrc` files in Homebrew. (GH #598) + - Repaint the display when toggling `line-graphics`. (GH #527) + - Fix custom date formatting support longer strings. (GH #522) + - Don't segfault on ":exec" irregular args. (GH #686) + - Fix segfault when calling htab_empty. (GH #663, #745) + +tig-2.2.2 +--------- + +Upgrade instructions: + + - The `status-untracked-dirs` option was renamed to + `status-show-untracked-dirs` to match the new `status-show-untracked-files` + option. + +Improvements: + + - Use `diff-options` when preparing the diff in the stage view to make the diff + state configurable. (GH #545) + - Add 'status-show-untracked-files' option mirroring Git's + 'status.showUntrackedFiles' to toggle display of untracked files. in the + status view. On by default. (GH #562) + - Update `ax_with_curses.m4` and use `pkg-config` to detect. (GH #546) + - Add `tig-pick` script for using Tig as a commit picker. (GH #575, #580) + - Add "smart case" option ('set ignore-case = smart-case') to ignore case when + the search string is lower-case only. (GH #320, #579) + +Bug fixes: + + - Fix author ident cache being keyed by email only. (GH #424, #526, #547) + - Fix periodic refresh mode to properly detect ref changes. (GH #430, #591) + - Add workaround for detecting failure to start the diff-highlight process. + - Show diffs in the stash view when `set mailmap = true`. (GH #556) + - Fix parsing of git-log revision arguments, such as `--exclude=...` in + conjunction with `--all`. (GH #555) + - Fix diff stat parsing for binary copies. + - Fix crash when resizing terminal while search is in progress. (GH #515, #550) + - Fix argument filtering to pass more arguments through to Git. + - Check for termcap support in split tinfo libs. (GH #568, #585) + +tig-2.2.1 +--------- + +Tarballs should now be downloaded from GitHub. Either go to +https://github.com/jonas/tig/releases or use the following pattern: + + https://github.com/jonas/tig/releases/download/tig-VERSION/tig-VERSION.tar.gz + +MD5 checksums can be found at: + + https://github.com/jonas/tig/releases/download/tig-VERSION/tig-VERSION.tar.gz.md5 + +Similarly, the home page is now also on GitHub at https://jonas.github.io/tig/. +A big thanks to Simon L. B. Nielsen for generously hosting Tig on nitro.dk! + +Improvements: + + - Support Git's 'diff-highlight' program when `diff-highlight` is set to either + true or the path of the script to use for post-processing. + - Add navigation between merge commits. (GH #525) + - Add 'A' as a binding to apply a stash without dropping it. + - Bind 'Ctrl-D' and 'Ctrl-U' to half-page movements by default. + - manual: Mention how to change default Up/Down behavior in diff view. + +Bug fixes: + + - Reorganize checking of libraries for termcap functions. + - Fix `:goto ` error message. + tig-2.2 ------- @@ -37,6 +167,7 @@ - Add `:goto ` prompt command to go to a `git-rev-parse`d revision, e.g. `:goto some/branch` or `:goto %(commit)^2`. - Respect the XDG standard for configuration files. (GH #513) + - Show tracking information in `tig status` (GH #504) - Resolve diff paths when `diff.noprefix` is true. (GH #487, #488) - Support for custom `strftime(3)` date formats, e.g.: @@ -68,7 +199,7 @@ - Add support for key combos. (GH #67) - See `contrib/vim.tigrc` for Vim-like keybindings. (GH #273, #351) - Add GitHub inspired file finder to search for and open any file. (GH #342) - - Add `search` keymap for navigation file finder search results. + - Add `search` keymap for navigating file finder search results. Bug fixes: @@ -84,7 +215,7 @@ - Improve C99 compliance so Tig compiles with the native compilers on Solaris (SunStudio cc) and AIX (xlc). (GH #380) - Add move-half-page-up and move-half-page-down actions. (GH #323) - - Preserve the cursor position when changing the diff context. + - Preserve the cursor position when changing the diff context. - Show 'Unstaged changes' above 'Staged changes' in the main view. (GH #383) - Add `:exec ` prompt command to execute commands. - Add shorthand for changing the view settings of a single column, @@ -491,7 +622,7 @@ - Stage view: fix off-by-one error when jumping to a file in a diff with only one file. - Fix diff-header colorization. (GH #15) - + tig-0.18 -------- @@ -510,7 +641,7 @@ the diff and stage view. - (GH-6) Make blame configurable via extra options passed from the command line and blame-options setting from ~/.tigrc. For example: - + set blame-options = -C -C -C Bug fixes: @@ -684,7 +815,7 @@ - Read tigrc(5) options from Git configuration files using the syntax: [tig] show-rev-graph = true - [tig "color"] cursor = yellow red bold + [tig "color"] cursor = yellow red bold [tig "bind"] generic = P parent - Tree view: avoid flickering when updating. diff -Nru tig-2.2/NEWS.html tig-2.3.0/NEWS.html --- tig-2.2/NEWS.html 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/NEWS.html 2017-09-29 15:15:26.000000000 +0000 @@ -737,6 +737,411 @@
  • +

    tig-2.3.0

    +
    +

    Incompatibilities:

    +
      +
    • +

      +The width setting on the status, text and commit-title columns was + never applied and has been removed. (GH #617) +

      +
    • +
    +

    Improvements:

    +
      +
    • +

      +Improve load performance by throttling screen updates. (GH #622, #629) +

      +
    • +
    • +

      +Speed up graph rendering. (GH #638) +

      +
    • +
    • +

      +Enable scroll optimizations for Terminal.app and iTerm2. (GH #637) +

      +
    • +
    • +

      +Improve the test suite portability to not depend on GNU sed. (GH #609, #614) +

      +
    • +
    • +

      +Make build reproducible. (https://reproducible-builds.org/) (GH #613) +

      +
    • +
    • +

      +Enable binding to more symbolic keys and keys with control modifier: + F13-F19, ShiftLeft, ShiftRight, ShiftDel, ShiftHome, ShiftEnd, + ShiftTab, Ctrl-C, Ctrl-V, Ctrl-S, and Ctrl-@. (GH #314, #619, #642) +

      +
    • +
    • +

      +Persist readline history to ~/.tig_history or $XDG_DATA_HOME/tig/history. + Use history-size to control the number of entries to save. (GH #620, #713, + #714, #718) +

      +
    • +
    • +

      +Preload last search from persistent history. (GH #630) +

      +
    • +
    • +

      +Add view-close-no-quit action, unbound by default. (GH #607) +

      +
    • +
    • +

      +Add mouse-wheel-cursor option (off by default) when set to true causes + wheel actions to prefer moving the cursor instead of scrolling. (GH #608) +

      +
    • +
    • +

      +Add truncation-delimiter option, set to ~ by default. (GH #646) +

      +
    • +
    • +

      +Add -q parameter to source for "source-if-present". (GH #612) +

      +
    • +
    • +

      +Add :echo prompt command to display text in the status bar. (GH #626, #636) +

      +
    • +
    • +

      +Make diff-highlight colors configurable. (GH #625, #633) +

      +
    • +
    • +

      +Let Ctrl-C exit Y/N dialog, menu prompts and the file finder. (GH #632, #648) +

      +
    • +
    • +

      +Hide cursor unless at textual prompt. (GH #643) +

      +
    • +
    • +

      +Expand tilde (~) in :script paths. (GH #674) +

      +
    • +
    • +

      +Show single-line output of external command in status bar. (GH #200, #557, + #678) +

      +
    • +
    • +

      +Disable the graph when --no-merges is passed. (GH #687) +

      +
    • +
    • +

      +Print backtraces on segfault in debug mode. +

      +
    • +
    • +

      +Ignore script lines starting with # (comment). (GH #705) +

      +
    • +
    • +

      +Complete repo:* variables when readline is enabled. (GH #702) +

      +
    • +
    • +

      +Incorporate XTerm’s wcwidth.c to find Unicode widths. (GH #691) +

      +
    • +
    +

    Bug fixes:

    +
      +
    • +

      +Fix graph display issues. (GH #419, #638) +

      +
    • +
    • +

      +Fix and improve rendering of Unicode characters. (GH #330, #621, #644, #682) +

      +
    • +
    • +

      +Handle hyphenated directory names when listing content. (GH #602) +

      +
    • +
    • +

      +Do not jump to next match when cancelling the search prompt. (GH #627) +

      +
    • +
    • +

      +Fix clearing of the status line after Ctrl-C. (GH #623, #649) +

      +
    • +
    • +

      +Fix handling of width on line-number and trimmed width of 1. (GH #617) +

      +
    • +
    • +

      +Set cursor position when not updating prompt contents. (GH #647) +

      +
    • +
    • +

      +Erase status line at exit time for users without altscreen-capable terminals. + (GH #589) +

      +
    • +
    • +

      +Fix unexpected keys when restoring from suspend (Ctrl-Z). (GH #232) +

      +
    • +
    • +

      +contrib/vim.tigrc: Also bind G in the main as a workaround for limitations of + the none action. (GH #594, #599) +

      +
    • +
    • +

      +Only override blame-options when commands are given and fix parsing of + -C. (GH #597) +

      +
    • +
    • +

      +Fix diff name discovery to better handle prefixes. +

      +
    • +
    • +

      +Interpret button5 as wheel-down. (GH #321, #606) +

      +
    • +
    • +

      +Fix back / parent in tree view. (GH #641) +

      +
    • +
    • +

      +Fix memory corruption in concat_argv and file finder. (GH #634, #655) +

      +
    • +
    • +

      +Fix reading from stdin for tig show. +

      +
    • +
    • +

      +Document problem of outdated system-wide tigrc files in Homebrew. (GH #598) +

      +
    • +
    • +

      +Repaint the display when toggling line-graphics. (GH #527) +

      +
    • +
    • +

      +Fix custom date formatting support longer strings. (GH #522) +

      +
    • +
    • +

      +Don’t segfault on ":exec" irregular args. (GH #686) +

      +
    • +
    • +

      +Fix segfault when calling htab_empty. (GH #663, #745) +

      +
    • +
    +
    +
    +
    +

    tig-2.2.2

    +
    +

    Upgrade instructions:

    +
      +
    • +

      +The status-untracked-dirs option was renamed to + status-show-untracked-dirs to match the new status-show-untracked-files + option. +

      +
    • +
    +

    Improvements:

    +
      +
    • +

      +Use diff-options when preparing the diff in the stage view to make the diff + state configurable. (GH #545) +

      +
    • +
    • +

      +Add status-show-untracked-files option mirroring Git’s + status.showUntrackedFiles to toggle display of untracked files. in the + status view. On by default. (GH #562) +

      +
    • +
    • +

      +Update ax_with_curses.m4 and use pkg-config to detect. (GH #546) +

      +
    • +
    • +

      +Add tig-pick script for using Tig as a commit picker. (GH #575, #580) +

      +
    • +
    • +

      +Add "smart case" option (set ignore-case = smart-case) to ignore case when + the search string is lower-case only. (GH #320, #579) +

      +
    • +
    +

    Bug fixes:

    +
      +
    • +

      +Fix author ident cache being keyed by email only. (GH #424, #526, #547) +

      +
    • +
    • +

      +Fix periodic refresh mode to properly detect ref changes. (GH #430, #591) +

      +
    • +
    • +

      +Add workaround for detecting failure to start the diff-highlight process. +

      +
    • +
    • +

      +Show diffs in the stash view when set mailmap = true. (GH #556) +

      +
    • +
    • +

      +Fix parsing of git-log revision arguments, such as --exclude=... in + conjunction with --all. (GH #555) +

      +
    • +
    • +

      +Fix diff stat parsing for binary copies. +

      +
    • +
    • +

      +Fix crash when resizing terminal while search is in progress. (GH #515, #550) +

      +
    • +
    • +

      +Fix argument filtering to pass more arguments through to Git. +

      +
    • +
    • +

      +Check for termcap support in split tinfo libs. (GH #568, #585) +

      +
    • +
    +
    +
    +
    +

    tig-2.2.1

    +
    +

    Tarballs should now be downloaded from GitHub. Either go to +https://github.com/jonas/tig/releases or use the following pattern:

    +
    +
    +
    https://github.com/jonas/tig/releases/download/tig-VERSION/tig-VERSION.tar.gz
    +
    +

    MD5 checksums can be found at:

    +
    +
    +
    https://github.com/jonas/tig/releases/download/tig-VERSION/tig-VERSION.tar.gz.md5
    +
    +

    Similarly, the home page is now also on GitHub at https://jonas.github.io/tig/. +A big thanks to Simon L. B. Nielsen for generously hosting Tig on nitro.dk!

    +

    Improvements:

    +
      +
    • +

      +Support Git’s diff-highlight program when diff-highlight is set to either + true or the path of the script to use for post-processing. +

      +
    • +
    • +

      +Add navigation between merge commits. (GH #525) +

      +
    • +
    • +

      +Add A as a binding to apply a stash without dropping it. +

      +
    • +
    • +

      +Bind Ctrl-D and Ctrl-U to half-page movements by default. +

      +
    • +
    • +

      +manual: Mention how to change default Up/Down behavior in diff view. +

      +
    • +
    +

    Bug fixes:

    +
      +
    • +

      +Reorganize checking of libraries for termcap functions. +

      +
    • +
    • +

      +Fix :goto <id> error message. +

      +
    • +
    +
    +
    +

    tig-2.2

    Incompatibilities:

    @@ -862,6 +1267,11 @@
  • +Show tracking information in tig status (GH #504) +

    +
  • +
  • +

    Resolve diff paths when diff.noprefix is true. (GH #487, #488)

  • @@ -973,7 +1383,7 @@
  • -Add search keymap for navigation file finder search results. +Add search keymap for navigating file finder search results.

  • @@ -3411,7 +3821,7 @@

    diff -Nru tig-2.2/README.adoc tig-2.3.0/README.adoc --- tig-2.2/README.adoc 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/README.adoc 2017-09-29 15:15:26.000000000 +0000 @@ -15,21 +15,20 @@ Resources --------- - - Homepage: http://jonas.nitro.dk/tig/[] - - Manual: http://jonas.nitro.dk/tig/manual.html[] - - Tarballs: http://jonas.nitro.dk/tig/releases/[] - - Git URL: git://github.com/jonas/tig.git (master) or - git://repo.or.cz/tig.git (mirror) + - Homepage: https://jonas.github.io/tig/[] + - Manual: https://jonas.github.io/tig/doc/manual.html[] + - Tarballs: https://github.com/jonas/tig/releases[] + - Git URL: git://github.com/jonas/tig.git - Gitter: https://gitter.im/jonas/tig[] - - Q&A: http://stackoverflow.com/questions/tagged/tig[] + - Q&A: https://stackoverflow.com/questions/tagged/tig[] Bugs and Feature Requests ------------------------- -Bugs and feature requests can be reported using the issue tracker at -https://github.com/jonas/tig/issues[] or by mail to either the Git mailing -list or directly to the maintainer. Ensure that the word "tig" is in the -subject. For other Tig related questions please use Stack Overflow: -http://stackoverflow.com/questions/tagged/tig[]. +Bugs and feature requests can be reported using the +https://github.com/jonas/tig/issues[issue tracker] or by mail to either +the Git mailing list or directly to the maintainer. Ensure that the word +"tig" is in the subject. For other Tig related questions please use +Stack Overflow: http://stackoverflow.com/questions/tagged/tig[]. Installation and News --------------------- diff -Nru tig-2.2/README.html tig-2.3.0/README.html --- tig-2.2/README.html 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/README.html 2017-09-29 15:15:26.000000000 +0000 @@ -25,23 +25,22 @@
    @@ -60,11 +59,11 @@

    Bugs and Feature Requests

    -

    Bugs and feature requests can be reported using the issue tracker at -https://github.com/jonas/tig/issues or by mail to either the Git mailing -list or directly to the maintainer. Ensure that the word "tig" is in the -subject. For other Tig related questions please use Stack Overflow: -http://stackoverflow.com/questions/tagged/tig.

    +

    Bugs and feature requests can be reported using the +issue tracker or by mail to either +the Git mailing list or directly to the maintainer. Ensure that the word +"tig" is in the subject. For other Tig related questions please use +Stack Overflow: http://stackoverflow.com/questions/tagged/tig.

    diff -Nru tig-2.2/src/argv.c tig-2.3.0/src/argv.c --- tig-2.2/src/argv.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/argv.c 2017-09-29 15:15:26.000000000 +0000 @@ -18,16 +18,15 @@ #include "tig/prompt.h" static bool -concat_argv(const char *argv[SIZEOF_ARG], char *buf, size_t buflen, const char *sep, bool quoted) +concat_argv(const char *argv[], char *buf, size_t buflen, const char *sep, bool quoted) { size_t bufpos, argc; for (bufpos = 0, argc = 0; argv[argc]; argc++) { const char *arg_sep = argc ? sep : ""; const char *arg = argv[argc]; - int pos; - if (quoted && arg[(pos = strcspn(arg, " \t\""))]) { + if (quoted && arg[strcspn(arg, " \t\"")]) { if (!string_nformat(buf, buflen, &bufpos, "%s\"", arg_sep)) return false; @@ -37,7 +36,10 @@ if (!string_nformat(buf, buflen, &bufpos, "%.*s%s", pos, arg, qesc)) return false; - arg += pos + 1; + if (!arg[pos]) + break; + else + arg += pos + 1; } if (!string_nformat(buf, buflen, &bufpos, "\"")) @@ -53,6 +55,22 @@ return true; } +char * +argv_to_string_alloc(const char *argv[], const char *sep) +{ + size_t i, size = 0; + char *buf; + + for (i = 0; argv[i]; i++) + size += strlen(argv[i]); + + buf = malloc(size + 1); + if (buf && argv_to_string(argv, buf, size + 1, sep)) + return buf; + free(buf); + return NULL; +} + bool argv_to_string_quoted(const char *argv[SIZEOF_ARG], char *buf, size_t buflen, const char *sep) { @@ -134,7 +152,7 @@ if (!arg) break; argv[(*argc)++] = arg; - cmd = chomp_string(cmd); + cmd = string_trim(cmd); } if (*argc < SIZEOF_ARG) @@ -202,7 +220,7 @@ DEFINE_ALLOCATOR(argv_realloc, const char *, SIZEOF_ARG) bool -argv_append(const char ***argv, const char *arg) +argv_appendn(const char ***argv, const char *arg, size_t arglen) { size_t argc = argv_size(*argv); char *alloc; @@ -213,7 +231,7 @@ if (!argv_realloc(argv, argc, 2)) return false; - alloc = strdup(arg); + alloc = strndup(arg, arglen); (*argv)[argc++] = alloc; (*argv)[argc] = NULL; @@ -221,6 +239,13 @@ return alloc != NULL; } + +bool +argv_append(const char ***argv, const char *arg) +{ + return argv_appendn(argv, arg, strlen(arg)); +} + bool argv_append_array(const char ***dst_argv, const char *src_argv[]) { @@ -261,7 +286,7 @@ struct format_context { struct format_var *vars; size_t vars_size; - char buf[SIZEOF_STR]; + char buf[SIZEOF_CMD]; size_t bufpos; bool file_filter; }; @@ -427,7 +452,7 @@ if (file_filter && !argv_append_array(dst_argv, opt_file_args)) break; - } else if (!strcmp(arg, "%(diffargs)")) { + } else if (!strcmp(arg, DIFF_ARGS)) { if (!format_append_argv(&format, dst_argv, opt_diff_options)) break; @@ -510,6 +535,7 @@ "--committer=", "--date-order", "--dense", + "--exclude=", "--extended-regexp", "--first-parent", "--fixed-strings", @@ -518,11 +544,11 @@ "--glob=", "--left-only", "--max-parents=", + "--max-age=", "--merge", "--merges", "--min-parents=", "--no-max-parents", - "--no-merges", "--no-min-parents", "--no-walk", "--perl-regexp", @@ -549,6 +575,7 @@ "-i", }; static const char *no_graph[] = { + "--no-merges", "--follow", }; static const char *with_reflog[] = { diff -Nru tig-2.2/src/blame.c tig-2.3.0/src/blame.c --- tig-2.2/src/blame.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/blame.c 2017-09-29 15:15:26.000000000 +0000 @@ -73,7 +73,7 @@ !state->auto_filename_display); } -static bool +static enum status_code blame_open(struct view *view, enum open_flags flags) { struct blame_state *state = view->private; @@ -81,16 +81,6 @@ char path[SIZEOF_STR]; size_t i; - if (opt_blame_options) { - for (i = 0; opt_blame_options[i]; i++) { - if (prefixcmp(opt_blame_options[i], "-C")) - continue; - state->auto_filename_display = true; - } - } - - blame_update_file_name_visibility(view); - if (is_initial_view(view)) { /* Finish validating and setting up blame options */ if (!opt_file_args || opt_file_args[1]) @@ -98,8 +88,10 @@ string_ncopy(view->env->file, opt_file_args[0], strlen(opt_file_args[0])); - opt_blame_options = opt_cmdline_args; - opt_cmdline_args = NULL; + if (opt_cmdline_args) { + opt_blame_options = opt_cmdline_args; + opt_cmdline_args = NULL; + } /* * flags (like "--max-age=123") and bottom limits (like "^foo") @@ -124,27 +116,34 @@ } } - if (!view->env->file[0]) { - report("No file chosen, press %s to open tree view", - get_view_key(view, REQ_VIEW_TREE)); - return false; + if (opt_blame_options) { + for (i = 0; opt_blame_options[i]; i++) { + if (prefixcmp(opt_blame_options[i], "-C")) + continue; + state->auto_filename_display = true; + } } + blame_update_file_name_visibility(view); + + if (!view->env->file[0]) + return error("No file chosen, press %s to open tree view", + get_view_key(view, REQ_VIEW_TREE)); + if (!view->prev && *repo.prefix && !(flags & (OPEN_RELOAD | OPEN_REFRESH))) { string_copy(path, view->env->file); - if (!string_format(view->env->file, "%s%s", repo.prefix, path)) { - report("Failed to setup the blame view"); - return false; - } + if (!string_format(view->env->file, "%s%s", repo.prefix, path)) + return error("Failed to setup the blame view"); } - if (*view->env->ref || !begin_update(view, repo.cdup, file_argv, flags)) { + if (*view->env->ref || begin_update(view, repo.cdup, file_argv, flags) != SUCCESS) { const char *blame_cat_file_argv[] = { "git", "cat-file", "blob", "%(ref):%(file)", NULL }; + enum status_code code = begin_update(view, repo.cdup, blame_cat_file_argv, flags); - if (!begin_update(view, repo.cdup, blame_cat_file_argv, flags)) - return false; + if (code != SUCCESS) + return code; } /* First pass: remove multiple references to the same commit. */ @@ -170,11 +169,11 @@ string_copy_rev(state->history_state.id, view->env->ref); state->history_state.filename = get_path(view->env->file); if (!state->history_state.filename) - return false; + return ERROR_OUT_OF_MEMORY; string_format(view->vid, "%s", view->env->file); string_format(view->ref, "%s ...", view->env->file); - return true; + return SUCCESS; } static struct blame_commit * @@ -240,7 +239,7 @@ if (failed_to_load_initial_view(view)) die("No blame exist for %s", view->vid); - if (view->lines == 0 || !begin_update(view, repo.cdup, blame_argv, OPEN_EXTRA)) { + if (view->lines == 0 || begin_update(view, repo.cdup, blame_argv, OPEN_EXTRA) != SUCCESS) { report("Failed to load blame data"); return true; } @@ -286,7 +285,7 @@ if (!state->commit) { state->commit = read_blame_commit(view, buf->data, state); string_format(view->ref, "%s %2zd%%", view->vid, - view->lines ? state->blamed * 100 / view->lines : 0); + view->lines ? 5 * (size_t) (state->blamed * 20 / view->lines) : 0); } else if (parse_blame_info(state->commit, state->author, buf->data)) { bool update_view_columns = true; diff -Nru tig-2.2/src/blob.c tig-2.3.0/src/blob.c --- tig-2.2/src/blob.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/blob.c 2017-09-29 15:15:26.000000000 +0000 @@ -48,7 +48,7 @@ } } -static bool +static enum status_code blob_open(struct view *view, enum open_flags flags) { struct blob_state *state = view->private; @@ -71,19 +71,15 @@ }; if (!string_format(blob_spec, "%s:%s", commit, view->env->file) || - !io_run_buf(rev_parse_argv, view->env->blob, sizeof(view->env->blob), false)) { - report("Failed to resolve blob from file name"); - return false; - } + !io_run_buf(rev_parse_argv, view->env->blob, sizeof(view->env->blob), NULL, false)) + return error("Failed to resolve blob from file name"); string_ncopy(state->commit, commit, strlen(commit)); } - if (!state->file && !view->env->blob[0]) { - report("No file chosen, press %s to open tree view", - get_view_key(view, REQ_VIEW_TREE)); - return false; - } + if (!state->file && !view->env->blob[0]) + return error("No file chosen, press %s to open tree view", + get_view_key(view, REQ_VIEW_TREE)); view->encoding = get_path_encoding(view->env->file, default_encoding); diff -Nru tig-2.2/src/diff.c tig-2.3.0/src/diff.c --- tig-2.2/src/diff.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/diff.c 2017-09-29 15:15:26.000000000 +0000 @@ -21,38 +21,114 @@ #include "tig/diff.h" #include "tig/draw.h" -static bool +static enum status_code diff_open(struct view *view, enum open_flags flags) { const char *diff_argv[] = { "git", "show", encoding_arg, "--pretty=fuller", "--root", "--patch-with-stat", use_mailmap_arg(), show_notes_arg(), diff_context_arg(), ignore_space_arg(), - "%(diffargs)", "%(cmdlineargs)", "--no-color", "%(commit)", + DIFF_ARGS, "%(cmdlineargs)", "--no-color", "%(commit)", "--", "%(fileargs)", NULL }; + enum status_code code; diff_save_line(view, view->private, flags); - return begin_update(view, NULL, diff_argv, flags); + code = begin_update(view, NULL, diff_argv, flags); + if (code != SUCCESS) + return code; + + return diff_init_highlight(view, view->private); +} + +enum status_code +diff_init_highlight(struct view *view, struct diff_state *state) +{ + if (opt_diff_highlight) { + const char *argv[] = { opt_diff_highlight, NULL }; + char * const env[] = { "GIT_CONFIG=/dev/null", NULL }; + struct io io; + + if (!io_exec(&io, IO_RP, view->dir, env, argv, view->io.pipe)) + return error("Failed to run %s", opt_diff_highlight); + + state->view_io = view->io; + view->io = io; + state->highlight = true; + } + + return SUCCESS; +} + +bool +diff_done_highlight(struct diff_state *state) +{ + if (!state->highlight) + return true; + io_kill(&state->view_io); + return io_done(&state->view_io); } struct diff_stat_context { const char *text; enum line_type type; + bool skip; size_t cells; - struct box_cell cell[10]; + const char **cell_text; + struct box_cell cell[256]; }; -static void -diff_common_add_cell(struct diff_stat_context *context, size_t length) +static bool +diff_common_add_cell(struct diff_stat_context *context, size_t length, bool allow_empty) { assert(ARRAY_SIZE(context->cell) > context->cells); - if (length == 0) - return; + if (!allow_empty && (length == 0)) + return true; + if (context->skip && !argv_appendn(&context->cell_text, context->text, length)) + return false; context->cell[context->cells].length = length; context->cell[context->cells].type = context->type; context->cells++; + return true; +} + +static struct line * +diff_common_add_line(struct view *view, const char *text, enum line_type type, struct diff_stat_context *context) +{ + char *cell_text = context->cell_text ? argv_to_string_alloc(context->cell_text, "") : NULL; + const char *line_text = cell_text ? cell_text : text; + struct line *line = add_line_text_at(view, view->lines, line_text, type, context->cells); + struct box *box; + + free(cell_text); + argv_free(context->cell_text); + + if (!line) + return NULL; + + box = line->data; + if (context->cells) + memcpy(box->cell, context->cell, sizeof(struct box_cell) * context->cells); + box->cells = context->cells; + return line; +} + +static bool +diff_common_add_cell_until(struct diff_stat_context *context, const char *s, enum line_type next_type) +{ + const char *sep = strstr(context->text, s); + + if (sep == NULL) + return false; + + if (!diff_common_add_cell(context, sep - context->text, false)) + return false; + + context->text = sep + (context->skip ? strlen(s) : 0); + context->type = next_type; + + return true; } static bool @@ -63,7 +139,7 @@ if (sep == NULL) return false; - diff_common_add_cell(context, sep - context->text); + diff_common_add_cell(context, sep - context->text, false); context->text = sep; context->type = next_type; @@ -74,8 +150,6 @@ diff_common_read_diff_stat(struct view *view, const char *text) { struct diff_stat_context context = { text, LINE_DIFF_STAT }; - struct line *line; - struct box *box; diff_common_read_diff_stat_part(&context, '|', LINE_DEFAULT); if (diff_common_read_diff_stat_part(&context, 'B', LINE_DEFAULT)) { @@ -89,17 +163,9 @@ diff_common_read_diff_stat_part(&context, '+', LINE_DIFF_ADD); diff_common_read_diff_stat_part(&context, '-', LINE_DIFF_DEL); } - diff_common_add_cell(&context, strlen(context.text)); + diff_common_add_cell(&context, strlen(context.text), false); - line = add_line_text_at(view, view->lines, text, LINE_DIFF_STAT, context.cells); - if (!line) - return NULL; - - box = line->data; - if (context.cells) - memcpy(box->cell, context.cell, sizeof(struct box_cell) * context.cells); - box->cells = context.cells; - return line; + return diff_common_add_line(view, text, LINE_DIFF_STAT, &context); } struct line * @@ -112,7 +178,7 @@ /* Ensure that '|' is present and the file name part contains * non-space characters. */ - if (!pipe || pipe == data || strcspn(data, " ") == 0) + if (!pipe || pipe == data) return NULL; /* Detect remaining part of a diff stat line: @@ -124,17 +190,33 @@ * .../truncated file name | 11 ++--- * binary add | Bin 0 -> 1234 bytes * binary update | Bin 1234 -> 2345 bytes + * binary copy | Bin * unmerged | Unmerged */ if ((data[len - 1] == '-' || data[len - 1] == '+') || - strstr(pipe, " 0") || - (strstr(pipe, "Bin") && strstr(pipe, "->")) || - strstr(pipe, "Unmerged") || + strstr(pipe, " 0") || strstr(pipe, "Bin") || strstr(pipe, "Unmerged") || (data[len - 1] == '0' && (strstr(data, "=>") || !prefixcmp(data, "...")))) return diff_common_read_diff_stat(view, text); return NULL; } +static bool +diff_common_highlight(struct view *view, const char *text, enum line_type type) +{ + struct diff_stat_context context = { text, type, true }; + enum line_type hi_type = type == LINE_DIFF_ADD + ? LINE_DIFF_ADD_HIGHLIGHT : LINE_DIFF_DEL_HIGHLIGHT; + const char *codes[] = { "\x1b[7m", "\x1b[27m" }; + const enum line_type types[] = { hi_type, type }; + int i; + + for (i = 0; diff_common_add_cell_until(&context, codes[i], types[i]); i = (i + 1) % 2) + ; + + diff_common_add_cell(&context, strlen(context.text), true); + return diff_common_add_line(view, text, type, &context); +} + bool diff_common_read(struct view *view, const char *data, struct diff_state *state) { @@ -188,6 +270,9 @@ box->cell[box->cells++].type = LINE_DIFF_STAT; return true; + } else if (state->highlight && strchr(data, 0x1b)) { + return diff_common_highlight(view, data, type); + } else if (type == LINE_PP_MERGE) { state->combined_diff = true; } @@ -319,7 +404,7 @@ struct line *line = find_next_line_by_type(view, view->line, LINE_PP_REFS); if (line && buffer) { - const char *ref = chomp_string(buffer->data); + const char *ref = string_trim(buffer->data); const char *sep = !strcmp("Refs: ", box_text(line)) ? "" : ", "; if (*ref && !append_line_format(view, line, "%s%s", sep, ref)) @@ -338,6 +423,11 @@ return diff_read_describe(view, buf, state); if (!buf) { + if (!diff_done_highlight(state)) { + report("Failed run the diff-highlight program: %s", opt_diff_highlight); + return false; + } + /* Fall back to retry if no diff will be shown. */ if (view->lines == 0 && opt_file_args) { int pos = argv_size(view->argv) @@ -360,9 +450,10 @@ if (!state->adding_describe_ref && !ref_list_contains_tag(view->vid)) { const char *describe_argv[] = { "git", "describe", view->vid, NULL }; + enum status_code code = begin_update(view, NULL, describe_argv, OPEN_EXTRA); - if (!begin_update(view, NULL, describe_argv, OPEN_EXTRA)) { - report("Failed to load describe data"); + if (code != SUCCESS) { + report("Failed to load describe data: %s", get_status_message(code)); return true; } @@ -529,6 +620,7 @@ struct line *header; const char *dst; const char *prefixes[] = { "diff --cc ", "diff --combined " }; + const char *name; int i; header = find_prev_line_by_type(view, line, LINE_DIFF_HEADER); @@ -545,11 +637,17 @@ if (!header) return NULL; + name = box_text(header); + if (!prefixcmp(name, "+++ ")) + name += STRING_SIZE("+++ "); + if (opt_diff_noprefix) - return box_text(header) + STRING_SIZE("+++ "); + return name; /* Handle mnemonic prefixes, such as "b/" and "w/". */ - return box_text(header) + STRING_SIZE("+++ b/"); + if (!prefixcmp(name, "b/") || !prefixcmp(name, "w/")) + name += STRING_SIZE("b/"); + return name; } enum request diff -Nru tig-2.2/src/display.c tig-2.3.0/src/display.c --- tig-2.2/src/display.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/display.c 2017-09-29 15:15:26.000000000 +0000 @@ -21,6 +21,8 @@ #include "tig/display.h" #include "tig/watch.h" +static void set_terminal_modes(void); + struct view *display[2]; unsigned int current_view; @@ -44,19 +46,37 @@ if (is_script_executing()) return error("Scripts cannot be run from scripts"); - return io_open(&script_io, "%s", path) - ? SUCCESS : error("Failed to open %s", path); + char buf[SIZEOF_STR]; + + if (!expand_path(buf, sizeof(buf), path)) + return error("Failed to expand path: %s", path); + + return io_open(&script_io, "%s", buf) + ? SUCCESS : error("Failed to open %s", buf); } bool -open_external_viewer(const char *argv[], const char *dir, bool silent, bool confirm, bool refresh, const char *notice) +open_external_viewer(const char *argv[], const char *dir, bool silent, bool confirm, bool echo, bool refresh, const char *notice) { bool ok; - if (silent || is_script_executing()) { + if (echo) { + char buf[SIZEOF_STR] = ""; + + io_run_buf(argv, buf, sizeof(buf), dir, false); + if (*buf) { + report("%s", buf); + return true; + } else { + report("No output"); + return false; + } + } else if (silent || is_script_executing()) { ok = io_run_bg(argv, dir); } else { + clear(); + refresh(); endwin(); /* restore original tty modes */ ok = io_run_fg(argv, dir); if (confirm || !ok) { @@ -64,7 +84,9 @@ fprintf(stderr, "%s", notice); fprintf(stderr, "Press Enter to continue"); getc(opt_tty); + fseek(opt_tty, 0, SEEK_END); } + set_terminal_modes(); } if (watch_update(WATCH_EVENT_AFTER_COMMAND) && refresh) { @@ -116,7 +138,7 @@ if (lineno && opt_editor_line_number && string_format(lineno_cmd, "+%u", lineno)) editor_argv[argc++] = lineno_cmd; editor_argv[argc] = file; - if (!open_external_viewer(editor_argv, repo.cdup, false, false, true, EDITOR_LINENO_MSG)) + if (!open_external_viewer(editor_argv, repo.cdup, false, false, false, true, EDITOR_LINENO_MSG)) opt_editor_line_number = false; } @@ -282,8 +304,9 @@ save_window_line(FILE *file, WINDOW *win, int y, char *buf, size_t bufsize) { int read = mvwinnstr(win, y, 0, buf, bufsize); + const char *out = read == ERR ? "" : string_trim_end(buf); - return read == ERR ? false : fprintf(file, "%s\n", buf) == read + 1; + return read == ERR ? false : fprintf(file, "%s\n", out) == strlen(out) + 1; } static bool @@ -295,8 +318,9 @@ if (read2 == ERR) return false; buf[read1] = '|'; + buf = string_trim_end(buf); - return fprintf(file, "%s\n", buf) == read1 + 1 + read2 + 1; + return fprintf(file, "%s\n", string_trim_end(buf)) == strlen(buf) + 1; } bool @@ -345,6 +369,65 @@ } /* + * Dump view data to file. + * + * FIXME: Add support for more line state and column data. + */ +bool +save_view(struct view *view, const char *path) +{ + struct view_column_data column_data = {0}; + FILE *file = fopen(path, "w"); + size_t i; + + if (!file) + return false; + + fprintf(file, "View: %s\n", view->name); + if (view->parent && view->parent != view) + fprintf(file, "Parent: %s\n", view->parent->name); + fprintf(file, "Ref: %s\n", view->ref); + fprintf(file, "Dimensions: height=%d width=%d\n", view->height, view->width); + fprintf(file, "Position: offset=%ld column=%ld lineno=%ld\n", + view->pos.offset, + view->pos.col, + view->pos.lineno); + + for (i = 0; i < view->lines; i++) { + struct line *line = &view->line[i]; + + fprintf(file, "line[%3zu] type=%s selected=%d\n", + i, + enum_name(get_line_type_name(line->type)), + line->selected); + + if (!view->ops->get_column_data(view, line, &column_data)) + return true; + + if (column_data.box) { + const struct box *box = column_data.box; + size_t j; + size_t offset; + + fprintf(file, "line[%3zu] cells=%zu text=", + i, box->cells); + + for (j = 0, offset = 0; j < box->cells; j++) { + const struct box_cell *cell = &box->cell[j]; + + fprintf(file, "[%.*s]", (int) cell->length, box->text + offset); + offset += cell->length; + } + + fprintf(file, "\n"); + } + } + + fclose(file); + return true; +} + +/* * Status management */ @@ -365,7 +448,7 @@ /* Update status and title window. */ static bool -update_status_window(struct view *view, const char *msg, va_list args) +update_status_window(struct view *view, const char *context, const char *msg, va_list args) { if (input_mode) return false; @@ -381,6 +464,20 @@ status_empty = true; } wclrtoeol(status_win); + + if (context && *context) { + size_t contextlen = strlen(context); + int x, y, width, ___; + + getyx(status_win, y, x); + getmaxyx(status_win, ___, width); + (void) ___; + if (contextlen < width - x) { + mvwprintw(status_win, 0, width - contextlen, "%s", context); + wmove(status_win, y, x); + } + } + return true; } @@ -393,7 +490,17 @@ va_list args; va_start(args, msg); - update_status_window(display[current_view], msg, args); + update_status_window(display[current_view], "", msg, args); + va_end(args); +} + +void +update_status_with_context(const char *context, const char *msg, ...) +{ + va_list args; + + va_start(args, msg); + update_status_window(display[current_view], context, msg, args); va_end(args); } @@ -412,21 +519,53 @@ } va_start(args, msg); - if (update_status_window(view, msg, args)) + if (update_status_window(view, "", msg, args)) wnoutrefresh(status_win); va_end(args); update_view_title(view); } +void +report_clear(void) +{ + struct view *view = display[current_view]; + + if (!view) + return; + + if (!input_mode && !status_empty) { + werase(status_win); + doupdate(); + } + status_empty = true; + update_view_title(view); +} + static void done_display(void) { - if (cursed) + if (cursed) { + if (status_win) { + werase(status_win); + doupdate(); + } + curs_set(1); endwin(); + } cursed = false; } +static void +set_terminal_modes(void) +{ + nonl(); /* Disable conversion and detect newlines from input. */ + raw(); /* Take input chars one at a time, no wait for \n */ + noecho(); /* Don't echo input */ + curs_set(0); + leaveok(stdscr, false); +} + void init_display(void) { @@ -440,10 +579,7 @@ die("Failed to register done_display"); /* Initialize the curses library */ - if (!no_display && isatty(STDIN_FILENO)) { - cursed = !!initscr(); - opt_tty = stdin; - } else { + { /* Leave stdin and stdout alone when acting as a pager. */ FILE *out_tty; @@ -457,11 +593,7 @@ if (!cursed) die("Failed to initialize curses"); - nonl(); /* Disable conversion and detect newlines from input. */ - cbreak(); /* Take input chars one at a time, no wait for \n */ - noecho(); /* Don't echo input */ - leaveok(stdscr, false); - + set_terminal_modes(); init_colors(); getmaxyx(stdscr, y, x); @@ -480,7 +612,9 @@ TABSIZE = opt_tab_size; #endif - term = getenv("XTERM_VERSION") ? NULL : getenv("COLORTERM"); + term = getenv("XTERM_VERSION") + ? NULL + : (getenv("TERM_PROGRAM") ? getenv("TERM_PROGRAM") : getenv("COLORTERM")); if (term && !strcmp(term, "gnome-terminal")) { /* In the gnome-terminal-emulator, the warning message * shown when scrolling up one line while the cursor is @@ -490,14 +624,20 @@ use_scroll_status_wclear = true; use_scroll_redrawwin = false; - } else if (term && !strcmp(term, "xrvt-xpm")) { - /* No problems with full optimizations in xrvt-(unicode) - * and aterm. */ + } else if (term && + (!strcmp(term, "xrvt-xpm") || !strcmp(term, "Apple_Terminal") || + !strcmp(term, "iTerm.app"))) { + /* No problems with full optimizations in + * xrvt-(unicode) + * aterm + * Terminal.app + * iTerm2 */ use_scroll_status_wclear = use_scroll_redrawwin = false; } else { /* When scrolling in (u)xterm the last line in the - * scrolling direction will update slowly. */ + * scrolling direction will update slowly. This is + * the conservative default. */ use_scroll_redrawwin = true; use_scroll_status_wclear = false; } @@ -510,7 +650,7 @@ static const char *line = ""; enum status_code code; - if (!line || !*line) { + while (!line || !*line) { if (input_buffer.data && *input_buffer.data == ':') { line = ""; memset(&input_buffer, 0, sizeof(input_buffer)); @@ -518,6 +658,8 @@ } else if (!io_get(&script_io, &input_buffer, '\n', true)) { io_done(&script_io); return false; + } else if (input_buffer.data[strspn(input_buffer.data, " \t")] == '#') { + continue; } else { line = input_buffer.data; } @@ -570,10 +712,16 @@ if (opt_refresh_mode == REFRESH_MODE_PERIODIC) { delay = watch_periodic(opt_refresh_interval); + bool refs_refreshed = false; foreach_displayed_view (view, i) { if (view_can_refresh(view) && - watch_dirty(&view->watch)) + watch_dirty(&view->watch)) { + if (!refs_refreshed) { + load_refs(true); + refs_refreshed = true; + } refresh_view(view); + } } } @@ -627,6 +775,9 @@ resize_display(); redraw_display(true); + } else if (key_value == KEY_CTL('z')) { + raise(SIGTSTP); + } else { int pos, key_length; @@ -638,7 +789,7 @@ * Ctrl- values are represented using a 0x1F * bitmask on the key value. To 'unmap' we assume that: * - * - Ctrl-Z is handled by Ncurses. + * - Ctrl-Z is handled separately for job control. * - Ctrl-m is the same as Return/Enter. * - Ctrl-i is the same as Tab. * @@ -646,7 +797,7 @@ * is set and the key value is updated to the proper * ASCII value. */ - if (KEY_CTL('a') <= key_value && key_value <= KEY_CTL('y') && + if (KEY_CTL('@') <= key_value && key_value <= KEY_CTL('y') && key_value != KEY_RETURN && key_value != KEY_TAB) { key->modifiers.control = 1; key_value = key_value | 0x40; diff -Nru tig-2.2/src/draw.c tig-2.3.0/src/draw.c --- tig-2.2/src/draw.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/draw.c 2017-09-29 15:15:26.000000000 +0000 @@ -71,14 +71,13 @@ } set_view_attr(view, type); - if (len > 0) { + if (len > 0) waddnstr(view->win, string, len); - if (trimmed && use_tilde) { - set_view_attr(view, LINE_DELIMITER); - waddch(view->win, '~'); - col++; - } + if (trimmed && use_tilde) { + set_view_attr(view, LINE_DELIMITER); + waddstr(view->win, opt_truncation_delimiter ? opt_truncation_delimiter : "~"); + col++; } view->col += col; @@ -214,7 +213,7 @@ int leftpad = max - textlen - 1; if (leftpad > 0) { - if (draw_space(view, type, leftpad, leftpad)) + if (draw_space(view, type, leftpad, leftpad)) return true; max -= leftpad; col += leftpad;; @@ -308,7 +307,7 @@ draw_lineno_custom(struct view *view, struct view_column *column, unsigned int lineno) { char number[10]; - unsigned long digits3 = column->width < 3 ? 3 : column->width; + unsigned long digits3 = MIN(9,MAX(3,column->width)); int max = MIN(VIEW_MAX_LEN(view), digits3); char *text = NULL; chtype separator = opt_line_graphics ? ACS_VLINE : '|'; @@ -321,7 +320,7 @@ if (lineno == 1 || (lineno % interval) == 0) { static char fmt[] = "%ld"; - fmt[1] = '0' + (digits3 <= 9 ? digits3 : 1); + fmt[1] = '0' + digits3; if (string_format(number, fmt, lineno)) text = number; } @@ -570,7 +569,7 @@ draw_view_line_search_result(struct view *view, unsigned int lineno) { size_t bufsize = view->width * 4; - char *buf = malloc(bufsize); + char *buf = malloc(bufsize + 1); regmatch_t pmatch[1]; regoff_t bufpos = 0; diff -Nru tig-2.2/src/graph-v1.c tig-2.3.0/src/graph-v1.c --- tig-2.2/src/graph-v1.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/graph-v1.c 2017-09-29 15:15:26.000000000 +0000 @@ -313,6 +313,12 @@ } static bool +graph_is_merge(struct graph_canvas *canvas) +{ + return !!canvas->symbols->merge; +} + +static bool graph_add_commit(struct graph *graph_, struct graph_canvas *canvas, const char *id, const char *parents, bool is_boundary) { @@ -493,6 +499,7 @@ api->add_commit = graph_add_commit; api->add_parent = graph_add_parent; api->render_parents = graph_render_parents; + api->is_merge = graph_is_merge; api->foreach_symbol = graph_foreach_symbol; api->symbol_to_ascii = graph_symbol_to_ascii; api->symbol_to_utf8 = graph_symbol_to_utf8; diff -Nru tig-2.2/src/graph-v2.c tig-2.3.0/src/graph-v2.c --- tig-2.2/src/graph-v2.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/graph-v2.c 2017-09-29 15:15:26.000000000 +0000 @@ -48,7 +48,7 @@ struct graph_column { struct graph_symbol symbol; - char id[SIZEOF_REV]; /* Parent SHA1 ID. */ + const char *id; /* Parent SHA1 ID. */ }; struct graph_row { @@ -70,7 +70,7 @@ size_t position; size_t prev_position; size_t expanded; - char id[SIZEOF_REV]; + const char *id; struct colors colors; bool has_parents; bool is_boundary; @@ -79,6 +79,37 @@ DEFINE_ALLOCATOR(realloc_graph_columns, struct graph_column, 32) DEFINE_ALLOCATOR(realloc_graph_symbols, struct graph_symbol, 1) +static htab_t intern_string_htab; + +static int +intern_string_eq(const void *entry, const void *element) +{ + return strcmp((const char *) entry, (const char *) element) == 0; +} + +static hashval_t +intern_string_hash(const void *node) +{ + return htab_hash_string((const char *) node); +} + +static const char *intern_string(const char *str) +{ + void **result; + + if (!str) + return NULL; + + if (!intern_string_htab) + intern_string_htab = htab_create_alloc(500, intern_string_hash, intern_string_eq, free, calloc, free); + + result = htab_find_slot(intern_string_htab, str, INSERT); + if (!*result) + *result = strdup(str); + + return *result; +} + struct id_color { char *id; size_t color; @@ -190,10 +221,13 @@ } static size_t -get_color(struct graph_v2 *graph, char *new_id) +get_color(struct graph_v2 *graph, const char *new_id) { size_t color; + if (!new_id) + new_id = ""; + colors_init(&graph->colors); color = colors_get_color(&graph->colors, new_id); @@ -224,9 +258,12 @@ struct graph_v2 *graph = graph_ref->private; free(graph); + + if (intern_string_htab) + htab_empty(intern_string_htab); } -#define graph_column_has_commit(col) ((col)->id[0]) +#define graph_column_has_commit(col) ((col)->id) static size_t graph_find_column_by_id(struct graph_row *row, const char *id) @@ -237,7 +274,7 @@ for (i = 0; i < row->size; i++) { if (!graph_column_has_commit(&row->columns[i]) && free_column == row->size) free_column = i; - else if (!strcmp(row->columns[i].id, id)) + else if (row->columns[i].id == id) return i; } @@ -270,9 +307,11 @@ memmove(column + 1, column, sizeof(*column) * (row->size - pos)); } + id = intern_string(id); + row->size++; memset(column, 0, sizeof(*column)); - string_copy_rev(column->id, id); + column->id = id; column->symbol.boundary = !!graph->is_boundary; return column; @@ -298,13 +337,13 @@ graph_expand(struct graph_v2 *graph) { while (graph_needs_expansion(graph)) { - if (!graph_insert_column(graph, &graph->prev_row, graph->prev_row.size, "")) + if (!graph_insert_column(graph, &graph->prev_row, graph->prev_row.size, NULL)) return false; - if (!graph_insert_column(graph, &graph->row, graph->row.size, "")) + if (!graph_insert_column(graph, &graph->row, graph->row.size, NULL)) return false; - if (!graph_insert_column(graph, &graph->next_row, graph->next_row.size, "")) + if (!graph_insert_column(graph, &graph->next_row, graph->next_row.size, NULL)) return false; } @@ -343,8 +382,8 @@ int i; for (i = 0; i < row->size; i++) { - if (strcmp(row->columns[i].id, id) == 0) { - row->columns[i].id[0] = 0; + if (row->columns[i].id == id) { + row->columns[i].id = NULL; } } } @@ -364,10 +403,10 @@ if (graph_column_has_commit(new)) { size_t match = graph_find_free_column(next_row); - if (match == next_row->size && *next_row->columns[next_row->size - 1].id) { + if (match == next_row->size && graph_column_has_commit(&next_row->columns[next_row->size - 1])) { graph_insert_column(graph, next_row, next_row->size, new->id); - graph_insert_column(graph, row, row->size, ""); - graph_insert_column(graph, prev_row, prev_row->size, ""); + graph_insert_column(graph, row, row->size, NULL); + graph_insert_column(graph, prev_row, prev_row->size, NULL); } else { next_row->columns[match] = *new; } @@ -384,7 +423,7 @@ if (!graph_column_has_commit(&row->columns[i])) continue; - if (strcmp(id, row->columns[i].id) == 0) + if (id == row->columns[i].id) return true; } return false; @@ -403,16 +442,16 @@ if (i == graph->position + 1) continue; - if (strcmp(row->columns[i].id, graph->id) == 0) + if (row->columns[i].id == graph->id) continue; - if (strcmp(row->columns[i].id, row->columns[i - 1].id) != 0) + if (row->columns[i].id != row->columns[i - 1].id) continue; if (commit_is_in_row(row->columns[i].id, &graph->parents) && !graph_column_has_commit(&graph->prev_row.columns[i])) continue; - if (strcmp(row->columns[i - 1].id, graph->prev_row.columns[i - 1].id) != 0 || graph->prev_row.columns[i - 1].symbol.shift_left) { + if (row->columns[i - 1].id != graph->prev_row.columns[i - 1].id || graph->prev_row.columns[i - 1].symbol.shift_left) { if (i + 1 >= row->size) memset(&row->columns[i], 0, sizeof(row->columns[i])); else @@ -480,7 +519,7 @@ static bool continued_down(struct graph_row *row, struct graph_row *next_row, int pos) { - if (strcmp(row->columns[pos].id, next_row->columns[pos].id) != 0) + if (row->columns[pos].id != next_row->columns[pos].id) return false; if (row->columns[pos].symbol.shift_left) @@ -501,7 +540,7 @@ if (!graph_column_has_commit(&row->columns[i])) continue; - if (strcmp(row->columns[i].id, row->columns[pos].id) != 0) + if (row->columns[i].id != row->columns[pos].id) continue; if (!continued_down(prev_row, row, i)) @@ -522,7 +561,7 @@ return true; for (i = pos; i < row->size; i++) { - if (strcmp(row->columns[pos].id, prev_row->columns[i].id) == 0) + if (row->columns[pos].id == prev_row->columns[i].id) return false; } @@ -540,7 +579,7 @@ end = row->size; for (i = pos + 1; i < end; i++) { - if (strcmp(row->columns[pos].id, row->columns[i].id) == 0) + if (row->columns[pos].id == row->columns[i].id) return true; } @@ -561,7 +600,7 @@ if (!graph_column_has_commit(&row->columns[i])) continue; - if (strcmp(row->columns[pos].id, row->columns[i].id) == 0) + if (row->columns[pos].id == row->columns[i].id) return true; } @@ -577,7 +616,8 @@ if (!graph_column_has_commit(&parents->columns[parent])) continue; - if (strcmp(parents->columns[parent].id, next_row->columns[pos].id) == 0) + if (parents->columns[parent].id == next_row->columns[pos].id) + return true; } @@ -594,10 +634,10 @@ continue; for (i = pos + 1; i < next_row->size; i++) { - if (strcmp(parents->columns[parent].id, next_row->columns[i].id) != 0) + if (parents->columns[parent].id != next_row->columns[i].id) continue; - if (strcmp(parents->columns[parent].id, row->columns[i].id) != 0) + if (parents->columns[parent].id != row->columns[i].id) return true; } } @@ -619,7 +659,7 @@ } for (i = start; i < end; i++) { - if (strcmp(row->columns[i].id, commit_id) == 0) + if (row->columns[i].id == commit_id) return true; } @@ -632,7 +672,7 @@ if (pos != graph->prev_position) return false; - if (strcmp(graph->row.columns[pos].id, graph->prev_row.columns[pos].id)) + if (graph->row.columns[pos].id != graph->prev_row.columns[pos].id) return false; return true; @@ -645,17 +685,20 @@ struct graph_row *row = &graph->row; struct graph_row *next_row = &graph->next_row; struct graph_row *parents = &graph->parents; + int commits = commits_in_row(parents); + int initial = commits < 1; + int merge = commits > 1; int pos; for (pos = 0; pos < row->size; pos++) { struct graph_column *column = &row->columns[pos]; struct graph_symbol *symbol = &column->symbol; - char *id = next_row->columns[pos].id; + const char *id = next_row->columns[pos].id; symbol->commit = (pos == graph->position); symbol->boundary = (pos == graph->position && next_row->columns[pos].symbol.boundary); - symbol->initial = (commits_in_row(parents) < 1); - symbol->merge = (commits_in_row(parents) > 1); + symbol->initial = initial; + symbol->merge = merge; symbol->continued_down = continued_down(row, next_row, pos); symbol->continued_up = continued_down(prev_row, row, pos); @@ -669,7 +712,7 @@ symbol->below_commit = below_commit(pos, graph); symbol->flanked = flanked(row, pos, graph->position, graph->id); symbol->next_right = continued_right(next_row, pos, 0); - symbol->matches_commit = (strcmp(column->id, graph->id) == 0); + symbol->matches_commit = column->id == graph->id; symbol->shift_left = shift_left(row, prev_row, pos); symbol->continue_shift = (pos + 1 < row->size) ? shift_left(row, prev_row, pos + 1) : 0; @@ -695,7 +738,7 @@ struct graph_v2 *graph = graph_ref->private; if (graph->parents.size == 0 && - !graph_add_parent(graph_ref, "")) + !graph_add_parent(graph_ref, NULL)) return false; if (!graph_expand(graph)) @@ -714,20 +757,30 @@ } static bool +graph_is_merge(struct graph_canvas *canvas) +{ + return !!canvas->symbols->merge; +} + +static bool graph_add_commit(struct graph *graph_ref, struct graph_canvas *canvas, const char *id, const char *parents, bool is_boundary) { struct graph_v2 *graph = graph_ref->private; int has_parents = 0; + id = intern_string(id); + graph->position = graph_find_column_by_id(&graph->row, id); - string_copy_rev(graph->id, id); + graph->id = id; graph->is_boundary = is_boundary; graph->has_parents = false; while ((parents = strchr(parents, ' '))) { + char parent[SIZEOF_REV] = {0}; parents++; - if (!graph_add_parent(graph_ref, parents)) + string_copy_rev(parent, parents); + if (!graph_add_parent(graph_ref, *parent ? parent : NULL)) return false; has_parents++; } @@ -753,6 +806,51 @@ } static const bool +graph_symbol_cross_merge(const struct graph_symbol *symbol) +{ + if (symbol->empty) + return false; + + if (!symbol->continued_up && !symbol->new_column && !symbol->below_commit) + return false; + + if (symbol->shift_left && symbol->continued_up_left) + return false; + + if (symbol->next_right) + return false; + + if (symbol->merge && symbol->continued_up && symbol->continued_right && symbol->continued_left && symbol->parent_down && !symbol->next_right) + return true; + + return false; +} + +static const bool +graph_symbol_vertical_merge(const struct graph_symbol *symbol) +{ + if (symbol->empty) + return false; + + if (!symbol->continued_up && !symbol->new_column && !symbol->below_commit) + return false; + + if (symbol->shift_left && symbol->continued_up_left) + return false; + + if (symbol->next_right) + return false; + + if (!symbol->matches_commit) + return false; + + if (symbol->merge && symbol->continued_up && symbol->continued_left && symbol->parent_down && !symbol->continued_right) + return true; + + return false; +} + +static const bool graph_symbol_cross_over(const struct graph_symbol *symbol) { if (symbol->empty) @@ -805,6 +903,9 @@ if (!symbol->continued_right) return false; + if (!symbol->parent_right && !symbol->flanked) + return false; + if (symbol->flanked) return true; @@ -838,6 +939,9 @@ if (symbol->parent_right) return false; + if (symbol->continued_right) + return false; + return true; } @@ -847,7 +951,7 @@ if (!symbol->parent_down) return false; - if (!symbol->parent_right) + if (!symbol->parent_right && !symbol->continued_right) return false; return true; @@ -883,6 +987,9 @@ static const bool graph_symbol_horizontal_bar(const struct graph_symbol *symbol) { + if (!symbol->next_right) + return false; + if (symbol->shift_left) return true; @@ -937,6 +1044,12 @@ return " ●"; } + if (graph_symbol_cross_merge(symbol)) + return "─┼"; + + if (graph_symbol_vertical_merge(symbol)) + return "─┤"; + if (graph_symbol_cross_over(symbol)) return "─│"; @@ -987,6 +1100,14 @@ graphics[1] = 'o'; //ACS_DIAMOND; //'*'; return graphics; + } else if (graph_symbol_cross_merge(symbol)) { + graphics[0] = ACS_HLINE; + graphics[1] = ACS_PLUS; + + } else if (graph_symbol_vertical_merge(symbol)) { + graphics[0] = ACS_HLINE; + graphics[1] = ACS_RTEE; + } else if (graph_symbol_cross_over(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_VLINE; @@ -1046,6 +1167,12 @@ return " *"; } + if (graph_symbol_cross_merge(symbol)) + return "-+"; + + if (graph_symbol_vertical_merge(symbol)) + return "-|"; + if (graph_symbol_cross_over(symbol)) return "-|"; @@ -1109,6 +1236,7 @@ api->done_rendering = done_graph_rendering; api->add_commit = graph_add_commit; api->add_parent = graph_add_parent; + api->is_merge = graph_is_merge; api->render_parents = graph_render_parents; api->foreach_symbol = graph_foreach_symbol; api->symbol_to_ascii = graph_symbol_to_ascii; diff -Nru tig-2.2/src/grep.c tig-2.3.0/src/grep.c --- tig-2.2/src/grep.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/grep.c 2017-09-29 15:15:26.000000000 +0000 @@ -99,7 +99,9 @@ int argc = 0; char *grep = read_prompt("grep: "); - if (!grep || !argv_from_string_no_quotes(argv, &argc, grep)) + report_clear(); + + if (!grep || !*grep || !argv_from_string_no_quotes(argv, &argc, grep)) return false; if (grep_argv) argv_free(grep_argv); @@ -122,7 +124,7 @@ } } -static bool +static enum status_code grep_open(struct view *view, enum open_flags flags) { struct grep_state *state = view->private; @@ -135,7 +137,7 @@ if (!argv_append_array(&argv, grep_args) || !argv_append_array(&argv, grep_argv)) - return false; + return ERROR_OUT_OF_MEMORY; { struct view_column *column = get_view_column(view, VIEW_COLUMN_FILE_NAME); diff -Nru tig-2.2/src/help.c tig-2.3.0/src/help.c --- tig-2.2/src/help.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/help.c 2017-09-29 15:15:26.000000000 +0000 @@ -172,7 +172,7 @@ return true; } -static bool +static enum status_code help_open(struct view *view, enum open_flags flags) { struct help_request_iterator iterator = { view }; @@ -181,14 +181,15 @@ reset_view(view); if (!add_help_line(view, &help, NULL, LINE_HEADER)) - return false; + return ERROR_OUT_OF_MEMORY; help->data.text = "Quick reference for tig keybindings:"; if (!add_help_line(view, &help, NULL, LINE_DEFAULT)) - return false; + return ERROR_OUT_OF_MEMORY; help->data.text = ""; - return foreach_key(help_keys_visitor, &iterator, true); + return foreach_key(help_keys_visitor, &iterator, true) + ? SUCCESS : error("Failed to render key bindings"); } static enum request diff -Nru tig-2.2/src/io.c tig-2.3.0/src/io.c --- tig-2.2/src/io.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/io.c 2017-09-29 15:15:26.000000000 +0000 @@ -109,7 +109,7 @@ /* : encoding: */ - if (!*path || !io_run_buf(check_attr_argv, buf, sizeof(buf), false) + if (!*path || !io_run_buf(check_attr_argv, buf, sizeof(buf), NULL, false) || !(encoding = strstr(buf, ENCODING_SEP))) return default_encoding; @@ -121,7 +121,7 @@ "file", "-I", "--", path, NULL }; - if (!*path || !io_run_buf(file_argv, buf, sizeof(buf), false) + if (!*path || !io_run_buf(file_argv, buf, sizeof(buf), NULL, false) || !(encoding = strstr(buf, CHARSET_SEP))) return default_encoding; @@ -132,6 +132,41 @@ } /* + * Path manipulation. + */ + +bool +expand_path(char *dst, size_t dstlen, const char *src) +{ + if (!src) + return false; + + if (src[0] == '~') { + /* constrain wordexp to tilde expansion only */ + const char *ifs = getenv("IFS") ? getenv("IFS") : " \t\n"; + wordexp_t we_result; + size_t metachar_pos; + char metachars[SIZEOF_STR]; + char leading[SIZEOF_STR]; + + string_format(metachars, "%s%s", "/$|&;<>(){}`", ifs); + metachar_pos = strcspn(src, metachars); + if (src[metachar_pos] == '/' || src[metachar_pos] == 0) { + string_nformat(leading, metachar_pos + 1, NULL, "%s", src); + if (wordexp(leading, &we_result, WRDE_NOCMD)) + return false; + string_nformat(dst, dstlen, NULL, "%s%s", we_result.we_wordv[0], src + metachar_pos); + wordfree(&we_result); + return true; + } + } + + /* else */ + string_ncopy_do(dst, dstlen, src, strlen(src)); + return true; +} + +/* * Executing external commands. */ @@ -179,7 +214,7 @@ io_init(io); while (pid > 0) { - int status; + int status = 0; pid_t waiting = waitpid(pid, &status, 0); if (waiting < 0) { @@ -189,9 +224,7 @@ return false; } - if (WEXITSTATUS(status)) { - io->status = WEXITSTATUS(status); - } + io->status = WIFEXITED(status) ? WEXITSTATUS(status) : 0; return waiting == pid && !WIFSIGNALED(status) && @@ -216,16 +249,19 @@ int fd = open(trace_file, O_RDWR | O_CREAT | O_APPEND, 0666); int i; + flock(fd, LOCK_EX); for (i = 0; argv[i]; i++) { if (write(fd, argv[i], strlen(argv[i])) == -1 || write(fd, " ", 1) == -1) break; } if (argv[i] || write(fd, "\n", 1) == -1) { + flock(fd, LOCK_UN); close(fd); return devnull; } + flock(fd, LOCK_UN); return fd; } @@ -268,7 +304,7 @@ if (dir && !strcmp(dir, argv[0])) return io_open(io, "%s%s", dir, argv[1]); - if ((type == IO_RD || type == IO_WR) && pipe(pipefds) < 0) { + if ((type == IO_RD || type == IO_RP || type == IO_WR) && pipe(pipefds) < 0) { io->error = errno; return false; } else if (type == IO_AP) { @@ -288,9 +324,11 @@ } else { if (type != IO_FG) { int devnull = open("/dev/null", O_RDWR); - int readfd = type == IO_WR ? pipefds[0] : devnull; - int writefd = (type == IO_RD || type == IO_AP) - ? pipefds[1] : devnull; + int readfd = type == IO_WR ? pipefds[0] + : type == IO_RP ? custom + : devnull; + int writefd = (type == IO_RD || type == IO_RP || type == IO_AP) + ? pipefds[1] : devnull; int errorfd = open_trace(devnull, argv); /* Inject stdin given on the command line. */ @@ -314,7 +352,7 @@ } if (dir && *dir && chdir(dir) == -1) - exit(errno); + _exit(errno); if (env) { int i; @@ -325,7 +363,9 @@ } execvp(argv[0], (char *const*) argv); - exit(errno); + + close(STDOUT_FILENO); + _exit(errno); } if (pipefds[!!(type == IO_WR)] != -1) @@ -426,7 +466,7 @@ DEFINE_ALLOCATOR(io_realloc_buf, char, BUFSIZ) static bool -io_get_line(struct io *io, struct buffer *buf, int c, size_t *lineno, bool can_read) +io_get_line(struct io *io, struct buffer *buf, int c, size_t *lineno, bool can_read, char eol_char) { char *eol; ssize_t readsize; @@ -435,7 +475,7 @@ if (io->bufsize > 0) { eol = memchr(io->bufpos, c, io->bufsize); - while (io->span && io->bufpos < eol && eol[-1] == '\\') { + while (eol_char && io->bufpos < eol && eol[-1] == eol_char) { if (lineno) (*lineno)++; eol[-1] = eol[0] = ' '; @@ -492,7 +532,7 @@ bool io_get(struct io *io, struct buffer *buf, int c, bool can_read) { - return io_get_line(io, buf, c, NULL, can_read); + return io_get_line(io, buf, c, NULL, can_read, 0); } bool @@ -537,7 +577,7 @@ struct buffer result = {0}; if (io_get(io, &result, '\n', true)) { - result.data = chomp_string(result.data); + result.data = string_trim(result.data); string_ncopy_do(buf, bufsize, result.data, strlen(result.data)); } @@ -545,11 +585,11 @@ } bool -io_run_buf(const char **argv, char buf[], size_t bufsize, bool allow_empty) +io_run_buf(const char **argv, char buf[], size_t bufsize, const char *dir, bool allow_empty) { struct io io; - return io_run(&io, IO_RD, NULL, NULL, argv) && io_read_buf(&io, buf, bufsize, allow_empty); + return io_run(&io, IO_RD, dir, NULL, argv) && io_read_buf(&io, buf, bufsize, allow_empty); } bool @@ -577,18 +617,18 @@ struct buffer buf; enum status_code state = SUCCESS; - while (state == SUCCESS && io_get_line(io, &buf, '\n', lineno, true)) { + while (state == SUCCESS && io_get_line(io, &buf, '\n', lineno, true, '\\')) { char *name; char *value; size_t namelen; size_t valuelen; - name = chomp_string(buf.data); + name = string_trim(buf.data); namelen = strcspn(name, separators); if (name[namelen]) { name[namelen] = 0; - value = chomp_string(name + namelen + 1); + value = string_trim(name + namelen + 1); valuelen = strlen(value); } else { @@ -610,7 +650,6 @@ io_load_span(struct io *io, const char *separators, size_t *lineno, io_read_fn read_property, void *data) { - io->span = true; return io_load_file(io, separators, lineno, read_property, data); } diff -Nru tig-2.2/src/keys.c tig-2.3.0/src/keys.c --- tig-2.2/src/keys.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/keys.c 2017-09-29 15:15:26.000000000 +0000 @@ -224,10 +224,25 @@ { "F10", KEY_F(10) }, { "F11", KEY_F(11) }, { "F12", KEY_F(12) }, + { "F13", KEY_F(13) }, + { "F14", KEY_F(14) }, + { "F15", KEY_F(15) }, + { "F16", KEY_F(16) }, + { "F17", KEY_F(17) }, + { "F18", KEY_F(18) }, + { "F19", KEY_F(19) }, { "ScrollBack", KEY_SR }, { "SBack", KEY_SR }, { "ScrollFwd", KEY_SF }, { "SFwd", KEY_SF }, + { "BackTab", KEY_BTAB }, + { "ShiftTab", KEY_BTAB }, + { "ShiftLeft", KEY_SLEFT }, + { "ShiftRight", KEY_SRIGHT }, + { "ShiftDelete", KEY_SDC }, + { "ShiftDel", KEY_SDC }, + { "ShiftHome", KEY_SHOME }, + { "ShiftEnd", KEY_SEND }, }; static const struct key_mapping * @@ -435,11 +450,14 @@ DEFINE_ALLOCATOR(realloc_run_requests, struct run_request, 8) -#define COMMAND_FLAGS ":!?@<" +#define COMMAND_FLAGS ":!?@<+" enum status_code parse_run_request_flags(struct run_request_flags *flags, const char **argv) { + if (!argv[0]) + return error("No arguments"); + if (!strchr(COMMAND_FLAGS, *argv[0])) return error("Unknown command flag '%c'; expected one of %s", argv[0][0], COMMAND_FLAGS); @@ -454,6 +472,8 @@ flags->confirm = 1; } else if (*argv[0] == '<') { flags->exit = 1; + } else if (*argv[0] == '+') { + flags->echo = 1; } else if (*argv[0] != '!') { break; } @@ -514,6 +534,8 @@ flags[flagspos++] = '?'; if (req->flags.exit) flags[flagspos++] = '<'; + if (req->flags.echo) + flags[flagspos++] = '+'; if (flagspos > 1) flags[flagspos++] = 0; diff -Nru tig-2.2/src/line.c tig-2.3.0/src/line.c --- tig-2.2/src/line.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/line.c 2017-09-29 15:15:26.000000000 +0000 @@ -63,13 +63,20 @@ return LINE_MAIN_REF; } +const char * +get_line_type_name(enum line_type type) +{ + assert(0 <= type && type < line_rules); + return line_rule[type].name; +} + struct line_info * get_line_info(const char *prefix, enum line_type type) { struct line_info *info; struct line_rule *rule; - assert(type < line_rules); + assert(0 <= type && type < line_rules); rule = &line_rule[type]; for (info = &rule->info; info; info = info->next) { if (prefix && info->prefix == prefix) diff -Nru tig-2.2/src/log.c tig-2.3.0/src/log.c --- tig-2.2/src/log.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/log.c 2017-09-29 15:15:26.000000000 +0000 @@ -60,7 +60,7 @@ state->last_type = line->type; } -static bool +static enum status_code log_open(struct view *view, enum open_flags flags) { const char *log_argv[] = { diff -Nru tig-2.2/src/main.c tig-2.3.0/src/main.c --- tig-2.2/src/main.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/main.c 2017-09-29 15:15:26.000000000 +0000 @@ -24,6 +24,7 @@ #include "tig/stage.h" #include "tig/main.h" #include "tig/diff.h" +#include "tig/search.h" /* * Main view backend @@ -238,7 +239,7 @@ ? column->opt.commit_title.graph : GRAPH_DISPLAY_NO; } -static bool +static enum status_code main_open(struct view *view, enum open_flags flags) { struct view_column *commit_title_column = get_view_column(view, VIEW_COLUMN_COMMIT_TITLE); @@ -267,16 +268,20 @@ if (state->with_graph) { state->graph = init_graph(commit_title_column->opt.commit_title.graph); if (!state->graph) - return false; + return ERROR_OUT_OF_MEMORY; } if (open_in_pager_mode(flags)) { changes_triggers = WATCH_NONE; } - /* This calls reset_view() so must be before adding changes commits. */ - if (!begin_update(view, NULL, main_argv, flags)) - return false; + { + /* This calls reset_view() so must be before adding changes commits. */ + enum status_code code = begin_update(view, NULL, main_argv, flags); + + if (code != SUCCESS) + return code; + } /* Register watch before changes commits are added to record the * start. */ @@ -286,7 +291,7 @@ if (changes_triggers) main_check_index(view, state); - return true; + return SUCCESS; } void @@ -522,7 +527,7 @@ if (line->type == LINE_STAT_UNSTAGED || line->type == LINE_STAT_STAGED) - open_stage_view(view, NULL, line->type, flags); + open_stage_view(view, NULL, line->type, flags); else open_diff_view(view, flags); break; @@ -536,6 +541,11 @@ goto_id(view, "%(commit)^", true, false); break; + case REQ_MOVE_NEXT_MERGE: + case REQ_MOVE_PREV_MERGE: + find_merge(view, request); + break; + default: return request; } diff -Nru tig-2.2/src/options.c tig-2.3.0/src/options.c --- tig-2.2/src/options.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/options.c 2017-09-29 15:15:26.000000000 +0000 @@ -622,6 +622,18 @@ const char *alloc = NULL; const char **value = option->value; + if (option->value == &opt_diff_highlight) { + bool enabled = false; + + if (parse_bool(&enabled, arg) == SUCCESS) { + if (!enabled) { + *value = NULL; + return SUCCESS; + } + arg = "diff-highlight"; + } + } + if (strlen(arg)) { if (arg[0] == '"' && arg[strlen(arg) - 1] == '"') alloc = strndup(arg + 1, strlen(arg + 1) - 1); @@ -631,6 +643,18 @@ return ERROR_OUT_OF_MEMORY; } + if (!strcmp(name, "truncation-delimiter")) { + if (!strcmp(alloc, "utf-8") || !strcmp(alloc, "utf8")) { + alloc = strdup("⋯"); + if (!alloc) + return ERROR_OUT_OF_MEMORY; + } else if (utf8_width_of(alloc, -1, -1) != 1) { + alloc = strdup("~"); + if (!alloc) + return ERROR_OUT_OF_MEMORY; + } + } + free((void *) *value); *value = alloc; return SUCCESS; @@ -667,12 +691,38 @@ return parse_view_config(view_column, name, argv); } +static enum status_code +option_update(struct option_info *option, int argc, const char *argv[]) +{ + enum status_code code; + + if (option->seen) + return SUCCESS; + + if (!strcmp(option->type, "const char **")) + return parse_args(option->value, argv + 2); + + if (argc < 3) + return error("Invalid set command: set option = value"); + + if (!strcmp(option->type, "view_settings")) + return parse_view_settings(option->value, argv[0], argv + 2); + + if (!strcmp(option->type, "struct ref_format **")) + return parse_ref_formats(option->value, argv + 2); + + code = parse_option(option, "", argv[2]); + if (code == SUCCESS && argc != 3) + return error("Option %s only takes one value", argv[0]); + + return code; +} + /* Wants: name = value */ static enum status_code option_set_command(int argc, const char *argv[]) { struct option_info *option; - enum status_code code; if (argc < 2) return error("Invalid set command: set option = value"); @@ -681,28 +731,26 @@ return error("No value assigned to %s", argv[0]); option = find_option_info(option_info, ARRAY_SIZE(option_info), "", argv[0]); - if (option) { - if (option->seen) - return SUCCESS; - - if (!strcmp(option->type, "const char **")) - return parse_args(option->value, argv + 2); - - if (argc < 3) - return error("Invalid set command: set option = value"); - - if (!strcmp(option->type, "view_settings")) - return parse_view_settings(option->value, argv[0], argv + 2); + if (option) + return option_update(option, argc, argv); - if (!strcmp(option->type, "struct ref_format **")) - return parse_ref_formats(option->value, argv + 2); - - code = parse_option(option, "", argv[2]); - if (code == SUCCESS && argc != 3) - return error("Option %s only takes one value", argv[0]); - - return code; + { + const char *obsolete[][2] = { + { "status-untracked-dirs", "status-show-untracked-dirs" }, + }; + int index = find_remapped(obsolete, ARRAY_SIZE(obsolete), argv[0]); + if (index != -1) { + option = find_option_info(option_info, ARRAY_SIZE(option_info), "", obsolete[index][1]); + if (option) { + enum status_code code = option_update(option, argc, argv); + + if (code != SUCCESS) + return code; + return error("%s has been renamed to %s", + obsolete[index][0], obsolete[index][1]); + } + } } { @@ -776,6 +824,7 @@ { "diff-context-down", "diff-context" }, { "diff-context-up", "diff-context" }, { "stage-next", ":/^@@" }, + { "status-untracked-dirs", "status-show-untracked-dirs" }, { "toggle-author", "author" }, { "toggle-changes", "show-changes" }, { "toggle-commit-order", "show-commit-order" }, @@ -794,7 +843,7 @@ { "toggle-sort-field", "sort-field" }, { "toggle-sort-order", "sort-order" }, { "toggle-title-overflow", "commit-title-overflow" }, - { "toggle-untracked-dirs", "status-untracked-dirs" }, + { "toggle-untracked-dirs", "status-show-untracked-dirs" }, { "toggle-vertical-split", "show-vertical-split" }, }; int alias; @@ -841,14 +890,25 @@ option_source_command(int argc, const char *argv[]) { enum status_code code; + bool quiet = false; + + if ((argc < 1) || (argc > 2)) + return error("Invalid source command: source [-q] "); - if (argc < 1) - return error("Invalid source command: source path"); + if (argc == 2) { + if (!strcmp(argv[0], "-q")) + quiet = true; + else + return error("Invalid source option: %s", argv[0]); + } - code = load_option_file(argv[0]); + code = load_option_file(argv[argc - 1]); + + if (quiet) + return code == ERROR_FILE_DOES_NOT_EXIST ? 0 : code; return code == ERROR_FILE_DOES_NOT_EXIST - ? error("File does not exist: %s", argv[0]) : code; + ? error("File does not exist: %s", argv[argc - 1]) : code; } enum status_code @@ -925,26 +985,21 @@ if (!path || !strlen(path)) return SUCCESS; - if (!prefixcmp(path, "~/")) { - const char *home = getenv("HOME"); - - if (!home || !string_format(buf, "%s/%s", home, path + 2)) - return error("Failed to expand ~ to user home directory"); - path = buf; - } + if (!expand_path(buf, sizeof(buf), path)) + return error("Failed to expand path: %s", path); /* It's OK that the file doesn't exist. */ - if (!io_open(&io, "%s", path)) { + if (!io_open(&io, "%s", buf)) { /* XXX: Must return ERROR_FILE_DOES_NOT_EXIST so missing * system tigrc is detected properly. */ if (io_error(&io) == ENOENT) return ERROR_FILE_DOES_NOT_EXIST; - return error("Error loading file %s: %s", path, io_strerror(&io)); + return error("Error loading file %s: %s", buf, io_strerror(&io)); } if (io_load_span(&io, " \t", &config.lineno, read_option, &config) != SUCCESS || config.errors == true) - warn("Errors while loading %s.", path); + warn("Errors while loading %s.", buf); return SUCCESS; } @@ -1401,6 +1456,9 @@ else if (!strcmp(name, "diff.noprefix")) parse_bool(&opt_diff_noprefix, value); + else if (!strcmp(name, "status.showUntrackedFiles")) + parse_bool(&opt_status_show_untracked_files, value); + else if (!prefixcmp(name, "tig.color.")) set_repo_config_option(name + 10, value, option_color_command); diff -Nru tig-2.2/src/pager.c tig-2.3.0/src/pager.c --- tig-2.2/src/pager.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/pager.c 2017-09-29 15:15:26.000000000 +0000 @@ -174,14 +174,12 @@ } } -static bool +static enum status_code pager_open(struct view *view, enum open_flags flags) { - if (!open_from_stdin(flags) && !view->lines && !(flags & OPEN_PREPARED)) { - report("No pager content, press %s to run command from prompt", - get_view_key(view, REQ_PROMPT)); - return false; - } + if (!open_from_stdin(flags) && !view->lines && !(flags & OPEN_PREPARED)) + return error("No pager content, press %s to run command from prompt", + get_view_key(view, REQ_PROMPT)); return begin_update(view, NULL, NULL, flags); } diff -Nru tig-2.2/src/parse.c tig-2.3.0/src/parse.c --- tig-2.2/src/parse.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/parse.c 2017-09-29 15:15:26.000000000 +0000 @@ -65,9 +65,9 @@ if (nameend && emailend) *nameend = *emailend = 0; - name = chomp_string(ident); + name = string_trim(ident); if (nameend) - email = chomp_string(nameend + 1); + email = string_trim(nameend + 1); if (!*name) name = *email ? email : unknown_ident.name; if (!*email) @@ -267,25 +267,31 @@ return entry->path; } -DEFINE_STRING_MAP(author_cache, const struct ident *, email, 32) +DEFINE_STRING_MAP(author_cache, const struct ident *, key, 32) /* Small author cache to reduce memory consumption. No entries * are ever freed. */ struct ident * get_author(const char *name, const char *email) { - struct ident *ident = string_map_get(&author_cache, email); + char key[SIZEOF_STR + SIZEOF_STR]; + struct ident *ident; + string_format(key, "%s%s", email, name); + + ident = string_map_get(&author_cache, key); if (ident) return ident; ident = calloc(1, sizeof(*ident)); if (!ident) return NULL; + ident->key = strdup(key); ident->name = strdup(name); ident->email = strdup(email); - if (!ident->name || !ident->email || - !string_map_put(&author_cache, email, ident)) { + if (!ident->key || !ident->name || !ident->email || + !string_map_put(&author_cache, key, ident)) { + free((void *) ident->key); free((void *) ident->name); free((void *) ident->email); free(ident); diff -Nru tig-2.2/src/prompt.c tig-2.3.0/src/prompt.c --- tig-2.2/src/prompt.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/prompt.c 2017-09-29 15:15:26.000000000 +0000 @@ -37,6 +37,10 @@ int last_buf_length = promptlen ? -1 : promptlen; input->buf[0] = 0; + input->context[0] = 0; + + if (strlen(prompt) > 0) + curs_set(1); while (status == INPUT_OK || status == INPUT_SKIP) { int buf_length = strlen(input->buf) + promptlen; @@ -44,13 +48,16 @@ last_buf_length = buf_length; if (offset >= 0) - update_status("%s%.*s", prompt, pos, input->buf); + update_status_with_context(input->context, "%s%.*s", prompt, pos, input->buf); + else + wmove(status_win, 0, buf_length); if (get_input(offset, &key) == OK) { int len = strlen(key.data.bytes); if (pos + len >= sizeof(input->buf)) { report("Input string too long"); + curs_set(0); return NULL; } @@ -88,6 +95,7 @@ input->buf[pos] = 0; } + curs_set(0); report_clear(); if (status == INPUT_CANCEL) @@ -125,7 +133,7 @@ if (c == 'y' || c == 'Y') return INPUT_STOP; - if (c == 'n' || c == 'N') + if (c == 'n' || c == 'N' || key_to_control(key) == 'C') return INPUT_CANCEL; return prompt_default_handler(input, key); } @@ -172,6 +180,8 @@ incremental.input.allow_empty = allow_empty; incremental.input.data = data; + incremental.input.buf[0] = 0; + incremental.input.context[0] = 0; incremental.handler = handler; incremental.edit_mode = edit_mode; @@ -179,6 +189,8 @@ } #ifdef HAVE_READLINE +static volatile bool prompt_interrupted = false; + static void readline_display(void) { @@ -194,6 +206,9 @@ #define FORMAT_VAR(type, name, ifempty, initval) "%(" #name ")", ARGV_ENV_INFO(FORMAT_VAR) #undef FORMAT_VAR +#define FORMAT_VAR(type, name) "%(repo:" #name ")", + REPO_INFO(FORMAT_VAR) +#undef FORMAT_VAR NULL }; @@ -238,6 +253,7 @@ "save-display", "save-options", "exec", + "echo", #define REQ_GROUP(help) #define REQ_(req, help) #req REQ_INFO, @@ -443,39 +459,144 @@ rl_completion_display_matches_hook = readline_display_matches; } +static void sigint_absorb_handler(int sig) { + signal(SIGINT, SIG_DFL); + prompt_interrupted = true; +} + char * read_prompt(const char *prompt) { static char *line = NULL; + HIST_ENTRY *last_entry; if (line) { free(line); line = NULL; } + curs_set(1); + if (signal(SIGINT, sigint_absorb_handler) == SIG_ERR) + die("Failed to setup sigint handler"); line = readline(prompt); + if (signal(SIGINT, SIG_DFL) == SIG_ERR) + die("Failed to remove sigint handler"); + curs_set(0); + + /* readline can leave the virtual cursor out-of-place */ + set_cursor_pos(0, 0); - if (line && !*line) { + if (prompt_interrupted) { free(line); line = NULL; } - if (line) + prompt_interrupted = false; + + last_entry = history_get(history_length); + if (line && *line && + (!last_entry || strcmp(line, last_entry->line))) add_history(line); return line; } +static const char * +prompt_histfile(void) +{ + static char path[SIZEOF_STR] = ""; + const char *xdg_data_home = getenv("XDG_DATA_HOME"); + const char *home = getenv("HOME"); + int fd; + + if (!xdg_data_home || !*xdg_data_home) { + if (!string_format(path, "%s/.local/share/tig/history", home)) + die("Failed to expand $HOME"); + } else if (!string_format(path, "%s/tig/history", xdg_data_home)) + die("Failed to expand $XDG_DATA_HOME"); + + fd = open(path, O_RDWR | O_CREAT | O_APPEND, 0666); + if (fd > 0) + close(fd); + else if (!string_format(path, "%s/.tig_history", home)) + die("Failed to expand $HOME"); + + return path; +} + +static int +history_go_line(int rel_line_num) +{ + /* history_set_pos confusingly takes an absolute index. Expose a + * "relative offset" version consistent with the rest of readline. + */ + return history_set_pos(rel_line_num - history_base); +} + +static void +prompt_history_dedupe(void) +{ + HIST_ENTRY *uniq_entry, *earlier_entry; + int uniq_lineno; + + using_history(); + uniq_lineno = history_length; + + while (uniq_lineno >= history_base) { + history_go_line(uniq_lineno); + uniq_entry = current_history(); + if (!uniq_entry) + break; + while ((earlier_entry = previous_history())) { + if (!strcmp(earlier_entry->line, uniq_entry->line) + && ((earlier_entry = remove_history(where_history())))) { + free_history_entry(earlier_entry); + uniq_lineno--; + } + } + uniq_lineno--; + } + + /* defensive hard reset */ + using_history(); + history_go_line(history_length); +} + +static void +prompt_teardown(void) +{ + if (opt_history_size <= 0) + return; + + prompt_history_dedupe(); + write_history(prompt_histfile()); +} + void prompt_init(void) { + HIST_ENTRY *last_entry; + readline_init(); + + if (opt_history_size <= 0) + return; + + using_history(); + stifle_history(opt_history_size); + read_history(prompt_histfile()); + if (atexit(prompt_teardown)) + die("Failed to register prompt_teardown"); + + last_entry = history_get(history_length); + if (last_entry) + string_copy(argv_env.search, last_entry->line); } #else char * read_prompt(const char *prompt) { - return read_prompt_incremental(prompt, true, false, NULL, NULL); + return read_prompt_incremental(prompt, true, true, NULL, NULL); } void @@ -488,6 +609,7 @@ prompt_menu(const char *prompt, const struct menu_item *items, int *selected) { enum input_status status = INPUT_OK; + char buf[128]; struct key key; int size = 0; @@ -496,13 +618,17 @@ assert(size > 0); + curs_set(1); while (status == INPUT_OK) { const struct menu_item *item = &items[*selected]; - char hotkey[] = { '[', (char) item->hotkey, ']', ' ', 0 }; + const char hotkey[] = { ' ', '[', (char) item->hotkey, ']', 0 }; int i; - update_status("%s (%d of %d) %s%s", prompt, *selected + 1, size, - item->hotkey ? hotkey : "", item->text); + if (!string_format(buf, "(%d of %d)", *selected + 1, size)) + buf[0] = 0; + + update_status_with_context(buf, "%s %s%s", prompt, item->text, + item->hotkey ? hotkey : ""); switch (get_input(COLS - 1, &key)) { case KEY_RETURN: @@ -528,6 +654,11 @@ break; default: + if (key_to_control(&key) == 'C') { + status = INPUT_CANCEL; + break; + } + for (i = 0; items[i].text; i++) if (items[i].hotkey == key.data.bytes[0]) { *selected = i; @@ -536,6 +667,7 @@ } } } + curs_set(0); report_clear(); @@ -745,7 +877,7 @@ if (string_isnumber(cmd)) { int lineno = view->pos.lineno + 1; - if (parse_int(&lineno, cmd, 0, view->lines + 1) == SUCCESS) { + if (parse_int(&lineno, cmd, 0, view->lines) == SUCCESS) { if (!lineno) lineno = 1; select_view_line(view, lineno - 1); @@ -799,6 +931,22 @@ goto_id(view, argv[1], true, true); return REQ_NONE; + } else if (!strcmp(cmd, "echo")) { + const char **fmt_argv = NULL; + char text[SIZEOF_STR] = ""; + + if (argv[1] + && strlen(argv[1]) > 0 + && (!argv_format(view->env, &fmt_argv, &argv[1], false, true) + || !argv_to_string(fmt_argv, text, sizeof(text), " ") + )) { + report("Failed to format echo string"); + return REQ_NONE; + } + + report("%s", text); + return REQ_NONE; + } else if (!strcmp(cmd, "save-display")) { const char *path = argv[1] ? argv[1] : "tig-display.txt"; @@ -807,6 +955,14 @@ else report("Saved screen to %s", path); + } else if (!strcmp(cmd, "save-view")) { + const char *path = argv[1] ? argv[1] : "tig-view.txt"; + + if (!save_view(view, path)) + report("Failed to save view to %s", path); + else + report("Saved view to %s", path); + } else if (!strcmp(cmd, "save-options")) { const char *path = argv[1] ? argv[1] : "tig-options.txt"; enum status_code code = save_options(path); @@ -908,13 +1064,14 @@ const char **argv = NULL; bool confirmed = false; enum request request = REQ_NONE; - char cmd[SIZEOF_STR]; + char cmd[SIZEOF_CMD]; const char *req_argv[SIZEOF_ARG]; int req_argc = 0; if (!argv_to_string(req->argv, cmd, sizeof(cmd), " ") || !argv_from_string_no_quotes(req_argv, &req_argc, cmd) - || !argv_format(view->env, &argv, req_argv, false, true)) { + || !argv_format(view->env, &argv, req_argv, false, true) + || !argv) { report("Failed to format arguments"); return REQ_NONE; } @@ -938,7 +1095,7 @@ if (confirmed) open_external_viewer(argv, repo.cdup, req->flags.silent, - !req->flags.exit, false, ""); + !req->flags.exit, req->flags.echo, false, ""); } if (argv) @@ -967,11 +1124,16 @@ const char *argv[SIZEOF_ARG] = { NULL }; int argc = 0; - if (cmd && !argv_from_string(argv, &argc, cmd)) { + if (cmd && *cmd && !argv_from_string(argv, &argc, cmd)) { report("Too many arguments"); return REQ_NONE; } + if (!cmd || !*cmd) { + report_clear(); + return REQ_NONE; + } + return run_prompt_command(view, argv); } diff -Nru tig-2.2/src/refdb.c tig-2.3.0/src/refdb.c --- tig-2.2/src/refdb.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/refdb.c 2017-09-29 15:15:26.000000000 +0000 @@ -489,6 +489,9 @@ size_t bufpos = 0; const char *sep = ""; + if (!formats) + return SUCCESS; + for (type = 0; type < map->size; type++) { struct ref_format *format = formats[type]; diff -Nru tig-2.2/src/refs.c tig-2.3.0/src/refs.c --- tig-2.2/src/refs.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/refs.c 2017-09-29 15:15:26.000000000 +0000 @@ -138,7 +138,7 @@ return true; } -static bool +static enum status_code refs_open(struct view *view, enum open_flags flags) { const char *refs_log[] = { @@ -147,21 +147,22 @@ : "--pretty=format:%H%x00%an <%ae> %ad%x00%s", "--all", "--simplify-by-decoration", NULL }; + enum status_code code; if (!refs_all) { struct ref *ref = calloc(1, sizeof(*refs_all) + strlen(REFS_ALL_NAME)); - if (ref) { - strncpy(ref->name, REFS_ALL_NAME, strlen(REFS_ALL_NAME)); - refs_all = ref; - } - } + if (!ref) + return ERROR_OUT_OF_MEMORY; - if (!refs_all || !begin_update(view, NULL, refs_log, OPEN_RELOAD)) { - report("Failed to load reference data"); - return false; + strncpy(ref->name, REFS_ALL_NAME, strlen(REFS_ALL_NAME)); + refs_all = ref; } + code = begin_update(view, NULL, refs_log, OPEN_RELOAD); + if (code != SUCCESS) + return code; + if (!view->lines) view->sort.current = get_view_column(view, VIEW_COLUMN_REF); refs_open_visitor(view, refs_all); @@ -170,7 +171,7 @@ watch_register(&view->watch, WATCH_HEAD | WATCH_REFS); - return true; + return SUCCESS; } static void diff -Nru tig-2.2/src/search.c tig-2.3.0/src/search.c --- tig-2.2/src/search.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/search.c 2017-09-29 15:15:26.000000000 +0000 @@ -15,6 +15,8 @@ #include "tig/prompt.h" #include "tig/display.h" #include "tig/draw.h" +#include "tig/main.h" +#include "tig/graph.h" DEFINE_ALLOCATOR(realloc_unsigned_ints, unsigned int, 32) @@ -55,11 +57,25 @@ static enum status_code find_next_match(struct view *view, enum request request); +static bool contains_uppercase(const char *search) +{ + const char *c = search; + for (; *c != '\0'; ++c) { + if (isupper(*c)) + return true; + } + return false; +} + static enum status_code setup_and_find_next(struct view *view, enum request request) { int regex_err; - int regex_flags = opt_ignore_case ? REG_ICASE : 0; + int regex_flags = opt_ignore_case == IGNORE_CASE_YES ? REG_ICASE : 0; + + if (opt_ignore_case == IGNORE_CASE_SMART_CASE + && !contains_uppercase(view->env->search)) + regex_flags |= REG_ICASE; if (view->regex) { regfree(view->regex); @@ -159,6 +175,66 @@ report("%s", get_status_message(code)); } +static enum status_code +find_next_merge_line(struct view *view, int direction, bool wrapped) +{ + int dist; + size_t max; + + if (wrapped) + max = view->lines; + else + max = direction > 0 ? view->lines - view->pos.lineno + : view->pos.lineno; + + for (dist = direction; abs(dist) < max; dist += direction) { + ssize_t lineno = view->pos.lineno + dist; + if (lineno < 0) + lineno += view->lines; + else if (lineno >= view->lines) + lineno -= view->lines; + + struct line *line = &view->line[lineno]; + struct commit *commit = line->data; + struct graph_canvas *canvas = &commit->graph; + struct view_column_data column_data; + + if (!view->ops->get_column_data(view, line, &column_data)) + continue; + + if (column_data.graph && !column_data.graph->is_merge(canvas)) + continue; + + select_view_line(view, lineno); + return SUCCESS; + } + + return success("No merge commit found"); +} + +static enum status_code +find_next_merge(struct view *view, enum request request) +{ + switch (request) { + case REQ_MOVE_NEXT_MERGE: + return find_next_merge_line(view, 1, opt_wrap_search); + + case REQ_MOVE_PREV_MERGE: + return find_next_merge_line(view, -1, opt_wrap_search); + + default: + return error("Invalid request searching for next merge"); + } +} + +void +find_merge(struct view *view, enum request request) +{ + enum status_code code = find_next_merge(view, request); + + report("%s", get_status_message(code)); +} + void reset_search(struct view *view) { @@ -173,13 +249,13 @@ const char *prompt = request == REQ_SEARCH ? "/" : "?"; char *search = read_prompt(prompt); - if (search) { + if (search && *search) { enum status_code code; string_ncopy(argv_env.search, search, strlen(search)); code = setup_and_find_next(view, request); report("%s", get_status_message(code)); - } else if (*argv_env.search) { + } else if (search && *argv_env.search) { find_next(view, request); } else { report_clear(); diff -Nru tig-2.2/src/stage.c tig-2.3.0/src/stage.c --- tig-2.2/src/stage.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/stage.c 2017-09-29 15:15:26.000000000 +0000 @@ -477,7 +477,7 @@ diff_common_select(view, line, changes_msg); } -static bool +static enum status_code stage_open(struct view *view, enum open_flags flags) { const char *no_head_diff_argv[] = { @@ -496,18 +496,17 @@ * path, so leave out the new path. */ const char *files_unmerged_argv[] = { "git", "diff-files", encoding_arg, "--root", "--patch-with-stat", - diff_context_arg(), ignore_space_arg(), "--", + DIFF_ARGS, diff_context_arg(), ignore_space_arg(), "--", stage_status.old.name, NULL }; static const char *file_argv[] = { repo.cdup, stage_status.new.name, NULL }; const char **argv = NULL; struct stage_state *state = view->private; + enum status_code code; - if (!stage_line_type) { - report("No stage content, press %s to open the status view and choose file", - get_view_key(view, REQ_VIEW_STATUS)); - return false; - } + if (!stage_line_type) + return error("No stage content, press %s to open the status view and choose file", + get_view_key(view, REQ_VIEW_STATUS)); view->encoding = NULL; @@ -538,18 +537,21 @@ die("line type %d not handled in switch", stage_line_type); } - if (!status_stage_info(view->ref, stage_line_type, &stage_status) - || !argv_copy(&view->argv, argv)) { - report("Failed to open staged view"); - return false; - } + if (!status_stage_info(view->ref, stage_line_type, &stage_status)) + return error("Failed to open staged view"); if (stage_line_type != LINE_STAT_UNTRACKED) diff_save_line(view, &state->diff, flags); view->vid[0] = 0; - view->dir = repo.cdup; - return begin_update(view, NULL, NULL, flags); + code = begin_update(view, repo.cdup, argv, flags); + if (code == SUCCESS && stage_line_type != LINE_STAT_UNTRACKED) { + struct stage_state *state = view->private; + + return diff_init_highlight(view, &state->diff); + } + + return code; } static bool @@ -560,6 +562,13 @@ if (stage_line_type == LINE_STAT_UNTRACKED) return pager_common_read(view, buf ? buf->data : NULL, LINE_DEFAULT, NULL); + if (!buf) { + if (!diff_done_highlight(&state->diff)) { + report("Failed run the diff-highlight program: %s", opt_diff_highlight); + return true; + } + } + if (!buf && !view->lines && view->parent) { maximize_view(view->parent, true); return true; diff -Nru tig-2.2/src/stash.c tig-2.3.0/src/stash.c --- tig-2.2/src/stash.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/stash.c 2017-09-29 15:15:26.000000000 +0000 @@ -16,7 +16,7 @@ #include "tig/main.h" #include "tig/diff.h" -static bool +static enum status_code stash_open(struct view *view, enum open_flags flags) { static const char *stash_argv[] = { "git", "stash", "list", @@ -53,9 +53,9 @@ strcmp(view->env->stash, diff->ref)) { const char *diff_argv[] = { "git", "stash", "show", encoding_arg, "--pretty=fuller", - "--root", "--patch-with-stat", use_mailmap_arg(), + "--root", "--patch-with-stat", show_notes_arg(), diff_context_arg(), - ignore_space_arg(), "%(diffargs)", + ignore_space_arg(), DIFF_ARGS, "--no-color", "%(stash)", NULL }; diff -Nru tig-2.2/src/status.c tig-2.3.0/src/status.c --- tig-2.2/src/status.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/status.c 2017-09-29 15:15:26.000000000 +0000 @@ -332,20 +332,33 @@ string_copy(status_onbranch, "Not currently on any branch"); } +static bool +status_read_untracked(struct view *view) +{ + if (!opt_status_show_untracked_files) + return add_line_nodata(view, LINE_STAT_UNTRACKED) + && add_line_nodata(view, LINE_STAT_NONE); + + status_list_other_argv[ARRAY_SIZE(status_list_other_argv) - 3] = + opt_status_show_untracked_dirs ? NULL : "--directory"; + status_list_other_argv[ARRAY_SIZE(status_list_other_argv) - 2] = + opt_status_show_untracked_dirs ? NULL : "--no-empty-directory"; + + return status_run(view, status_list_other_argv, '?', LINE_STAT_UNTRACKED); +} + /* First parse staged info using git-diff-index(1), then parse unstaged * info using git-diff-files(1), and finally untracked files using * git-ls-files(1). */ -static bool +static enum status_code status_open(struct view *view, enum open_flags flags) { const char **staged_argv = is_initial_commit() ? status_list_no_head_argv : status_diff_index_argv; char staged_status = staged_argv == status_list_no_head_argv ? 'A' : 0; - if (repo.is_inside_work_tree == false) { - report("The status view requires a working tree"); - return false; - } + if (repo.is_inside_work_tree == false) + return error("The status view requires a working tree"); reset_view(view); @@ -357,22 +370,15 @@ update_index(); - status_list_other_argv[ARRAY_SIZE(status_list_other_argv) - 3] = - opt_status_untracked_dirs ? NULL : "--directory"; - status_list_other_argv[ARRAY_SIZE(status_list_other_argv) - 2] = - opt_status_untracked_dirs ? NULL : "--no-empty-directory"; - if (!status_run(view, staged_argv, staged_status, LINE_STAT_STAGED) || !status_run(view, status_diff_files_argv, 0, LINE_STAT_UNSTAGED) || - !status_run(view, status_list_other_argv, '?', LINE_STAT_UNTRACKED)) { - report("Failed to load status data"); - return false; - } + !status_read_untracked(view)) + return error("Failed to load status data"); /* Restore the exact position or use the specialized restore * mode? */ status_restore(view); - return true; + return SUCCESS; } static bool @@ -407,6 +413,10 @@ case LINE_STAT_NONE: type = LINE_DEFAULT; text = " (no files)"; + if (!opt_status_show_untracked_files + && view->line < line + && line[-1].type == LINE_STAT_UNTRACKED) + text = " (not shown)"; break; case LINE_HEADER: @@ -451,7 +461,7 @@ return REQ_NONE; } - if (!suffixcmp(status->new.name, -1, "/")) { + if (!suffixcmp(status->new.name, -1, "/")) { report("Cannot display a directory"); return REQ_NONE; } @@ -666,7 +676,7 @@ { const char *mergetool_argv[] = { "git", "mergetool", file, NULL }; - open_external_viewer(mergetool_argv, repo.cdup, false, true, true, ""); + open_external_viewer(mergetool_argv, repo.cdup, false, true, false, true, ""); } static enum request diff -Nru tig-2.2/src/string.c tig-2.3.0/src/string.c --- tig-2.2/src/string.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/string.c 2017-09-29 15:15:26.000000000 +0000 @@ -13,6 +13,7 @@ #include "tig/tig.h" #include "tig/string.h" +#include "compat/wcwidth.h" /* * Strings. @@ -129,20 +130,25 @@ } char * -chomp_string(char *name) +string_trim_end(char *name) { - int namelen; + int namelen = strlen(name) - 1; - while (isspace(*name)) - name++; - - namelen = strlen(name) - 1; while (namelen > 0 && isspace(name[namelen])) name[namelen--] = 0; return name; } +char * +string_trim(char *name) +{ + while (isspace(*name)) + name++; + + return string_trim_end(name); +} + bool PRINTF_LIKE(4, 5) string_nformat(char *buf, size_t bufsize, size_t *bufpos, const char *fmt, ...) { @@ -199,36 +205,34 @@ * NOTE: Much of the following code for dealing with Unicode is derived from * ELinks' UTF-8 code developed by Scrool . Origin file is * src/intl/charset.c from the UTF-8 branch commit elinks-0.11.0-g31f2c28. + * + * unicode_width() is driven by xterm's mk_wcwidth(), which is the work of + * Markus Kuhn and Thomas Dickey. */ int unicode_width(unsigned long c, int tab_size) { - if (c >= 0x1100 && - (c <= 0x115f /* Hangul Jamo */ - || c == 0x2329 - || c == 0x232a - || (c >= 0x2e80 && c <= 0xa4cf && c != 0x303f) - /* CJK ... Yi */ - || (c >= 0xac00 && c <= 0xd7a3) /* Hangul Syllables */ - || (c >= 0xf900 && c <= 0xfaff) /* CJK Compatibility Ideographs */ - || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */ - || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */ - || (c >= 0xffe0 && c <= 0xffe6) - || (c >= 0x20000 && c <= 0x2fffd) - || (c >= 0x30000 && c <= 0x3fffd))) - return 2; - - if ((c >= 0x0300 && c <= 0x036f) /* combining diacretical marks */ - || (c >= 0x1dc0 && c <= 0x1dff) /* combining diacretical marks supplement */ - || (c >= 0x20d0 && c <= 0x20ff) /* combining diacretical marks for symbols */ - || (c >= 0xfe20 && c <= 0xfe2f)) /* combining half marks */ - return 0; - + if (c == '\0') + /* + * xterm mk_wcwidth() returns 0 for NUL, which causes two tig + * tests to fail, which seems like a tig bug. Return 1 here + * as a workaround. + */ + return 1; if (c == '\t') return tab_size; - return 1; + int result = mk_wcwidth((wchar_t) c); + + if (result < 0) + /* + * xterm mk_wcwidth() returns -1 for unmapped codepoints and + * control characters, which might be smarter semantics. + */ + return 0; + + return result; } /* Number of bytes used for encoding a UTF-8 character indexed by first byte. @@ -298,7 +302,7 @@ /* Invalid characters could return the special 0xfffd value but NUL * should be just as good. */ - return unicode > 0xffff ? 0 : unicode; + return unicode > 0x10FFFF ? 0 : unicode; } /* Calculates how much of string can be shown within the given maximum width diff -Nru tig-2.2/src/tig.c tig-2.3.0/src/tig.c --- tig-2.2/src/tig.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/tig.c 2017-09-29 15:15:26.000000000 +0000 @@ -66,7 +66,7 @@ view_has_flags(view, VIEW_SEND_CHILD_ENTER)) { struct view *child = display[1]; - if (forward_request_to_child(child, request)) { + if (forward_request_to_child(child, request)) { view_request(child, request); return REQ_NONE; } @@ -99,7 +99,7 @@ _('X', "commit ID display", "id"), \ _('%', "file filtering", "file-filter"), \ _('$', "commit title overflow display", "commit-title-overflow"), \ - _('d', "untracked directory info", "status-untracked-dirs"), \ + _('d', "untracked directory info", "status-show-untracked-dirs"), \ _('|', "view split", "vertical-split"), \ static void @@ -171,6 +171,8 @@ case REQ_MOVE_HALF_PAGE_DOWN: case REQ_MOVE_FIRST_LINE: case REQ_MOVE_LAST_LINE: + case REQ_MOVE_WHEEL_DOWN: + case REQ_MOVE_WHEEL_UP: move_view(view, request); break; @@ -292,16 +294,23 @@ find_next(view, request); break; + case REQ_MOVE_NEXT_MERGE: + case REQ_MOVE_PREV_MERGE: + report("Moving between merge commits is not supported by the %s view", view->name); + break; + case REQ_STOP_LOADING: foreach_view(view, i) { if (view->pipe) report("Stopped loading the %s view", view->name), end_update(view, true); + if (view_is_displayed(view)) + update_view_title(view); } break; case REQ_SHOW_VERSION: - report("tig-%s (built %s)", TIG_VERSION, __DATE__); + report("tig-%s", TIG_VERSION); return true; case REQ_SCREEN_REDRAW: @@ -316,6 +325,7 @@ report("Nothing to enter"); break; + case REQ_VIEW_CLOSE_NO_QUIT: case REQ_VIEW_CLOSE: /* XXX: Mark closed views by letting view->prev point to the * view itself. Parents to closed view should never be @@ -327,6 +337,10 @@ view->parent = NULL; break; } + if (request == REQ_VIEW_CLOSE_NO_QUIT) { + report("Can't close last remaining view"); + break; + } /* Fall-through */ case REQ_QUIT: return false; @@ -345,7 +359,7 @@ */ static const char usage_string[] = -"tig " TIG_VERSION " (" __DATE__ ")\n" +"tig " TIG_VERSION " \n" "\n" "Usage: tig [options] [revs] [--] [paths]\n" " or: tig log [options] [revs] [--] [paths]\n" @@ -403,6 +417,23 @@ return; } + /* Add known revision arguments in opt_rev_args and use + * git-rev-parse to filter out the remaining options. + */ + for (next = flags_pos = 0; argv[next]; next++) { + const char *arg = argv[next]; + + if (!strcmp(arg, "--")) + while (argv[next]) + argv[flags_pos++] = argv[next++]; + else if (argv_parse_rev_flag(arg, NULL)) + argv_append(&opt_rev_args, arg); + else + argv[flags_pos++] = arg; + } + + argv[flags_pos] = NULL; + filter_rev_parse(&opt_file_args, "--no-revs", "--no-flags", argv); filter_rev_parse(&flags, "--flags", "--no-revs", argv); @@ -421,17 +452,6 @@ opt_cmdline_args = flags; } - for (next = flags_pos = 0; argv[next]; next++) { - const char *arg = argv[next]; - - if (!strcmp(arg, "--all")) - argv_append(&opt_rev_args, arg); - else - argv[flags_pos++] = arg; - } - - argv[flags_pos] = NULL; - filter_rev_parse(&opt_rev_args, "--symbolic", "--revs-only", argv); } @@ -529,7 +549,7 @@ } else if (request == REQ_VIEW_DIFF) { if (argv_contains(opt_rev_args, "--stdin")) open_diff_view(NULL, OPEN_FORWARD_STDIN); - else + else open_diff_view(NULL, OPEN_STDIN); } else { @@ -578,11 +598,15 @@ if (!view) return REQ_NONE; +#ifdef BUTTON5_PRESSED + if (event.bstate & (BUTTON2_PRESSED | BUTTON5_PRESSED)) +#else if (event.bstate & BUTTON2_PRESSED) - return REQ_SCROLL_WHEEL_DOWN; +#endif + return opt_mouse_wheel_cursor ? REQ_MOVE_WHEEL_DOWN : REQ_SCROLL_WHEEL_DOWN; if (event.bstate & BUTTON4_PRESSED) - return REQ_SCROLL_WHEEL_UP; + return opt_mouse_wheel_cursor ? REQ_MOVE_WHEEL_UP : REQ_SCROLL_WHEEL_UP; if (event.bstate & BUTTON1_PRESSED) { if (event.y == view->pos.lineno - view->pos.offset) { @@ -603,6 +627,43 @@ } #endif +/* + * Error handling. + * + * Inspired by code from src/util.c in ELinks + * (f86be659718c0cd0a67f88b42f07044c23d0d028). + */ + +#ifdef DEBUG +void +sigsegv_handler(int sig) +{ + if (die_callback) + die_callback(); + + fputs("Tig crashed!\n\n" + "Please report this issue along with all info printed below to\n\n" + " https://github.com/jonas/tig/issues/new\n\n", stderr); + + fputs("Tig version: ", stderr); + fputs(TIG_VERSION, stderr); + fputs("\n\n", stderr); + +#ifdef HAVE_EXECINFO_H + { + /* glibc way of doing this */ + void *stack[20]; + size_t size = backtrace(stack, 20); + + backtrace_symbols_fd(stack, size, STDERR_FILENO); + } +#endif + + /* The fastest way OUT! */ + abort(); +} +#endif + struct key_combo { enum request request; struct keymap *keymap; @@ -661,11 +722,14 @@ enum request request = parse_options(argc, argv, pager_mode); struct view *view; - prompt_init(); - if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) die("Failed to setup signal handler"); +#ifdef DEBUG + if (signal(SIGSEGV, sigsegv_handler) == SIG_ERR) + die("Failed to setup signal handler"); +#endif + if (setlocale(LC_ALL, "")) { codeset = nl_langinfo(CODESET); } @@ -674,6 +738,8 @@ die_if_failed(load_options(), "Failed to load user config."); die_if_failed(load_git_config(), "Failed to load repo config."); + prompt_init(); + /* Require a git repository unless when running in pager mode. */ if (!repo.git_dir[0] && request != REQ_VIEW_PAGER) die("Not a git repository"); diff -Nru tig-2.2/src/tree.c tig-2.3.0/src/tree.c --- tig-2.2/src/tree.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/tree.c 2017-09-29 15:15:26.000000000 +0000 @@ -162,7 +162,7 @@ return true; } - if (!begin_update(view, repo.cdup, log_file, OPEN_EXTRA)) { + if (begin_update(view, repo.cdup, log_file, OPEN_EXTRA) != SUCCESS) { report("Failed to load tree data"); return true; } @@ -360,7 +360,7 @@ /* fake 'cd ..' */ pop_tree_stack_entry(&view->pos); reload_view(view); - break; + return REQ_NONE; case REQ_ENTER: break; @@ -427,17 +427,15 @@ string_copy_rev(view->ref, entry->id); } -static bool +static enum status_code tree_open(struct view *view, enum open_flags flags) { static const char *tree_argv[] = { - "git", "ls-tree", "-l", "%(commit)", "%(directory)", NULL + "git", "ls-tree", "-l", "%(commit)", "--", "%(directory)", NULL }; - if (string_rev_is_null(view->env->commit)) { - report("No tree exists for this commit"); - return false; - } + if (string_rev_is_null(view->env->commit)) + return error("No tree exists for this commit"); if (view->lines == 0 && repo.prefix[0]) { char *pos = repo.prefix; diff -Nru tig-2.2/src/ui.c tig-2.3.0/src/ui.c --- tig-2.2/src/ui.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/ui.c 2017-09-29 15:15:26.000000000 +0000 @@ -64,7 +64,7 @@ break; } - finder->file[files] = calloc(1, sizeof(*finder->file) + buf.size); + finder->file[files] = calloc(1, sizeof(struct file_finder_line) + buf.size); if (!finder->file[files]) { ok = false; break; @@ -145,7 +145,7 @@ int column; wbkgdset(finder->win, get_line_attr(NULL, LINE_DEFAULT)); - wclear(finder->win); + werase(finder->win); for (column = 0; *line_pos && column < finder->height - 1; line_pos++) { struct file_finder_line *line = *line_pos; @@ -256,6 +256,12 @@ file_finder_draw(finder); return INPUT_SKIP; + case REQ_BACK: + case REQ_PARENT: + case REQ_VIEW_CLOSE: + case REQ_VIEW_CLOSE_NO_QUIT: + return INPUT_CANCEL; + default: if (key_to_value(key) == 0) { argv_append(&finder->search, key->data.bytes); diff -Nru tig-2.2/src/util.c tig-2.3.0/src/util.c --- tig-2.2/src/util.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/util.c 2017-09-29 15:15:26.000000000 +0000 @@ -180,7 +180,7 @@ const char * mkdate(const struct time *time, enum date date, bool local, const char *custom_format) { - static char buf[STRING_SIZE("2006-04-29 14:21") + 1]; + static char buf[SIZEOF_STR]; struct tm tm; const char *format; @@ -239,7 +239,11 @@ return string_format(buf, "%ld", size) ? buf : NULL; } -const struct ident unknown_ident = { "Unknown", "unknown@localhost" }; +const struct ident unknown_ident = { + "unknown@localhostUnknown", // key + "Unknown", // name + "unknown@localhost" // email +}; int ident_compare(const struct ident *i1, const struct ident *i2) diff -Nru tig-2.2/src/view.c tig-2.3.0/src/view.c --- tig-2.2/src/view.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/view.c 2017-09-29 15:15:26.000000000 +0000 @@ -201,6 +201,14 @@ ? view->lines - view->pos.lineno - 1 : view->height / 2; break; + case REQ_MOVE_WHEEL_DOWN: + steps = opt_mouse_scroll; + break; + + case REQ_MOVE_WHEEL_UP: + steps = -opt_mouse_scroll; + break; + case REQ_MOVE_UP: case REQ_PREVIOUS: steps = -1; @@ -304,7 +312,7 @@ const char *rev_parse_argv[] = { "git", "rev-parse", "--revs-only", rev, NULL }; - bool ok = rev && io_run_buf(rev_parse_argv, id, sizeof(id), true); + bool ok = rev && io_run_buf(rev_parse_argv, id, sizeof(id), NULL, true); free(rev); if (!ok) { @@ -340,7 +348,7 @@ } } - report("Unable to find commit '%s'", view->env->search); + report("Unable to find commit '%s'", id); } /* @@ -523,14 +531,14 @@ return io_exec(&view->io, IO_RD, view->dir, opt_env, view->argv, io_flags); } -bool +enum status_code begin_update(struct view *view, const char *dir, const char **argv, enum open_flags flags) { bool extra = !!(flags & (OPEN_EXTRA)); bool refresh = flags & (OPEN_REFRESH | OPEN_PREPARED | OPEN_STDIN); if (view_no_refresh(view, flags)) - return true; + return SUCCESS; if (view->pipe) { if (extra) @@ -545,17 +553,13 @@ bool file_filter = !view_has_flags(view, VIEW_FILE_FILTER) || opt_file_filter; view->dir = dir; - if (!argv_format(view->env, &view->argv, argv, !view->prev, file_filter)) { - report("Failed to format %s arguments", view->name); - return false; - } + if (!argv_format(view->env, &view->argv, argv, !view->prev, file_filter)) + return error("Failed to format %s arguments", view->name); } if (view->argv && view->argv[0] && - !view_exec(view, flags)) { - report("Failed to open %s view", view->name); - return false; - } + !view_exec(view, flags)) + return error("Failed to open %s view", view->name); if (open_from_stdin(flags)) { if (!io_open(&view->io, "%s", "")) @@ -565,7 +569,7 @@ if (!extra) setup_update(view, view->ops->id); - return true; + return SUCCESS; } bool @@ -641,6 +645,9 @@ WINDOW *window = view->title; struct line *line = &view->line[view->pos.lineno]; unsigned int view_lines, lines; + int update_increment = view_has_flags(view, VIEW_LOG_LIKE | VIEW_GREP_LIKE) + ? 100 + : view_has_flags(view, VIEW_DIFF_LIKE) ? 10 : 1; assert(view_is_displayed(view)); @@ -661,7 +668,11 @@ wprintw(window, " - %s %d of %zd", view->ops->type, line->lineno, - view->lines - view->custom_lines); + MAX(line->lineno, + view->pipe + ? update_increment * + (size_t) ((view->lines - view->custom_lines) / update_increment) + : view->lines - view->custom_lines)); } if (view->pipe) { @@ -719,10 +730,10 @@ if (redraw) { redraw_display(false); report_clear(); - } - if (view_has_flags(view, VIEW_FLEX_WIDTH)) - load_view(view, NULL, OPEN_RELOAD); + if (view_has_flags(view, VIEW_FLEX_WIDTH)) + load_view(view, NULL, OPEN_RELOAD); + } } void @@ -743,6 +754,8 @@ } if (refresh) { + enum status_code code; + if (view->pipe) end_update(view, true); if (view->ops->private_size) { @@ -755,8 +768,11 @@ } } - if (!view->ops->open(view, flags)) + code = view->ops->open(view, flags); + if (code != SUCCESS) { + report("%s", get_status_message(code)); return; + } } if (prev) { @@ -1427,7 +1443,6 @@ break; case VIEW_COLUMN_COMMIT_TITLE: - width = column->opt.commit_title.width; break; case VIEW_COLUMN_DATE: @@ -1451,10 +1466,13 @@ break; case VIEW_COLUMN_LINE_NUMBER: - if (column_data.line_number) - width = count_digits(*column_data.line_number); - else - width = count_digits(view->lines); + width = column->opt.line_number.width; + if (!width) { + if (column_data.line_number) + width = count_digits(*column_data.line_number); + else + width = count_digits(view->lines); + } if (width < 3) width = 3; break; @@ -1471,11 +1489,9 @@ break; case VIEW_COLUMN_STATUS: - width = column->opt.status.width; break; case VIEW_COLUMN_TEXT: - width = column->opt.text.width; break; } diff -Nru tig-2.2/src/watch.c tig-2.3.0/src/watch.c --- tig-2.2/src/watch.c 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/src/watch.c 2017-09-29 15:15:26.000000000 +0000 @@ -85,7 +85,7 @@ // FIXME: check branch if ((head = get_ref_head()) && - check_file_mtime(&handler->last_modified, "%s/refs/head/%s", repo.git_dir, head->name)) + check_file_mtime(&handler->last_modified, "%s/refs/heads/%s", repo.git_dir, head->name)) return WATCH_HEAD; return WATCH_NONE; diff -Nru tig-2.2/test/blame/default-test tig-2.3.0/test/blame/default-test --- tig-2.2/test/blame/default-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/blame/default-test 2017-09-29 15:15:26.000000000 +0000 @@ -27,128 +27,128 @@ test_tig blame project/Build.scala assert_equals 'blame-default.screen' < -AuthorDate: Tue Oct 29 18:46:52 2013 +0100 -Commit: Sébastien Doeraene -CommitDate: Tue Oct 29 18:46:52 2013 +0100 - - Update for new groupId and package structure of Scala.js. ---- - project/Build.scala | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/project/Build.scala b/project/Build.scala -index 560bca1..1713681 100644 ---- a/project/Build.scala -+++ b/project/Build.scala -@@ -1,7 +1,7 @@ - import sbt._ - import Keys._ +commit 74537d9b257954056d3caa19eb3837500aded883 +Author: Sébastien Doeraene +AuthorDate: Tue Oct 29 18:46:52 2013 +0100 +Commit: Sébastien Doeraene +CommitDate: Tue Oct 29 18:46:52 2013 +0100 + + Update for new groupId and package structure of Scala.js. +--- + project/Build.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/project/Build.scala b/project/Build.scala +index 560bca1..1713681 100644 +--- a/project/Build.scala ++++ b/project/Build.scala +@@ -1,7 +1,7 @@ + import sbt._ + import Keys._ [diff] 74537d9b257954056d3caa19eb3837500aded883 - line 1 of 24 75% EOF assert_equals 'blame-with-diff-no-file-filter.screen' < -AuthorDate: Tue Oct 29 18:46:52 2013 +0100 -Commit: Sébastien Doeraene -CommitDate: Tue Oct 29 18:46:52 2013 +0100 - - Update for new groupId and package structure of Scala.js. ---- - project/Build.scala | 2 +- - project/build.sbt | 2 +- - tracer/App.scala | 4 ++-- - tracer/Engine.scala | 2 +- - tracer/JSTypes.scala | 2 +- - 5 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/project/Build.scala b/project/Build.scala -index 560bca1..1713681 100644 ---- a/project/Build.scala +commit 74537d9b257954056d3caa19eb3837500aded883 +Author: Sébastien Doeraene +AuthorDate: Tue Oct 29 18:46:52 2013 +0100 +Commit: Sébastien Doeraene +CommitDate: Tue Oct 29 18:46:52 2013 +0100 + + Update for new groupId and package structure of Scala.js. +--- + project/Build.scala | 2 +- + project/build.sbt | 2 +- + tracer/App.scala | 4 ++-- + tracer/Engine.scala | 2 +- + tracer/JSTypes.scala | 2 +- + 5 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/project/Build.scala b/project/Build.scala +index 560bca1..1713681 100644 +--- a/project/Build.scala [diff] 74537d9b257954056d3caa19eb3837500aded883 - line 1 of 76 23% EOF assert_equals 'blame-parent-of-74537d9.screen' < -AuthorDate: Sat Mar 1 15:59:02 2014 -0500 -Commit: Jonas Fonseca -CommitDate: Sat Mar 1 15:59:02 2014 -0500 - - Add type parameter for js.Dynamic ---- - common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - +commit a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff +Author: Jonas Fonseca +AuthorDate: Sat Mar 1 15:59:02 2014 -0500 +Commit: Jonas Fonseca +CommitDate: Sat Mar 1 15:59:02 2014 -0500 + + Add type parameter for js.Dynamic +--- + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala b/commo -index 65f914a..3aa4320 100644 ---- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala -+++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala -@@ -15,7 +15,7 @@ object Benchmark { - val benchmarks = js.Array[Benchmark]() - val benchmarkApps = js.Array[BenchmarkApp]() - -- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] -+ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] - global("runScalaJSBenchmarks") = runBenchmarks _ - global("initScalaJSBenchmarkApps") = initBenchmarkApps _ - - - - - +index 65f914a..3aa4320 100644 +--- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala ++++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala +@@ -15,7 +15,7 @@ object Benchmark { + val benchmarks = js.Array[Benchmark]() + val benchmarkApps = js.Array[BenchmarkApp]() + +- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] ++ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] + global("runScalaJSBenchmarks") = runBenchmarks _ + global("initScalaJSBenchmarkApps") = initBenchmarkApps _ + + + + + [diff] a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff - line 1 of 24 100% EOF assert_equals 'diff-u4.screen' < -AuthorDate: Sat Mar 1 15:59:02 2014 -0500 -Commit: Jonas Fonseca -CommitDate: Sat Mar 1 15:59:02 2014 -0500 - - Add type parameter for js.Dynamic ---- - common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - +commit a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff +Author: Jonas Fonseca +AuthorDate: Sat Mar 1 15:59:02 2014 -0500 +Commit: Jonas Fonseca +CommitDate: Sat Mar 1 15:59:02 2014 -0500 + + Add type parameter for js.Dynamic +--- + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala b/commo -index 65f914a..3aa4320 100644 ---- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala -+++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala -@@ -14,9 +14,9 @@ import scala.scalajs.js - object Benchmark { - val benchmarks = js.Array[Benchmark]() - val benchmarkApps = js.Array[BenchmarkApp]() - -- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] -+ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] - global("runScalaJSBenchmarks") = runBenchmarks _ - global("initScalaJSBenchmarkApps") = initBenchmarkApps _ - - def add(benchmark: Benchmark) { - - +index 65f914a..3aa4320 100644 +--- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala ++++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala +@@ -14,9 +14,9 @@ import scala.scalajs.js + object Benchmark { + val benchmarks = js.Array[Benchmark]() + val benchmarkApps = js.Array[BenchmarkApp]() + +- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] ++ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] + global("runScalaJSBenchmarks") = runBenchmarks _ + global("initScalaJSBenchmarkApps") = initBenchmarkApps _ + + def add(benchmark: Benchmark) { + + [diff] Changes to 'common/src/main/scala/org/scalajs/benchmark/Benchmark.sca100% EOF assert_equals 'diff-u5.screen' < -AuthorDate: Sat Mar 1 15:59:02 2014 -0500 -Commit: Jonas Fonseca -CommitDate: Sat Mar 1 15:59:02 2014 -0500 - - Add type parameter for js.Dynamic ---- - common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - +Author: Jonas Fonseca +AuthorDate: Sat Mar 1 15:59:02 2014 -0500 +Commit: Jonas Fonseca +CommitDate: Sat Mar 1 15:59:02 2014 -0500 + + Add type parameter for js.Dynamic +--- + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala b/commo -index 65f914a..3aa4320 100644 ---- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala -+++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala -@@ -13,11 +13,11 @@ import scala.scalajs.js - - object Benchmark { - val benchmarks = js.Array[Benchmark]() - val benchmarkApps = js.Array[BenchmarkApp]() - -- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] -+ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] - global("runScalaJSBenchmarks") = runBenchmarks _ - global("initScalaJSBenchmarkApps") = initBenchmarkApps _ - - def add(benchmark: Benchmark) { - benchmarks.push(benchmark) - +index 65f914a..3aa4320 100644 +--- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala ++++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala +@@ -13,11 +13,11 @@ import scala.scalajs.js + + object Benchmark { + val benchmarks = js.Array[Benchmark]() + val benchmarkApps = js.Array[BenchmarkApp]() + +- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] ++ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] + global("runScalaJSBenchmarks") = runBenchmarks _ + global("initScalaJSBenchmarkApps") = initBenchmarkApps _ + + def add(benchmark: Benchmark) { + benchmarks.push(benchmark) + [diff] Changes to 'common/src/main/scala/org/scalajs/benchmark/Benchmark.sca100% EOF assert_equals 'diff-u10.screen' < +AuthorDate: Sat Mar 1 15:59:02 2014 -0500 +Commit: Jonas Fonseca +CommitDate: Sat Mar 1 15:59:02 2014 -0500 + + Add type parameter for js.Dynamic +--- + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala b/commo +index 65f914a..3aa4320 100644 +--- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala ++++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala +@@ -15,7 +15,7 @@ object Benchmark { + val benchmarks = js.Array[Benchmark]() + val benchmarkApps = js.Array[BenchmarkApp]() + +- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] ++ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] + global("runScalaJSBenchmarks") = runBenchmarks _ + global("initScalaJSBenchmarkApps") = initBenchmarkApps _ + + + + + +[diff] a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff - line 1 of 24 100% +EOF diff -Nru tig-2.2/test/diff/diff-highlight-test tig-2.3.0/test/diff/diff-highlight-test --- tig-2.2/test/diff/diff-highlight-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/diff/diff-highlight-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,127 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +file bin/diff-highlight < +AuthorDate: Sat Mar 1 15:59:02 2014 -0500 +Commit: Jonas Fonseca +CommitDate: Sat Mar 1 15:59:02 2014 -0500 + + Changed by diff-highlight +--- + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala b/commo +index 65f914a..3aa4320 100644 +--- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala ++++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala +@@ -15,7 +15,7 @@ object Benchmark { + val benchmarks = js.Array[Benchmark]() + val benchmarkApps = js.Array[BenchmarkApp]() + +- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] ++ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] + global("runScalaJSBenchmarks") = runBenchmarks _ + global("initScalaJSBenchmarkApps") = initBenchmarkApps _ + + + + + +[diff] a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff - line 1 of 24 100% +EOF + +assert_equals 'diff-custom.screen' < +AuthorDate: Sat Mar 1 15:59:02 2014 -0500 +Commit: Jonas Fonseca +CommitDate: Sat Mar 1 15:59:02 2014 -0500 + + Add type parameter for js.Dynamic +--- + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala b/commo +index 65f914a..3aa4320 100644 +--- a/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala ++++ b/common/src/main/scala/org/scalajs/benchmark/Benchmark.scala +@@ -15,7 +15,7 @@ object Benchmark { + val benchmarks = js.Array[Benchmark]() + val benchmarkApps = js.Array[BenchmarkApp]() + +- val global = js.Dynamic.global.asInstanceOf[js.Dictionary] ++ val global = js.Dynamic.global.asInstanceOf[js.Dictionary[js.Any]] + global("runScalaJSBenchmarks") = runBenchmarks _ + global("initScalaJSBenchmarkApps") = initBenchmarkApps _ + + + + + +[diff] a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff - line 1 of 24 100% +EOF + +assert_equals 'diff-failure.screen' < +2014-01-16 17:43 Jonas Fonseca ● Bump Scala.js version to 0.3-SNAPSHOT |AuthorDate: Sat Mar 1 17:26:01 2014 -0500 +2014-01-16 17:39 Jonas Fonseca ● Integrate app code into the benchmark infrastructure |Commit: Jonas Fonseca +2014-01-16 07:47 Jonas Fonseca ●─╮ Merge pull request #4 from phaller/patch-1 |CommitDate: Sat Mar 1 17:26:01 2014 -0500 +2014-01-16 15:32 Philipp Haller │ ● Fix link to Dart benchmark harness | +2013-12-17 00:02 Jonas Fonseca ●─╯ Update links to reflect project name change | WIP: Upgrade to 0.4-SNAPSHOT and DCE +2013-12-03 23:35 Jonas Fonseca ● Use Scala.js 0.2-SNAPSHOT |--- +2013-11-26 23:39 Jonas Fonseca ● Extract the benchmark list variable name; fix push to| common/benchmark-runner.sh | 5 +++-- +2013-11-26 23:31 Jonas Fonseca ● Solve the easiest sudoku grid | common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ +2013-11-26 23:22 Jonas Fonseca ● Disable phantomjs by default | common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- +2013-11-26 22:55 Jonas Fonseca ● Exclude Sudoku when running all benchmarks | common/start-benchmark.js | 9 +++++++-- +2013-11-26 22:52 Jonas Fonseca ● Fix reference setup to work for node | deltablue/exports.js | 13 ------------- +2013-11-26 22:03 Jonas Fonseca ● Move benchmark registration to Scala | .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ +2013-11-26 20:13 Jonas Fonseca ● Rename projects to be grouped together in Eclipse | project/Build.scala | 13 ++++--------- +2013-11-19 21:56 Jonas Fonseca ● sudoku: use iterator instead of Try() | project/build.sbt | 5 ++++- +2013-11-11 21:56 Jonas Fonseca ● Add verification of sudoku solutions | richards/exports.js | 13 ------------- +2013-11-11 21:50 Jonas Fonseca ● Use stream to halt when first sudoku solution has bee| .../src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ +2013-11-11 01:11 Jonas Fonseca ● Add initial version of sudoku benchmark | run.sh | 2 +- +2013-11-05 23:20 Jonas Fonseca ● Reformat code using Scala IDE | sudoku/exports.js | 13 ------------- +2013-11-05 20:41 Jonas Fonseca ● Update exports.js files to use new Scala.js class nam| sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ +2013-11-03 23:48 Jonas Fonseca ● Add support for PhantomJS | tracer/exports.js | 13 ------------- +2013-11-03 23:11 Jonas Fonseca ● Make the engine stubs file optional | tracer/index-dev.html | 2 +- +2013-11-03 22:44 Jonas Fonseca ● Refactor the benchmark shell code | tracer/index.html | 2 +- +2013-10-29 17:29 Jonas Fonseca ●─╮ Merge pull request #2 from sjrd/patch-2 | tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ +2013-10-29 18:48 Sébastien Doeraene │ ● Remove workaround to support Node.js. | 17 files changed, 42 insertions(+), 76 deletions(-) +2013-10-29 18:46 Sébastien Doeraene │ ● Update for new groupId and package structure of Sca| +[main] ee912870202200a0b9cf4fd86ba57243212d341e - commit 1 of 48 58%|[diff] ee912870202200a0b9cf4fd86ba57243212d341e - line 1 of 367 7% +EOF diff -Nru tig-2.2/test/diff/diff-stat-test tig-2.3.0/test/diff/diff-stat-test --- tig-2.2/test/diff/diff-stat-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/diff/diff-stat-test 2017-09-29 15:15:26.000000000 +0000 @@ -6,8 +6,7 @@ export COLUMNS=181 steps ' - :enter - :save-display diff-stat.screen + :save-view view.data ' tigrc < +Date: Sun Jul 2 15:01:24 2017 +0200 -assert_equals 'diff-stat.screen' < -2014-01-16 17:43 Jonas Fonseca ● Bump Scala.js version to 0.3-SNAPSHOT |AuthorDate: Sat Mar 1 17:26:01 2014 -0500 -2014-01-16 17:39 Jonas Fonseca ● Integrate app code into the benchmark infrastructure |Commit: Jonas Fonseca -2014-01-16 07:47 Jonas Fonseca ●─╮ Merge pull request #4 from phaller/patch-1 |CommitDate: Sat Mar 1 17:26:01 2014 -0500 -2014-01-16 15:32 Philipp Haller │ ● Fix link to Dart benchmark harness | -2013-12-17 00:02 Jonas Fonseca ●─╯ Update links to reflect project name change | WIP: Upgrade to 0.4-SNAPSHOT and DCE -2013-12-03 23:35 Jonas Fonseca ● Use Scala.js 0.2-SNAPSHOT |--- -2013-11-26 23:39 Jonas Fonseca ● Extract the benchmark list variable name; fix push to| common/benchmark-runner.sh | 5 +++-- -2013-11-26 23:31 Jonas Fonseca ● Solve the easiest sudoku grid | common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ -2013-11-26 23:22 Jonas Fonseca ● Disable phantomjs by default | common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- -2013-11-26 22:55 Jonas Fonseca ● Exclude Sudoku when running all benchmarks | common/start-benchmark.js | 9 +++++++-- -2013-11-26 22:52 Jonas Fonseca ● Fix reference setup to work for node | deltablue/exports.js | 13 ------------- -2013-11-26 22:03 Jonas Fonseca ● Move benchmark registration to Scala | .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ -2013-11-26 20:13 Jonas Fonseca ● Rename projects to be grouped together in Eclipse | project/Build.scala | 13 ++++--------- -2013-11-19 21:56 Jonas Fonseca ● sudoku: use iterator instead of Try() | project/build.sbt | 5 ++++- -2013-11-11 21:56 Jonas Fonseca ● Add verification of sudoku solutions | richards/exports.js | 13 ------------- -2013-11-11 21:50 Jonas Fonseca ● Use stream to halt when first sudoku solution has bee| .../src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ -2013-11-11 01:11 Jonas Fonseca ● Add initial version of sudoku benchmark | run.sh | 2 +- -2013-11-05 23:20 Jonas Fonseca ● Reformat code using Scala IDE | sudoku/exports.js | 13 ------------- -2013-11-05 20:41 Jonas Fonseca ● Update exports.js files to use new Scala.js class nam| sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ -2013-11-03 23:48 Jonas Fonseca ● Add support for PhantomJS | tracer/exports.js | 13 ------------- -2013-11-03 23:11 Jonas Fonseca ● Make the engine stubs file optional | tracer/index-dev.html | 2 +- -2013-11-03 22:44 Jonas Fonseca ● Refactor the benchmark shell code | tracer/index.html | 2 +- -2013-10-29 17:29 Jonas Fonseca ●─╮ Merge pull request #2 from sjrd/patch-2 | tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ -2013-10-29 18:48 Sébastien Doeraene │ ● Remove workaround to support Node.js. | 17 files changed, 42 insertions(+), 76 deletions(-) -2013-10-29 18:46 Sébastien Doeraene │ ● Update for new groupId and package structure of Sca| -[main] ee912870202200a0b9cf4fd86ba57243212d341e - commit 1 of 48 58%|[diff] ee912870202200a0b9cf4fd86ba57243212d341e - line 1 of 367 7% + Diff stat examples +--- + added | 40 +++++++++++ + remove | 124 -------------------------- + updated | 14 +---- + rename.from => rename.to | 0 + dir/{rename.from => rename.to} | 0 + .../truncated file name | 11 ++--- + binary add | Bin 0 -> 1234 bytes + binary update | Bin 1234 -> 2345 bytes + binary copy | Bin + binary del | Bin 16787 -> 0 bytes + unmerged | Unmerged + 42 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/file.c b/src/file.c +... +EOF + +assert_equals 'view.data' <] +line[ 2] type= selected=0 +line[ 2] cells=1 text=[Date: Sun Jul 2 15:01:24 2017 +0200] +line[ 3] type=default selected=0 +line[ 3] cells=1 text=[] +line[ 4] type=default selected=0 +line[ 4] cells=1 text=[ Diff stat examples] +line[ 5] type=diff-start selected=0 +line[ 5] cells=1 text=[---] +line[ 6] type=diff-stat selected=0 +line[ 6] cells=3 text=[ added ][| 40 ][+++++++++++] +line[ 7] type=diff-stat selected=0 +line[ 7] cells=3 text=[ remove ][| 124 ][--------------------------] +line[ 8] type=diff-stat selected=0 +line[ 8] cells=4 text=[ updated ][| 14 ][+][----] +line[ 9] type=diff-stat selected=0 +line[ 9] cells=2 text=[ rename.from => rename.to ][| 0] +line[ 10] type=diff-stat selected=0 +line[ 10] cells=2 text=[ dir/{rename.from => rename.to} ][| 0] +line[ 11] type=diff-stat selected=0 +line[ 11] cells=4 text=[ .../truncated file name ][| 11 ][++][---] +line[ 12] type=diff-stat selected=0 +line[ 12] cells=7 text=[ binary add ][| ][Bin][ 0 ][->][ 1234 ][bytes] +line[ 13] type=diff-stat selected=0 +line[ 13] cells=7 text=[ binary update ][| ][Bin][ 1234 ][->][ 2345 ][bytes] +line[ 14] type=diff-stat selected=0 +line[ 14] cells=3 text=[ binary copy ][| ][Bin] +line[ 15] type=diff-stat selected=0 +line[ 15] cells=7 text=[ binary del ][| ][Bin][ 16787 ][->][ 0 ][bytes] +line[ 16] type=diff-stat selected=0 +line[ 16] cells=2 text=[ unmerged ][| Unmerged] +line[ 17] type=default selected=0 +line[ 17] cells=1 text=[ 42 file changed, 5 insertions(+), 2 deletions(-)] +line[ 18] type=default selected=0 +line[ 18] cells=1 text=[] +line[ 19] type=diff-header selected=0 +line[ 19] cells=1 text=[diff --git a/src/file.c b/src/file.c] +line[ 20] type=default selected=0 +line[ 20] cells=1 text=[...] EOF diff -Nru tig-2.2/test/diff/diff-stdin-test tig-2.3.0/test/diff/diff-stdin-test --- tig-2.2/test/diff/diff-stdin-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/diff/diff-stdin-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,84 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +steps ' + :save-display diff.screen +' + +git_init + +test_tig show < +Date: Sun Jul 2 15:01:24 2017 +0200 + + graph: Optimize initial and merge calculation + + The initial and merge flags do not depend on any column-specific + information, so calculate them only once. + + Signed-off-by: Sven Wegener +--- + src/graph-v2.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/graph-v2.c b/src/graph-v2.c +index 4cf3d9e..ced6838 100644 +--- a/src/graph-v2.c ++++ b/src/graph-v2.c +@@ -683,6 +683,9 @@ graph_generate_symbols(struct graph_v2 *graph, struct graph_canvas *canvas) + struct graph_row *row = &graph->row; + struct graph_row *next_row = &graph->next_row; + struct graph_row *parents = &graph->parents; ++ int commits = commits_in_row(parents); ++ int initial = commits < 1; ++ int merge = commits > 1; + int pos; + + for (pos = 0; pos < row->size; pos++) { +@@ -692,8 +695,8 @@ graph_generate_symbols(struct graph_v2 *graph, struct graph_canvas *canvas) + + symbol->commit = (pos == graph->position); + symbol->boundary = (pos == graph->position && next_row->columns[pos].symbol.boundary); +- symbol->initial = (commits_in_row(parents) < 1); +- symbol->merge = (commits_in_row(parents) > 1); ++ symbol->initial = initial; ++ symbol->merge = merge; + + symbol->continued_down = continued_down(row, next_row, pos); + symbol->continued_up = continued_down(prev_row, row, pos); +EOF + +assert_equals 'diff.screen' < +Date: Sun Jul 2 15:01:24 2017 +0200 + + graph: Optimize initial and merge calculation + + The initial and merge flags do not depend on any column-specific + information, so calculate them only once. + + Signed-off-by: Sven Wegener +--- + src/graph-v2.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/graph-v2.c b/src/graph-v2.c +index 4cf3d9e..ced6838 100644 +--- a/src/graph-v2.c ++++ b/src/graph-v2.c +@@ -683,6 +683,9 @@ graph_generate_symbols(struct graph_v2 *graph, struct graph_ + struct graph_row *row = &graph->row; + struct graph_row *next_row = &graph->next_row; + struct graph_row *parents = &graph->parents; ++ int commits = commits_in_row(parents); ++ int initial = commits < 1; ++ int merge = commits > 1; + int pos; + + for (pos = 0; pos < row->size; pos++) { +[diff] 1b4c64b595aeb4de1d317d669faacd3c1d82f0b0 - line 1 of 39 71% +EOF diff -Nru tig-2.2/test/diff/editor-test tig-2.3.0/test/diff/editor-test --- tig-2.2/test/diff/editor-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/diff/editor-test 2017-09-29 15:15:26.000000000 +0000 @@ -23,33 +23,33 @@ test_case default \ --args='show ee912870202200a0b9cf4fd86ba57243212d341e' \ --script="$script" <>>>>>> conflict-branch - - - - - - - - - - - - - - - - - - + 1| diff --cc conflict-file + | index 86c5a05,b4c3de6..0000000 + | --- a/conflict-file + | +++ b/conflict-file + 5| @@@ -1,1 -1,1 +1,5 @@@ + | ++<<<<<<< HEAD + | +c' + | ++======= + | + d' + 10| ++>>>>>>> conflict-branch + + + + + + + + + + + + + + + + + + [stage] Unstaged changes to 'conflict-file' - line 10 of 10 100% EOF @@ -179,34 +179,34 @@ :10 :exec !vim +%(lineno) %(file) ' << EOF - 1| diff --cc conflict-file - | index 86c5a05,b4c3de6..0000000 - | --- a/conflict-file - | +++ b/conflict-file - 5| @@@ -1,1 -1,1 +1,5 @@@ - | ++<<<<<<< HEAD - | +c' - | ++======= - | + d' - 10| ++>>>>>>> conflict-branch - - - - - - - - - - - - - - - - - - + 1| diff --cc conflict-file + | index 86c5a05,b4c3de6..0000000 + | --- a/conflict-file + | +++ b/conflict-file + 5| @@@ -1,1 -1,1 +1,5 @@@ + | ++<<<<<<< HEAD + | +c' + | ++======= + | + d' + 10| ++>>>>>>> conflict-branch + + + + + + + + + + + + + + + + + + [stage] Unstaged changes to 'conflict-file' - line 10 of 10 100% EOF diff -Nru tig-2.2/test/diff/start-on-line-test tig-2.3.0/test/diff/start-on-line-test --- tig-2.2/test/diff/start-on-line-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/diff/start-on-line-test 2017-09-29 15:15:26.000000000 +0000 @@ -13,33 +13,33 @@ test_tig show d92a308941e6ccb79cb02f96417cab7b67b998c2 +42 assert_equals 'position.screen' < ++@gmail.com> AuthorDate: Sat Mar 1 17:26:01 2014 -050 -+0 ++0 Commit: Jonas Fonseca ++@gmail.com> CommitDate: Sat Mar 1 17:26:01 2014 -050 -+0 - ++0 + WIP: Upgrade to 0.4-SNAPSHOT and DCE ---- - .../benchmark-runner.sh | 5 ++- - .../Benchmark.scala | 11 +++--- - .../BenchmarkApp.scala | 2 +- - common/start-benchmark.js | 9 ++++- - deltablue/exports.js | 13 ------- - .../DeltaBlue.scala | 7 ++++ - project/Build.scala | 13 ++----- - project/build.sbt | 5 ++- - richards/exports.js | 13 ------- - .../Richards.scala | 3 ++ - run.sh | 2 +- - sudoku/exports.js | 13 ------- - .../sudoku/Sudoku.scala | 2 + - tracer/exports.js | 13 ------- +--- + .../benchmark-runner.sh | 5 ++- + .../Benchmark.scala | 11 +++--- + .../BenchmarkApp.scala | 2 +- + common/start-benchmark.js | 9 ++++- + deltablue/exports.js | 13 ------- + .../DeltaBlue.scala | 7 ++++ + project/Build.scala | 13 ++----- + project/build.sbt | 5 ++- + richards/exports.js | 13 ------- + .../Richards.scala | 3 ++ + run.sh | 2 +- + sudoku/exports.js | 13 ------- + .../sudoku/Sudoku.scala | 2 + + tracer/exports.js | 13 ------- [diff] ee912870202200a0b9cf4fd86ba57245% EOF Binary files /tmp/tmpck2gpM/bpxM2M9tPz/tig-2.2/test/files/repo-authornamechange.tgz and /tmp/tmpck2gpM/cdizMD71w2/tig-2.3.0/test/files/repo-authornamechange.tgz differ diff -Nru tig-2.2/test/graph/00-simple-test tig-2.3.0/test/graph/00-simple-test --- tig-2.2/test/graph/00-simple-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/graph/00-simple-test 2017-09-29 15:15:26.000000000 +0000 @@ -17,16 +17,6 @@ branch1 commit a init -* 5ce4f7f (HEAD, master) Merge branch 'branch3' -|\ -| * b47bfd8 (branch3) branch3 -* | ecc01c0 Merge branch 'branch2' -|\ \ -| * | 814336c (branch2) branch2 -| |/ -* | e51b810 (branch1) branch1 -|/ -* de1bd54 init EOF assert_equals stdout < 1382248932 -0400 Refactor defined enum maps to contain size information - + The existing struct enum_map is renamed to enum_map_entry. commit 536d565fcd789a2ea9dda43b3ae989e9d651af55 57787a3668d28808764dd1525a1157e3564d9b46 @@ -271,7 +271,7 @@ committer Jonas Fonseca 1382133286 -0400 Set the commit reference when opening the blame view from the blob view - + This is what tree_request does. Else the blame view is opened against an unrelated version of %(ref) or HEAD. diff -Nru tig-2.2/test/graph/20-tig-all-long-test tig-2.3.0/test/graph/20-tig-all-long-test --- tig-2.2/test/graph/20-tig-all-long-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/graph/20-tig-all-long-test 2017-09-29 15:15:26.000000000 +0000 @@ -742,10 +742,10 @@ ● │ Fix mistake in tigrc: line-graphic expects utf8, not utf-8 ●─│─╮ Merge pull request #37 from v0n/abbrev_commit_hash │ │ ● string_copy_rev: chop rev on first space (if any) -●─│─╯ Merge pull request #36 from tsibley/reload-diff-view-on-toggle +●─│─┤ Merge pull request #36 from tsibley/reload-diff-view-on-toggle │ │ ● Reload the view on a diff-like option change │ │ ● Doc typo -●─│─╯ Merge pull request #34 from tsibley/combined-diff-coloring +●─│─┤ Merge pull request #34 from tsibley/combined-diff-coloring │ │ ● [GH #32] Only color +/- in the second column when in a combined diff ●─│─╯ Only reload the view after changing diff options for diff-like views ● │ Document how to submit bugs diff -Nru tig-2.2/test/graph/gh-490-heap-buffer-overflow-test tig-2.3.0/test/graph/gh-490-heap-buffer-overflow-test --- tig-2.2/test/graph/gh-490-heap-buffer-overflow-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/graph/gh-490-heap-buffer-overflow-test 2017-09-29 15:15:26.000000000 +0000 @@ -10,9 +10,7 @@ :quit ' -export TIG_NO_DISPLAY=y - -gunzip --stdout "$source_dir/$test.gz" | tig --graph --pretty=raw 2>stderr >stdout +gunzip --stdout -- "$source_dir/$test.gz" | tig --graph --pretty=raw 2>stderr >stdout assert_equals stderr < - -int -main(int argc, const char *argv[]) -{ - /* Some text */ - exit(0); -} - +#include + +int +main(int argc, const char *argv[]) +{ + /* Some text */ + exit(0); +} + [blob] main.c - line 1 of 8 100% EOF assert_equals 'grep-text-split-4.screen' < - -int -main(int argc, const char *argv[]) -{ - /* Some text */ - exit(0); -} - +#include + +int +main(int argc, const char *argv[]) +{ + /* Some text */ + exit(0); +} + [blob] main.c - line 6 of 8 100% EOF assert_equals 'grep-main.screen' < - 3| int - 4| main(int argc, const char *argv[]) - 7| exit(0); - +README + 1| = Title + 4| Wherein. + 5| Description. + 6| Hidden. + 7| Idling. + 8| Is inserted. + 10| The exit paragraph. +main.c + 1| #include + 3| int + 4| main(int argc, const char *argv[]) + 7| exit(0); + [grep] README - line 1 of 13 100% EOF assert_equals 'grep-i-split.screen' < + 14| Is inserted. + 16| The exit paragraph. +main.c + 7| #include [grep] main.c - line 10 of 13 76% -#include - -int -main(int argc, const char *argv[]) -{ - /* Some text */ - exit(0); -} - +#include + +int +main(int argc, const char *argv[]) +{ + /* Some text */ + exit(0); +} + [blob] main.c - line 1 of 8 100% EOF assert_equals 'grep-none.screen' < enter Enter and open selected line - < back Go back to the previous view state - , , J next Move to next - , , K previous Move to previous - ',' parent Move to parent - view-next Move focus to the next view - R, refresh Reload and refresh view - O maximize Maximize the current view - q view-close Close the current view - Q quit Close all views and quit -Cursor navigation - k move-up Move cursor one line up - j move-down Move cursor one line down - , , move-page-down Move cursor one page down - , , - move-page-up Move cursor half a page up - move-first-line Move cursor to first line - move-last-line Move cursor to last line -Scrolling - , scroll-line-up Scroll one line up - , scroll-line-down Scroll one line down - scroll-page-up Scroll one page up - scroll-page-down Scroll one page down - | scroll-first-col Scroll to the first line columns - scroll-left Scroll two columns left - scroll-right Scroll two columns right -Searching - / search Search the view - ? search-back Search backwards in the view - n find-next Find next search match - N find-prev Find previous search match -Misc - e edit Open in editor - : prompt Open the prompt - o options Open the options menu - screen-redraw Redraw the screen - z stop-loading Stop all loading views - v show-version Show version information -Option toggling: - I :toggle sort-order - i :toggle sort-field - # :toggle line-number - D :toggle date - A :toggle author - ~ :toggle line-graphics - F :toggle file-name - W :toggle ignore-space - X :toggle id - $ :toggle commit-title-overflow - % :toggle file-filter -[-] search bindings -Searching - , , find-next Find next search match - , , find-prev Find previous search match -[-] main bindings -Option toggling: - G :toggle commit-title-graph - F :toggle commit-title-refs -External commands: - C ?git cherry-pick %(commit) -[-] diff bindings -Option toggling: - [ :toggle diff-context -1 - ] :toggle diff-context +1 -Internal commands: - @ :/^@@ -[-] refs bindings -External commands: - C ?git checkout %(branch) - ! ?git branch -D %(branch) -[-] status bindings -View specific actions - u status-update Stage/unstage chunk or file changes - ! status-revert Revert chunk or file changes - M status-merge Merge file using external tool -External commands: - C !git commit -[-] stage bindings -View specific actions - u status-update Stage/unstage chunk or file changes - ! status-revert Revert chunk or file changes - 1 stage-update-line Stage/unstage single line - \ stage-split-chunk Split current diff chunk -Option toggling: - [ :toggle diff-context -1 - ] :toggle diff-context +1 -Internal commands: - @ :/^@@ -[-] stash bindings -External commands: - P ?git stash pop %(stash) -[help] - line 1 of 109 99% -EOF +assert_equals \ + 'help-default.screen' \ + 'ignore' \ + "Test failures due to changes to 'tigrc' can be fixed by running:" \ + " > make test/help/all-keybindings-test && cp test/tmp/help/all-keybindings-test/help-default.screen test/help/all-keybindings-test.expected" \ + < "$expected" diff -Nru tig-2.2/test/help/all-keybindings-test.expected tig-2.3.0/test/help/all-keybindings-test.expected --- tig-2.2/test/help/all-keybindings-test.expected 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/help/all-keybindings-test.expected 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,119 @@ +Quick reference for tig keybindings: + +[-] generic bindings +View switching + m view-main Show main view + d view-diff Show diff view + l view-log Show log view + t view-tree Show tree view + f view-blob Show blob view + b view-blame Show blame view + r view-refs Show refs view + s, S view-status Show status view + c view-stage Show stage view + y view-stash Show stash view + g view-grep Show grep view + p view-pager Show pager view + h view-help Show help view +View manipulation + enter Enter and open selected line + < back Go back to the previous view state + , , J next Move to next + , , K previous Move to previous + ',' parent Move to parent + view-next Move focus to the next view + R, refresh Reload and refresh view + O maximize Maximize the current view + q view-close Close the current view + Q, quit Close all views and quit +Cursor navigation + k move-up Move cursor one line up + j move-down Move cursor one line down + , move-page-down Move cursor one page down + , - move-page-up Move cursor half a page up + move-half-page-down Move cursor half a page down + move-half-page-up Move cursor one page up + move-first-line Move cursor to first line + move-last-line Move cursor to last line +Scrolling + , scroll-line-up Scroll one line up + , scroll-line-down Scroll one line down + scroll-page-up Scroll one page up + scroll-page-down Scroll one page down + | scroll-first-col Scroll to the first line columns + scroll-left Scroll two columns left + scroll-right Scroll two columns right +Searching + / search Search the view + ? search-back Search backwards in the view + n find-next Find next search match + N find-prev Find previous search match +Misc + e edit Open in editor + : prompt Open the prompt + o options Open the options menu + screen-redraw Redraw the screen + z stop-loading Stop all loading views + v show-version Show version information +Option toggling: + I :toggle sort-order + i :toggle sort-field + # :toggle line-number + D :toggle date + A :toggle author + ~ :toggle line-graphics + F :toggle file-name + W :toggle ignore-space + X :toggle id + $ :toggle commit-title-overflow + % :toggle file-filter +[-] search bindings +View manipulation + view-close Close the current view +Searching + , , find-next Find next search match + , , find-prev Find previous search match +[-] main bindings +Option toggling: + G :toggle commit-title-graph + F :toggle commit-title-refs +External commands: + C ?git cherry-pick %(commit) +[-] diff bindings +Option toggling: + [ :toggle diff-context -1 + ] :toggle diff-context +1 +Internal commands: + @ :/^@@ +[-] refs bindings +External commands: + C ?git checkout %(branch) + ! ?git branch -D %(branch) +[-] status bindings +View-specific actions + u status-update Stage/unstage chunk or file changes + ! status-revert Revert chunk or file changes + M status-merge Merge file using external tool +External commands: + C !git commit +[-] stage bindings +View-specific actions + u status-update Stage/unstage chunk or file changes + ! status-revert Revert chunk or file changes + 1 stage-update-line Stage/unstage single line + \ stage-split-chunk Split current diff chunk +Option toggling: + [ :toggle diff-context -1 + ] :toggle diff-context +1 +Internal commands: + @ :/^@@ +[-] stash bindings +External commands: + A ?git stash apply %(stash) + P ?git stash pop %(stash) + ! ?git stash drop %(stash) + + + + +[help] - line 1 of 114 100% diff -Nru tig-2.2/test/help/default-test tig-2.3.0/test/help/default-test --- tig-2.2/test/help/default-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/help/default-test 2017-09-29 15:15:26.000000000 +0000 @@ -23,97 +23,97 @@ test_tig assert_equals 'help-default.screen' < enter Enter and open selected line - < back Go back to the previous view s - , , J next Move to next - , , K previous Move to previous - ',' parent Move to parent - view-next Move focus to the next view - R, refresh Reload and refresh view - O maximize Maximize the current view - q view-close Close the current view - Q quit Close all views and quit -[help] - line 1 of 109 25% +Quick reference for tig keybindings: + +[-] generic bindings +View switching + m view-main Show main view + d view-diff Show diff view + l view-log Show log view + t view-tree Show tree view + f view-blob Show blob view + b view-blame Show blame view + r view-refs Show refs view + s, S view-status Show status view + c view-stage Show stage view + y view-stash Show stash view + g view-grep Show grep view + p view-pager Show pager view + h view-help Show help view +View manipulation + enter Enter and open selected line + < back Go back to the previous view st + , , J next Move to next + , , K previous Move to previous + ',' parent Move to parent + view-next Move focus to the next view + R, refresh Reload and refresh view + O maximize Maximize the current view + q view-close Close the current view + Q, quit Close all views and quit +[help] - line 1 of 114 24% EOF assert_equals 'help-search.screen' < enter Enter and open selected line - < back Go back to the previous view s - , , J next Move to next - , , K previous Move to previous - ',' parent Move to parent - view-next Move focus to the next view - R, refresh Reload and refresh view - O maximize Maximize the current view - q view-close Close the current view - Q quit Close all views and quit -[help] - line 18 of 109 25% +Quick reference for tig keybindings: + +[-] generic bindings +View switching + m view-main Show main view + d view-diff Show diff view + l view-log Show log view + t view-tree Show tree view + f view-blob Show blob view + b view-blame Show blame view + r view-refs Show refs view + s, S view-status Show status view + c view-stage Show stage view + y view-stash Show stash view + g view-grep Show grep view + p view-pager Show pager view + h view-help Show help view +View manipulation + enter Enter and open selected line + < back Go back to the previous view st + , , J next Move to next + , , K previous Move to previous + ',' parent Move to parent + view-next Move focus to the next view + R, refresh Reload and refresh view + O maximize Maximize the current view + q view-close Close the current view + Q, quit Close all views and quit +[help] - line 18 of 114 24% EOF assert_equals 'help-collapsed.screen' <, , find-next Find next search match - , , find-prev Find previous search match -[-] main bindings -Option toggling: - F :toggle commit-title-refs -External commands: - C ?git cherry-pick %(commit) -[help] - line 76 of 133 77% + oa :toggle author + og :toggle line-graphics + of :toggle file-name + op :toggle ignore-space + oi :toggle id + ot :toggle commit-title-overflow + oF :toggle file-filter + or :toggle commit-title-refs + @- :toggle diff-context -1 + @+ :toggle diff-context +1 +Internal commands: + @j :/^@@ + @k :?^@@ +External commands: + a @?user-test-cmd + b @?user-test-cmd + d !user-test-cmd + cc !git commit + ca @?git commit --amend --no-edit +[-] search bindings +View manipulation + view-close Close the current view +Searching + , , find-next Find next search match + , , find-prev Find previous search match +[-] main bindings +Cursor navigation + G move-last-line Move cursor to last line +[help] - line 78 of 140 75% EOF diff -Nru tig-2.2/test/log/diff-stat-test tig-2.3.0/test/log/diff-stat-test --- tig-2.2/test/log/diff-stat-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/log/diff-stat-test 2017-09-29 15:15:26.000000000 +0000 @@ -22,65 +22,65 @@ test_tig log assert_equals 'diff-stat.screen' < |Author: Jonas Fonseca -Date: Sat Mar 1 17:26:01 2014 -0500 |AuthorDate: Sat Mar 1 17:26:01 2014 -0500 - |Commit: Jonas Fonseca - WIP: Upgrade to 0.4-SNAPSHOT and DCE |CommitDate: Sat Mar 1 17:26:01 2014 -0500 - | - common/benchmark-runner.sh | 5 +++-- | WIP: Upgrade to 0.4-SNAPSHOT and DCE - common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ |--- - common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- | common/benchmark-runner.sh | 5 +++-- - common/start-benchmark.js | 9 +++++++-- | common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ - deltablue/exports.js | 13 ------------- | common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- - .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ | common/start-benchmark.js | 9 +++++++-- - project/Build.scala | 13 ++++--------- | deltablue/exports.js | 13 ------------- - project/build.sbt | 5 ++++- | .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ - richards/exports.js | 13 ------------- | project/Build.scala | 13 ++++--------- - richards/src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ | project/build.sbt | 5 ++++- - run.sh | 2 +- | richards/exports.js | 13 ------------- - sudoku/exports.js | 13 ------------- | .../src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ - sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ | run.sh | 2 +- - tracer/exports.js | 13 ------------- | sudoku/exports.js | 13 ------------- - tracer/index-dev.html | 2 +- | sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ - tracer/index.html | 2 +- | tracer/exports.js | 13 ------------- - tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ | tracer/index-dev.html | 2 +- - 17 files changed, 42 insertions(+), 76 deletions(-) | tracer/index.html | 2 +- - | tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ -commit a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff | 17 files changed, 42 insertions(+), 76 deletions(-) -Author: Jonas Fonseca | +commit ee912870202200a0b9cf4fd86ba57243212d341e |commit ee912870202200a0b9cf4fd86ba57243212d341e +Refs: [master] |Refs: [master] +Author: Jonas Fonseca |Author: Jonas Fonseca +Date: Sat Mar 1 17:26:01 2014 -0500 |AuthorDate: Sat Mar 1 17:26:01 2014 -0500 + |Commit: Jonas Fonseca + WIP: Upgrade to 0.4-SNAPSHOT and DCE |CommitDate: Sat Mar 1 17:26:01 2014 -0500 + | + common/benchmark-runner.sh | 5 +++-- | WIP: Upgrade to 0.4-SNAPSHOT and DCE + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ |--- + common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- | common/benchmark-runner.sh | 5 +++-- + common/start-benchmark.js | 9 +++++++-- | common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ + deltablue/exports.js | 13 ------------- | common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- + .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ | common/start-benchmark.js | 9 +++++++-- + project/Build.scala | 13 ++++--------- | deltablue/exports.js | 13 ------------- + project/build.sbt | 5 ++++- | .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ + richards/exports.js | 13 ------------- | project/Build.scala | 13 ++++--------- + richards/src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ | project/build.sbt | 5 ++++- + run.sh | 2 +- | richards/exports.js | 13 ------------- + sudoku/exports.js | 13 ------------- | .../src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ + sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ | run.sh | 2 +- + tracer/exports.js | 13 ------------- | sudoku/exports.js | 13 ------------- + tracer/index-dev.html | 2 +- | sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ + tracer/index.html | 2 +- | tracer/exports.js | 13 ------------- + tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ | tracer/index-dev.html | 2 +- + 17 files changed, 42 insertions(+), 76 deletions(-) | tracer/index.html | 2 +- + | tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ +commit a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff | 17 files changed, 42 insertions(+), 76 deletions(-) +Author: Jonas Fonseca | [log] ee912870202200a0b9cf4fd86ba57243212d341e - line 1 of 668 4%|[diff] ee912870202200a0b9cf4fd86ba57243212d341e - line 1 of 367 7% EOF assert_equals 'diff-stat-after-refresh.screen' < |Author: Jonas Fonseca -Date: Sat Mar 1 17:26:01 2014 -0500 |AuthorDate: Sat Mar 1 17:26:01 2014 -0500 - |Commit: Jonas Fonseca - WIP: Upgrade to 0.4-SNAPSHOT and DCE |CommitDate: Sat Mar 1 17:26:01 2014 -0500 - | - common/benchmark-runner.sh | 5 +++-- | WIP: Upgrade to 0.4-SNAPSHOT and DCE - common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ |--- - common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- | common/benchmark-runner.sh | 5 +++-- - common/start-benchmark.js | 9 +++++++-- | common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ - deltablue/exports.js | 13 ------------- | common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- - .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ | common/start-benchmark.js | 9 +++++++-- - project/Build.scala | 13 ++++--------- | deltablue/exports.js | 13 ------------- - project/build.sbt | 5 ++++- | .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ - richards/exports.js | 13 ------------- | project/Build.scala | 13 ++++--------- - richards/src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ | project/build.sbt | 5 ++++- - run.sh | 2 +- | richards/exports.js | 13 ------------- - sudoku/exports.js | 13 ------------- | .../src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ - sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ | run.sh | 2 +- - tracer/exports.js | 13 ------------- | sudoku/exports.js | 13 ------------- - tracer/index-dev.html | 2 +- | sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ - tracer/index.html | 2 +- | tracer/exports.js | 13 ------------- - tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ | tracer/index-dev.html | 2 +- - 17 files changed, 42 insertions(+), 76 deletions(-) | tracer/index.html | 2 +- - | tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ -commit a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff | 17 files changed, 42 insertions(+), 76 deletions(-) -Author: Jonas Fonseca | +commit ee912870202200a0b9cf4fd86ba57243212d341e |commit ee912870202200a0b9cf4fd86ba57243212d341e +Refs: [master] |Refs: [master] +Author: Jonas Fonseca |Author: Jonas Fonseca +Date: Sat Mar 1 17:26:01 2014 -0500 |AuthorDate: Sat Mar 1 17:26:01 2014 -0500 + |Commit: Jonas Fonseca + WIP: Upgrade to 0.4-SNAPSHOT and DCE |CommitDate: Sat Mar 1 17:26:01 2014 -0500 + | + common/benchmark-runner.sh | 5 +++-- | WIP: Upgrade to 0.4-SNAPSHOT and DCE + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ |--- + common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- | common/benchmark-runner.sh | 5 +++-- + common/start-benchmark.js | 9 +++++++-- | common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 11 +++++------ + deltablue/exports.js | 13 ------------- | common/src/main/scala/org/scalajs/benchmark/BenchmarkApp.scala | 2 +- + .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ | common/start-benchmark.js | 9 +++++++-- + project/Build.scala | 13 ++++--------- | deltablue/exports.js | 13 ------------- + project/build.sbt | 5 ++++- | .../src/main/scala/org/scalajs/benchmark/deltablue/DeltaBlue.scala | 7 +++++++ + richards/exports.js | 13 ------------- | project/Build.scala | 13 ++++--------- + richards/src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ | project/build.sbt | 5 ++++- + run.sh | 2 +- | richards/exports.js | 13 ------------- + sudoku/exports.js | 13 ------------- | .../src/main/scala/org/scalajs/benchmark/richards/Richards.scala | 3 +++ + sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ | run.sh | 2 +- + tracer/exports.js | 13 ------------- | sudoku/exports.js | 13 ------------- + tracer/index-dev.html | 2 +- | sudoku/src/main/scala/org/scalajs/benchmark/sudoku/Sudoku.scala | 2 ++ + tracer/index.html | 2 +- | tracer/exports.js | 13 ------------- + tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ | tracer/index-dev.html | 2 +- + 17 files changed, 42 insertions(+), 76 deletions(-) | tracer/index.html | 2 +- + | tracer/src/main/scala/org/scalajs/benchmark/tracer/Tracer.scala | 3 +++ +commit a1dcf1aaa11470978db1d5d8bcf9e16201eb70ff | 17 files changed, 42 insertions(+), 76 deletions(-) +Author: Jonas Fonseca | [log] ee912870202200a0b9cf4fd86ba57243212d341e - line 1 of 668 4%|[diff] ee912870202200a0b9cf4fd86ba57243212d341e - line 1 of 367 7% EOF diff -Nru tig-2.2/test/log/pretty-format-test tig-2.3.0/test/log/pretty-format-test --- tig-2.2/test/log/pretty-format-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/log/pretty-format-test 2017-09-29 15:15:26.000000000 +0000 @@ -33,89 +33,89 @@ test_tig log assert_equals 'log-pretty-format-override.screen' < -Date: 2010-04-07 - - Commit 10 E - -commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 -Author: Jørgen Thygesen Brahe -Date: 2010-03-29 - - Commit 10 D - -commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 -Author: 作者 -Date: 2010-03-21 - - Commit 10 C +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +Author: Max Power +Date: 2010-04-07 + + Commit 10 E + +commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +Author: Jørgen Thygesen Brahe +Date: 2010-03-29 + + Commit 10 D + +commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 +Author: 作者 +Date: 2010-03-21 + + Commit 10 C [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 301 5% EOF assert_equals 'log-pretty-raw.screen' < 1270618660 +0000 -committer Committer 1270618660 +0000 - - Commit 10 E - -commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 -tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 -parent 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 -author Jørgen Thygesen Brahe 1269882930 +0000 -committer Committer 1269882930 +0000 - - Commit 10 D - -commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +parent 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +author Max Power 1270618660 +0000 +committer Committer 1270618660 +0000 + + Commit 10 E + +commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +parent 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 +author Jørgen Thygesen Brahe 1269882930 +0000 +committer Committer 1269882930 +0000 + + Commit 10 D + +commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 400 4% EOF assert_equals 'log-pretty-full.screen' < -Commit: Committer - - Commit 10 E - -commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 -Author: Jørgen Thygesen Brahe -Commit: Committer - - Commit 10 D - -commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 -Author: 作者 -Commit: Committer - - Commit 10 C +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +Author: Max Power +Commit: Committer + + Commit 10 E + +commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +Author: Jørgen Thygesen Brahe +Commit: Committer + + Commit 10 D + +commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 +Author: 作者 +Commit: Committer + + Commit 10 C [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 301 5% EOF assert_equals 'log-pretty-fuller.screen' < -AuthorDate: Wed Apr 7 05:37:40 2010 +0000 -Commit: Committer -CommitDate: Wed Apr 7 05:37:40 2010 +0000 - - Commit 10 E - -commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 -Author: Jørgen Thygesen Brahe -AuthorDate: Mon Mar 29 17:15:30 2010 +0000 -Commit: Committer -CommitDate: Mon Mar 29 17:15:30 2010 +0000 - - Commit 10 D - -commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +Author: Max Power +AuthorDate: Wed Apr 7 05:37:40 2010 +0000 +Commit: Committer +CommitDate: Wed Apr 7 05:37:40 2010 +0000 + + Commit 10 E + +commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +Author: Jørgen Thygesen Brahe +AuthorDate: Mon Mar 29 17:15:30 2010 +0000 +Commit: Committer +CommitDate: Mon Mar 29 17:15:30 2010 +0000 + + Commit 10 D + +commit 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 [log] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 401 4% EOF diff -Nru tig-2.2/test/log/start-on-line-test tig-2.3.0/test/log/start-on-line-test --- tig-2.2/test/log/start-on-line-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/log/start-on-line-test 2017-09-29 15:15:26.000000000 +0000 @@ -12,33 +12,33 @@ test_tig log +42 assert_equals 'position.screen' < -Date: Sat Mar 1 15:59:02 2014 -0500 - - Add type parameter for js.Dynamic - - common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 296fc90ba2c47ba3d2b6ab8e984ea3a82bb4cd6e -Author: Jonas Fonseca -Date: Thu Jan 16 22:51:27 2014 -0500 - - Move classes under org.scalajs.benchmark package scope - - common/Benchmark.scala | 110 ---- - common/BenchmarkApp.scala | 47 -- - common/DOMTypes.scala | 49 -- - .../scala/org/scalajs/benchmark/Benchmark.scala | 110 ++++ - .../scala/org/scalajs/benchmark/BenchmarkApp.scala | 46 ++ - .../scala/org/scalajs/benchmark/dom/DOMTypes.scala | 49 ++ - deltablue/DeltaBlue.scala | 704 --------------------- - deltablue/exports.js | 2 +- - .../scalajs/benchmark/deltablue/DeltaBlue.scala | 704 +++++++++++++++++++++ - richards/Richards.scala | 460 -------------- - richards/exports.js | 2 +- - .../org/scalajs/benchmark/richards/Richards.scala | 460 ++++++++++++++ - sudoku/Sudoku.scala | 197 ------ - sudoku/exports.js | 2 +- +Author: Jonas Fonseca +Date: Sat Mar 1 15:59:02 2014 -0500 + + Add type parameter for js.Dynamic + + common/src/main/scala/org/scalajs/benchmark/Benchmark.scala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 296fc90ba2c47ba3d2b6ab8e984ea3a82bb4cd6e +Author: Jonas Fonseca +Date: Thu Jan 16 22:51:27 2014 -0500 + + Move classes under org.scalajs.benchmark package scope + + common/Benchmark.scala | 110 ---- + common/BenchmarkApp.scala | 47 -- + common/DOMTypes.scala | 49 -- + .../scala/org/scalajs/benchmark/Benchmark.scala | 110 ++++ + .../scala/org/scalajs/benchmark/BenchmarkApp.scala | 46 ++ + .../scala/org/scalajs/benchmark/dom/DOMTypes.scala | 49 ++ + deltablue/DeltaBlue.scala | 704 --------------------- + deltablue/exports.js | 2 +- + .../scalajs/benchmark/deltablue/DeltaBlue.scala | 704 +++++++++++++++++++++ + richards/Richards.scala | 460 -------------- + richards/exports.js | 2 +- + .../org/scalajs/benchmark/richards/Richards.scala | 460 ++++++++++++++ + sudoku/Sudoku.scala | 197 ------ + sudoku/exports.js | 2 +- [log] 296fc90ba2c47ba3d2b6ab8e984ea3a82bb4cd6e - line 42 of 668 8% EOF diff -Nru tig-2.2/test/log/submodule-test tig-2.3.0/test/log/submodule-test --- tig-2.2/test/log/submodule-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/log/submodule-test 2017-09-29 15:15:26.000000000 +0000 @@ -26,99 +26,99 @@ test_tig log assert_equals 'log-submodule.screen' < -Date: Sun Sep 6 08:23:30 2009 +0000 - - [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c - - repo-two-a | 2 +- - repo-two-b | 2 +- - repo-two-c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -commit 7f9d74d1b554e99059334799f56b1307f9c324d4 -Author: A. U. Thor -Date: Mon Aug 3 06:54:50 2009 +0000 - - [repo-two] Integrate feature from repo-two-b - - repo-two-b | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 2bbde7f66edbac9b45b86ad75e6b1e8e02970a67 -Author: A. U. Thor -Date: Wed Jul 8 17:48:20 2009 +0000 - - [repo-two] Integrate feature from repo-two-a, repo-two-c - - repo-two-a | 2 +- - repo-two-c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -commit 3a2603a2ea55ef06860f8d8ec33ee10d95d08117 -Author: A. U. Thor -Date: Wed May 27 03:57:30 2009 +0000 - - [repo-two] Creating repository - - .gitmodules | 9 +++++++++ - repo-two-a | 1 + - repo-two-b | 1 + - repo-two-c | 1 + - 4 files changed, 12 insertions(+) - -commit 9bb0f0da3dd2dec58efa5d8fa9d2b1f4768504e9 -Author: A. U. Thor +commit feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d +Refs: [master], {origin/master}, {origin/HEAD} +Author: A. U. Thor +Date: Sun Sep 6 08:23:30 2009 +0000 + + [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c + + repo-two-a | 2 +- + repo-two-b | 2 +- + repo-two-c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 7f9d74d1b554e99059334799f56b1307f9c324d4 +Author: A. U. Thor +Date: Mon Aug 3 06:54:50 2009 +0000 + + [repo-two] Integrate feature from repo-two-b + + repo-two-b | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2bbde7f66edbac9b45b86ad75e6b1e8e02970a67 +Author: A. U. Thor +Date: Wed Jul 8 17:48:20 2009 +0000 + + [repo-two] Integrate feature from repo-two-a, repo-two-c + + repo-two-a | 2 +- + repo-two-c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 3a2603a2ea55ef06860f8d8ec33ee10d95d08117 +Author: A. U. Thor +Date: Wed May 27 03:57:30 2009 +0000 + + [repo-two] Creating repository + + .gitmodules | 9 +++++++++ + repo-two-a | 1 + + repo-two-b | 1 + + repo-two-c | 1 + + 4 files changed, 12 insertions(+) + +commit 9bb0f0da3dd2dec58efa5d8fa9d2b1f4768504e9 +Author: A. U. Thor [log] feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d - line 1 of 69 65% EOF assert_equals 'log-submodule-diff.screen' < -Date: Sun Sep 6 08:23:30 2009 +0000 - - [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c ---- - repo-two-a | 2 +- - repo-two-b | 2 +- - repo-two-c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -Submodule repo-two-a a1d2fa2..598d4e4: - > [repo-two-a] Commit 5 -Submodule repo-two-b f3866fb..8ab92f1: - > [repo-two-b] Commit 5 -Submodule repo-two-c cd41885..e4b7821: - > [repo-two-c] Commit 5 - -commit 7f9d74d1b554e99059334799f56b1307f9c324d4 -Author: A. U. Thor -Date: Mon Aug 3 06:54:50 2009 +0000 - - [repo-two] Integrate feature from repo-two-b ---- - repo-two-b | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Submodule repo-two-b e795b27..f3866fb: - > [repo-two-b] Commit 4 - > [repo-two-b] Commit 3 - -commit 2bbde7f66edbac9b45b86ad75e6b1e8e02970a67 -Author: A. U. Thor -Date: Wed Jul 8 17:48:20 2009 +0000 - - [repo-two] Integrate feature from repo-two-a, repo-two-c ---- - repo-two-a | 2 +- - repo-two-c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -Submodule repo-two-a 7df88b0..a1d2fa2: - > [repo-two-a] Commit 4 - > [repo-two-a] Commit 3 +commit feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d +Refs: [master], {origin/master}, {origin/HEAD} +Author: A. U. Thor +Date: Sun Sep 6 08:23:30 2009 +0000 + + [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c +--- + repo-two-a | 2 +- + repo-two-b | 2 +- + repo-two-c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +Submodule repo-two-a a1d2fa2..598d4e4: + > [repo-two-a] Commit 5 +Submodule repo-two-b f3866fb..8ab92f1: + > [repo-two-b] Commit 5 +Submodule repo-two-c cd41885..e4b7821: + > [repo-two-c] Commit 5 + +commit 7f9d74d1b554e99059334799f56b1307f9c324d4 +Author: A. U. Thor +Date: Mon Aug 3 06:54:50 2009 +0000 + + [repo-two] Integrate feature from repo-two-b +--- + repo-two-b | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Submodule repo-two-b e795b27..f3866fb: + > [repo-two-b] Commit 4 + > [repo-two-b] Commit 3 + +commit 2bbde7f66edbac9b45b86ad75e6b1e8e02970a67 +Author: A. U. Thor +Date: Wed Jul 8 17:48:20 2009 +0000 + + [repo-two] Integrate feature from repo-two-a, repo-two-c +--- + repo-two-a | 2 +- + repo-two-c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Submodule repo-two-a 7df88b0..a1d2fa2: + > [repo-two-a] Commit 4 + > [repo-two-a] Commit 3 [log] feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d - line 1 of 130 34% EOF diff -Nru tig-2.2/test/main/all-arg-test tig-2.3.0/test/main/all-arg-test --- tig-2.2/test/main/all-arg-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/all-arg-test 2017-09-29 15:15:26.000000000 +0000 @@ -21,43 +21,43 @@ test_tig --all -assert_vars +assert_vars 1 assert_equals stderr < Commit 10 B -2010-03-04 04:09 A. U. Thor * Commit 10 A -2010-02-23 15:46 Max Power * Commit 9 E -2010-02-15 03:24 Jørgen Thygesen Brahe * Commit 9 D -2010-02-06 15:02 作者 * Commit 9 C -2010-01-29 02:40 René Lévesque * Commit 9 B -2010-01-20 14:18 A. U. Thor * Commit 9 A -2010-01-12 01:56 Max Power * Commit 8 E -2010-01-03 13:33 Jørgen Thygesen Brahe * Commit 8 D -2009-12-26 01:11 作者 * [r1.1.2] [r1.1.x] Commit 8 C +2010-03-29 17:15 Jørgen Thygesen Brahe * Commit 10 D +2010-03-21 04:53 作者 * Commit 10 C +2010-03-12 16:31 René Lévesque * Commit 10 B +2010-03-04 04:09 A. U. Thor * Commit 10 A +2010-02-23 15:46 Max Power * Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe * Commit 9 D +2010-02-06 15:02 作者 * Commit 9 C +2010-01-29 02:40 René Lévesque * Commit 9 B +2010-01-20 14:18 A. U. Thor * Commit 9 A +2010-01-12 01:56 Max Power * Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe * Commit 8 D +2009-12-26 01:11 作者 * [r1.1.2] [r1.1.x] Commit 8 C [main] 042f71a7592228ae84cbb3642c2666dcd35aa527 - commit 1 of 51 27% EOF assert_equals 'detached.screen' < Commit 10 B -2010-03-04 04:09 A. U. Thor * Commit 10 A -2010-02-23 15:46 Max Power * Commit 9 E -2010-02-15 03:24 Jørgen Thygesen Brahe * Commit 9 D -2010-02-06 15:02 作者 * Commit 9 C -2010-01-29 02:40 René Lévesque * Commit 9 B -2010-01-20 14:18 A. U. Thor * Commit 9 A -2010-01-12 01:56 Max Power * Commit 8 E -2010-01-03 13:33 Jørgen Thygesen Brahe * Commit 8 D -2009-12-26 01:11 作者 * [r1.1.2] [r1.1.x] Commit 8 C +2010-03-29 17:15 Jørgen Thygesen Brahe * Commit 10 D +2010-03-21 04:53 作者 * [HEAD] Commit 10 C +2010-03-12 16:31 René Lévesque * Commit 10 B +2010-03-04 04:09 A. U. Thor * Commit 10 A +2010-02-23 15:46 Max Power * Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe * Commit 9 D +2010-02-06 15:02 作者 * Commit 9 C +2010-01-29 02:40 René Lévesque * Commit 9 B +2010-01-20 14:18 A. U. Thor * Commit 9 A +2010-01-12 01:56 Max Power * Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe * Commit 8 D +2009-12-26 01:11 作者 * [r1.1.2] [r1.1.x] Commit 8 C [main] 042f71a7592228ae84cbb3642c2666dcd35aa527 - commit 1 of 51 27% EOF diff -Nru tig-2.2/test/main/author-name-change-test tig-2.3.0/test/main/author-name-change-test --- tig-2.2/test/main/author-name-change-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/main/author-name-change-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Test display and options specific to the main view. + +. libtest.sh +. libgit.sh + +export LINES=5 + +tigrc < Commit 10 B -2010-03-04 04:09 A. U. Thor * Commit 10 A -2010-02-23 15:46 Max Power * Commit 9 E -2010-02-15 03:24 Jørgen Thygesen Brahe * Commit 9 D -2010-02-06 15:02 作者 * Commit 9 C -2010-01-29 02:40 René Lévesque * Commit 9 B -2010-01-20 14:18 A. U. Thor * Commit 9 A -2010-01-12 01:56 Max Power * Commit 8 E -2010-01-03 13:33 Jørgen Thygesen Brahe * Commit 8 D -2009-12-26 01:11 作者 * [r1.1.2] [r1.1.x] Commit 8 C -2009-12-17 12:49 René Lévesque * [r1.0] Commit 8 B -2009-12-09 00:27 A. U. Thor * Commit 8 A +2010-03-29 17:15 Jørgen Thygesen Brahe * Commit 10 D +2010-03-21 04:53 作者 * Commit 10 C +2010-03-12 16:31 René Lévesque * Commit 10 B +2010-03-04 04:09 A. U. Thor * Commit 10 A +2010-02-23 15:46 Max Power * Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe * Commit 9 D +2010-02-06 15:02 作者 * Commit 9 C +2010-01-29 02:40 René Lévesque * Commit 9 B +2010-01-20 14:18 A. U. Thor * Commit 9 A +2010-01-12 01:56 Max Power * Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe * Commit 8 D +2009-12-26 01:11 作者 * [r1.1.2] [r1.1.x] Commit 8 C +2009-12-17 12:49 René Lévesque * [r1.0] Commit 8 B +2009-12-09 00:27 A. U. Thor * Commit 8 A [main] 042f71a7592228ae84cbb3642c2666dcd35aa527 - commit 1 of 51 31% EOF diff -Nru tig-2.2/test/main/commit-order-edge-case-test tig-2.3.0/test/main/commit-order-edge-case-test --- tig-2.2/test/main/commit-order-edge-case-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/commit-order-edge-case-test 2017-09-29 15:15:26.000000000 +0000 @@ -22,25 +22,25 @@ test_tig assert_equals 'ensure-topo-order-with-graph.screen' <者者者者者作者 : #4 - mixed prefix ->åååååæøå : #3 - mixed prefix -....|.作者 : #2 - ASCII prefix -....|.æøå : #1 - ASCII prefix -__________________________________________[ Variation 6 ] -者者者者者作者 : #6 - non-ASCII prefix -åååååæøå : #5 - non-ASCII prefix ->者者者者作者 : #4 - mixed prefix ->ååååæøå : #3 - mixed prefix -....|作者 : #2 - ASCII prefix -....|æøå : #1 - ASCII prefix -__________________________________________[ Variation 5 ] -者者者者作者 : #6 - non-ASCII prefix -ååååæøå : #5 - non-ASCII prefix ->者者者作者 : #4 - mixed prefix ->åååæøå : #3 - mixed prefix -....作者 : #2 - ASCII prefix -....æøå : #1 - ASCII prefix -__________________________________________[ Variation 4 ] -者者者作者 : #6 - non-ASCII prefix -åååæøå : #5 - non-ASCII prefix ->者者作者 : #4 - mixed prefix ->ååæøå : #3 - mixed prefix -...作者 : #2 - ASCII prefix -...æøå : #1 - ASCII prefix -__________________________________________[ Variation 3 ] -者者作者 : #6 - non-ASCII prefix -ååæøå : #5 - non-ASCII prefix ->者作者 : #4 - mixed prefix ->åæøå : #3 - mixed prefix -..作者 : #2 - ASCII prefix -..æøå : #1 - ASCII prefix -__________________________________________[ Variation 2 ] -者作者 : #6 - non-ASCII prefix -åæøå : #5 - non-ASCII prefix ->作者 : #4 - mixed prefix ->æøå : #3 - mixed prefix -.作者 : #2 - ASCII prefix -.æøå : #1 - ASCII prefix -__________________________________________[ Variation 1 ] -作者 : #6 - non-ASCII prefix -æøå : #5 - non-ASCII prefix -作者 : #4 - mixed prefix -æøå : #3 - mixed prefix -作者 : #2 - ASCII prefix -æøå : #1 - ASCII prefix +__________________________________________[ Variation 7 ] +者者者者者者作者 : #6 - non-ASCII prefix +ååååååæøå : #5 - non-ASCII prefix +>者者者者者作者 : #4 - mixed prefix +>åååååæøå : #3 - mixed prefix +....|.作者 : #2 - ASCII prefix +....|.æøå : #1 - ASCII prefix +__________________________________________[ Variation 6 ] +者者者者者作者 : #6 - non-ASCII prefix +åååååæøå : #5 - non-ASCII prefix +>者者者者作者 : #4 - mixed prefix +>ååååæøå : #3 - mixed prefix +....|作者 : #2 - ASCII prefix +....|æøå : #1 - ASCII prefix +__________________________________________[ Variation 5 ] +者者者者作者 : #6 - non-ASCII prefix +ååååæøå : #5 - non-ASCII prefix +>者者者作者 : #4 - mixed prefix +>åååæøå : #3 - mixed prefix +....作者 : #2 - ASCII prefix +....æøå : #1 - ASCII prefix +__________________________________________[ Variation 4 ] +者者者作者 : #6 - non-ASCII prefix +åååæøå : #5 - non-ASCII prefix +>者者作者 : #4 - mixed prefix +>ååæøå : #3 - mixed prefix +...作者 : #2 - ASCII prefix +...æøå : #1 - ASCII prefix +__________________________________________[ Variation 3 ] +者者作者 : #6 - non-ASCII prefix +ååæøå : #5 - non-ASCII prefix +>者作者 : #4 - mixed prefix +>åæøå : #3 - mixed prefix +..作者 : #2 - ASCII prefix +..æøå : #1 - ASCII prefix +__________________________________________[ Variation 2 ] +者作者 : #6 - non-ASCII prefix +åæøå : #5 - non-ASCII prefix +>作者 : #4 - mixed prefix +>æøå : #3 - mixed prefix +.作者 : #2 - ASCII prefix +.æøå : #1 - ASCII prefix +__________________________________________[ Variation 1 ] +作者 : #6 - non-ASCII prefix +æøå : #5 - non-ASCII prefix +作者 : #4 - mixed prefix +æøå : #3 - mixed prefix +作者 : #2 - ASCII prefix +æøå : #1 - ASCII prefix [main] 2c360aa85544dd96eb1c4be5234c06c192f9a895 - commit 1 of 49 100% EOF diff -Nru tig-2.2/test/main/date-test tig-2.3.0/test/main/date-test --- tig-2.2/test/main/date-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/date-test 2017-09-29 15:15:26.000000000 +0000 @@ -12,196 +12,230 @@ steps ' :save-display default-date.screen - - :toggle date-local + + :toggle date-local :save-display local-date.screen :toggle date-local - - :toggle date + + :toggle date :save-display relative-date.screen - - :toggle date + + :toggle date :save-display relative-compact-date.screen - - :toggle date + + :toggle date :save-display short-date.screen - - :toggle date + + :toggle date :save-display no-date.screen + + :set main-view-date = custom + :set main-view-date-local = true + :set main-view-date-format = "%F %R %Z" + :save-display custom-date.screen ' test_tig --pretty=raw < "$source_dir/$test.in" assert_equals 'default-date.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 5cb3412a5e06e506840495b91acc885037a48b72 - commit 1 of 50 28% EOF assert_equals 'main-ref-format.screen' < -AuthorDate: Thu Dec 17 12:49:30 2009 +0000 -Commit: Committer -CommitDate: Thu Dec 17 12:49:30 2009 +0000 - - Commit 8 B - +commit 957f2b368e6fa5c0757f36b1441e32729ee5e9c7 +Refs: [v1.0] +Author: René Lévesque +AuthorDate: Thu Dec 17 12:49:30 2009 +0000 +Commit: Committer +CommitDate: Thu Dec 17 12:49:30 2009 +0000 + + Commit 8 B + [diff] 957f2b368e6fa5c0757f36b1441e32729ee5e9c7 - line 1 of 8 100% EOF diff -Nru tig-2.2/test/main/emoji-test tig-2.3.0/test/main/emoji-test --- tig-2.2/test/main/emoji-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/main/emoji-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,74 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +export LINES=10 + +tigrc <> common/build.sbt + export GIT_AUTHOR_DATE="1486403695" + export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" + git commit -a -m "Feature X" +} + +steps ' + :save-display filtered.screen +' + +test_tig --exclude=refs/remotes/origin/* --exclude=refs/heads/master --all -- common tracer + +grep 'git rev-parse' < "$TIG_TRACE" > rev-parse.trace +grep 'git log' < "$TIG_TRACE" > log.trace + +assert_equals 'rev-parse.trace' < %ad%x00%s -- common tracer +EOF + +assert_equals 'filtered.screen' < 作者 " Stargazer Jørgen Thygesen Brahe " Full Throttle Max Power " -¯\_(ツ)_/¯ Committer +¯\_(ツ)_/¯ Committer EOF tigrc < -AuthorDate: Wed Apr 7 05:37:40 2010 +0000 -Commit: ¯\_(ツ)_/¯ -CommitDate: Wed Apr 7 05:37:40 2010 +0000 - - Commit 10 E - - - - - +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +Author: Full Throttle +AuthorDate: Wed Apr 7 05:37:40 2010 +0000 +Commit: ¯\_(ツ)_/¯ +CommitDate: Wed Apr 7 05:37:40 2010 +0000 + + Commit 10 E + + + + + [diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 8 100% EOF diff -Nru tig-2.2/test/main/main-options-test tig-2.3.0/test/main/main-options-test --- tig-2.2/test/main/main-options-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/main-options-test 2017-09-29 15:15:26.000000000 +0000 @@ -20,19 +20,19 @@ test_tig assert_equals 'with-10-lines.screen' < :save-display main-search-time.screen :0 + :set ignore-case = smart-case + /thor + :save-display main-search-smart-case.screen + :0 ' git_clone 'repo-one' @@ -33,127 +37,145 @@ test_tig assert_equals 'main-search-author.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 8d53d6a41f8540749c0db5d0b53e48d2f178dce4 - commit 3 of 50 28% EOF assert_equals 'main-search-author-empty.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 711615619913109be8fd85f2c378839acaa6db11 - commit 8 of 50 28% EOF assert_equals 'main-search-author-find-next.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] b45b5704c34dbd4c5fd89d58d45238ad136ae166 - commit 13 of 50 28% EOF assert_equals 'main-search-title.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 99278700109ac9fe4a80bbc1e5b26769e3614f1b - commit 9 of 50 28% EOF assert_equals 'main-search-title-no-match.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 99278700109ac9fe4a80bbc1e5b26769e3614f1b - commit 9 of 50 28% EOF assert_equals 'main-search-refs.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 957f2b368e6fa5c0757f36b1441e32729ee5e9c7 - commit 14 of 50 28% EOF assert_equals 'main-search-time.screen' < Commit 8 B +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D +2010-03-21 04:53 作者 o Commit 10 C +2010-03-12 16:31 René Lévesque o Commit 10 B +2010-03-04 04:09 A. U. Thor o Commit 10 A +2010-02-23 15:46 Max Power o Commit 9 E +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D +2010-02-06 15:02 作者 o Commit 9 C +2010-01-29 02:40 René Lévesque o Commit 9 B +2010-01-20 14:18 A. U. Thor o Commit 9 A +2010-01-12 01:56 Max Power o Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D +2009-12-26 01:11 作者 o Commit 8 C +2009-12-17 12:49 René Lévesque o Commit 8 B [main] 545eb1fa92b902b6799e2a1691419c3158254a0a - commit 12 of 50 28% EOF + +assert_equals 'main-search-smart-case.screen' < Commit 8 B +[main] 19455fa3642af6a6a7d527dd043caf5a70eaad2d - commit 5 of 50 28% +EOF diff -Nru tig-2.2/test/main/show-changes-after-rename-test tig-2.3.0/test/main/show-changes-after-rename-test --- tig-2.2/test/main/show-changes-after-rename-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/show-changes-after-rename-test 2017-09-29 15:15:26.000000000 +0000 @@ -15,10 +15,10 @@ git_init test_setup_work_dir() { - echo data >file1 + printf 'data\n' >file1 git add file1 git_commit -m "commit1" - echo data >file2 + printf 'data\n' >file2 git add file2 git rm file1 } @@ -26,7 +26,7 @@ test_tig assert_equals 'default.screen' <' to jump to file diff - line 1 of 107 8% EOF assert_equals 'main-with-unstaged-and-staged-split.screen' <' to jump to file diff - line 1 of 86 10% EOF assert_equals 'main-with-staged.screen' <' to jump to file diff - line 1 of 107 8% EOF assert_equals 'main-with-staged-and-unstaged.screen' < Commit 8 B -2009-12-09 00:27 A. U. Thor Commit 8 A - - - - - - - - - +2010-01-12 01:56 Max Power Commit 8 E +2010-01-03 13:33 Jørgen Thygesen Brahe Commit 8 D +2009-12-26 01:11 作者 Commit 8 C +2009-12-17 12:49 René Lévesque Commit 8 B +2009-12-09 00:27 A. U. Thor Commit 8 A + + + + + + + + + [main] d9a8c8b1e52ba7f1673cebb271f1fc0bdac3579b - commit 1 of 5 100% EOF diff -Nru tig-2.2/test/main/submodule-test tig-2.3.0/test/main/submodule-test --- tig-2.2/test/main/submodule-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/submodule-test 2017-09-29 15:15:26.000000000 +0000 @@ -29,99 +29,99 @@ test_tig assert_equals 'main-submodule.screen' < -AuthorDate: Sun Sep 6 08:23:30 2009 +0000 -Commit: Committer -CommitDate: Sun Sep 6 08:23:30 2009 +0000 - - [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c ---- - repo-two-a | 2 +- - repo-two-b | 2 +- - repo-two-c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/repo-two-a b/repo-two-a -index a1d2fa2..598d4e4 160000 ---- a/repo-two-a -+++ b/repo-two-a -@@ -1 +1 @@ --Subproject commit a1d2fa223a5f983adaad9a22df5c518aefba1d07 -+Subproject commit 598d4e4d8b652f28e7b78fd4f95124fadb10efcf -diff --git a/repo-two-b b/repo-two-b -index f3866fb..8ab92f1 160000 ---- a/repo-two-b -+++ b/repo-two-b -@@ -1 +1 @@ --Subproject commit f3866fb983d82c8fc2b01423dde37084f59385d5 -+Subproject commit 8ab92f1f22470039668eb12d405e4356dcae8305 -diff --git a/repo-two-c b/repo-two-c -index cd41885..e4b7821 160000 ---- a/repo-two-c -+++ b/repo-two-c -@@ -1 +1 @@ --Subproject commit cd41885fa2b86fa6aae5308bba55c76a97498dcc -+Subproject commit e4b78219ea174bc0c7f97024cf18fc1e6c08013a - +commit feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d +Refs: [master], {origin/master}, {origin/HEAD} +Author: A. U. Thor +AuthorDate: Sun Sep 6 08:23:30 2009 +0000 +Commit: Committer +CommitDate: Sun Sep 6 08:23:30 2009 +0000 + + [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c +--- + repo-two-a | 2 +- + repo-two-b | 2 +- + repo-two-c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/repo-two-a b/repo-two-a +index a1d2fa2..598d4e4 160000 +--- a/repo-two-a ++++ b/repo-two-a +@@ -1 +1 @@ +-Subproject commit a1d2fa223a5f983adaad9a22df5c518aefba1d07 ++Subproject commit 598d4e4d8b652f28e7b78fd4f95124fadb10efcf +diff --git a/repo-two-b b/repo-two-b +index f3866fb..8ab92f1 160000 +--- a/repo-two-b ++++ b/repo-two-b +@@ -1 +1 @@ +-Subproject commit f3866fb983d82c8fc2b01423dde37084f59385d5 ++Subproject commit 8ab92f1f22470039668eb12d405e4356dcae8305 +diff --git a/repo-two-c b/repo-two-c +index cd41885..e4b7821 160000 +--- a/repo-two-c ++++ b/repo-two-c +@@ -1 +1 @@ +-Subproject commit cd41885fa2b86fa6aae5308bba55c76a97498dcc ++Subproject commit e4b78219ea174bc0c7f97024cf18fc1e6c08013a + [diff] feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d - line 1 of 35 100% EOF assert_equals 'main-submodule-diff.screen' < -AuthorDate: Sun Sep 6 08:23:30 2009 +0000 -Commit: Committer -CommitDate: Sun Sep 6 08:23:30 2009 +0000 - - [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c ---- - repo-two-a | 2 +- - repo-two-b | 2 +- - repo-two-c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -Submodule repo-two-a a1d2fa2..598d4e4: - > [repo-two-a] Commit 5 -Submodule repo-two-b f3866fb..8ab92f1: - > [repo-two-b] Commit 5 -Submodule repo-two-c cd41885..e4b7821: - > [repo-two-c] Commit 5 - - - - - - - - - - - - - - - - +commit feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d +Refs: [master], {origin/master}, {origin/HEAD} +Author: A. U. Thor +AuthorDate: Sun Sep 6 08:23:30 2009 +0000 +Commit: Committer +CommitDate: Sun Sep 6 08:23:30 2009 +0000 + + [repo-two] Integrate feature from repo-two-a, repo-two-b, repo-two-c +--- + repo-two-a | 2 +- + repo-two-b | 2 +- + repo-two-c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +Submodule repo-two-a a1d2fa2..598d4e4: + > [repo-two-a] Commit 5 +Submodule repo-two-b f3866fb..8ab92f1: + > [repo-two-b] Commit 5 +Submodule repo-two-c cd41885..e4b7821: + > [repo-two-c] Commit 5 + + + + + + + + + + + + + + + + [diff] feeb2dfd5e09e887e4b6c901e7d91a4c85a7831d - line 1 of 20 100% EOF diff -Nru tig-2.2/test/main/update-unstaged-changes-test tig-2.3.0/test/main/update-unstaged-changes-test --- tig-2.2/test/main/update-unstaged-changes-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/main/update-unstaged-changes-test 2017-09-29 15:15:26.000000000 +0000 @@ -26,15 +26,15 @@ test_tig assert_equals 'start.screen' < -2010-03-12 16:31 R~ |AuthorDate: Wed Apr 7 05:37:40 2010 +0000 -2010-03-04 04:09 A~ |Commit: Committer -2010-02-23 15:46 M~ |CommitDate: Wed Apr 7 05:37:40 2010 +0000 -2010-02-15 03:24 J~ | -2010-02-06 15:02 | Commit 10 E -2010-01-29 02:40 R~ | -2010-01-20 14:18 A~ | -2010-01-12 01:56 M~ | -2010-01-03 13:33 J~ | -2009-12-26 01:11 | -2009-12-17 12:49 R~ | -2009-12-09 00:27 A~ | -2009-11-30 12:05 M~ | +2010-04-07 05:37 M~ |commit 5cb3412a5e06e506840495b91acc885037a48b72 +2010-03-29 17:15 J~ |Refs: [master], {origin/master}, {origin/HEAD} +2010-03-21 04:53 ~ |Author: Max Power +2010-03-12 16:31 R~ |AuthorDate: Wed Apr 7 05:37:40 2010 +0000 +2010-03-04 04:09 A~ |Commit: Committer +2010-02-23 15:46 M~ |CommitDate: Wed Apr 7 05:37:40 2010 +0000 +2010-02-15 03:24 J~ | +2010-02-06 15:02 ~ | Commit 10 E +2010-01-29 02:40 R~ | +2010-01-20 14:18 A~ | +2010-01-12 01:56 M~ | +2010-01-03 13:33 J~ | +2009-12-26 01:11 ~ | +2009-12-17 12:49 R~ | +2009-12-09 00:27 A~ | +2009-11-30 12:05 M~ | [main] 5cb3412a5e32%|[diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 100% EOF assert_equals 'main-hsplit-default.screen' < -AuthorDate: Wed Apr 7 05:37:40 2010 +0000 -Commit: Committer -CommitDate: Wed Apr 7 05:37:40 2010 +0000 - - Commit 10 E - - +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +Author: Max Power +AuthorDate: Wed Apr 7 05:37:40 2010 +0000 +Commit: Committer +CommitDate: Wed Apr 7 05:37:40 2010 +0000 + + Commit 10 E + + [diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 8 100% EOF assert_equals 'main-hsplit-50-50.screen' < -AuthorDate: Wed Apr 7 05:37:40 2010 +0000 -Commit: Committer -CommitDate: Wed Apr 7 05:37:40 2010 +0000 - +commit 5cb3412a5e06e506840495b91acc885037a48b72 +Refs: [master], {origin/master}, {origin/HEAD} +Author: Max Power +AuthorDate: Wed Apr 7 05:37:40 2010 +0000 +Commit: Committer +CommitDate: Wed Apr 7 05:37:40 2010 +0000 + [diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 8 87% EOF diff -Nru tig-2.2/test/prompt/exec-test tig-2.3.0/test/prompt/exec-test --- tig-2.2/test/prompt/exec-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/prompt/exec-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,42 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +LINES=10 + +in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz" + +test_case exec-without-arg-doesnt-crash \ + --args='status' \ + --script=' + :exec + ' <:: + + Set the default timeout for each invocation of tig under the + test harness. The default is 10 if unset. 0 means "no + timeout". Individual tests may override the value. diff -Nru tig-2.2/test/refs/branch-checkout-test tig-2.3.0/test/refs/branch-checkout-test --- tig-2.2/test/refs/branch-checkout-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/refs/branch-checkout-test 2017-09-29 15:15:26.000000000 +0000 @@ -62,34 +62,34 @@ EOF assert_equals 'refs-init.screen' < file + printf '3.14\n' > file git add file git_commit -m "committed" cd "$pwd" @@ -31,11 +31,11 @@ test_tig assert_equals 'initial.screen' < committed +2009-02-13 23:31 Committer I [master] {origin/master} {origin/HEAD} committed [main] 6b55d08be93000f4bdf67f74177ab14f590910d4 - commit 1 of 1 100% EOF diff -Nru tig-2.2/test/regressions/github-434-test tig-2.3.0/test/regressions/github-434-test --- tig-2.2/test/regressions/github-434-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/regressions/github-434-test 2017-09-29 15:15:26.000000000 +0000 @@ -27,97 +27,97 @@ test_tig assert_equals 'vsplit-auto.screen' < -2010-03-12 16:31 René Lévesque o Commit 10 B |AuthorDate: Wed Apr 7 05:37:40 2010 +0000 -2010-03-04 04:09 A. U. Thor o Commit 10 A |Commit: Committer -2010-02-23 15:46 Max Power o Commit 9 E |CommitDate: Wed Apr 7 05:37:40 2010 +0000 -2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D | -2010-02-06 15:02 作者 o Commit 9 C | Commit 10 E -2010-01-29 02:40 René Lévesque o Commit 9 B | -2010-01-20 14:18 A. U. Thor o Commit 9 A | -2010-01-12 01:56 Max Power o Commit 8 E | -2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D | -2009-12-26 01:11 作者 o Commit 8 C | -2009-12-17 12:49 René Lévesque o Commit 8 B | -2009-12-09 00:27 A. U. Thor o Commit 8 A | -2009-11-30 12:05 Max Power o Commit 7 E | -2009-11-21 23:43 Jørgen Thygesen Brahe o Commit 7 D | -2009-11-13 11:20 作者 o Commit 7 C | -2009-11-04 22:58 René Lévesque o Commit 7 B | -2009-10-27 10:36 A. U. Thor o Commit 7 A | -2009-10-18 22:14 Max Power o Commit 6 E | -2009-10-10 09:52 Jørgen Thygesen Brahe o Commit 6 D | -2009-10-01 21:30 作者 o Commit 6 C | -2009-09-23 09:07 René Lévesque o Commit 6 B | -2009-09-14 20:45 A. U. Thor o Commit 6 A | -2009-09-06 08:23 Max Power o Commit 5 E | -2009-08-28 20:01 Jørgen Thygesen Brahe o Commit 5 D | -2009-08-20 07:39 作者 o Commit 5 C | +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} |commit 5cb3412a5e06e506840495b91acc885037a48b72 +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D |Refs: [master], {origin/master}, {origin/HEAD} +2010-03-21 04:53 作者 o Commit 10 C |Author: Max Power +2010-03-12 16:31 René Lévesque o Commit 10 B |AuthorDate: Wed Apr 7 05:37:40 2010 +0000 +2010-03-04 04:09 A. U. Thor o Commit 10 A |Commit: Committer +2010-02-23 15:46 Max Power o Commit 9 E |CommitDate: Wed Apr 7 05:37:40 2010 +0000 +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D | +2010-02-06 15:02 作者 o Commit 9 C | Commit 10 E +2010-01-29 02:40 René Lévesque o Commit 9 B | +2010-01-20 14:18 A. U. Thor o Commit 9 A | +2010-01-12 01:56 Max Power o Commit 8 E | +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D | +2009-12-26 01:11 作者 o Commit 8 C | +2009-12-17 12:49 René Lévesque o Commit 8 B | +2009-12-09 00:27 A. U. Thor o Commit 8 A | +2009-11-30 12:05 Max Power o Commit 7 E | +2009-11-21 23:43 Jørgen Thygesen Brahe o Commit 7 D | +2009-11-13 11:20 作者 o Commit 7 C | +2009-11-04 22:58 René Lévesque o Commit 7 B | +2009-10-27 10:36 A. U. Thor o Commit 7 A | +2009-10-18 22:14 Max Power o Commit 6 E | +2009-10-10 09:52 Jørgen Thygesen Brahe o Commit 6 D | +2009-10-01 21:30 作者 o Commit 6 C | +2009-09-23 09:07 René Lévesque o Commit 6 B | +2009-09-14 20:45 A. U. Thor o Commit 6 A | +2009-09-06 08:23 Max Power o Commit 5 E | +2009-08-28 20:01 Jørgen Thygesen Brahe o Commit 5 D | +2009-08-20 07:39 作者 o Commit 5 C | [main] 5cb3412a5e06e506840495b91acc885037a48b72 - commit 1 of 50 56%|[diff] 5cb3412a5e06e506840495b91acc885037a48b72 - line 1 of 8 100% EOF assert_equals 'hsplit.screen' < -AuthorDate: Mon Mar 29 17:15:30 2010 +0000 -Commit: Committer -CommitDate: Mon Mar 29 17:15:30 2010 +0000 - - Commit 10 D - - - - - - - - - - - +commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +Author: Jørgen Thygesen Brahe +AuthorDate: Mon Mar 29 17:15:30 2010 +0000 +Commit: Committer +CommitDate: Mon Mar 29 17:15:30 2010 +0000 + + Commit 10 D + + + + + + + + + + + [diff] 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 - line 1 of 7 100% EOF assert_equals 'vsplit.screen' < -2010-03-21 04:53 作者 o Commit 10 C |AuthorDate: Mon Mar 29 17:15:30 2010 +0000 -2010-03-12 16:31 René Lévesque o Commit 10 B |Commit: Committer -2010-03-04 04:09 A. U. Thor o Commit 10 A |CommitDate: Mon Mar 29 17:15:30 2010 +0000 -2010-02-23 15:46 Max Power o Commit 9 E | -2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D | Commit 10 D -2010-02-06 15:02 作者 o Commit 9 C | -2010-01-29 02:40 René Lévesque o Commit 9 B | -2010-01-20 14:18 A. U. Thor o Commit 9 A | -2010-01-12 01:56 Max Power o Commit 8 E | -2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D | -2009-12-26 01:11 作者 o Commit 8 C | -2009-12-17 12:49 René Lévesque o Commit 8 B | -2009-12-09 00:27 A. U. Thor o Commit 8 A | -2009-11-30 12:05 Max Power o Commit 7 E | -2009-11-21 23:43 Jørgen Thygesen Brahe o Commit 7 D | -2009-11-13 11:20 作者 o Commit 7 C | -2009-11-04 22:58 René Lévesque o Commit 7 B | -2009-10-27 10:36 A. U. Thor o Commit 7 A | -2009-10-18 22:14 Max Power o Commit 6 E | -2009-10-10 09:52 Jørgen Thygesen Brahe o Commit 6 D | -2009-10-01 21:30 作者 o Commit 6 C | -2009-09-23 09:07 René Lévesque o Commit 6 B | -2009-09-14 20:45 A. U. Thor o Commit 6 A | -2009-09-06 08:23 Max Power o Commit 5 E | -2009-08-28 20:01 Jørgen Thygesen Brahe o Commit 5 D | -2009-08-20 07:39 作者 o Commit 5 C | +2010-04-07 05:37 Max Power o [master] {origin/master} {origin/HEAD} |commit 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 +2010-03-29 17:15 Jørgen Thygesen Brahe o Commit 10 D |Author: Jørgen Thygesen Brahe +2010-03-21 04:53 作者 o Commit 10 C |AuthorDate: Mon Mar 29 17:15:30 2010 +0000 +2010-03-12 16:31 René Lévesque o Commit 10 B |Commit: Committer +2010-03-04 04:09 A. U. Thor o Commit 10 A |CommitDate: Mon Mar 29 17:15:30 2010 +0000 +2010-02-23 15:46 Max Power o Commit 9 E | +2010-02-15 03:24 Jørgen Thygesen Brahe o Commit 9 D | Commit 10 D +2010-02-06 15:02 作者 o Commit 9 C | +2010-01-29 02:40 René Lévesque o Commit 9 B | +2010-01-20 14:18 A. U. Thor o Commit 9 A | +2010-01-12 01:56 Max Power o Commit 8 E | +2010-01-03 13:33 Jørgen Thygesen Brahe o Commit 8 D | +2009-12-26 01:11 作者 o Commit 8 C | +2009-12-17 12:49 René Lévesque o Commit 8 B | +2009-12-09 00:27 A. U. Thor o Commit 8 A | +2009-11-30 12:05 Max Power o Commit 7 E | +2009-11-21 23:43 Jørgen Thygesen Brahe o Commit 7 D | +2009-11-13 11:20 作者 o Commit 7 C | +2009-11-04 22:58 René Lévesque o Commit 7 B | +2009-10-27 10:36 A. U. Thor o Commit 7 A | +2009-10-18 22:14 Max Power o Commit 6 E | +2009-10-10 09:52 Jørgen Thygesen Brahe o Commit 6 D | +2009-10-01 21:30 作者 o Commit 6 C | +2009-09-23 09:07 René Lévesque o Commit 6 B | +2009-09-14 20:45 A. U. Thor o Commit 6 A | +2009-09-06 08:23 Max Power o Commit 5 E | +2009-08-28 20:01 Jørgen Thygesen Brahe o Commit 5 D | +2009-08-20 07:39 作者 o Commit 5 C | [main] 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 - commit 2 of 50 56%|[diff] 2843bfd58b98c7e23ab91e51ffa4db4f8e27c9a4 - line 1 of 7 100% EOF diff -Nru tig-2.2/test/script/comment-test tig-2.3.0/test/script/comment-test --- tig-2.2/test/script/comment-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/script/comment-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +export LINES=5 + +in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz" + +steps ' + :set line-graphics = ascii + # comment + :save-display main.screen +' + +test_tig + +assert_equals main.screen < @sh -c 'echo "view not closed" > "$HOME/$view_open_file"' +EOF + +test_tig_script 'view-close-no-quit-should-not-close-tig' ' + :view-close-no-quit + +' + +assert_equals "$view_open_file" < @sh -c 'echo "view not closed" > "$HOME/$view_closed_file"' @@ -37,4 +52,4 @@ assert_equals "$view_closed_file" < stderr +find . -name "*.stderr" -exec cat -- "{}" \; > stderr diff -Nru tig-2.2/test/stage/default-test tig-2.3.0/test/stage/default-test --- tig-2.2/test/stage/default-test 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/stage/default-test 2017-09-29 15:15:26.000000000 +0000 @@ -47,199 +47,199 @@ test_tig status assert_equals 'status.screen' <' to jump to file diff - line 1 of 44 40% EOF assert_equals 'staged-changes-for-a.screen' <' to jump to file diff - line 1 of 65 27% EOF assert_equals 'unstaged-changes-default-title.screen' < hello.txt + printf 'Hello\n' > hello.txt git add . git_commit -m "first commit" - echo "Hello2" >> hello.txt + printf 'Hello2\n' >> hello.txt } test_tig status assert_equals 'status-before.screen' <' to jump to file diff - line 1 of 10 100% EOF assert_equals 'status-after.screen' < a' test_tig status assert_equals 'default-diff.screen' <' to jump to file diff - line 1 of 25 100% EOF assert_equals 'split-diff.screen' < "stashed-file-$i" + printf '%s\n' "$i" > "stashed-file-$i" git stash save -q -u "Stash #$i" done } @@ -25,33 +25,33 @@ test_tig stash +42 assert_equals 'position.screen' <> README.md + printf 'Topic branch\n' >> README.md git add README.md git_commit -m "Topic branch" git checkout master @@ -28,14 +28,14 @@ test_case on-branch-master \ --args='status' \ --before='git checkout master' < test.txt + printf 'test\n' > test.txt git add test.txt git_commit -m "Ahead branch" git checkout master git checkout -b diverged HEAD~2 - echo test > test.txt + printf 'test\n' > test.txt git add test.txt git_commit -m "Diverged branch" git checkout master @@ -24,14 +24,14 @@ test_case up-to-date-with-remote-master \ --args='status' < stderr diff -Nru tig-2.2/test/tigrc/source-test tig-2.3.0/test/tigrc/source-test --- tig-2.2/test/tigrc/source-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/tigrc/source-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,116 @@ +#!/bin/sh + +. libtest.sh + +LINES=9 + +# Disable built-in configuration +export TIGRC_SYSTEM=does-not-exist + +file "$HOME/.tigrc.bind.q.for.help.screen" <> "$out_file" + printf '\n' >> "$out_file" fi ;; *) if [ -e "$out_file" ]; then - echo "$line" >> "$out_file" + printf '%s\n' "$line" >> "$out_file" fi ;; esac done < "$base_dir/../doc/tigrc.5.adoc" # Create files used by the `source` example -mkdir .tig +mkdir -p .tig touch .tig/colorscheme.tigrc .tig/keybindings.tigrc tigrc <' echo "bind generic @sh -c 'echo $name >> $HOME/$TEST_NAME.out'" > "$path" test_tig status - assert_equals "$TEST_NAME.out" "$name" - assert_equals "$TEST_NAME.stderr" '' + printf '%s\n' "$name" > "$TEST_NAME.out.expected" + assert_equals "$TEST_NAME.out" < "$TEST_NAME.out.expected" + assert_equals "$TEST_NAME.stderr" < /dev/null } unset XDG_CONFIG_HOME diff -Nru tig-2.2/test/tools/libgit.sh tig-2.3.0/test/tools/libgit.sh --- tig-2.2/test/tools/libgit.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/tools/libgit.sh 2017-09-29 15:15:26.000000000 +0000 @@ -41,7 +41,7 @@ dir="${1:-$work_dir}" if [ ! -d "$dir/.git" ]; then - git init -q "$dir" + git init -q -- "$dir" (cd "$dir" && git_config) fi } @@ -51,9 +51,9 @@ [ -d .git ] || die "git_add called outside of git repo" path="$1"; shift - mkdir -p "$(dirname "$path")" + mkdir -p -- "$(dirname -- "$path")" file "$path" "$@" - git add "$path" + git add -- "$path" } git_commit() @@ -64,7 +64,7 @@ GIT_COMMITTER_EMAIL="$0" export GIT_AUTHOR_DATE="$author_date" - author_date="$(expr $author_date + $author_date_delta)" + author_date="$(expr "$author_date" + "$author_date_delta")" [ -z "${GIT_COMMITTER_DATE:-}" ] && export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" @@ -77,12 +77,12 @@ git init -q . git_config - echo "*.o" > .gitignore - echo "*~" > .git/info/exclude + printf '*.o\n' > .gitignore + printf '*~\n' > .git/info/exclude for file in a b.c "d~" e/f "g h" i.o .j "h~/k"; do - dir="$(dirname "$file")" - [ -n "$dir" ] && mkdir -p "$dir" + dir="$(dirname -- "$file")" + [ -n "$dir" ] && mkdir -p -- "$dir" printf "%s\n%s" "$file" "$(seq 1 10)" > "$file" done @@ -103,7 +103,7 @@ (cd "$worktree_base_dir" && { create_repo_from_tgz "$base_dir/files/repo-one.tgz" && git branch dev - git worktree add "$work_dir_abs" dev + git worktree add -- "$work_dir_abs" dev }) } diff -Nru tig-2.2/test/tools/libtest.sh tig-2.3.0/test/tools/libtest.sh --- tig-2.2/test/tools/libtest.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/tools/libtest.sh 2017-09-29 15:15:26.000000000 +0000 @@ -20,10 +20,10 @@ IFS=$'\n\t' fi -test="$(basename "$0")" -source_dir="$(cd $(dirname "$0") >/dev/null && pwd)" -base_dir="$(echo "$source_dir" | sed -n 's#\(.*/test\)\([/].*\)*#\1#p')" -prefix_dir="$(echo "$source_dir" | sed -n 's#\(.*/test/\)\([/].*\)*#\2#p')" +test="$(basename -- "$0")" +source_dir="$(cd "$(dirname -- "$0")" >/dev/null && pwd)" +base_dir="$(printf '%s\n' "$source_dir" | sed -n 's#\(.*/test\)\([/].*\)*#\1#p')" +prefix_dir="$(printf '%s\n' "$source_dir" | sed -n 's#\(.*/test/\)\([/].*\)*#\2#p')" output_dir="$base_dir/tmp/$prefix_dir/$test" tmp_dir="$base_dir/tmp" output_dir="$tmp_dir/$prefix_dir/$test" @@ -40,6 +40,10 @@ export HOME="$output_dir" unset CDPATH unset VISUAL +unset INPUTRC + +# Freedesktop env +unset XDG_CONFIG_HOME XDG_CONFIG_DIRS XDG_DATA_HOME XDG_DATA_DIRS XDG_CACHE_HOME # Git env export GIT_CONFIG_NOSYSTEM @@ -59,24 +63,27 @@ export LINES=30 export COLUMNS=80 +# Disable memleak detection for AddressSanitizer. +export ASAN_OPTIONS=detect_leaks=false + # Internal test env -# A comma-separated list of options. See docs in test/README. +# A space-separated list of options. See docs in test/README. export TEST_OPTS="${TEST_OPTS:-}" # Used by tig_script to set the test "scope" used by test_tig. export TEST_NAME= -[ -e "$output_dir" ] && rm -rf "$output_dir" -mkdir -p "$output_dir/$work_dir" +[ -e "$output_dir" ] && rm -rf -- "$output_dir" +mkdir -p -- "$output_dir/$work_dir" if [ ! -d "$tmp_dir/.git" ]; then # Create a dummy repository to avoid reading .git/config # settings from the tig repository. - git init -q "$tmp_dir" + git init -q -- "$tmp_dir" fi # For any utilities used in Tig scripts BIN_DIR="$HOME/bin" -mkdir -p "$BIN_DIR" +mkdir -p -- "$BIN_DIR" export PATH="$BIN_DIR:$PATH" executable() { @@ -88,9 +95,9 @@ *) sed 's/^[ ]//' ;; esac > "$path" else - printf '%s' "$@" > "$path" + printf '%s' "$*" > "$path" fi - chmod +x "$path" + chmod -- +x "$path" } # Setup fake editor @@ -104,7 +111,7 @@ file="\$2" fi -echo "\$@" >> "$HOME/editor.log" +printf '%s\\n' "\$*" >> "$HOME/editor.log" sed -n -e "\${lineno}p" "\$file" >> "$HOME/editor.log" 2>&1 EOF @@ -116,21 +123,22 @@ die() { - echo >&2 "$*" + printf '%s\n' "$*" >&2 exit 1 } file() { path="$1"; shift - mkdir -p "$(dirname "$path")" + mkdir -p -- "$(dirname -- "$path")" if [ "$#" = 0 ]; then case "$path" in stdin|expected*) cat ;; *) sed 's/^[ ]//' ;; - esac > "$path" + esac > "${path}.tmp" + mv -f -- "${path}.tmp" "$path" else - printf '%s' "$@" > "$path" + printf '%s' "$*" > "$path" fi } @@ -142,9 +150,11 @@ export TEST_NAME="$name" # Ensure that the steps finish by quitting - printf '%s\n:quit\n' "$@" \ - | sed -e 's/^[ ]*//' -e '/^$/d' \ - | sed "s|:save-display\s\+\(\S*\)|:save-display $HOME/\1|" \ + printf '%s\n:quit\n' "$*" \ + | sed -e 's/^[ ]*//' \ + | sed "s|:save-display[ ]\{1,\}\([^ ]\{1,\}\)|:save-display $HOME/\1|" \ + | sed "s|:save-options[ ]\{1,\}\([^ ]\{1,\}\)|:save-options $HOME/\1|" \ + | sed "s|:save-view[ ]\{1,\}\([^ ]\{1,\}\)|:save-view $HOME/\1|" \ > "$TIG_SCRIPT" } @@ -166,14 +176,14 @@ in_work_dir() { - (cd "$work_dir" && $@) + (cd "$work_dir" && "$@") } auto_detect_debugger() { for dbg in gdb lldb; do dbg="$(command -v "$dbg" 2>/dev/null || true)" if [ -n "$dbg" ]; then - echo "$dbg" + printf '%s\n' "$dbg" return fi done @@ -193,21 +203,31 @@ verbose= debugger= trace= +todos= valgrind= +timeout=10 +vlg_timeout_bonus=60 -set -- $TIG_TEST_OPTS $TEST_OPTS - -while [ $# -gt 0 ]; do - arg="$1"; shift +ORIG_IFS="$IFS" +IFS=" " +for arg in ${MAKE_TEST_OPTS:-} ${TEST_OPTS:-}; do + if [ -z "$arg" ]; then + continue; + fi case "$arg" in verbose) verbose=yes ;; - no-indent) indent= ;; - debugger=*) debugger=$(expr "$arg" : 'debugger=\(.*\)') ;; + no[-_]indent|noindent) indent= ;; + debugger=*) debugger="$(expr "$arg" : 'debugger=\(.*\)')" ;; debugger) debugger="$(auto_detect_debugger)" ;; + timeout=*) timeout="$(expr "$arg" : 'timeout=\(.*\)')" ;; trace) trace=yes ;; + todo|todos) todos=yes ;; valgrind) valgrind="$HOME/valgrind.log" ;; + *) die "unknown TEST_OPTS element '$arg'" ;; esac done +IFS="$ORIG_IFS" +ORIG_IFS= # # Test runners and assertion checking. @@ -216,20 +236,34 @@ assert_equals() { file="$1"; shift + whitespace_arg='-w'; + + if [ "$#" -ge 1 ]; then + whitespace_arg="${1:-}" + shift + fi + if [ "$whitespace_arg" = strict ]; then + whitespace_arg='' + elif [ "$whitespace_arg" = ignore ]; then + whitespace_arg='-w' + fi - file "expected/$file" "$@" + file "expected/$file" if [ -e "$file" ]; then - git diff -w --no-index $diff_color_arg "expected/$file" "$file" > "$file.diff" || true + git diff --no-index $diff_color_arg $whitespace_arg -- "expected/$file" "$file" > "$file.diff" || true if [ -s "$file.diff" ]; then - echo "[FAIL] $file != expected/$file" >> .test-result - cat "$file.diff" >> .test-result + printf '[FAIL] %s != expected/%s\n' "$file" "$file" >> .test-result + if [ -n "$*" ]; then + printf '[NOTE] %s\n' "$*" >> .test-result + fi + cat < "$file.diff" >> .test-result else - echo " [OK] $file assertion" >> .test-result + printf ' [OK] %s assertion\n' "$file" >> .test-result fi - rm -f "$file.diff" + rm -f -- "$file.diff" else - echo "[FAIL] $file not found" >> .test-result + printf '[FAIL] %s not found\n' "$file" >> .test-result fi } @@ -238,36 +272,55 @@ file="$1"; shift if [ -e "$file" ]; then - echo "[FAIL] $file should not exist" >> .test-result + printf '[FAIL] %s should not exist\n' "$file" >> .test-result else - echo " [OK] $file does not exist" >> .test-result + printf ' [OK] %s does not exist\n' "$file" >> .test-result fi } vars_file="vars" -expected_var_file="$HOME/expected/$vars_file" +vars_count_file="${vars_file}_assert_count" +expected_vars_file="$HOME/expected/$vars_file" executable 'assert-var' <> "$HOME/$vars_file" ;; - esac -done -echo "\$@" >> "$expected_var_file" +mkdir -p "$(dirname -- "$expected_vars_file")" +lhs="\${1:-}" +if [ "\$#" -gt 0 ]; then + shift +fi +if [ "\${1:-}" = "==" ]; then + shift +fi +rhs="\$*" + +if [ -z "\$lhs" ]; then + lhs='\"\"' +fi +if [ -z "\$rhs" ]; then + rhs='\"\"' +fi + +printf '%s\\n' "\$lhs" >> "$HOME/$vars_file" +printf '%s\\n' "\$rhs" >> "$expected_vars_file" EOF assert_vars() { - if [ -e "$expected_var_file" ]; then - assert_equals "$vars_file" "$(cat "$expected_var_file")" + if [ -n "${1:-}" ]; then + printf '%s\n' "$1" > "$vars_count_file" + shift + else + die "Test must supply the expected count of assertions to assert_vars()" + fi + + grep -c . < "$vars_file" | assert_equals "$vars_count_file" strict "$*" + + if [ -e "$expected_vars_file" ]; then + assert_equals "$vars_file" strict "$*" < "$expected_vars_file" else - echo "[FAIL] $expected_var_file not found" >> .test-result + printf '[FAIL] %s not found\n' "$expected_vars_file" >> .test-result fi } @@ -277,23 +330,23 @@ sed "s/^/$indent[skipped] /" < .test-skipped return fi - if [ -n "$trace" -a -n "$TIG_TRACE" -a -e "$TIG_TRACE" ]; then + if [ -n "$trace" ] && [ -n "$TIG_TRACE" ] && [ -e "$TIG_TRACE" ]; then sed "s/^/$indent[trace] /" < "$TIG_TRACE" fi - if [ -n "$valgrind" -a -e "$valgrind" ]; then - sed "s/^/$indent[valgrind] /" < "$valgrind" + if [ -n "$valgrind" ] && [ -s "$valgrind" ]; then + grep -v '^-\+[0-9]\+-\+ \+run:' < "${valgrind}" || true | sed "s/^/$indent[valgrind] /" fi if [ ! -d "$HOME" ] || [ ! -e .test-result ]; then [ -e stderr ] && sed "s/^/[stderr] /" < stderr [ -e stderr.orig ] && sed "s/^/[stderr] /" < stderr.orig - echo "No test results found" - elif grep FAIL -q < .test-result; then - failed="$(grep FAIL < .test-result | wc -l)" - count="$(sed -n '/\(FAIL\|OK\)/p' < .test-result | wc -l)" + printf 'No test results found\n' + elif grep -q '^ *\[FAIL\]' < .test-result; then + failed="$(grep -c '^ *\[FAIL\]' < .test-result || true)" + count="$(grep -c '^ *\[\(FAIL\|OK\)\]' < .test-result || true)" - printf "Failed %d out of %d test(s)%s\n" $failed $count + printf 'Failed %d out of %d test(s)\n' "$failed" "$count" # Show output from stderr if no output is expected if [ -e stderr ]; then @@ -303,9 +356,9 @@ # Replace CR used by Git progress messages tr '\r' '\n' < .test-result - elif [ "$verbose" ]; then - count="$(sed -n '/\(OK\)/p' < .test-result | wc -l)" - printf "Passed %d assertions\n" $count + elif [ -n "$verbose" ]; then + count="$(grep -c '^ *\[OK\]' < .test-result || true)" + printf 'Passed %d assertions\n' "$count" fi | sed "s/^/$indent| /" } @@ -313,18 +366,46 @@ test_skip() { - echo "$@" >> .test-skipped + printf '%s\n' "$*" >> .test-skipped +} + +test_todo_message() +{ + explanation="$*" + if [ -n "$explanation" ]; then + explanation=": $explanation" + fi + + printf '[TODO] Not yet expected to pass%s\n' "$explanation" +} + +test_todo() +{ + if [ -n "$todos" ]; then + return + fi + + test_todo_message "$*" >> .test-skipped +} + +test_timeout() +{ + if [ -z "${1:-}" ]; then + die 'test_timeout requires an argument' + fi + + timeout="${1:-}" } require_git_version() { git_version="$(git version | sed 's/git version \([0-9\.]*\).*/\1/')" - actual_major="$(expr "$git_version" : '\([0-9]\).*')" - actual_minor="$(expr "$git_version" : '[0-9]\.\([0-9]\).*')" + actual_major="$(expr "$git_version" : '\([0-9]*\).*')" + actual_minor="$(expr "$git_version" : '[0-9]*\.\([0-9]*\).*')" required_version="$1"; shift - required_major="$(expr "$required_version" : '\([0-9]\).*')" - required_minor="$(expr "$required_version" : '[0-9]\.\([0-9]\).*')" + required_major="$(expr "$required_version" : '\([0-9]*\).*')" + required_minor="$(expr "$required_version" : '[0-9]*\.\([0-9]*\).*')" if [ "$required_major" -gt "$actual_major" ] || [ "$required_minor" -gt "$actual_minor" ]; then @@ -347,28 +428,38 @@ test_skip "The test requires clang and is only run via \`make test-address-sanitizer\`" fi ;; + diff-highlight) + diff_highlight_path="$(git --exec-path)/../../share/git-core/contrib/diff-highlight/diff-highlight" + if [ ! -e "$diff_highlight_path" ]; then + # alt path + diff_highlight_path="$(git --exec-path)/../../share/git/contrib/diff-highlight/diff-highlight" + fi + if [ ! -e "$diff_highlight_path" ]; then + test_skip "The test requires diff-highlight, usually found in share/git-core-contrib" + fi + ;; *) - test_skip "Unknown feature requirement: $feature" + test_skip "Unknown feature requirement: $feature" esac done } test_exec_work_dir() { - echo "=== $@ ===" >> "$HOME/test-exec.log" + printf '=== %s ===\n' "$*" >> "$HOME/test-exec.log" test_exec_log="$HOME/test-exec.log.tmp" - rm -f "$test_exec_log" + rm -f -- "$test_exec_log" set +e in_work_dir "$@" 1>>"$test_exec_log" 2>>"$test_exec_log" test_exec_exit_code=$? set -e - cat "$test_exec_log" >> "$HOME/test-exec.log" + cat < "$test_exec_log" >> "$HOME/test-exec.log" if [ "$test_exec_exit_code" != 0 ]; then - cmd="$@" - echo "[FAIL] unexpected exit code while executing '$cmd': $test_exec_exit_code" >> .test-result - cat "$test_exec_log" >> .test-result + cmd="$*" + printf "[FAIL] unexpected exit code while executing '%s': %s\n" "$cmd" "$test_exec_exit_code" >> .test-result + cat < "$test_exec_log" >> .test-result # Exit gracefully to allow additional tests to run exit 0 fi @@ -383,32 +474,50 @@ run_setup="$(type test_setup_work_dir 2>/dev/null | grep 'function' || true)" if [ -n "$run_setup" ]; then - if test ! -e "$HOME/test-exec.log" || ! grep -q test_setup_work_dir "$HOME/test-exec.log"; then + if test ! -e "$HOME/test-exec.log" || ! grep -q test_setup_work_dir -- "$HOME/test-exec.log"; then test_exec_work_dir test_setup_work_dir fi fi } +install_pid_timeout() { + pid="${1:-}" + signal="${2:-ALRM}" + test "$timeout" -gt 0 || return + test "$pid" -gt 0 || return + test "$pid" != "$$" || return + trap '' "$signal" + sleep "$timeout" && kill -0 "$pid" >/dev/null 2>&1 && kill -"$signal" "$pid" >/dev/null 2>&1 || true & +} + valgrind_exec() { - kernel="$(uname -s 2>/dev/null || echo unknown)" - kernel_supp="test/tools/valgrind-$kernel.supp" + kernel="$(uname -s 2>/dev/null || printf 'unknown\n')" + kernel_supp="$base_dir/tools/valgrind-$kernel.supp" + + valgrind_ops="" - valgrind_ops= + valgrind_supp="--suppressions=/dev/null" if [ -e "$kernel_supp" ]; then - valgrind_ops="$valgrind_ops --suppresions='$kernel_supp'" + valgrind_supp="--suppressions=$kernel_supp" fi - valgrind -q --gen-suppressions=all --track-origins=yes --error-exitcode=1 \ - --log-file="$valgrind.orig" $valgrind_ops \ - "$@" + ( + IFS=' ' + valgrind -q --gen-suppressions=all --track-origins=yes --error-exitcode=1 \ + --log-file="$valgrind.orig" "$valgrind_supp" $valgrind_ops \ + "$@" + ) + valgrind_status_code=$? case "$kernel" in - Darwin) grep -v "mach_msg unhandled MACH_SEND_TRAILER option" < "$valgrind.orig" > "$valgrind" ;; - *) mv "$valgrind.orig" "$valgrind" ;; + Darwin) grep -v "mach_msg unhandled MACH_SEND_TRAILER option" < "$valgrind.orig" > "$valgrind" ;; + *) mv -- "$valgrind.orig" "$valgrind" ;; esac - rm -f "$valgrind.orig" + rm -f -- "$valgrind.orig" + + return "$valgrind_status_code" } test_tig() @@ -421,46 +530,58 @@ if [ -n "$trace" ]; then export TIG_TRACE="$HOME/${prefix}tig-trace" fi - touch "${prefix}stdin" "${prefix}stderr" - if [ -n "$debugger" ]; then - echo "*** Running tests in '$(pwd)/$work_dir'" - if [ -s "$work_dir/${prefix}stdin" ]; then - echo "*** - This test requires data to be injected via stdin." - echo "*** The expected input file is: '../${prefix}stdin'" - fi - if [ "$#" -gt 0 ]; then - echo "*** - This test expects the following arguments: $@" - fi - (cd "$work_dir" && $debugger tig "$@") - else - set +e - runner= - # FIXME: Tell Valgrind to forward status code - if [ "$expected_status_code" = 0 -a -n "$valgrind" ]; then - runner=valgrind_exec - fi - if [ -s "${prefix}stdin" ]; then - (cd "$work_dir" && $runner tig "$@") < "${prefix}stdin" > "${prefix}stdout" 2> "${prefix}stderr.orig" + touch -- "${prefix}stdin" "${prefix}stderr" + ( + # subshell handles cleanup of cwd, variables, redirections, set +e + cd "$work_dir" || die "chdir failed" + if [ -n "$debugger" ]; then + printf "*** Running tests in '%s/%s'\n" "$HOME" "$work_dir" + if [ -s "$HOME/${prefix}stdin" ]; then + printf '*** - This test requires data to be injected via stdin.\n' + printf "*** The expected input file is: '%s'\n" "../${prefix}stdin" + fi + if [ "$#" -gt 0 ]; then + printf '*** - This test expects the following arguments: %s\n' "$*" + fi + "$debugger" tig "$@" else - (cd "$work_dir" && $runner tig "$@") > "${prefix}stdout" 2> "${prefix}stderr.orig" + set +e + runner=exec + if [ "$expected_status_code" = 0 ] && [ -n "$valgrind" ]; then + runner=valgrind_exec + if [ "$timeout" -gt 0 ]; then + timeout="$((timeout + vlg_timeout_bonus))" + fi + fi + if [ -s "$HOME/${prefix}stdin" ]; then + exec 4<"$HOME/${prefix}stdin" + else + exec 4<&0 + fi + "$runner" tig "$@" <&4 > "$HOME/${prefix}stdout" 2> "$HOME/${prefix}stderr.orig" & + tig_pid="$!" + signal=14 + install_pid_timeout "$tig_pid" "$signal" + wait "$tig_pid" fi status_code="$?" - if [ "$status_code" != "$expected_status_code" ]; then - echo "[FAIL] unexpected status code: $status_code (should be $expected_status_code)" >> .test-result + if [ "$status_code" -eq "$(( 256 + signal))" ] || [ "$status_code" -eq "$(( 128 + signal))" ]; then + printf '[FAIL] Test timed out after %s seconds\n' "$timeout" >> "$HOME/.test-result" + elif [ "$status_code" != "$expected_status_code" ]; then + printf '[FAIL] unexpected status code: %s (should be %s)\n' "$status_code" "$expected_status_code" >> "$HOME/.test-result" fi - set -e - fi + ) # Normalize paths in stderr output if [ -e "${prefix}stderr.orig" ]; then sed "s#$output_dir#HOME#" < "${prefix}stderr.orig" > "${prefix}stderr" - rm -f "${prefix}stderr.orig" + rm -f -- "${prefix}stderr.orig" fi if [ -n "$trace" ]; then export TIG_TRACE="$HOME/.tig-trace" if [ -n "$name" ]; then sed "s#^#[$name] #" < "$HOME/${prefix}tig-trace" >> "$HOME/.tig-trace" else - mv "$HOME/${prefix}tig-trace" "$HOME/.tig-trace" + mv -- "$HOME/${prefix}tig-trace" "$HOME/.tig-trace" fi fi if [ -n "$prefix" ]; then @@ -470,17 +591,17 @@ test_graph() { - test-graph $@ > stdout 2> stderr.orig + test-graph "$@" > stdout 2> stderr.orig } test_case() { name="$1"; shift - echo "$name" >> test-cases + printf '%s\n' "$name" >> test-cases cat > "$name.expected" - touch "$name-before" "$name-after" "$name.script" "$name-args" + touch -- "$name-before" "$name-after" "$name-script" "$name-args" "$name-tigrc" "$name-assert-stderr" "$name-todo" "$name-subshell" "$name-timeout" while [ "$#" -gt 0 ]; do arg="$1"; shift @@ -488,8 +609,13 @@ value="$(expr "X$arg" : 'X--[^=]*=\(.*\)')" case "$key" in - before|after|script|args|cwd) - echo "$value" > "$name-$key" ;; + before|after|script|args|cwd|tigrc|assert-stderr|todo|subshell|timeout) + printf '%s\n' "$value" > "$name-$key" ;; + assert-equals) + filename="$(expr "X$value" : 'X\([^=]*\)')" + content="$(expr "X$value" : 'X[^=]*=\(.*\)')" + printf '%s\n' "$filename" > "$name-$key" + printf '%s\n' "$content" > "$name-$key-content" ;; *) die "Unknown test_case argument: $arg" esac done @@ -501,28 +627,48 @@ return fi test_setup - for name in $(cat test-cases); do + while read -r name <&3; do + if [ -s "$name-todo" ] && [ -z "$todos" ]; then + printf '%s[skipped] ' "$indent" + test_todo_message "$(cat < "$name-todo")" + test_todo_message "$(cat < "$name-todo")" >> ".test-skipped-subtest-$name" + continue; + fi tig_script "$name" " - $(if [ -e "$name-script" ]; then cat "$name-script"; fi) + $(if [ -e "$name-script" ]; then cat < "$name-script"; fi) :save-display $name.screen " + if [ -s "$name-tigrc" ]; then + tigrc "$(cat < "$name-tigrc")" + fi if [ -e "$name-before" ]; then - test_exec_work_dir "$SHELL" "$HOME/$name-before" + test_exec_work_dir "$SHELL" "$HOME/$name-before" fi - old_work_dir="$work_dir" - if [ -e "$name-cwd" ]; then - work_dir="$work_dir/$(cat "$name-cwd")" - fi - ORIG_IFS="$IFS" - IFS=$' ' - test_tig $(if [ -e "$name-args" ]; then cat "$name-args"; fi) - IFS="$ORIG_IFS" - work_dir="$old_work_dir" + ( + if [ -e "$name-cwd" ]; then + work_dir="$work_dir/$(cat < "$name-cwd")" + fi + if [ -e ./"$name-subshell" ]; then + . ./"$name-subshell" + fi + if [ -s "$name-timeout" ]; then + timeout="$(cat < "$name-timeout")" + fi + IFS=' ' + test_tig $(if [ -e "$name-args" ]; then cat < "$name-args"; fi) + ) if [ -e "$name-after" ]; then - test_exec_work_dir "$SHELL" "$HOME/$name-after" + test_exec_work_dir "$SHELL" "$HOME/$name-after" fi assert_equals "$name.screen" < "$name.expected" - assert_equals "$name.stderr" '' - done + if [ -s "$name-assert-stderr" ]; then + assert_equals "$name.stderr" < "$name-assert-stderr" + else + assert_equals "$name.stderr" < /dev/null + fi + if [ -e "$name-assert-equals" ]; then + assert_equals "$(cat < "$name-assert-equals")" < "$name-assert-equals-content" + fi + done 3< test-cases } diff -Nru tig-2.2/test/tools/setup-conflict.sh tig-2.3.0/test/tools/setup-conflict.sh --- tig-2.2/test/tools/setup-conflict.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/tools/setup-conflict.sh 2017-09-29 15:15:26.000000000 +0000 @@ -5,9 +5,9 @@ git reset --hard change() { - echo "$@" > conflict-file + printf '%s\n' "$*" > conflict-file git add conflict-file - git_commit --message="Change: $@" + git_commit --message="Change: $*" } change "a" diff -Nru tig-2.2/test/tools/show-results.sh tig-2.3.0/test/tools/show-results.sh --- tig-2.2/test/tools/show-results.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/test/tools/show-results.sh 2017-09-29 15:15:26.000000000 +0000 @@ -21,20 +21,25 @@ IFS=$' \n\t' fi -tests="$(find test/ -name ".test-result" | wc -l)" -asserts="$(find test/ -name ".test-result" | xargs sed -n '/\[\(OK\|FAIL\)\]/p' | wc -l)" -failures="$(find test/ -name ".test-result" | xargs grep FAIL | wc -l || true)" -skipped="$(find test/ -name ".test-skipped" | wc -l || true)" +tests="$(find test/ -name ".test-result" | grep -c . || true)" +asserts="$(find test/ -name ".test-result" -exec cat -- "{}" \; | grep -c '^ *\[\(OK\|FAIL\)\]' || true)" +failures="$(find test/ -name ".test-result" -exec cat -- "{}" \; | grep -c '^ *\[FAIL\]' || true)" +skipped="$(find test/ -name ".test-skipped" | grep -c . || true)" +todos="$(find test/ \( -name ".test-skipped" -or -name ".test-skipped-subtest-*" \) -exec cat -- "{}" + | grep -c '^\[TODO\]' || true)" -if [ $failures = 0 ]; then +if [ "$failures" = 0 ]; then printf "Passed %d assertions in %d tests" "$asserts" "$tests" else printf "Failed %d of %d assertions in %d tests" "$failures" "$asserts" "$tests" fi -if [ $skipped != 0 ]; then - printf " (%d skipped)" "$skipped" +if [ "$skipped" != 0 ]; then + todo_text="" + if [ "$todos" != 0 ]; then + todo_text=", $todos as todos" + fi + printf " (%d skipped%s)" "$skipped" "$todo_text" fi -echo -exit $failures +printf '\n' +exit "$failures" diff -Nru tig-2.2/test/tools/valgrind-Darwin.supp tig-2.3.0/test/tools/valgrind-Darwin.supp --- tig-2.2/test/tools/valgrind-Darwin.supp 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/tools/valgrind-Darwin.supp 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,9 @@ +{ + darwin_libsystem_wordexp + Memcheck:Cond + fun:strstr + fun:wordexp + fun:expand_path + ... + fun:main +} diff -Nru tig-2.2/test/tree/chdir-test tig-2.3.0/test/tree/chdir-test --- tig-2.2/test/tree/chdir-test 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/test/tree/chdir-test 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,197 @@ +#!/bin/sh + +. libtest.sh +. libgit.sh + +export LINES=16 + +tigrc < "-foo/-bar" + touch -- "-foo/-bar" + + git add . + git_commit -m "Initial" +} + +git_init +test_tig + +assert_equals 'root-dir.screen' < {remote} ~replace~ # Settings controlling how content is read from Git set commit-order = auto # Enum: auto, default, topo, date, reverse (main) -set status-untracked-dirs = yes # Show files in untracked directories? (status) +set status-show-untracked-dirs = yes # Show files in untracked directories? (status) +set status-show-untracked-files = yes # Show untracked files? set ignore-space = no # Enum: no, all, some, at-eol (diff) set show-notes = yes # When non-bool passed as `--show-notes=...` (diff) #set diff-context = 3 # Number of lines to show around diff changes (diff) #set diff-options = -C # User-defined options for `tig show` (git-diff) +#set diff-highlight = true # String (or bool): Path to diff-highlight script, + # defaults to `diff-highlight`. #set blame-options = -C -C -C # User-defined options for `tig blame` (git-blame) #set log-options = --pretty=raw # User-defined options for `tig log` (git-log) #set main-options = -n 1000 # User-defined options for `tig` (git-log) @@ -103,7 +107,8 @@ # Misc set refresh-mode = auto # Enum: manual, auto, after-command, periodic set refresh-interval = 10 # Interval in seconds between refreshes -set ignore-case = no # Ignore case when searching? +set ignore-case = no # Enum: no, yes, smart-case + # Ignore case when searching? Smart-case option will set wrap-search = yes # Wrap around to top/bottom of view when searching set focus-child = yes # Move focus to child view when opened? set horizontal-scroll = 50% # Number of columns to scroll as % of width @@ -113,8 +118,10 @@ set split-view-width = 50% # Width of right-most view for vertical splits set editor-line-number = yes # Automatically pass line number to editor? Used # for opening file at specific line e.g. from a diff +set history-size = 500 # Size of persistent history, 0 to disable set mouse = no # Enable mouse support? set mouse-scroll = 3 # Number of lines to scroll via the mouse +set mouse-wheel-cursor = no # Prefer moving the cursor to scrolling the view? # User-defined commands # --------------------- @@ -141,7 +148,7 @@ # %(remote) The current remote name. # %(tag) The current tag name. # %(stash) The current stash name. -# %(directory) The current directory path in the tree view; +# %(directory) The current directory path in the tree view; # empty for the root directory. # %(file) The currently selected file. # %(ref) The reference given to blame or HEAD if undefined. @@ -153,6 +160,7 @@ bind main C ?git cherry-pick %(commit) bind status C !git commit +bind stash A ?git stash apply %(stash) bind stash P ?git stash pop %(stash) bind stash ! ?git stash drop %(stash) bind refs C ?git checkout %(branch) @@ -193,6 +201,7 @@ bind generic O maximize # Maximize the current view bind generic q view-close # Close the current view bind generic Q quit # Close all views and quit +bind generic quit # Close all views and quit # View specific bind status u status-update # Stage/unstage changes in file @@ -204,7 +213,7 @@ bind stage ! status-revert # Revert current diff (c)hunk bind stage \ stage-split-chunk # Split current diff (c)hunk bind stage @ :/^@@ # Jump to next (c)hunk -bind stage [ :toggle diff-context -1 # Decrease the diff context +bind stage [ :toggle diff-context -1 # Decrease the diff context bind stage ] :toggle diff-context +1 # Increase the diff context bind diff @ :/^@@ # Jump to next (c)hunk bind diff [ :toggle diff-context -1 @@ -215,13 +224,11 @@ # Cursor navigation bind generic j move-down bind generic k move-up -#bind generic ? move-half-page-down -#bind generic ? move-half-page-up +bind generic move-half-page-down +bind generic move-half-page-up bind generic move-page-down -bind generic move-page-down bind generic move-page-down bind generic move-page-up -bind generic move-page-up bind generic - move-page-up bind generic move-first-line bind generic move-last-line @@ -249,6 +256,7 @@ bind search find-prev bind search find-prev bind search find-prev +bind search view-close # Option manipulation bind generic o options # Open the options menu @@ -268,7 +276,7 @@ # Toggle highlighting of commit title overflow # bind generic ??? :toggle file-size # Toggle file size format # bind generic ??? :toggle status # Toggle status display -# bind generic ??? :toggle status-untracked-dirs +# bind generic ??? :toggle status-show-untracked-dirs # Toggle display of file in untracked directories # bind generic ??? :toggle vertical-split # Toggle vertical split bind generic % :toggle file-filter @@ -372,6 +380,8 @@ color help-group blue default color help-action yellow default color diff-stat blue default +color diff-add-highlight green default standout +color diff-del-highlight red default standout color palette-0 magenta default color palette-1 yellow default color palette-2 cyan default @@ -379,13 +389,13 @@ color palette-4 default default color palette-5 white default color palette-6 red default -color palette-7 magenta default bold -color palette-8 yellow default bold -color palette-9 cyan default bold -color palette-10 green default bold -color palette-11 default default bold -color palette-12 white default bold -color palette-13 red default bold +color palette-7 magenta default bold +color palette-8 yellow default bold +color palette-9 cyan default bold +color palette-10 green default bold +color palette-11 default default bold +color palette-12 white default bold +color palette-13 red default bold color graph-commit blue default color search-result black yellow @@ -405,6 +415,9 @@ diff.old=diff-del \ diff.new=diff-add \ \ + diff-highlight.oldHighlight=diff-del-highlight \ + diff-highlight.newHighlight=diff-add-highlight \ + \ grep.filename=grep.file \ grep.linenumber=grep.line-number \ grep.separator=grep.delimiter \ diff -Nru tig-2.2/tig.spec tig-2.3.0/tig.spec --- tig-2.2/tig.spec 2016-08-11 02:39:02.000000000 +0000 +++ tig-2.3.0/tig.spec 2017-09-29 15:15:29.000000000 +0000 @@ -3,13 +3,13 @@ Summary: Tig: text-mode interface for git Name: tig -Version: 2.2 +Version: 2.3.0 Release: 0%{?dist} License: GPL Group: Development/Tools Vendor: Jonas Fonseca -URL: http://jonas.nitro.dk/tig/ -Source: http://jonas.nitro.dk/tig/releases/%{name}-%{version}.tar.gz +URL: https://jonas.github.io/tig +Source: https://github.com/jonas/tig/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz BuildRequires: ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: git-core, ncurses diff -Nru tig-2.2/tools/aspell.dict tig-2.3.0/tools/aspell.dict --- tig-2.2/tools/aspell.dict 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/tools/aspell.dict 2017-09-29 15:15:26.000000000 +0000 @@ -1,20 +1,25 @@ -personal_ws-1.1 en 259 +personal_ws-1.1 en 286 CJK del goto Ctrl refspec +BackTab Shorthands Gedit cmd +noprefix dev cdup ident +SBack sudo +optimizations AuthorDate TMPDIR tig dir +ShiftTab readline's keybinding unstage @@ -26,11 +31,14 @@ asciidoc AsciiDoc unstanged +ShiftDel revgraph revargs configs topo toc +terminfo +Preload tmp cwd frontend @@ -59,6 +67,7 @@ colorN nowarn sys +ShiftRight subshell tty XDG @@ -73,11 +82,14 @@ Nano DSSL manpages +ShiftEnd LDLIBS lookup stdout ncurses txt +SFwd +resizing Makefile cacheinfo enum @@ -111,12 +123,15 @@ wrt libiconv unicode +ShiftLeft multi +altscreen Navely reachability autoconf xpm filesystem +ScrollFwd reflogmsg Fonseca tigrc @@ -167,20 +182,24 @@ tig's dirs ld +showUntrackedFiles newmode keymaps endif namespace commitencoding +nitro subdirectory utils delim unstaged Nn xrvt +automake nodelay VLINE extdiff +checksums keybindings ifndef subdirectories @@ -189,6 +208,7 @@ ncursesw PDF CFLAGS +ScrollBack linenumber fileargs UI @@ -197,23 +217,26 @@ Homebrew chunked BUILTIN +tinfo drwxr ascii Baudis substring PID tz -docbook DocBook +docbook submodule strndup startup Yi docext +ShiftHome renderer strftime textconv strchr +termcap lineno repo NUL @@ -221,8 +244,10 @@ unmerged blameargs GitHub +XTerm's Yy fgcolor +backtraces ScrFwd localtime filename @@ -244,6 +269,7 @@ struct untracked commit's +sed autoreconf ScrBack subcommands @@ -254,6 +280,7 @@ cmdline Jamo unrepresentable +ShiftDelete FIXME whitespace subtrees diff -Nru tig-2.2/tools/ax_lib_readline.m4 tig-2.3.0/tools/ax_lib_readline.m4 --- tig-2.2/tools/ax_lib_readline.m4 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/tools/ax_lib_readline.m4 2017-09-29 15:15:26.000000000 +0000 @@ -33,17 +33,22 @@ fi AC_CACHE_VAL(bash_cv_termcap_lib, [AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc, - [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, - [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, - bash_cv_termcap_lib=gnutermcap if test "$ax_cv_curses_which" = "ncursesw"; then - [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw)] + [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw, + [AC_CHECK_LIB(tinfow, tgetent, bash_cv_termcap_lib=libtinfow)] + )] elif test "$ax_cv_curses_which" = "ncurses"; then - [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses)] + [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, + [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo)] + )] elif test "$ax_cv_curses_which" = "plaincurses"; then - [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses)] + [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses)] +else + [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, + bash_cv_termcap_lib=gnutermcap + )] fi -)])])]) +)]) if test "X$_bash_needmsg" = "Xyes"; then AC_MSG_CHECKING(which library has the termcap functions) fi @@ -52,19 +57,22 @@ LDFLAGS="$LDFLAGS -L./lib/termcap" TERMCAP_LIB="./lib/termcap/libtermcap.a" TERMCAP_DEP="./lib/termcap/libtermcap.a" -elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +elif test X$bash_cv_termcap_lib = Xlibtermcap && test -z "$prefer_curses"; then TERMCAP_LIB=-ltermcap TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libtinfo; then +elif test X$bash_cv_termcap_lib = Xlibtinfow; then +TERMCAP_LIB=-ltinfow +TERMCAP_DEP= +elif test X$bash_cv_termcap_lib = Xlibtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libncursesw; then +elif test X$bash_cv_termcap_lib = Xlibncursesw; then TERMCAP_LIB=-lncursesw TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libncurses; then +elif test X$bash_cv_termcap_lib = Xlibncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= -elif test $bash_cv_termcap_lib = libc; then +elif test X$bash_cv_termcap_lib = Xlibc; then TERMCAP_LIB= TERMCAP_DEP= else diff -Nru tig-2.2/tools/ax_require_defined.m4 tig-2.3.0/tools/ax_require_defined.m4 --- tig-2.2/tools/ax_require_defined.m4 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/tools/ax_require_defined.m4 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,37 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_REQUIRE_DEFINED(MACRO) +# +# DESCRIPTION +# +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have +# been defined and thus are available for use. This avoids random issues +# where a macro isn't expanded. Instead the configure script emits a +# non-fatal: +# +# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found +# +# It's like AC_REQUIRE except it doesn't expand the required macro. +# +# Here's an example: +# +# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +# +# LICENSE +# +# Copyright (c) 2014 Mike Frysinger +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 1 + +AC_DEFUN([AX_REQUIRE_DEFINED], [dnl + m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) +])dnl AX_REQUIRE_DEFINED diff -Nru tig-2.2/tools/ax_with_curses.m4 tig-2.3.0/tools/ax_with_curses.m4 --- tig-2.2/tools/ax_with_curses.m4 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/tools/ax_with_curses.m4 2017-09-29 15:15:26.000000000 +0000 @@ -12,7 +12,9 @@ # present, along with the associated header file. The NcursesW # (wide-character) library is searched for first, followed by Ncurses, # then the system-default plain Curses. The first library found is the -# one returned. +# one returned. Finding libraries will first be attempted by using +# pkg-config, and should the pkg-config files not be available, will +# fallback to combinations of known flags itself. # # The following options are understood: --with-ncursesw, --with-ncurses, # --without-ncursesw, --without-ncurses. The "--with" options force the @@ -52,23 +54,29 @@ # # (These preprocessor symbols are discussed later in this document.) # -# The following output variable is defined by this macro; it is precious -# and may be overridden on the ./configure command line: +# The following output variables are defined by this macro; they are +# precious and may be overridden on the ./configure command line: # -# CURSES_LIB - library to add to xxx_LDADD +# CURSES_LIBS - library to add to xxx_LDADD +# CURSES_CFLAGS - include paths to add to xxx_CPPFLAGS # -# The library listed in CURSES_LIB is NOT added to LIBS by default. You -# need to add CURSES_LIB to the appropriate xxx_LDADD line in your -# Makefile.am. For example: -# -# prog_LDADD = @CURSES_LIB@ -# -# If CURSES_LIB is set on the configure command line (such as by running -# "./configure CURSES_LIB=-lmycurses"), then the only header searched for -# is . The user may use the CPPFLAGS precious variable to -# override the standard #include search path. If the user needs to -# specify an alternative path for a library (such as for a non-standard -# NcurseW), the user should use the LDFLAGS variable. +# In previous versions of this macro, the flags CURSES_LIB and +# CURSES_CPPFLAGS were defined. These have been renamed, in keeping with +# AX_WITH_CURSES's close bigger brother, PKG_CHECK_MODULES, which should +# eventually supersede the use of AX_WITH_CURSES. Neither the library +# listed in CURSES_LIBS, nor the flags in CURSES_CFLAGS are added to LIBS, +# respectively CPPFLAGS, by default. You need to add both to the +# appropriate xxx_LDADD/xxx_CPPFLAGS line in your Makefile.am. For +# example: +# +# prog_LDADD = @CURSES_LIBS@ +# prog_CPPFLAGS = @CURSES_CFLAGS@ +# +# If CURSES_LIBS is set on the configure command line (such as by running +# "./configure CURSES_LIBS=-lmycurses"), then the only header searched for +# is . If the user needs to specify an alternative path for a +# library (such as for a non-standard NcurseW), the user should use the +# LDFLAGS variable. # # The following shell variables may be defined by this macro: # @@ -88,7 +96,7 @@ # # AX_WITH_CURSES # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then -# AX_MSG_ERROR([requires either NcursesW or Ncurses library]) +# AC_MSG_ERROR([requires either NcursesW or Ncurses library]) # fi # # If any Curses library will do (but one must be present and must support @@ -182,11 +190,66 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 13 +#serial 17 + +# internal function to factorize common code that is used by both ncurses +# and ncursesw +AC_DEFUN([_FIND_CURSES_FLAGS], [ + AC_MSG_CHECKING([for $1 via pkg-config]) + + AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS]) + _PKG_CONFIG([_ax_cv_$1_libs], [libs], [$1]) + _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1]) + + AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[ + AC_MSG_RESULT([no]) + # No suitable .pc file found, have to find flags via fallback + AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [ + AS_ECHO() + pkg_cv__ax_cv_$1_libs="-l$1" + pkg_cv__ax_cv_$1_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS" + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs" + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags" + + AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_libs]) + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs]) + AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[ + ax_cv_$1=yes + ],[ + AC_MSG_RESULT([no]) + m4_if( + [$1],[ncursesw],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfow"], + [$1],[ncurses],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfo"] + ) + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs" + + AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs]) + AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[ + ax_cv_$1=yes + ],[ + ax_cv_$1=no + ]) + ]) + ],[ + ax_cv_$1=no + ]) + ]) + ],[ + AC_MSG_RESULT([yes]) + # Found .pc file, using its information + LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs" + CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags" + ax_cv_$1=yes + ]) +]) AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) AC_DEFUN([AX_WITH_CURSES], [ - AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses]) + AC_ARG_VAR([CURSES_LIBS], [linker library for Curses, e.g. -lcurses]) + AC_ARG_VAR([CURSES_CFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw]) AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], [force the use of Ncurses or NcursesW])], [], [with_ncurses=check]) @@ -195,20 +258,17 @@ [], [with_ncursesw=check]) ax_saved_LIBS=$LIBS + ax_saved_CPPFLAGS=$CPPFLAGS + AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes], [ax_with_plaincurses=no], [ax_with_plaincurses=check]) ax_cv_curses_which=no # Test for NcursesW + AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno], [ + _FIND_CURSES_FLAGS([ncursesw]) - AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [ - LIBS="$ax_saved_LIBS -lncursesw" - - AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [ - AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], - [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no]) - ]) AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [ AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library]) ]) @@ -216,7 +276,8 @@ AS_IF([test "x$ax_cv_ncursesw" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncursesw - CURSES_LIB="-lncursesw" + CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs" + CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags" AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) @@ -318,16 +379,13 @@ ]) ]) ]) + unset pkg_cv__ax_cv_ncursesw_libs + unset pkg_cv__ax_cv_ncursesw_cppflags # Test for Ncurses + AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ + _FIND_CURSES_FLAGS([ncurses]) - AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ - LIBS="$ax_saved_LIBS -lncurses" - - AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [ - AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], - [ax_cv_ncurses=yes], [ax_cv_ncurses=no]) - ]) AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [ AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library]) ]) @@ -335,7 +393,8 @@ AS_IF([test "x$ax_cv_ncurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncurses - CURSES_LIB="-lncurses" + CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs" + CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags" AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) @@ -390,12 +449,13 @@ ]) ]) ]) + unset pkg_cv__ax_cv_ncurses_libs + unset pkg_cv__ax_cv_ncurses_cppflags - # Test for plain Curses (or if CURSES_LIB was set by user) - + # Test for plain Curses (or if CURSES_LIBS was set by user) AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [ - AS_IF([test "x$CURSES_LIB" != x], [ - LIBS="$ax_saved_LIBS $CURSES_LIB" + AS_IF([test "x$CURSES_LIBS" != x], [ + LIBS="$ax_saved_LIBS $CURSES_LIBS" ], [ LIBS="$ax_saved_LIBS -lcurses" ]) @@ -408,8 +468,8 @@ AS_IF([test "x$ax_cv_plaincurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=plaincurses - AS_IF([test "x$CURSES_LIB" = x], [ - CURSES_LIB="-lcurses" + AS_IF([test "x$CURSES_LIBS" = x], [ + CURSES_LIBS="-lcurses" ]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) @@ -515,4 +575,8 @@ AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no]) LIBS=$ax_saved_LIBS + CPPFLAGS=$ax_saved_CPPFLAGS + + unset ax_saved_LIBS + unset ax_saved_CPPFLAGS ])dnl diff -Nru tig-2.2/tools/iconv.m4 tig-2.3.0/tools/iconv.m4 --- tig-2.2/tools/iconv.m4 1970-01-01 00:00:00.000000000 +0000 +++ tig-2.3.0/tools/iconv.m4 2017-09-29 15:15:26.000000000 +0000 @@ -0,0 +1,62 @@ +dnl From Bruno Haible. +AC_DEFUN([AM_ICONV], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + AC_ARG_WITH([libiconv], +[ --with-libiconv=DIR search for libiconv in DIR/include and DIR/lib], [ + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + ]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])],[am_cv_func_iconv=yes],[]) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])],[am_cv_lib_iconv=yes + am_cv_func_iconv=yes],[]) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +]], [[]])],[am_cv_proto_iconv_arg1=""],[am_cv_proto_iconv_arg1="const"]) + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + else + AC_MSG_FAILURE([iconv() not found. Please install libiconv and use --with-libiconv=/path/to/dir.],[1]) + fi + if test "$am_cv_lib_iconv" = yes; then + LIBS="$LIBS -liconv" + fi +]) diff -Nru tig-2.2/tools/make-builtin-config.sh tig-2.3.0/tools/make-builtin-config.sh --- tig-2.2/tools/make-builtin-config.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/tools/make-builtin-config.sh 2017-09-29 15:15:26.000000000 +0000 @@ -27,7 +27,7 @@ fi } -echo "/* Generated by $0 on $(date) */" +echo "/* Generated by $0 */" echo "const char *builtin_config =" read_tigrc | while read line; do diff -Nru tig-2.2/tools/release.sh tig-2.3.0/tools/release.sh --- tig-2.2/tools/release.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/tools/release.sh 2017-09-29 15:15:26.000000000 +0000 @@ -34,7 +34,8 @@ git checkout master # Update files which should reference the version. - sed -i "s/VERSION\s*=\s*[0-9.]\+/VERSION = $VERSION/" Makefile + sed -i "s/VERSION\s*=\s*[0-9.]\+/VERSION = $VERSION/" Makefile + sed -i "s#tig-[0-9.]\+[0-9]\+#tig-$VERSION#g" INSTALL.adoc perl -pi -e 's/^master$/RELEASE_TITLE/ms' "$NEWS" perl -pi -e 's/^RELEASE_TITLE.*/RELEASE_TITLE/ms' "$NEWS" perl -pi -e "s/^RELEASE_TITLE.*/$TITLE/" "$NEWS" diff -Nru tig-2.2/tools/update-release-docs.sh tig-2.3.0/tools/update-release-docs.sh --- tig-2.2/tools/update-release-docs.sh 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/tools/update-release-docs.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -#!/bin/sh -# -# Prepare documentation for http://jonas.nitro.dk/tig/ -# -# Copyright (c) 2009-2014 Jonas Fonseca - -LATEST="$(git describe | sed 's/-[0-9]*-g[0-9a-f]*//')" -DOCDIR="doc/release-docs/" - -TRACKER=" - - -" - -mkdir -p "$DOCDIR/releases" - -for file in doc/tig.1.html doc/tigrc.5.html doc/manual.html README.html NEWS.html INSTALL.html; do - { - git cat-file blob release:$file > tmp - grep -v '' < tmp | grep -v '' - echo "$TRACKER" - if grep -q '' tmp; then - echo "" - fi - } > "$DOCDIR/$(basename "$file")" -done - -mv "$DOCDIR/README.html" tmp - -{ - head -n 1 < tmp - cat <Tig Releases -

    Latest version of tig is -$LATEST -(md5).

    -

    See the release notes -for information about each release.

    -
    -$TRACKER -EOF -} > "$DOCDIR/releases/HEADER.html" - -head -n 2 < tmp > "$DOCDIR/HEADER.html" -sed -n '3,$p' < tmp > "$DOCDIR/README.html" -rm tmp diff -Nru tig-2.2/.travis.yml tig-2.3.0/.travis.yml --- tig-2.2/.travis.yml 2016-08-11 02:38:59.000000000 +0000 +++ tig-2.3.0/.travis.yml 2017-09-29 15:15:26.000000000 +0000 @@ -17,6 +17,7 @@ - # ============ Build from config =============== - cp contrib/config.make . - make all-debug + - make update-docs && git diff --exit-code - make test - make test TEST_OPTS=valgrind - if [ $CC = clang ]; then make test-address-sanitizer; fi