SOURCES: tig-git.patch - up

adamg adamg at pld-linux.org
Sat Jun 7 19:16:18 CEST 2008


Author: adamg                        Date: Sat Jun  7 17:16:18 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- up

---- Files affected:
SOURCES:
   tig-git.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/tig-git.patch
diff -u SOURCES/tig-git.patch:1.2 SOURCES/tig-git.patch:1.3
--- SOURCES/tig-git.patch:1.2	Thu Apr 10 09:34:11 2008
+++ SOURCES/tig-git.patch	Sat Jun  7 19:16:12 2008
@@ -1,17 +1,1001 @@
+diff --git a/INSTALL b/INSTALL
+index 85662a3..3f6ff92 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -23,6 +23,10 @@ need to first make the configure script:
+ 
+ 	$ make configure
+ 
++Release notes documenting notable changes are available in the NEWS file. When
++upgrading, you are adviced to also read them after you have completed the
++installation.
++
+ The following tools and packages are needed:
+ 
+ `-------------------------------`----------------------------------------------
+diff --git a/Makefile b/Makefile
+index 575c5bf..1107f95 100644
+--- a/Makefile
++++ b/Makefile
+@@ -37,7 +37,7 @@ CFLAGS ?= -Wall -O2
+ DFLAGS	= -g -DDEBUG -Werror
+ PROGS	= tig
+ MANDOC	= tig.1 tigrc.5
+-HTMLDOC = tig.1.html tigrc.5.html manual.html README.html
++HTMLDOC = tig.1.html tigrc.5.html manual.html README.html NEWS.html
+ ALLDOC	= $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf
+ 
+ # Never include the release number in the tarname for tagged
+@@ -99,8 +99,9 @@ clean:
+ 	$(RM) $(PROGS) core *.o *.xml
+ 
+ distclean: clean
+-	$(RM) -r manual.html-chunked *.toc $(ALLDOC)
+-	$(RM) -r autom4te.cache aclocal.m4 config.{h,log,make,status} config.h.in configure
++	$(RM) -r manual.html-chunked autom4te.cache
++	$(RM) *.toc $(ALLDOC) aclocal.m4 configure
++	$(RM) config.h config.log config.make config.status config.h.in
+ 
+ spell-check:
+ 	aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
+@@ -162,6 +163,9 @@ manual.toc: manual.txt
+ README.html: README asciidoc.conf
+ 	$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article -a readme $<
+ 
++NEWS.html: NEWS asciidoc.conf
++	$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article $<
++
+ %.1.html : %.1.txt asciidoc.conf
+ 	$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d manpage $<
+ 
+diff --git a/NEWS b/NEWS
+new file mode 100644
+index 0000000..fcaa853
+--- /dev/null
++++ b/NEWS
+@@ -0,0 +1,156 @@
++Release notes
++=============
++
++tig master branch
++-----------------
++
++Improvements:
++
++ - F5 also refreshes the current view.
++ - Allow line graphics to be disabled with new line-graphics option.
++ - Main view: also include the reference names when searching.
++ - Stage view: add stage-next action to jump to next diff chunk that can
++   be staged. By default bound to '@'.
++ - Configure: check for the ncurses header files.
++
++Bug fixes:
++
++ - Fix regression when staging all diff chunks in a section.
++ - Bind the maximize view action to 'O'; it conflicted with the
++   keybinding to launch the merge tool in the status view.
++ - Fix problem with $(cmd) usage in shell code. Some shells (jsh)
++   installed as /bin/sh does not support it.
++ - Documentation: Rename gitlink macro to support AsciiDoc 8.2.3.
++
++tig-0.11
++--------
++
++Incompatibilities:
++
++ - Remove parsing of deprecated options: -g, -l, -d.
++ - The first seen '--' will stop option parsing and is passed to git
++   instead of breaking out of tig's option parsing.
++
++New features:
++
++ - Blame view; bound to 'B' by default, reachable from the command line
++   and the tree, status, and stage views.
++ - Blame/main view: allow display of date, author, and references to be
++   toggled on/off. Bound to 'D', 'A', and 'F' respectively.
++ - Add action to maximize the current view.
++
++Improvements:
++
++ - Show the current branch in the status view.
++ - Show local/light-weight tags.
++
++Bug fixes:
++
++ - Fix regressions for the pager mode.
++ - Fix refreshing of the index with working directory info.
++
++tig-0.10.1
++----------
++
++Improvements:
++
++ - Status view: detect renamed files and show them with 'R'.
++ - Status view: refresh the index to avoid "empty diffs".
++ - Diff view: make diff headers more verbose to include e.g. committer.
++ - Configure: check for the ncursesw library.
++
++Bug fixes:
++
++ - Fix UTF8 handling for tag names and commit messages.
++ - Fix the check for git-config(1) in configure to handle the case when
++   git has been installed using a libexecdir which is not in the path.
++ - Fix replacing of SYSCONFDIR when installing from released tarballs.
++
++tig-0.10
++---------
++
++Incompatibilities:
++
++ - Deprecate most tig specific command line options to make tig more
++   compatible with gitk. The deprecated options are: -g, -l, -d, and -S.
++   Use of any of them will result in a warning being printed to stderr.
++   Instead of '-S', use the new 'status' subcommand.
++ - Make man page building depend on DocBook XSL version >= 1.72.0.
++ - Install man pages in $(prefix)/share/man.
++ - Implement the cherry pick action (bound to 'C') using new support for
++   running external commands. This obsoletes the TIG_CHEERY_PICK
++   environment variable
++
++New features:
++
++ - Add support for binding keys to external commands. To bind '.' to
++   running git-commit(1), add the line: "bind generic . !git commit" to
++   your ~/.tigrc. Each command can have replacement string such as
++   %(commit), %(head), and %(blob), which are substituted before the
++   command is run.
++ - Add system-wide configuration file defaulting to $(prefix)/etc/tigrc.
++ - Add the environment variables TIGRC_USER and TIGRC_SYSTEM to change
++   user and system-wide configuration files, respectively.
++
++Improvements:
++
++ - Main view: color the revision graph.
++ - Main view: show boundary commits; they are marked with '^' in the
++   revision graph.
++ - Tree view: add tree-parent action to jump to view of the parent tree.
++   Bound to ',' by default.
++ - Allow the default terminal colors to be overwritten. To use black
++   text on white, add the line "color default white black" to your
++   ~/.tigrc.
++ - Misc. documentation improvements.
++
++Bug fixes:
++
++ - Use git-diff-index(1) and git-diff-files(1) instead of git-diff(1) to
++   avoid running external diff drivers.
++ - Use --no-color when calling git-log(1).
++ - Fix crash when opening mergetool for lines that are not unmerged.
++
++tig-0.9.1
++---------
++
++Incompatibilities:
++
++ - Make the clean rule to never remove generated documentation files.
++   Use the distclean rule for accomplishing this.
++
++New features:
++
++ - Add support for cherry-picking commits in the main view to the
++   current branch. Bound to 'C' by default.
++
++Improvements:
++
++ - Add support for launching git-mergetool(1) from the status view.
++   Bound to 'M' by default.
++ - Add support for refreshing/reloading the status view
++ - Detect working trees and disable the status view when it is missing.
++
++Bug fixes:
++
++ - Fix iconv() checking in configure.
++ - Fix editor invocation to make paths relative to the project root.
++ - Fix out-of-range current line when reloading the status view.
++ - Include autoconf files in the tarball generated by `make dist`.
++
++tig-0.9
++-------
++
++New features:
++
++ - Add bash completion script for tig (contrib/tig-completion.bash).
++ - Add optional autoconf-based build infrastructure.
++ - Add stage view for showing changes in the working tree and add
++   support for staging individual diff chunks for commit.
++
++Improvements:
++
++ - Status view: allow all files in a section to be staged for commit.
++ - Status view: Add support for opening files in an editor. Bound to 'e'
++   by default.
++ - Tree view: use a stack for remembering the lines for parent tree.
+diff --git a/asciidoc.conf b/asciidoc.conf
+index 630552c..90fdb6a 100644
+--- a/asciidoc.conf
++++ b/asciidoc.conf
+@@ -1,5 +1,5 @@
+ ifdef::backend-docbook[]
+-[gitlink-inlinemacro]
++[manpage-inlinemacro]
+ {0%{target}}
+ {0#<citerefentry>}
+ {0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
+@@ -7,7 +7,7 @@ ifdef::backend-docbook[]
+ endif::backend-docbook[]
+ 
+ ifdef::backend-xhtml11[]
+-[gitlink-inlinemacro]
++[manpage-inlinemacro]
+ <a href="{target}{0?.{0}}.html">{target}{0?({0})}</a>
+ endif::backend-xhtml11[]
+ 
+@@ -56,4 +56,7 @@ ifdef::readme[]
+ 
+ [footer]
+ </div>
++
++[replacements]
++(^|[^-\\])--($|[^-])=\1--\2
+ endif::readme[]
+diff --git a/configure.ac b/configure.ac
+index 764190a..6b0fc45 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,13 +1,23 @@
+-AC_INIT([tig], [0],
+-	[Jonas Fonseca <fonseca at diku.dk>],
+-	[tig])
++AC_INIT([tig], [0], [Jonas Fonseca <fonseca at diku.dk>], [tig])
+ 
+ AC_LANG([C])
+ AC_CONFIG_HEADER(config.h)
+ AC_CONFIG_SRCDIR(tig.c)
+ 
+-AC_SEARCH_LIBS([wclear], [ncursesw ncurses curses], [],
+-	       [AC_ERROR([curses not found])])
++cursed=no
++AC_CHECK_HEADERS([ncursesw/ncurses.h],
++		 [AC_SEARCH_LIBS([initscr], [ncursesw], [cursed=yes])])
++case "$cursed" in "no")
++	AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h],
++			 [AC_SEARCH_LIBS([wclear], [ncurses], [cursed=yes])])
++
++	case "$cursed" in "no")
++		AC_ERROR([ncurses not found])
++	esac
++
++	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
+ 
+ AM_ICONV
+ 
+@@ -26,9 +36,3 @@ AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf false])
+ 
+ AC_CONFIG_FILES([config.make])
+ AC_OUTPUT
+-
+-case "$LIBS" in
+-*-lncursesw*) ;;
+-*) AC_MSG_RESULT([NOTE: The found ncurses library does not support wide-char.])
+-   AC_MSG_RESULT([NOTE: This means that tig will not correctly render UTF-8])
+-esac
+diff --git a/manual.txt b/manual.txt
+index e4f937a..3157eb3 100644
+--- a/manual.txt
++++ b/manual.txt
+@@ -366,6 +366,7 @@ u	Update status of file. In the status view, this allows you to add an \
+ M	Resolve unmerged file by launching git-mergetool(1). Note, to work \
+ 	correctly this might require some initial configuration of your \
+ 	preferred merge tool. See the manpage of git-mergetool(1).
++@	Move to next chunk in the stage view.
+ ','	Move tree view to the parent tree.
+ e	Open file in editor.
+ -----------------------------------------------------------------------------
+@@ -526,8 +527,8 @@ References and Related Tools
+ 
+ Manpages:
+ 
+- - gitlink:tig[1]
+- - gitlink:tigrc[5]
++ - manpage:tig[1]
++ - manpage:tigrc[5]
+ 
+ Online resources:
+ 
+diff --git a/tig.1.txt b/tig.1.txt
+index ee96a97..6a7e266 100644
+--- a/tig.1.txt
++++ b/tig.1.txt
+@@ -135,7 +135,7 @@ TIG_BLOB_CMD::
+ FILES
+ -----
+ '~/.tigrc'::
+-	User configuration file. See gitlink:tigrc[5] for examples.
++	User configuration file. See manpage:tigrc[5] for examples.
+ 
+ '{sysconfdir}/tigrc'::
+ 	System wide configuration file.
+@@ -158,7 +158,7 @@ the Free Software Foundation; either version 2 of the License, or
+ SEE ALSO
+ --------
+ 
+-gitlink:tigrc[5], git(7), cogito(7), as well as other git repository browsers:
++manpage:tigrc[5], git(7), cogito(7), as well as other git repository browsers:
+ gitk(1), qgit(1), gitview(1).
+ 
+ Online resources:
 diff --git a/tig.c b/tig.c
-index 5280da8..a3d2232 100644
+index 5280da8..3802204 100644
 --- a/tig.c
 +++ b/tig.c
-@@ -731,7 +731,7 @@ static struct keybinding default_keybindings[] = {
+@@ -45,7 +45,15 @@
+ /* ncurses(3): Must be defined to have extended wide-character functions. */
+ #define _XOPEN_SOURCE_EXTENDED
+ 
+-#include <curses.h>
++#ifdef HAVE_NCURSESW_NCURSES_H
++#include <ncursesw/ncurses.h>
++#else
++#ifdef HAVE_NCURSES_NCURSES_H
++#include <ncurses/ncurses.h>
++#else
++#include <ncurses.h>
++#endif
++#endif
+ 
+ #if __GNUC__ >= 3
+ #define __NORETURN __attribute__((__noreturn__))
+@@ -58,7 +66,7 @@ static void warn(const char *msg, ...);
+ static void report(const char *msg, ...);
+ static int read_properties(FILE *pipe, const char *separators, int (*read)(char *, size_t, char *, size_t));
+ static void set_nonblocking_input(bool loading);
+-static size_t utf8_length(const char *string, size_t max_width, int *trimmed, bool reserve);
++static size_t utf8_length(const char *string, int *width, size_t max_width, int *trimmed, bool reserve);
+ 
+ #define ABS(x)		((x) >= 0  ? (x) : -(x))
+ #define MIN(x, y)	((x) < (y) ? (x) :  (y))
+@@ -77,7 +85,6 @@ static size_t utf8_length(const char *string, size_t max_width, int *trimmed, bo
+ #define REVGRAPH_BRANCH	'+'
+ #define REVGRAPH_COMMIT	'*'
+ #define REVGRAPH_BOUND	'^'
+-#define REVGRAPH_LINE	'|'
+ 
+ #define SIZEOF_REVGRAPH	19	/* Size of revision ancestry graphics. */
+ 
+@@ -99,7 +106,7 @@ static size_t utf8_length(const char *string, size_t max_width, int *trimmed, bo
+ /* The default interval between line numbers. */
+ #define NUMBER_INTERVAL	5
+ 
+-#define TABSIZE		8
++#define TAB_SIZE	8
+ 
+ #define	SCALE_SPLIT_VIEW(height)	((height) * 2 / 3)
+ 
+@@ -110,7 +117,7 @@ static size_t utf8_length(const char *string, size_t max_width, int *trimmed, bo
+ #endif
+ 
+ #define TIG_LS_REMOTE \
+-	"git ls-remote $(git rev-parse --git-dir) 2>/dev/null"
++	"git ls-remote . 2>/dev/null"
+ 
+ #define TIG_DIFF_CMD \
+ 	"git show --pretty=fuller --no-color --root --patch-with-stat --find-copies-harder -C %s 2>/dev/null"
+@@ -369,6 +376,7 @@ sq_quote(char buf[SIZEOF_STR], size_t bufsize, const char *src)
+ 	REQ_(TOGGLE_REFS,	"Toggle reference display (tags/branches)"), \
+ 	REQ_(STATUS_UPDATE,	"Update file status"), \
+ 	REQ_(STATUS_MERGE,	"Merge file using external tool"), \
++	REQ_(STAGE_NEXT,	"Find next chunk to stage"), \
+ 	REQ_(TREE_PARENT,	"Switch to parent directory in tree view"), \
+ 	REQ_(EDIT,		"Open in editor"), \
+ 	REQ_(NONE,		"Do nothing")
+@@ -438,10 +446,11 @@ static const char usage[] =
+ static bool opt_date			= TRUE;
+ static bool opt_author			= TRUE;
+ static bool opt_line_number		= FALSE;
++static bool opt_line_graphics		= TRUE;
+ static bool opt_rev_graph		= FALSE;
+ static bool opt_show_refs		= TRUE;
+ static int opt_num_interval		= NUMBER_INTERVAL;
+-static int opt_tab_size			= TABSIZE;
++static int opt_tab_size			= TAB_SIZE;
+ static enum request opt_request		= REQ_VIEW_MAIN;
+ static char opt_cmd[SIZEOF_STR]		= "";
+ static char opt_path[SIZEOF_STR]	= "";
+@@ -612,7 +621,8 @@ LINE(BLAME_ID,     "",			COLOR_MAGENTA,	COLOR_DEFAULT,	0)
+ enum line_type {
+ #define LINE(type, line, fg, bg, attr) \
+ 	LINE_##type
+-	LINE_INFO
++	LINE_INFO,
++	LINE_NONE
+ #undef	LINE
+ };
+ 
+@@ -731,7 +741,8 @@ static struct keybinding default_keybindings[] = {
  	{ KEY_UP,	REQ_PREVIOUS },
  	{ KEY_DOWN,	REQ_NEXT },
  	{ 'R',		REQ_REFRESH },
 -	{ 'M',		REQ_MAXIMIZE },
++	{ KEY_F(5),	REQ_REFRESH },
 +	{ 'O',		REQ_MAXIMIZE },
  
  	/* Cursor navigation */
  	{ 'k',		REQ_MOVE_UP },
-@@ -3977,7 +3977,7 @@ status_open(struct view *view)
+@@ -769,6 +780,7 @@ static struct keybinding default_keybindings[] = {
+ 	{ ':',		REQ_PROMPT },
+ 	{ 'u',		REQ_STATUS_UPDATE },
+ 	{ 'M',		REQ_STATUS_MERGE },
++	{ '@',		REQ_STAGE_NEXT },
+ 	{ ',',		REQ_TREE_PARENT },
+ 	{ 'e',		REQ_EDIT },
+ 
+@@ -954,22 +966,23 @@ static size_t run_requests;
+ static enum request
+ add_run_request(enum keymap keymap, int key, int argc, char **argv)
+ {
+-	struct run_request *tmp;
+-	struct run_request req = { keymap, key };
++	struct run_request *req;
++	char cmd[SIZEOF_STR];
+ 	size_t bufpos;
+ 
+ 	for (bufpos = 0; argc > 0; argc--, argv++)
+-		if (!string_format_from(req.cmd, &bufpos, "%s ", *argv))
++		if (!string_format_from(cmd, &bufpos, "%s ", *argv))
+ 			return REQ_NONE;
+ 
+-	req.cmd[bufpos - 1] = 0;
+-
+-	tmp = realloc(run_request, (run_requests + 1) * sizeof(*run_request));
+-	if (!tmp)
++	req = realloc(run_request, (run_requests + 1) * sizeof(*run_request));
++	if (!req)
+ 		return REQ_NONE;
+ 
+-	run_request = tmp;
+-	run_request[run_requests++] = req;
++	run_request = req;
++	req = &run_request[run_requests++];
++	string_copy(req->cmd, cmd);
++	req->keymap = keymap;
++	req->key = key;
+ 
+ 	return REQ_NONE + run_requests;
+ }
+@@ -1126,6 +1139,11 @@ option_set_command(int argc, char *argv[])
+ 		return OK;
+ 	}
+ 
++	if (!strcmp(argv[0], "line-graphics")) {
++		opt_line_graphics = parse_bool(argv[2]);
++		return OK;
++	}
++
+ 	if (!strcmp(argv[0], "line-number-interval")) {
+ 		opt_num_interval = atoi(argv[2]);
+ 		return OK;
+@@ -1391,6 +1409,11 @@ struct view {
+ 	size_t line_size;	/* Total number of used lines */
+ 	unsigned int digits;	/* Number of digits in the lines member. */
+ 
++	/* Drawing */
++	struct line *curline;	/* Line currently being drawn. */
++	enum line_type curtype;	/* Attribute currently used for drawing. */
++	unsigned long col;	/* Column when drawing. */
++
+ 	/* Loading */
+ 	FILE *pipe;
+ 	time_t start_time;
+@@ -1404,7 +1427,7 @@ struct view_ops {
+ 	/* Read one line; updates view->line. */
+ 	bool (*read)(struct view *view, char *data);
+ 	/* Draw one line; @lineno must be < view->height. */
+-	bool (*draw)(struct view *view, struct line *line, unsigned int lineno, bool selected);
++	bool (*draw)(struct view *view, struct line *line, unsigned int lineno);
+ 	/* Depending on view handle a special requests. */
+ 	enum request (*request)(struct view *view, enum request request, struct line *line);
+ 	/* Search for regex in a line. */
+@@ -1451,107 +1474,175 @@ static struct view views[] = {
+ #define view_is_displayed(view) \
+ 	(view == display[0] || view == display[1])
+ 
++
++enum line_graphic {
++	LINE_GRAPHIC_VLINE
++};
++
++static int line_graphics[] = {
++	/* LINE_GRAPHIC_VLINE: */ '|'
++};
++
++static inline void
++set_view_attr(struct view *view, enum line_type type)
++{
++	if (!view->curline->selected && view->curtype != type) {
++		wattrset(view->win, get_line_attr(type));
++		wchgat(view->win, -1, 0, type, NULL);
++		view->curtype = type;
++	}
++}
++
+ static int
+-draw_text(struct view *view, const char *string, int max_len,
+-	  bool use_tilde, bool selected)
++draw_chars(struct view *view, enum line_type type, const char *string,
++	   int max_len, bool use_tilde)
+ {
+ 	int len = 0;
++	int col = 0;
+ 	int trimmed = FALSE;
+ 
+ 	if (max_len <= 0)
+ 		return 0;
+ 
+ 	if (opt_utf8) {
+-		len = utf8_length(string, max_len, &trimmed, use_tilde);
++		len = utf8_length(string, &col, max_len, &trimmed, use_tilde);
+ 	} else {
+-		len = strlen(string);
++		col = len = strlen(string);
+ 		if (len > max_len) {
+ 			if (use_tilde) {
+ 				max_len -= 1;
+ 			}
+-			len = max_len;
++			col = len = max_len;
+ 			trimmed = TRUE;
+ 		}
+ 	}
+ 
++	set_view_attr(view, type);
+ 	waddnstr(view->win, string, len);
+ 	if (trimmed && use_tilde) {
+-		if (!selected)
+-			wattrset(view->win, get_line_attr(LINE_DELIMITER));
++		set_view_attr(view, LINE_DELIMITER);
+ 		waddch(view->win, '~');
+-		len++;
++		col++;
+ 	}
+ 
+-	return len;
++	return col;
+ }
+ 
+ static int
+-draw_lineno(struct view *view, unsigned int lineno, int max, bool selected)
++draw_space(struct view *view, enum line_type type, int max, int spaces)
+ {
+-	static char fmt[] = "%1ld";
+-	char number[10] = "          ";
++	static char space[] = "                    ";
++	int col = 0;
++
++	spaces = MIN(max, spaces);
++
++	while (spaces > 0) {
++		int len = MIN(spaces, sizeof(space) - 1);
++
++		col += draw_chars(view, type, space, spaces, FALSE);
++		spaces -= len;
++	}
++
++	return col;
++}
++
++static bool
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/tig-git.patch?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list