tig-2.0.2/000077500000000000000000000000001233303337700123025ustar00rootroot00000000000000tig-2.0.2/.gitignore000066400000000000000000000005171233303337700142750ustar00rootroot00000000000000*.html *.o *.swp *~ .deps /config.make aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure cscope.out ctags doc/*.[157] doc/*.xml doc/manual.html-chunked doc/manual.pdf doc/manual.toc doc/release-docs/ src/builtin-config.c src/tig tags test/test-graph tig-*.tar.gz tig-*.tar.gz.md5 tig.spec tools/doc-gen tig-2.0.2/.travis.yml000066400000000000000000000006601233303337700144150ustar00rootroot00000000000000language: c compiler: - clang - gcc env: - TEST=autoconf VERBOSE=1 - TEST=make VERBOSE=@ before_install: sudo apt-get update -qq install: sudo apt-get install -qq --no-install-recommends asciidoc xmlto docbook-utils script: - if [ "$TEST" = autoconf ]; then ./autogen.sh && ./configure; fi - if [ "$TEST" = make ]; then cp contrib/config.make .; fi - make V=$VERBOSE DESTDIR=/tmp all test install install-doc tig-2.0.2/COPYING000066400000000000000000000431071233303337700133420ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. tig-2.0.2/INSTALL.adoc000066400000000000000000000110271233303337700142410ustar00rootroot00000000000000Installation instructions ========================= :docext: adoc Download a tarball from http://jonas.nitro.dk/tig/releases[] or clone the Tig repository http://github.com/jonas/tig[git://github.com/jonas/tig.git]. The quick and simple way to install Tig is: $ make $ make install By default, `tig` is installed in `$HOME/bin`. To install `tig` elsewhere set `prefix` to the desired path: $ make prefix=/usr/local $ sudo make install prefix=/usr/local Documentation files, such as manpages, are distributed in the release tarballs, and can be installed using: $ make install-doc When installing directly from the Tig repository, `make install-doc` will assume that the documentation tool chain is available and build the documentation locally. In case you do not wish to install the required tools, documentation can be installed from the 'release' branch using: $ make install-release-doc Before upgrading, you are advised to read link:NEWS.{docext}[the release notes]. Installation using `configure` ------------------------------ Optionally, you can use the `configure` script to detect dependencies: $ ./configure $ make $ make install 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. 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: $ make configure Build configuration ------------------- Build settings are read from the file `config.make` and for certain systems also from `contrib/config.make-$kernel`. An example of the latter is Mac OS X, where `contrib/config.make-Darwin` provides out-of-the-box configuration for using the system ncurses library and linking with the iconv library. This makes it easy to configure the build without having to use the `configure` script. As a side note, `configure` itself generates a `config.make` file. Apart from the different standard `make` build variables (`CC`, `CFLAGS`, etc.) and standard `configure` variables (`prefix`, `bindir`, etc.), build settings can be one of the following flags: - `NO_SETENV`: Define this variable to enable work-around for missing `setenv()`. - `NO_MKSTEMPS`: Define this variable to enable work-around for missing `mkstemps()`. - `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`). The following example `config.make` manually configures Tig to use the ncurses library with wide character support and include the proper ncurses header file (see tig.h for more information): LDLIBS = -lncursesw CPPFLAGS = -DHAVE_NCURSESW_CURSES_H For more examples of build settings, see `contrib/config.make` and `config.make.in`. Tools and packages ------------------ The following tools and packages are needed: [cols="2<,8<",options="header"] |============================================================================= |Tool |Description |git-core |Tig is just a frontend for Git. |ncurses or ncursesw |Be sure to have the development files installed. Usually they are available in a separate package ending with `-dev`. Ncurses with wide character support (ncursesw) is required to properly handle UTF-8 encoded strings. Note for packagers: For Tig's `configure` script to work as expected you should avoid configuring and building ncurses using `--with-shared`. |iconv |If iconv is not provided by the c library you need to change the Makefile to link it into the binary. |============================================================================= The following tools and packages are optional and mainly needed for creating the configure script and building documentation: [cols="2<,8<",options="header"] |============================================================================= |Tool |Description |readline |Adds support for completion and history in search and command prompts. |autoconf |Contains autoreconf for generating configure from configure.ac. |asciidoc (>= 8.4) |Generates HTML and (DocBook) XML from text. |xmlto |Generates manpages and chunked HTML from XML. |DocBook XSL (>= 1.72.0) |Used by xmlto for building manpages. |DocBook (DSSL/Jade) tools |Generates PDF from XML. Also known as docbook-utils. |============================================================================= tig-2.0.2/INSTALL.html000066400000000000000000000605341233303337700143060ustar00rootroot00000000000000 Installation instructions

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

The quick and simple way to install Tig is:

$ make
$ make install

By default, tig is installed in $HOME/bin. To install tig elsewhere set prefix to the desired path:

$ make prefix=/usr/local
$ sudo make install prefix=/usr/local

Documentation files, such as manpages, are distributed in the release tarballs, and can be installed using:

$ make install-doc

When installing directly from the Tig repository, make install-doc will assume that the documentation tool chain is available and build the documentation locally. In case you do not wish to install the required tools, documentation can be installed from the release branch using:

$ make install-release-doc

Before upgrading, you are advised to read the release notes.

Installation using configure

Optionally, you can use the configure script to detect dependencies:

$ ./configure
$ make
$ make install

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.

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:

$ make configure

Build configuration

Build settings are read from the file config.make and for certain systems also from contrib/config.make-$kernel. An example of the latter is Mac OS X, where contrib/config.make-Darwin provides out-of-the-box configuration for using the system ncurses library and linking with the iconv library. This makes it easy to configure the build without having to use the configure script. As a side note, configure itself generates a config.make file.

Apart from the different standard make build variables (CC, CFLAGS, etc.) and standard configure variables (prefix, bindir, etc.), build settings can be one of the following flags:

  • NO_SETENV: Define this variable to enable work-around for missing setenv().

  • NO_MKSTEMPS: Define this variable to enable work-around for missing mkstemps().

  • 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).

The following example config.make manually configures Tig to use the ncurses library with wide character support and include the proper ncurses header file (see tig.h for more information):

LDLIBS = -lncursesw
CPPFLAGS = -DHAVE_NCURSESW_CURSES_H

For more examples of build settings, see contrib/config.make and config.make.in.

Tools and packages

The following tools and packages are needed:

Tool Description

git-core

Tig is just a frontend for Git.

ncurses or ncursesw

Be sure to have the development files installed. Usually they are available in a separate package ending with -dev.

Ncurses with wide character support (ncursesw) is required to properly handle UTF-8 encoded strings.

Note for packagers: For Tig’s configure script to work as expected you should avoid configuring and building ncurses using --with-shared.

iconv

If iconv is not provided by the c library you need to change the Makefile to link it into the binary.

The following tools and packages are optional and mainly needed for creating the configure script and building documentation:

Tool Description

readline

Adds support for completion and history in search and command prompts.

autoconf

Contains autoreconf for generating configure from configure.ac.

asciidoc (>= 8.4)

Generates HTML and (DocBook) XML from text.

xmlto

Generates manpages and chunked HTML from XML.

DocBook XSL (>= 1.72.0)

Used by xmlto for building manpages.

DocBook (DSSL/Jade) tools

Generates PDF from XML. Also known as docbook-utils.


tig-2.0.2/NEWS.adoc000066400000000000000000000745001233303337700137140ustar00rootroot00000000000000Release notes ============= tig-2.0.2 --------- Improvements: - Use git-status for diffing the index. - Group toggle options together in the help view. Bug fixes: - Fix refs, main and grep loading when 'gui.encoding' is set. (GH #287) - Ignore 'gui.encoding' and 'i18n.commitencoding' when set to 'UTF-8'. - Add work-around for missing strndup() on Mac OS X v10.6. (GH #286) - Fix spurious abbreviation of author names. (GH #288) - Don't show empty action groups in the help view. tig-2.0.1 --------- Bug fixes: - Fix compilation in watch.c. - Fix parsing of key bindings mapped to '^' and '<'. (GH #280, #282) tig-2.0 ------- Note to packagers: - Add `.adoc` extension to AsciiDoc files so they show correctly on GitHub. This includes `README`, `INSTALL`, and `NEWS` and files in `doc/` directory. - `BUGS` file has been merged into `README.adoc`. - Default keybindings have been moved to a system-level `tigrc` file, which is installed to ${sysconfdir} by default. The content of the `tigrc` file is included inside the binary as a fall-back. Pass `NO_BUILTIN_TIGRC=y` to not include the system `tigrc` content and reduce the size of the binary. - The example `contrib/tigrc` file (made obsolete by `tigrc`) has been removed. - Source files have been moved to `src` and `include` and `tig.c` was split up. - Build output is less verbose by default; use `make V=1` for old output. Incompatibilities: - In preparation for key combo support, key mappings for symbolic keys (e.g. `Up` and `Down`) must now start with `<` and end with `>`, e.g. `` and ``. Furthermore, escape key combos must now use `key` instead of `^[key`, and control key mappings must now use `` instead of `^key`. - Only use 'diff-options' for the diff view and introduce '%(cmdlineargs)' to hold non-file and non-revision flags passed on the command line. Affects all user-defined commands that expect '%(diffargs)' to hold both 'diff-options' arguments and those passed on the command line. (GH #228) - Remove built-in keybinding for `git gc`. Add the following line to `~/.tigrc` to restore it: `bind generic G ?git gc`. - To support view specific colors, '.' can no longer be used interchangeably with '-' and '_' in settings names and in particular color names. - Replace 'stage-next' action with prompt command using a predefined search (see below) and add binding (`@` by default) to also work in the diff view. - Most view display options must now be set via the new `*-view` options in tigrc. Existing options are no longer recognized, but a warning is shown. - Remap default bindings to have more consistent convention: use lower-case keys primarily for view switching and non-destructive actions, use upper-case keys for view-specific actions including user-defined commands. To preserve old default key bindings see `contrib/bindings-v1.x.tigrc`. (GH #257) Improvements: - Add mouse support: scroll view, click line to move cursor, double click line (or click again) to "Enter" cursor line, e.g. open commit diff. Disabled by default, since it makes text selection less intuitive. If you enable this remember to hold down Shift (or Option on Mac) when selecting text. - Rewrite and improve the rendering of the commit graph. (GH #144, #46) - Add completion and history support to the prompt via readline. (GH #185) - Options can be configured and toggled individually for each view. Use the new view settings to configure the order and display options for each view columns. See system tigrc and tigrc(5) for examples. (GH #89, #222) - Add grep view as a front-end to git-grep(1): `tig grep -p strchr`. From within Tig, the key for switching or grepping is bound to 'g' by default. - Rename 'branch' view to 'refs' view and show tags. (GH #134) - Add main view pager mode that reads git-log's '--pretty=raw' data from stdin, e.g. `git reflog --pretty=raw | tig --pretty=raw`. - Add support for `--graph` and highlight diff stats in the log view. - Add default command bindings: `!` to delete branch, `!` to drop stash. - Add 'stage-split-chunk' action for splitting chunks in the stage view. Bound to '\' by default. (GH #107) - Add 'back' action bound to '<' by default, which will return the blame view to the previous revision and line after moving e.g. to the parent. (GH #124) - Auto-refresh views based on watched repository changes. Configure by setting `refresh-mode` to 'manual', 'auto', 'after-command', or 'periodic'. (GH #190) - All default settings are in well-documented system `tigrc`. - Add `:toggle` prompt command to manipulate options using keybindings. For example: `bind diff D :toggle diff-options --patience --notes`. (GH #69) - Add a new "auto" value for the 'vertical-split' option to let Tig choose the split orientation (this is the new default behavior). Can be toggled. - Make it possible to toggle the display of files in untracked directories. - Allow Tig to be started with no default configuration by specifying an alternative system `tigrc` file, e.g.: `TIGRC_SYSTEM=~/.tigrc.safe tig`. Set `TIGRC_SYSTEM` to the empty string to use built-in configuration instead of - Key mappings can contain UTF-8 multibyte unicode keys. - Warn about conflicting keybindings using Ctrl, e.g. `` and ``. (GH #218) - Extend key bindings for prompt commands (ie. `bind :`) to support predefined searches, eg.: `bind stage 2 :?^@@`. - Git color mappings can be configured in tigrc. - More informative configuration error messages. - Make reference label formatting configurable, for example: `set reference-format = (branch) remote`. (GH #201) - Adjust author width and other view columns automatically. (GH #49) - Support view specific colors: `color stage.diff-add yellow default`. - Copy `-S`, `-G` and `--grep=` pattern to search buffer so 'find-next' and 'find-prev' work as expected. - Optionally specify custom prompt for `%(prompt)` in shell commands, e.g. `bind main B ?git checkout -b "%(prompt Enter new branch name: )"`. - Add `%(remote)` and `%(tag)` symbols to complement `%(branch)`. - User-defined commands can now be prefixed with any of the supported flags, e.g. `?git checkout -b %(branch)`. - Open editor at line number for combined diffs e.g. diffs of unmerged files. - Add build configuration for Cygwin (OS name: CYGWIN_NT-6.1). (GH #92) - Document the Git commands supported by the pager mode. (GH #1) system `tigrc` configuration. (GH #235) Bug fixes: - Fix stash diff display when reloading the stash view after a deleting. - Set the commit reference when opening the blame view from the blob view. - Correctly identify and highlight the remote branch tracked by HEAD. - Pass --no-color after user defined arguments to ensure that colors do not break the output parsing. (GH #191) - Close stdin when pager mode is not supported. - Show newly created branches in the main view. (GH #196) - File with 0 changes breaks diffstat highlighting (GH #215) - Update %(branch) variable in the main view. (GH #223) - Disable graph rendering when either of `--reverse`, `-S`, `-G`, and `--grep` are passed to the main view. (GH #127) - Only refresh views that support it. - Fix author and date annotation of renamed entries in the tree view. - Fix use of unsafe methods in the signal handler. (GH #245) - Fix rendering in non-UTF8 terminals. - Fix stage-update-line by rewriting the diff chunk containing the line instead of using `--unidiff-zero` and a diff context of zero. (GH #130) - Fix status-update to work for untracked directories. (GH #236) - Don't pass log parameters given on the command line to the diff view. tig-1.2.1 --------- Incompatibilities: - Move manual and man pages to doc/ directory and rename AsciiDoc files to have .asciidoc as the extension to make them render on GitHub. Improvements: - Show blob sizes in the tree view either as bytes or using binary unit prefixes. Example: `set show-file-size = units`. (GH #163) - Reduce main view memory usage and startup time, especially when revision graph rendering is disabled. (GH #160) Bug fixes: - Fix submodule-related setup to check for non-zero return value from setenv(). (GH #188) tig-1.2 ------- - Tig now has its own tag on Stack Overflow, where users are invited to ask questions: http://stackoverflow.com/questions/tagged/tig Improvements: - Prompt commands can be bound to keys. For example: `bind diff F :set diff-options = --full-diff`. (GH #69, #116) - Add a diff-options setting for specifying default diff options. Example: `set diff-options = --patience`. (GH #116) - Options in diff-options and blame-options matching Tig browsing state variables are replaced. - Show diff stats as wide as the terminal. (GH #109) - Show line numbers in the branch view. (GH #135) - Add toggles for showing author email or email user names. (GH #115) - Open editor at the selected line by prefixing the file argument with `+`. Tested in vi, Vim, Emacs, Nano, Gedit, Geany. Disable by adding `set editor-line-number = no` to ~/.tigrc. (GH #118, #119) - Add toggle-files to control whether to show full commit diff or only the diff concerning the currently selected file, e.g. for blame. - Optionally highlight exceeding characters in long commit titles. The default title max width is 50 characters. Customize using: `set title-overflow = 50` (GH #125) - Add +ESC key bindings. Example: `bind generic ^[v move-page-up` (GH #120) - Create temporary files in TMPDIR, TEMP, or TMP before defaulting to /tmp. - Reenable `tig log` as a subcommand. (GH #146) - Enable tilde expansion in ~/.tigrc "source" commands. (GH #168) - Introduce the stash view, bound to the 'y' keybinding. (GH #169, #174) Bug fixes: - Fix blame and status to work in directories starting with a dot. (GH #172) - Reload current branch name when reloading the status view. (GH #93) - Fix compile errors on old Solaris. (GH #97) - Reload HEAD info when reloading the stage view. (GH #104, #93) - Fix disappearing branch labels after external commands. (GH #148) - Fix diff view display for staged/unstaged changes when using 'd'. - Fix display of status messages when toggling view options. (GH #111) - Fix illegal memory access. (GH #98) - Fix display of all branches label in repos with short branch names. - Fix rendering glitch for branch names. - Do not apply diff styling to untracked files in the stage view. (GH #153) - Fix tree indentation for entries containing combining characters. (GH #170) - Ignore unrepresentable characters when transliterating text for rendering. - Transliterate text to output encoding before trimming it to avoid misalignment. (GH #86) - Introduce a more natural context-sensitive log display. (GH #155) tig-1.1 ------- Incompatibilities: - Disable diff move/copy detection by default, boosting diff performance on larger projects. Use git config 'diff.renames' option (Git-wide) to set your preferred behavior. Environment variable TIG_DIFF_OPTS can be used to restore the old behavior. - Fix manual keybinding for stage-single-line. (GH #108) - Values set for author-width and filename-width will result in widths one character bigger than previously. Improvements: - Typing a text in the prompt will be interpreted as a Tig command. Prefixing the command with a '!' will execute this system command in an external pager. Entering a single key will execute the corresponding key binding. - Basic support for wrapping long line in pager, diff, and stage views. Enable using: `set wrap-lines = yes`. (GH #2) - User-defined commands prefixed with a '?' means prompt before execution. Example: `bind main B !?git rebase -i %(commit)`. - User-defined commands prefixed with a '<' means exit after execution. Example: `bind main C ! to open the initial view at an arbitrary line. (GH #20) - Add show-notes ~/.tigrc option. Notes are displayed by default. - Support jumping to specific SHAs in the main view. - Decorate replaced commits. - Display line numbers in main view. - Colorize binary diff stats. (GH #17) - Custom colorization of lines matching a string prefix (GH #16). Example configuration: color "Reported-by:" green default - Use Git's color settings for the main, status and diff views. Put `set read-git-colors = no` in ~/.tigrc to disable. - Handle editor options with multiple arguments. (GH #12) - Show filename when running tig blame with copy detection. (GH #19) - Use 'source ' command to load additional files from ~/.tigrc - User-defined commands prefixed with '@' are run with no console output, e.g. bind generic 3 !@rm sys$command - Make display of space changes togglable in the diff and stage view. Bound to 'W' by default. - Use per-file encoding specified in gitattributes(5) for blobs and unstaged files. - Obsolete commit-encoding option and pass --encoding=UTF-8 to revision commands. - Main view: show uncommitted changes as staged/unstaged commits. Can be disabled by putting `set show-changes = no` in ~/.tigrc. - Add %(prompt) external command variable, which will prompt for the argument value. - Log information about Git commands when the TIG_TRACE environment variable is set. Example: `TIG_TRACE=/tmp/tig.log tig` - Branch view: Show the title of the last commit. - Increase the author auto-abbreviation threshold to 10. (GH #49) - For old commits show number of years in relative dates. (GH #50) Bug fixes: - Fix navigation behavior when going from branch to main view. (GH #38) - Fix segfault when sorting the tree view by author name. - Fix diff stat navigation for unmodified files with stat changes. - Show branches/refs which names are a substring of the current branch. - 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 -------- Incompatibilities: - Remove support for the deprecated TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables. Improvements: - Pressing enter on diff stat file lines will jump to file's diff. - Naïvely color blame IDs to distinguish lines. - Document palette color options used for revision graph and blame IDs. - Add support for blaming diff lines. - Add diff-context option and bindings to increase the diff context in 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: - Expand browsing state variables for prompt. (LP #694780, Debian #635546) - Fix segfault when sorting the branch view by author. - Expand %(directory) to . for the root directory. (GH-3) - Accept 'utf-8' for the line-graphics option as indicated in the docs. - Use erasechar() to check for the correct backspace character. tig-0.17 -------- Improvements: - Start rewrite of the revision graph renderer. Three modes are supported UTF-8, ncurses line graphics, and ASCII. Also, enable revision graph rendering by default. Bug fixes: - Fix ncurses 5.8 issue by passing non-zero column size to newwin(). - Fix opening of diffs when browsing branches. tig-0.16.2 ---------- Bug fixes: - Fix regression causing empty tree view. - Fix set_tabsize() compile error for older versions of ncurses. tig-0.16.1 ---------- Improvements: - Add scroll-first-col action to jump to the first column. Bound to '|' by default. - Add 'status-untracked-dirs' option to ignore unknown directories contents in the status view. On by default. Bug fixes: - Fix 'tig show ' to show the provided commit. - Fix problem with empty diff views when file specs were passed on the command line. - Fix segfault when starting Tig in pager mode. tig-0.16 -------- Incompatibilities: - Encode everything internally as UTF-8. This can affect performance, but should in general improve handling of character lengths etc. Also, to properly handle UTF-8 environments use ncurses with wide character support. - The use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables has been deprecated. To allow configuration of the diff view, TIG_DIFF_OPTS can be used. Improvements: - Plug several memory leaks. - Command line arguments are split into diff, revision, and file arguments and made available as %(diffargs), %(revargs), and %(fileargs). Diff view will limit diffs using %(fileargs). - Status view: update the file variable when a line is selected so %(file) works as expected. - Branch view: add %(branch) symbol providing access to the selected branch. - Branch view: add entry to browse all branches (uses git-log's --all flag). - Abbreviation of author names can now be configured and toggled. - Mark detached heads with [HEAD]. - Add support for displaying dates in local time. Bug fixes: - Status view: fix usage from sub directories, which was broken by the changes made to support blame view from sub directories. - Fix text expansion to not truncate long lines - Fix parsing of boolean show-date values. - Fix relative date. - Fix unbind to behave as if the keybinding was never defined. - Fix unbind to also cover built-in run requests. - Fix parsing of unknown keymap names. - Blame view: fix parent blame to detect renames. It uses "previous" line info from the blame porcelain output added in Git version 1.6.3. tig-0.15 -------- Incompatibilities: - Setting the cursor color no longer automatically sets the text to bold. The old 'lazy' behavior was a bug. - Remove check for git-repo-config, which was officially deprecated in Git version 1.5.4. The configure script no longer depends on Git being installed. Improvements: - Provide the manual as a man page named tigmanual(7). - Add ability to toggle between showing shorter dates (without time info) and relative dates. Use 'D' to toggle between date formats. - Show the active (instead of the default) keybindings in the help view. Furthermore, honor the keymap when suggesting actions in the help messages. - Add branch view for choosing which branch to display in the main view. Bound to 'H' by default. - Tree view: show entry to parent directory ('..') when running from subdirectory. - Tree view: sort entries by name, date or author. Toggling is bound to 'i' by default, with 'I' controlling whether or not to sort in ascending order. - Make height of the lower view in a split view configurable by setting the 'split-view-height' variable to a number or a percentage. Defaults to 2/3 of the total view height. - Allow multiple text attributes for color commands: color cursor white blue underline bold Bug fixes: - Blame view: fix loading of blame data when opened from the tree view and CWD is not the repo root. (Debian bug 540766) - Tree view: fix searching. tig-0.14.1 ---------- Improvements: - Status view: improve "on branch" information inspired by the prompt code in Git's bash completion script. - Colors for 256-capable terminals can be specified as colorN. - Entering a number in the prompt will jump to that line number. - Handle core.worktree by setting GIT_DIR and GIT_WORK_TREE. - Make behavior of horizontal scrolling configurable by setting the 'horizontal-scroll' variable to a number or a percentage. Defaults to scrolling 50% of the view width. Bug fixes: - Status view: show error when failing to open a file. - Status view: report failures to update a file. - Blame view: fix problem with uninitialized variable. - Blame view: use line number information when loading blame for specific commit. - Fix handling of quoted strings in the config file. - Fix horizontal scrolling glitches. tig-0.14 -------- Incompatibilities: - The screen-resize action has been deprecated. It had no real use for users and was never meant to be exposed. - The "tree-parent" action was renamed to "parent". Warnings will be emitted for transition. - Remove parsing of deprecated option -S and subcommands log and diff. - The "author" color replaces "main-author". Setting the latter will now set the "author" color. Improvements: - Horizontal scrolling. Bound to Left/Right by default. - Read tigrc(5) options from Git configuration files using the syntax: [tig] show-rev-graph = true [tig "color"] cursor = yellow red bold [tig "bind"] generic = P parent - Tree view: avoid flickering when updating. - Tree view: annotate entries with commit information. - Tree & blob view: open any blob in an editor. - Stage & main view: restore view position when reloading. - Blame view: load blame for parent commit. For merge commits the parent is queried. Bound to ',' by default via the existing "parent" action. - Abbreviate author names to initials when the width of the author column is below 6 characters. Bug fixes: - Tree view: fix memory corruption bug when updating. - Tree view: improve handling of empty trees. - Status view: fix reverting of unmerged files. - Fix regression for non-UTF-8 locales corrupting the view data. - Fix regression parsing multiple spaces in ~/.tigrc. tig-0.13 -------- Incompatibilities: - Commands from the environment (e.g. TIG_MAIN_CMD) will no longer have access to shell features, such as subshells and variable expansion. The easiest way to upgrade your configuration is to put such commands in a script file or as a Git alias. Improvements: - Display repository references in the sorted order: tags, heads, tracked remotes, remotes. - Add bash completion for blame. - Tree view: edit files of the current branch. - Run requests: new identifiers %(directory), %(file), and %(ref) - Improve responsiveness and view loading speed by using select(2). Bug fixes: - Separate blame revision and file argument by "--" to avoid problems. - Main view: fix redrawing of the last commit wrt. the revision graph. - Fix waiting for input after executing a run request in pager mode. - Status & stage view: refuse to open directories and deleted files. - Tree view: show error when requesting blame for all non-file entries. - Do not draw loading views, which are not displayed. - Fix launching of mergetool from a subdirectory. tig-0.12.1 ---------- Improvements: - Status view: revert uncommitted diff chunks and unstaged files with changes. Bound to '!' by default. - Main view: use --topo-order also when rev-list arguments are given on the command line. - Log view: support for refreshing. Bug fixes: - Status view: use ls-files' --exclude-standard so user specific ignore rules are effective. The option was added in Git version 1.5.4. - Stage view: fix assertion failure triggered when updating while status view is not displayed. - Help view: avoid confusion by showing "(no key)" instead of "'?'" for unbound requests. - Reload repository references when refreshing the main (and log) view. - Do not maximize views when refreshing. tig-0.12 -------- 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. - Main view: support for refreshing. - Main view: disable boundary commits by default. Use --boundary when they should be shown. (Debian bug 498628) - 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. - Add author-width option to customize the width of the author column. For example, put the following in ~/.tigrc: set author-width = 10 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. - Do not show incomplete boundary commits when --no-walk is used. - Documentation: Rename gitlink macro to support AsciiDoc 8.2.3. - Ignore pipe reads with errno "Success" reported after a signals, for example when refreshing doing background loading. 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 UTF-8 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. tig-2.0.2/NEWS.html000066400000000000000000001730161233303337700137540ustar00rootroot00000000000000 Release notes

tig-2.0.2

Improvements:

  • Use git-status for diffing the index.

  • Group toggle options together in the help view.

Bug fixes:

  • Fix refs, main and grep loading when gui.encoding is set. (GH #287)

  • Ignore gui.encoding and i18n.commitencoding when set to UTF-8.

  • Add work-around for missing strndup() on Mac OS X v10.6. (GH #286)

  • Fix spurious abbreviation of author names. (GH #288)

  • Don’t show empty action groups in the help view.

tig-2.0.1

Bug fixes:

  • Fix compilation in watch.c.

  • Fix parsing of key bindings mapped to ^ and <. (GH #280, #282)

tig-2.0

Note to packagers:

  • Add .adoc extension to AsciiDoc files so they show correctly on GitHub. This includes README, INSTALL, and NEWS and files in doc/ directory.

  • BUGS file has been merged into README.adoc.

  • Default keybindings have been moved to a system-level tigrc file, which is installed to $++SYSCONFDIR++ by default. The content of the tigrc file is included inside the binary as a fall-back. Pass NO_BUILTIN_TIGRC=y to not include the system tigrc content and reduce the size of the binary.

  • The example contrib/tigrc file (made obsolete by tigrc) has been removed.

  • Source files have been moved to src and include and tig.c was split up.

  • Build output is less verbose by default; use make V=1 for old output.

Incompatibilities:

  • In preparation for key combo support, key mappings for symbolic keys (e.g. Up and Down) must now start with < and end with >, e.g. <Up> and <Down>. Furthermore, escape key combos must now use <Esc>key instead of ^[key, and control key mappings must now use <Ctrl-key> instead of ^key.

  • Only use diff-options for the diff view and introduce %(cmdlineargs) to hold non-file and non-revision flags passed on the command line. Affects all user-defined commands that expect %(diffargs) to hold both diff-options arguments and those passed on the command line. (GH #228)

  • Remove built-in keybinding for git gc. Add the following line to ~/.tigrc to restore it: bind generic G ?git gc.

  • To support view specific colors, . can no longer be used interchangeably with - and _ in settings names and in particular color names.

  • Replace stage-next action with prompt command using a predefined search (see below) and add binding (@ by default) to also work in the diff view.

  • Most view display options must now be set via the new *-view options in tigrc. Existing options are no longer recognized, but a warning is shown.

  • Remap default bindings to have more consistent convention: use lower-case keys primarily for view switching and non-destructive actions, use upper-case keys for view-specific actions including user-defined commands. To preserve old default key bindings see contrib/bindings-v1.x.tigrc. (GH #257)

Improvements:

  • Add mouse support: scroll view, click line to move cursor, double click line (or click again) to "Enter" cursor line, e.g. open commit diff. Disabled by default, since it makes text selection less intuitive. If you enable this remember to hold down Shift (or Option on Mac) when selecting text.

  • Rewrite and improve the rendering of the commit graph. (GH #144, #46)

  • Add completion and history support to the prompt via readline. (GH #185)

  • Options can be configured and toggled individually for each view. Use the new view settings to configure the order and display options for each view columns. See system tigrc and tigrc(5) for examples. (GH #89, #222)

  • Add grep view as a front-end to git-grep(1): tig grep -p strchr. From within Tig, the key for switching or grepping is bound to g by default.

  • Rename branch view to refs view and show tags. (GH #134)

  • Add main view pager mode that reads git-log’s --pretty=raw data from stdin, e.g. git reflog --pretty=raw | tig --pretty=raw.

  • Add support for --graph and highlight diff stats in the log view.

  • Add default command bindings: ! to delete branch, ! to drop stash.

  • Add stage-split-chunk action for splitting chunks in the stage view. Bound to \ by default. (GH #107)

  • Add back action bound to < by default, which will return the blame view to the previous revision and line after moving e.g. to the parent. (GH #124)

  • Auto-refresh views based on watched repository changes. Configure by setting refresh-mode to manual, auto, after-command, or periodic. (GH #190)

  • All default settings are in well-documented system tigrc.

  • Add :toggle prompt command to manipulate options using keybindings. For example: bind diff D :toggle diff-options --patience --notes. (GH #69)

  • Add a new "auto" value for the vertical-split option to let Tig choose the split orientation (this is the new default behavior). Can be toggled.

  • Make it possible to toggle the display of files in untracked directories.

  • Allow Tig to be started with no default configuration by specifying an alternative system tigrc file, e.g.: TIGRC_SYSTEM=~/.tigrc.safe tig. Set TIGRC_SYSTEM to the empty string to use built-in configuration instead of

  • Key mappings can contain UTF-8 multibyte unicode keys.

  • Warn about conflicting keybindings using Ctrl, e.g. <Ctrl-f> and <Ctrl-F>. (GH #218)

  • Extend key bindings for prompt commands (ie. bind <keymap> <key> :<prompt>) to support predefined searches, eg.: bind stage 2 :?^@@.

  • Git color mappings can be configured in tigrc.

  • More informative configuration error messages.

  • Make reference label formatting configurable, for example: set reference-format = (branch) <tags> remote. (GH #201)

  • Adjust author width and other view columns automatically. (GH #49)

  • Support view specific colors: color stage.diff-add yellow default.

  • Copy -S, -G and --grep= pattern to search buffer so find-next and find-prev work as expected.

  • Optionally specify custom prompt for %(prompt) in shell commands, e.g. bind main B ?git checkout -b "%(prompt Enter new branch name: )".

  • Add %(remote) and %(tag) symbols to complement %(branch).

  • User-defined commands can now be prefixed with any of the supported flags, e.g. ?git checkout -b %(branch).

  • Open editor at line number for combined diffs e.g. diffs of unmerged files.

  • Add build configuration for Cygwin (OS name: CYGWIN_NT-6.1). (GH #92)

  • Document the Git commands supported by the pager mode. (GH #1) system tigrc configuration. (GH #235)

Bug fixes:

  • Fix stash diff display when reloading the stash view after a deleting.

  • Set the commit reference when opening the blame view from the blob view.

  • Correctly identify and highlight the remote branch tracked by HEAD.

  • Pass --no-color after user defined arguments to ensure that colors do not break the output parsing. (GH #191)

  • Close stdin when pager mode is not supported.

  • Show newly created branches in the main view. (GH #196)

  • File with 0 changes breaks diffstat highlighting (GH #215)

  • Update %(branch) variable in the main view. (GH #223)

  • Disable graph rendering when either of --reverse, -S, -G, and --grep are passed to the main view. (GH #127)

  • Only refresh views that support it.

  • Fix author and date annotation of renamed entries in the tree view.

  • Fix use of unsafe methods in the signal handler. (GH #245)

  • Fix rendering in non-UTF8 terminals.

  • Fix stage-update-line by rewriting the diff chunk containing the line instead of using --unidiff-zero and a diff context of zero. (GH #130)

  • Fix status-update to work for untracked directories. (GH #236)

  • Don’t pass log parameters given on the command line to the diff view.

tig-1.2.1

Incompatibilities:

  • Move manual and man pages to doc/ directory and rename AsciiDoc files to have .asciidoc as the extension to make them render on GitHub.

Improvements:

  • Show blob sizes in the tree view either as bytes or using binary unit prefixes. Example: set show-file-size = units. (GH #163)

  • Reduce main view memory usage and startup time, especially when revision graph rendering is disabled. (GH #160)

Bug fixes:

  • Fix submodule-related setup to check for non-zero return value from setenv(). (GH #188)

tig-1.2

Improvements:

  • Prompt commands can be bound to keys. For example: bind diff F :set diff-options = --full-diff. (GH #69, #116)

  • Add a diff-options setting for specifying default diff options. Example: set diff-options = --patience. (GH #116)

  • Options in diff-options and blame-options matching Tig browsing state variables are replaced.

  • Show diff stats as wide as the terminal. (GH #109)

  • Show line numbers in the branch view. (GH #135)

  • Add toggles for showing author email or email user names. (GH #115)

  • Open editor at the selected line by prefixing the file argument with +<lineno>. Tested in vi, Vim, Emacs, Nano, Gedit, Geany. Disable by adding set editor-line-number = no to ~/.tigrc. (GH #118, #119)

  • Add toggle-files to control whether to show full commit diff or only the diff concerning the currently selected file, e.g. for blame.

  • Optionally highlight exceeding characters in long commit titles. The default title max width is 50 characters. Customize using: set title-overflow = 50 (GH #125)

  • Add +ESC key bindings. Example: bind generic ^[v move-page-up (GH #120)

  • Create temporary files in TMPDIR, TEMP, or TMP before defaulting to /tmp.

  • Reenable tig log as a subcommand. (GH #146)

  • Enable tilde expansion in ~/.tigrc "source" commands. (GH #168)

  • Introduce the stash view, bound to the y keybinding. (GH #169, #174)

Bug fixes:

  • Fix blame and status to work in directories starting with a dot. (GH #172)

  • Reload current branch name when reloading the status view. (GH #93)

  • Fix compile errors on old Solaris. (GH #97)

  • Reload HEAD info when reloading the stage view. (GH #104, #93)

  • Fix disappearing branch labels after external commands. (GH #148)

  • Fix diff view display for staged/unstaged changes when using d.

  • Fix display of status messages when toggling view options. (GH #111)

  • Fix illegal memory access. (GH #98)

  • Fix display of all branches label in repos with short branch names.

  • Fix rendering glitch for branch names.

  • Do not apply diff styling to untracked files in the stage view. (GH #153)

  • Fix tree indentation for entries containing combining characters. (GH #170)

  • Ignore unrepresentable characters when transliterating text for rendering.

  • Transliterate text to output encoding before trimming it to avoid misalignment. (GH #86)

  • Introduce a more natural context-sensitive log display. (GH #155)

tig-1.1

Incompatibilities:

  • Disable diff move/copy detection by default, boosting diff performance on larger projects. Use git config diff.renames option (Git-wide) to set your preferred behavior. Environment variable TIG_DIFF_OPTS can be used to restore the old behavior.

  • Fix manual keybinding for stage-single-line. (GH #108)

  • Values set for author-width and filename-width will result in widths one character bigger than previously.

Improvements:

  • Typing a text in the prompt will be interpreted as a Tig command. Prefixing the command with a ! will execute this system command in an external pager. Entering a single key will execute the corresponding key binding.

  • Basic support for wrapping long line in pager, diff, and stage views. Enable using: set wrap-lines = yes. (GH #2)

  • User-defined commands prefixed with a ? means prompt before execution. Example: bind main B !?git rebase -i %(commit).

  • User-defined commands prefixed with a < means exit after execution. Example: bind main C !<git commit. (GH #66)

  • User-defined commands are executed unquoted to support shell commands. Example: bind generic I !@sh -c "echo -n %(commit) | xclip -selection c". (GH #65)

  • Configure case-insensitive searches using: set ignore-case = yes.

  • Add "deleted mode" line type for better diff coloring.

  • Open editor when requesting edit action from within a file diff.

  • Update AX_WITH_CURSES to build under Cygwin.

  • Improve tigrc(5) documentation. (Debian #682766)

  • Allow to build on Mac OS 10.7 without the configure script. (GH #25)

  • Add option to split the view vertically instead of horizontally. Example: ‘set vertical-split = yes’. (GH #76)

  • Add show-id and id-width options to configure the display of commit IDs in the main view and ID width in the blame view. (GH #77)

  • Allow to override Git based encoding to UTF-8 by setting i18n.commitencoding or gui.encoding.

  • Improve autobuild support to track generated files and work with autoreconf 2.61.

  • Commit IDs are read from stdin when --stdin is given; works for main and diff view, e.g. tig --no-walk --stdin < cherry-picks.txt.

  • Add option to disable focusing of the child view when it’s opened. Disable using: set focus-child = no. (GH #83)

  • Allow to open blob related with added content in a diff. (GH #91)

Bug fixes:

  • Fix commit graph regression when a path spec is specified. (GH #53)

  • Main view: only show staged/unstaged changes for the current branch.

  • Support submodules created with current version of git. (GH #54)

  • Fix diff status message for file diffs with no content changes.

  • Fix parent blaming when Tig is launched in subdirectory. (GH #70)

  • Do not show deleted branch when reloading the branch view.

tig-1.0

The master repository is git://github.com/jonas/tig.git, and the old master repository (http://jonas.nitro.dk/tig/tig.git) will be retired.

Improvements:

  • Use git-log(1)s default commit ordering. The old behavior can be restored by adding set commit-order = topo to ~/.tigrc.

  • Support staging of single lines. Bound to 1 default. (GH #21)

  • Use +<lineno> to open the initial view at an arbitrary line. (GH #20)

  • Add show-notes ~/.tigrc option. Notes are displayed by default.

  • Support jumping to specific SHAs in the main view.

  • Decorate replaced commits.

  • Display line numbers in main view.

  • Colorize binary diff stats. (GH #17)

  • Custom colorization of lines matching a string prefix (GH #16). Example configuration: color "Reported-by:" green default

  • Use Git’s color settings for the main, status and diff views. Put set read-git-colors = no in ~/.tigrc to disable.

  • Handle editor options with multiple arguments. (GH #12)

  • Show filename when running tig blame with copy detection. (GH #19)

  • Use source <path> command to load additional files from ~/.tigrc

  • User-defined commands prefixed with @ are run with no console output, e.g.

    bind generic 3 !@rm sys$command
  • Make display of space changes togglable in the diff and stage view. Bound to W by default.

  • Use per-file encoding specified in gitattributes(5) for blobs and unstaged files.

  • Obsolete commit-encoding option and pass --encoding=UTF-8 to revision commands.

  • Main view: show uncommitted changes as staged/unstaged commits. Can be disabled by putting set show-changes = no in ~/.tigrc.

  • Add %(prompt) external command variable, which will prompt for the argument value.

  • Log information about Git commands when the TIG_TRACE environment variable is set. Example: TIG_TRACE=/tmp/tig.log tig

  • Branch view: Show the title of the last commit.

  • Increase the author auto-abbreviation threshold to 10. (GH #49)

  • For old commits show number of years in relative dates. (GH #50)

Bug fixes:

  • Fix navigation behavior when going from branch to main view. (GH #38)

  • Fix segfault when sorting the tree view by author name.

  • Fix diff stat navigation for unmodified files with stat changes.

  • Show branches/refs which names are a substring of the current branch.

  • 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

Incompatibilities:

  • Remove support for the deprecated TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables.

Improvements:

  • Pressing enter on diff stat file lines will jump to file’s diff.

  • Naïvely color blame IDs to distinguish lines.

  • Document palette color options used for revision graph and blame IDs.

  • Add support for blaming diff lines.

  • Add diff-context option and bindings to increase the diff context in 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:

  • Expand browsing state variables for prompt. (LP #694780, Debian #635546)

  • Fix segfault when sorting the branch view by author.

  • Expand %(directory) to . for the root directory. (GH-3)

  • Accept utf-8 for the line-graphics option as indicated in the docs.

  • Use erasechar() to check for the correct backspace character.

tig-0.17

Improvements:

  • Start rewrite of the revision graph renderer. Three modes are supported UTF-8, ncurses line graphics, and ASCII. Also, enable revision graph rendering by default.

Bug fixes:

  • Fix ncurses 5.8 issue by passing non-zero column size to newwin().

  • Fix opening of diffs when browsing branches.

tig-0.16.2

Bug fixes:

  • Fix regression causing empty tree view.

  • Fix set_tabsize() compile error for older versions of ncurses.

tig-0.16.1

Improvements:

  • Add scroll-first-col action to jump to the first column. Bound to | by default.

  • Add status-untracked-dirs option to ignore unknown directories contents in the status view. On by default.

Bug fixes:

  • Fix tig show <commit> to show the provided commit.

  • Fix problem with empty diff views when file specs were passed on the command line.

  • Fix segfault when starting Tig in pager mode.

tig-0.16

Incompatibilities:

  • Encode everything internally as UTF-8. This can affect performance, but should in general improve handling of character lengths etc. Also, to properly handle UTF-8 environments use ncurses with wide character support.

  • The use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables has been deprecated. To allow configuration of the diff view, TIG_DIFF_OPTS can be used.

Improvements:

  • Plug several memory leaks.

  • Command line arguments are split into diff, revision, and file arguments and made available as %(diffargs), %(revargs), and %(fileargs). Diff view will limit diffs using %(fileargs).

  • Status view: update the file variable when a line is selected so %(file) works as expected.

  • Branch view: add %(branch) symbol providing access to the selected branch.

  • Branch view: add entry to browse all branches (uses git-log’s --all flag).

  • Abbreviation of author names can now be configured and toggled.

  • Mark detached heads with [HEAD].

  • Add support for displaying dates in local time.

Bug fixes:

  • Status view: fix usage from sub directories, which was broken by the changes made to support blame view from sub directories.

  • Fix text expansion to not truncate long lines

  • Fix parsing of boolean show-date values.

  • Fix relative date.

  • Fix unbind to behave as if the keybinding was never defined.

  • Fix unbind to also cover built-in run requests.

  • Fix parsing of unknown keymap names.

  • Blame view: fix parent blame to detect renames. It uses "previous" line info from the blame porcelain output added in Git version 1.6.3.

tig-0.15

Incompatibilities:

  • Setting the cursor color no longer automatically sets the text to bold. The old lazy behavior was a bug.

  • Remove check for git-repo-config, which was officially deprecated in Git version 1.5.4. The configure script no longer depends on Git being installed.

Improvements:

  • Provide the manual as a man page named tigmanual(7).

  • Add ability to toggle between showing shorter dates (without time info) and relative dates. Use D to toggle between date formats.

  • Show the active (instead of the default) keybindings in the help view. Furthermore, honor the keymap when suggesting actions in the help messages.

  • Add branch view for choosing which branch to display in the main view. Bound to H by default.

  • Tree view: show entry to parent directory (..) when running from subdirectory.

  • Tree view: sort entries by name, date or author. Toggling is bound to i by default, with I controlling whether or not to sort in ascending order.

  • Make height of the lower view in a split view configurable by setting the split-view-height variable to a number or a percentage. Defaults to 2/3 of the total view height.

  • Allow multiple text attributes for color commands:

    color cursor white blue underline bold

Bug fixes:

  • Blame view: fix loading of blame data when opened from the tree view and CWD is not the repo root. (Debian bug 540766)

  • Tree view: fix searching.

tig-0.14.1

Improvements:

  • Status view: improve "on branch" information inspired by the prompt code in Git’s bash completion script.

  • Colors for 256-capable terminals can be specified as colorN.

  • Entering a number in the prompt will jump to that line number.

  • Handle core.worktree by setting GIT_DIR and GIT_WORK_TREE.

  • Make behavior of horizontal scrolling configurable by setting the horizontal-scroll variable to a number or a percentage. Defaults to scrolling 50% of the view width.

Bug fixes:

  • Status view: show error when failing to open a file.

  • Status view: report failures to update a file.

  • Blame view: fix problem with uninitialized variable.

  • Blame view: use line number information when loading blame for specific commit.

  • Fix handling of quoted strings in the config file.

  • Fix horizontal scrolling glitches.

tig-0.14

Incompatibilities:

  • The screen-resize action has been deprecated. It had no real use for users and was never meant to be exposed.

  • The "tree-parent" action was renamed to "parent". Warnings will be emitted for transition.

  • Remove parsing of deprecated option -S and subcommands log and diff.

  • The "author" color replaces "main-author". Setting the latter will now set the "author" color.

Improvements:

  • Horizontal scrolling. Bound to Left/Right by default.

  • Read tigrc(5) options from Git configuration files using the syntax:

    [tig] show-rev-graph = true
    [tig "color"] cursor = yellow red bold
    [tig "bind"] generic = P parent
  • Tree view: avoid flickering when updating.

  • Tree view: annotate entries with commit information.

  • Tree & blob view: open any blob in an editor.

  • Stage & main view: restore view position when reloading.

  • Blame view: load blame for parent commit. For merge commits the parent is queried. Bound to , by default via the existing "parent" action.

  • Abbreviate author names to initials when the width of the author column is below 6 characters.

Bug fixes:

  • Tree view: fix memory corruption bug when updating.

  • Tree view: improve handling of empty trees.

  • Status view: fix reverting of unmerged files.

  • Fix regression for non-UTF-8 locales corrupting the view data.

  • Fix regression parsing multiple spaces in ~/.tigrc.

tig-0.13

Incompatibilities:

  • Commands from the environment (e.g. TIG_MAIN_CMD) will no longer have access to shell features, such as subshells and variable expansion. The easiest way to upgrade your configuration is to put such commands in a script file or as a Git alias.

Improvements:

  • Display repository references in the sorted order: tags, heads, tracked remotes, remotes.

  • Add bash completion for blame.

  • Tree view: edit files of the current branch.

  • Run requests: new identifiers %(directory), %(file), and %(ref)

  • Improve responsiveness and view loading speed by using select(2).

Bug fixes:

  • Separate blame revision and file argument by "--" to avoid problems.

  • Main view: fix redrawing of the last commit wrt. the revision graph.

  • Fix waiting for input after executing a run request in pager mode.

  • Status & stage view: refuse to open directories and deleted files.

  • Tree view: show error when requesting blame for all non-file entries.

  • Do not draw loading views, which are not displayed.

  • Fix launching of mergetool from a subdirectory.

tig-0.12.1

Improvements:

  • Status view: revert uncommitted diff chunks and unstaged files with changes. Bound to ! by default.

  • Main view: use --topo-order also when rev-list arguments are given on the command line.

  • Log view: support for refreshing.

Bug fixes:

  • Status view: use ls-files' --exclude-standard so user specific ignore rules are effective. The option was added in Git version 1.5.4.

  • Stage view: fix assertion failure triggered when updating while status view is not displayed.

  • Help view: avoid confusion by showing "(no key)" instead of "?" for unbound requests.

  • Reload repository references when refreshing the main (and log) view.

  • Do not maximize views when refreshing.

tig-0.12

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.

  • Main view: support for refreshing.

  • Main view: disable boundary commits by default. Use --boundary when they should be shown. (Debian bug 498628)

  • 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.

  • Add author-width option to customize the width of the author column. For example, put the following in ~/.tigrc: set author-width = 10

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.

  • Do not show incomplete boundary commits when --no-walk is used.

  • Documentation: Rename gitlink macro to support AsciiDoc 8.2.3.

  • Ignore pipe reads with errno "Success" reported after a signals, for example when refreshing doing background loading.

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 UTF-8 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.


tig-2.0.2/README.adoc000066400000000000000000000026541233303337700140760ustar00rootroot00000000000000Tig: text-mode interface for Git ================================ :docext: adoc image::https://secure.travis-ci.org/jonas/tig.png?branch=master[Build Status,link=http://travis-ci.org/jonas/tig] What is Tig? ------------ Tig is an ncurses-based text-mode interface for git. 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. 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) - Gitweb: http://repo.or.cz/w/tig.git[] - Q&A: http://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[]. Installation and News --------------------- Information on how to build and install Tig are found in link:INSTALL.{docext}[the installation instructions]. News about releases and latest features and bug fixes are found in link:NEWS.{docext}[the release notes]. tig-2.0.2/README.html000066400000000000000000000050521233303337700141270ustar00rootroot00000000000000

Tig: text-mode interface for Git

Build Status

What is Tig?

Tig is an ncurses-based text-mode interface for git. 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.

Resources

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.

Installation and News

Information on how to build and install Tig are found in the installation instructions.

News about releases and latest features and bug fixes are found in the release notes.

tig-2.0.2/acinclude.m4000066400000000000000000000045501233303337700144770ustar00rootroot00000000000000dnl 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 ]) tig-2.0.2/autogen.sh000077500000000000000000000007621233303337700143100ustar00rootroot00000000000000#!/bin/sh export WARNINGS="all" set -e # Ideally, we could just do this: # #${AUTORECONF:-autoreconf} -v -I tools # # Unfortunately, Autoconf 2.61's autoreconf(1) (found in Mac OS X 10.5 # Leapard) neglects to pass the -I on to aclocal(1), which is # precisely where we need it! So we do basically what it would have # done. run () { echo $0: running: "$@" "$@" } run ${ACLOCAL:-aclocal} -I tools run ${AUTOCONF:-autoconf} --include=tools run ${AUTOHEADER:-autoheader} --include=tools tig-2.0.2/compat/000077500000000000000000000000001233303337700135655ustar00rootroot00000000000000tig-2.0.2/compat/ansidecl.h000066400000000000000000000244761233303337700155350ustar00rootroot00000000000000/* ANSI and traditional C compatability macros Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2013 Free Software Foundation, Inc. This file is part of the GNU C Library. 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. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* ANSI and traditional C compatibility macros ANSI C is assumed if __STDC__ is #defined. Macro ANSI C definition Traditional C definition ----- ---- - ---------- ----------- - ---------- PTR `void *' `char *' const not defined `' volatile not defined `' signed not defined `' For ease of writing code which uses GCC extensions but needs to be portable to other compilers, we provide the GCC_VERSION macro that simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various wrappers around __attribute__. Also, __extension__ will be #defined to nothing if it doesn't work. See below. */ #ifndef _ANSIDECL_H #define _ANSIDECL_H 1 #ifdef __cplusplus extern "C" { #endif /* Every source file includes this file, so they will all get the switch for lint. */ /* LINTLIBRARY */ /* Using MACRO(x,y) in cpp #if conditionals does not work with some older preprocessors. Thus we can't define something like this: #define HAVE_GCC_VERSION(MAJOR, MINOR) \ (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR))) and then test "#if HAVE_GCC_VERSION(2,7)". So instead we use the macro below and test it against specific values. */ /* This macro simplifies testing whether we are using gcc, and if it is of a particular minimum version. (Both major & minor numbers are significant.) This macro will evaluate to 0 if we are not using gcc at all. */ #ifndef GCC_VERSION #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) #endif /* GCC_VERSION */ #if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) /* All known AIX compilers implement these things (but don't always define __STDC__). The RISC/OS MIPS compiler defines these things in SVR4 mode, but does not define __STDC__. */ /* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other C++ compilers, does not define __STDC__, though it acts as if this was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */ #define PTR void * #undef const #undef volatile #undef signed /* inline requires special treatment; it's in C99, and GCC >=2.7 supports it too, but it's not in C89. */ #undef inline #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__)) /* it's a keyword */ #else # if GCC_VERSION >= 2007 # define inline __inline__ /* __inline__ prevents -pedantic warnings */ # else # define inline /* nothing */ # endif #endif #else /* Not ANSI C. */ #define PTR char * /* some systems define these in header files for non-ansi mode */ #undef const #undef volatile #undef signed #undef inline #define const #define volatile #define signed #define inline #endif /* ANSI C. */ /* Define macros for some gcc attributes. This permits us to use the macros freely, and know that they will come into play for the version of gcc in which they are supported. */ #if (GCC_VERSION < 2007) # define __attribute__(x) #endif /* Attribute __malloc__ on functions was valid as of gcc 2.96. */ #ifndef ATTRIBUTE_MALLOC # if (GCC_VERSION >= 2096) # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) # else # define ATTRIBUTE_MALLOC # endif /* GNUC >= 2.96 */ #endif /* ATTRIBUTE_MALLOC */ /* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For g++ an attribute on a label must be followed by a semicolon. */ #ifndef ATTRIBUTE_UNUSED_LABEL # ifndef __cplusplus # if GCC_VERSION >= 2093 # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED # else # define ATTRIBUTE_UNUSED_LABEL # endif # else # if GCC_VERSION >= 4005 # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ; # else # define ATTRIBUTE_UNUSED_LABEL # endif # endif #endif /* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend couldn't parse attributes placed after the identifier name, and now the entire compiler is built with C++. */ #ifndef ATTRIBUTE_UNUSED #if GCC_VERSION >= 3004 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #else #define ATTRIBUTE_UNUSED #endif #endif /* ATTRIBUTE_UNUSED */ /* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the identifier name. */ #if ! defined(__cplusplus) || (GCC_VERSION >= 3004) # define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED #else /* !__cplusplus || GNUC >= 3.4 */ # define ARG_UNUSED(NAME) NAME #endif /* !__cplusplus || GNUC >= 3.4 */ #ifndef ATTRIBUTE_NORETURN #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) #endif /* ATTRIBUTE_NORETURN */ /* Attribute `nonnull' was valid as of gcc 3.3. */ #ifndef ATTRIBUTE_NONNULL # if (GCC_VERSION >= 3003) # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) # else # define ATTRIBUTE_NONNULL(m) # endif /* GNUC >= 3.3 */ #endif /* ATTRIBUTE_NONNULL */ /* Attribute `returns_nonnull' was valid as of gcc 4.9. */ #ifndef ATTRIBUTE_RETURNS_NONNULL # if (GCC_VERSION >= 4009) # define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) # else # define ATTRIBUTE_RETURNS_NONNULL # endif /* GNUC >= 4.9 */ #endif /* ATTRIBUTE_RETURNS_NONNULL */ /* Attribute `pure' was valid as of gcc 3.0. */ #ifndef ATTRIBUTE_PURE # if (GCC_VERSION >= 3000) # define ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define ATTRIBUTE_PURE # endif /* GNUC >= 3.0 */ #endif /* ATTRIBUTE_PURE */ /* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL. This was the case for the `printf' format attribute by itself before GCC 3.3, but as of 3.3 we need to add the `nonnull' attribute to retain this behavior. */ #ifndef ATTRIBUTE_PRINTF #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) #define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) #endif /* ATTRIBUTE_PRINTF */ /* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on a function pointer. Format attributes were allowed on function pointers as of gcc 3.1. */ #ifndef ATTRIBUTE_FPTR_PRINTF # if (GCC_VERSION >= 3001) # define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n) # else # define ATTRIBUTE_FPTR_PRINTF(m, n) # endif /* GNUC >= 3.1 */ # define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2) # define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3) # define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4) # define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5) # define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6) #endif /* ATTRIBUTE_FPTR_PRINTF */ /* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A NULL format specifier was allowed as of gcc 3.3. */ #ifndef ATTRIBUTE_NULL_PRINTF # if (GCC_VERSION >= 3003) # define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) # else # define ATTRIBUTE_NULL_PRINTF(m, n) # endif /* GNUC >= 3.3 */ # define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2) # define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3) # define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4) # define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5) # define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6) #endif /* ATTRIBUTE_NULL_PRINTF */ /* Attribute `sentinel' was valid as of gcc 3.5. */ #ifndef ATTRIBUTE_SENTINEL # if (GCC_VERSION >= 3005) # define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__)) # else # define ATTRIBUTE_SENTINEL # endif /* GNUC >= 3.5 */ #endif /* ATTRIBUTE_SENTINEL */ #ifndef ATTRIBUTE_ALIGNED_ALIGNOF # if (GCC_VERSION >= 3000) # define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m)))) # else # define ATTRIBUTE_ALIGNED_ALIGNOF(m) # endif /* GNUC >= 3.0 */ #endif /* ATTRIBUTE_ALIGNED_ALIGNOF */ /* Useful for structures whose layout must much some binary specification regardless of the alignment and padding qualities of the compiler. */ #ifndef ATTRIBUTE_PACKED # define ATTRIBUTE_PACKED __attribute__ ((packed)) #endif /* Attribute `hot' and `cold' was valid as of gcc 4.3. */ #ifndef ATTRIBUTE_COLD # if (GCC_VERSION >= 4003) # define ATTRIBUTE_COLD __attribute__ ((__cold__)) # else # define ATTRIBUTE_COLD # endif /* GNUC >= 4.3 */ #endif /* ATTRIBUTE_COLD */ #ifndef ATTRIBUTE_HOT # if (GCC_VERSION >= 4003) # define ATTRIBUTE_HOT __attribute__ ((__hot__)) # else # define ATTRIBUTE_HOT # endif /* GNUC >= 4.3 */ #endif /* ATTRIBUTE_HOT */ /* We use __extension__ in some places to suppress -pedantic warnings about GCC extensions. This feature didn't work properly before gcc 2.8. */ #if GCC_VERSION < 2008 #define __extension__ #endif /* This is used to declare a const variable which should be visible outside of the current compilation unit. Use it as EXPORTED_CONST int i = 1; This is because the semantics of const are different in C and C++. "extern const" is permitted in C but it looks strange, and gcc warns about it when -Wc++-compat is not used. */ #ifdef __cplusplus #define EXPORTED_CONST extern const #else #define EXPORTED_CONST const #endif /* Be conservative and only use enum bitfields with C++ or GCC. FIXME: provide a complete autoconf test for buggy enum bitfields. */ #ifdef __cplusplus #define ENUM_BITFIELD(TYPE) enum TYPE #elif (GCC_VERSION > 2000) #define ENUM_BITFIELD(TYPE) __extension__ enum TYPE #else #define ENUM_BITFIELD(TYPE) unsigned int #endif #ifdef __cplusplus } #endif #endif /* ansidecl.h */ tig-2.0.2/compat/compat.h000066400000000000000000000025171233303337700152260ustar00rootroot00000000000000/* Copyright (c) 2006-2013 Jonas Fonseca * Copyright (c) 2013 Drew Northup * * 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. */ #ifndef TIG_COMPAT_H #define TIG_COMPAT_H #ifndef HAVE_CONFIG_H /* * Enable inclusion of header files checked by configure. */ #define HAVE_STDINT_H #define HAVE_STDLIB_H #define HAVE_STRING_H #define HAVE_SYS_TIME_H #define HAVE_UNISTD_H #endif /* * XXX: Compatibility code must never be enabled by default. */ #ifdef NO_MKSTEMPS #define mkstemps compat_mkstemps int compat_mkstemps(char *pattern, int suffix_len); #endif #ifdef NO_SETENV #define setenv compat_setenv int compat_setenv(const char *name, const char *value, int replace); #endif #ifdef NO_STRNDUP #include #define strndup compat_strndup char *compat_strndup(const char *s, size_t n); #endif #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/compat/hashtab.c000066400000000000000000000711441233303337700153520ustar00rootroot00000000000000/* An expandable hash tables datatype. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2009, 2010 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This package implements basic hash table functionality. It is possible to search for an entry, create an entry and destroy an entry. Elements in the table are generic pointers. The size of the table is not fixed; if the occupancy of the table grows too high the hash table will be expanded. The abstract data implementation is based on generalized Algorithm D from Knuth's book "The art of computer programming". Hash table is expanded by creation of new hash table and transferring elements from the old table to the new table. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "compat.h" #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_MALLOC_H #include #endif #ifdef HAVE_LIMITS_H #include #endif #ifdef HAVE_INTTYPES_H #include #endif #ifdef HAVE_STDINT_H #include #endif #include #include "ansidecl.h" #include "hashtab.h" #ifndef CHAR_BIT #define CHAR_BIT 8 #endif static unsigned int higher_prime_index (unsigned long); static hashval_t htab_mod_1 (hashval_t, hashval_t, hashval_t, int); static hashval_t htab_mod (hashval_t, htab_t); static hashval_t htab_mod_m2 (hashval_t, htab_t); static hashval_t hash_pointer (const void *); static int eq_pointer (const void *, const void *); static int htab_expand (htab_t); static PTR *find_empty_slot_for_expand (htab_t, hashval_t); /* At some point, we could make these be NULL, and modify the hash-table routines to handle NULL specially; that would avoid function-call overhead for the common case of hashing pointers. */ htab_hash htab_hash_pointer = hash_pointer; htab_eq htab_eq_pointer = eq_pointer; /* Table of primes and multiplicative inverses. Note that these are not minimally reduced inverses. Unlike when generating code to divide by a constant, we want to be able to use the same algorithm all the time. All of these inverses (are implied to) have bit 32 set. For the record, here's the function that computed the table; it's a vastly simplified version of the function of the same name from gcc. */ #if 0 unsigned int ceil_log2 (unsigned int x) { int i; for (i = 31; i >= 0 ; --i) if (x > (1u << i)) return i+1; abort (); } unsigned int choose_multiplier (unsigned int d, unsigned int *mlp, unsigned char *shiftp) { unsigned long long mhigh; double nx; int lgup, post_shift; int pow, pow2; int n = 32, precision = 32; lgup = ceil_log2 (d); pow = n + lgup; pow2 = n + lgup - precision; nx = ldexp (1.0, pow) + ldexp (1.0, pow2); mhigh = nx / d; *shiftp = lgup - 1; *mlp = mhigh; return mhigh >> 32; } #endif struct prime_ent { hashval_t prime; hashval_t inv; hashval_t inv_m2; /* inverse of prime-2 */ hashval_t shift; }; static struct prime_ent const prime_tab[] = { { 7, 0x24924925, 0x9999999b, 2 }, { 13, 0x3b13b13c, 0x745d1747, 3 }, { 31, 0x08421085, 0x1a7b9612, 4 }, { 61, 0x0c9714fc, 0x15b1e5f8, 5 }, { 127, 0x02040811, 0x0624dd30, 6 }, { 251, 0x05197f7e, 0x073260a5, 7 }, { 509, 0x01824366, 0x02864fc8, 8 }, { 1021, 0x00c0906d, 0x014191f7, 9 }, { 2039, 0x0121456f, 0x0161e69e, 10 }, { 4093, 0x00300902, 0x00501908, 11 }, { 8191, 0x00080041, 0x00180241, 12 }, { 16381, 0x000c0091, 0x00140191, 13 }, { 32749, 0x002605a5, 0x002a06e6, 14 }, { 65521, 0x000f00e2, 0x00110122, 15 }, { 131071, 0x00008001, 0x00018003, 16 }, { 262139, 0x00014002, 0x0001c004, 17 }, { 524287, 0x00002001, 0x00006001, 18 }, { 1048573, 0x00003001, 0x00005001, 19 }, { 2097143, 0x00004801, 0x00005801, 20 }, { 4194301, 0x00000c01, 0x00001401, 21 }, { 8388593, 0x00001e01, 0x00002201, 22 }, { 16777213, 0x00000301, 0x00000501, 23 }, { 33554393, 0x00001381, 0x00001481, 24 }, { 67108859, 0x00000141, 0x000001c1, 25 }, { 134217689, 0x000004e1, 0x00000521, 26 }, { 268435399, 0x00000391, 0x000003b1, 27 }, { 536870909, 0x00000019, 0x00000029, 28 }, { 1073741789, 0x0000008d, 0x00000095, 29 }, { 2147483647, 0x00000003, 0x00000007, 30 }, /* Avoid "decimal constant so large it is unsigned" for 4294967291. */ { 0xfffffffb, 0x00000006, 0x00000008, 31 } }; /* The following function returns an index into the above table of the nearest prime number which is greater than N, and near a power of two. */ static unsigned int higher_prime_index (unsigned long n) { unsigned int low = 0; unsigned int high = sizeof(prime_tab) / sizeof(prime_tab[0]); while (low != high) { unsigned int mid = low + (high - low) / 2; if (n > prime_tab[mid].prime) low = mid + 1; else high = mid; } /* If we've run out of primes, abort. */ if (n > prime_tab[low].prime) { fprintf (stderr, "Cannot find prime bigger than %lu\n", n); abort (); } return low; } /* Returns non-zero if P1 and P2 are equal. */ static int eq_pointer (const PTR p1, const PTR p2) { return p1 == p2; } /* The parens around the function names in the next two definitions are essential in order to prevent macro expansions of the name. The bodies, however, are expanded as expected, so they are not recursive definitions. */ /* Return the current size of given hash table. */ #define htab_size(htab) ((htab)->size) size_t (htab_size) (htab_t htab) { return htab_size (htab); } /* Return the current number of elements in given hash table. */ #define htab_elements(htab) ((htab)->n_elements - (htab)->n_deleted) size_t (htab_elements) (htab_t htab) { return htab_elements (htab); } /* Return X % Y. */ static inline hashval_t htab_mod_1 (hashval_t x, hashval_t y, hashval_t inv, int shift) { /* The multiplicative inverses computed above are for 32-bit types, and requires that we be able to compute a highpart multiply. */ #ifdef UNSIGNED_64BIT_TYPE __extension__ typedef UNSIGNED_64BIT_TYPE ull; if (sizeof (hashval_t) * CHAR_BIT <= 32) { hashval_t t1, t2, t3, t4, q, r; t1 = ((ull)x * inv) >> 32; t2 = x - t1; t3 = t2 >> 1; t4 = t1 + t3; q = t4 >> shift; r = x - (q * y); return r; } #endif /* Otherwise just use the native division routines. */ return x % y; } /* Compute the primary hash for HASH given HTAB's current size. */ static inline hashval_t htab_mod (hashval_t hash, htab_t htab) { const struct prime_ent *p = &prime_tab[htab->size_prime_index]; return htab_mod_1 (hash, p->prime, p->inv, p->shift); } /* Compute the secondary hash for HASH given HTAB's current size. */ static inline hashval_t htab_mod_m2 (hashval_t hash, htab_t htab) { const struct prime_ent *p = &prime_tab[htab->size_prime_index]; return 1 + htab_mod_1 (hash, p->prime - 2, p->inv_m2, p->shift); } /* This function creates table with length slightly longer than given source length. Created hash table is initiated as empty (all the hash table entries are HTAB_EMPTY_ENTRY). The function returns the created hash table, or NULL if memory allocation fails. */ htab_t htab_create_alloc (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f, htab_alloc alloc_f, htab_free free_f) { return htab_create_typed_alloc (size, hash_f, eq_f, del_f, alloc_f, alloc_f, free_f); } /* As above, but uses the variants of ALLOC_F and FREE_F which accept an extra argument. */ htab_t htab_create_alloc_ex (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f, void *alloc_arg, htab_alloc_with_arg alloc_f, htab_free_with_arg free_f) { htab_t result; unsigned int size_prime_index; size_prime_index = higher_prime_index (size); size = prime_tab[size_prime_index].prime; result = (htab_t) (*alloc_f) (alloc_arg, 1, sizeof (struct htab)); if (result == NULL) return NULL; result->entries = (PTR *) (*alloc_f) (alloc_arg, size, sizeof (PTR)); if (result->entries == NULL) { if (free_f != NULL) (*free_f) (alloc_arg, result); return NULL; } result->size = size; result->size_prime_index = size_prime_index; result->hash_f = hash_f; result->eq_f = eq_f; result->del_f = del_f; result->alloc_arg = alloc_arg; result->alloc_with_arg_f = alloc_f; result->free_with_arg_f = free_f; return result; } /* @deftypefn Supplemental htab_t htab_create_typed_alloc (size_t @var{size}, @ htab_hash @var{hash_f}, htab_eq @var{eq_f}, htab_del @var{del_f}, @ htab_alloc @var{alloc_tab_f}, htab_alloc @var{alloc_f}, @ htab_free @var{free_f}) This function creates a hash table that uses two different allocators @var{alloc_tab_f} and @var{alloc_f} to use for allocating the table itself and its entries respectively. This is useful when variables of different types need to be allocated with different allocators. The created hash table is slightly larger than @var{size} and it is initially empty (all the hash table entries are @code{HTAB_EMPTY_ENTRY}). The function returns the created hash table, or @code{NULL} if memory allocation fails. @end deftypefn */ htab_t htab_create_typed_alloc (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f, htab_alloc alloc_tab_f, htab_alloc alloc_f, htab_free free_f) { htab_t result; unsigned int size_prime_index; size_prime_index = higher_prime_index (size); size = prime_tab[size_prime_index].prime; result = (htab_t) (*alloc_tab_f) (1, sizeof (struct htab)); if (result == NULL) return NULL; result->entries = (PTR *) (*alloc_f) (size, sizeof (PTR)); if (result->entries == NULL) { if (free_f != NULL) (*free_f) (result); return NULL; } result->size = size; result->size_prime_index = size_prime_index; result->hash_f = hash_f; result->eq_f = eq_f; result->del_f = del_f; result->alloc_f = alloc_f; result->free_f = free_f; return result; } /* Update the function pointers and allocation parameter in the htab_t. */ void htab_set_functions_ex (htab_t htab, htab_hash hash_f, htab_eq eq_f, htab_del del_f, PTR alloc_arg, htab_alloc_with_arg alloc_f, htab_free_with_arg free_f) { htab->hash_f = hash_f; htab->eq_f = eq_f; htab->del_f = del_f; htab->alloc_arg = alloc_arg; htab->alloc_with_arg_f = alloc_f; htab->free_with_arg_f = free_f; } /* These functions exist solely for backward compatibility. */ #undef htab_create /* htab_t htab_create (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f) { return htab_create_alloc (size, hash_f, eq_f, del_f, xcalloc, free); } htab_t htab_try_create (size_t size, htab_hash hash_f, htab_eq eq_f, htab_del del_f) { return htab_create_alloc (size, hash_f, eq_f, del_f, calloc, free); } */ /* This function frees all memory allocated for given hash table. Naturally the hash table must already exist. */ void htab_delete (htab_t htab) { size_t size = htab_size (htab); PTR *entries = htab->entries; int i; if (htab->del_f) for (i = size - 1; i >= 0; i--) if (entries[i] != HTAB_EMPTY_ENTRY && entries[i] != HTAB_DELETED_ENTRY) (*htab->del_f) (entries[i]); if (htab->free_f != NULL) { (*htab->free_f) (entries); (*htab->free_f) (htab); } else if (htab->free_with_arg_f != NULL) { (*htab->free_with_arg_f) (htab->alloc_arg, entries); (*htab->free_with_arg_f) (htab->alloc_arg, htab); } } /* This function clears all entries in the given hash table. */ void htab_empty (htab_t htab) { size_t size = htab_size (htab); PTR *entries = htab->entries; int i; if (htab->del_f) for (i = size - 1; i >= 0; i--) if (entries[i] != HTAB_EMPTY_ENTRY && entries[i] != HTAB_DELETED_ENTRY) (*htab->del_f) (entries[i]); /* Instead of clearing megabyte, downsize the table. */ if (size > 1024*1024 / sizeof (PTR)) { int nindex = higher_prime_index (1024 / sizeof (PTR)); int nsize = prime_tab[nindex].prime; if (htab->free_f != NULL) (*htab->free_f) (htab->entries); else if (htab->free_with_arg_f != NULL) (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries); if (htab->alloc_with_arg_f != NULL) htab->entries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, sizeof (PTR *)); else htab->entries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR *)); htab->size = nsize; htab->size_prime_index = nindex; } else memset (entries, 0, size * sizeof (PTR)); htab->n_deleted = 0; htab->n_elements = 0; } /* Similar to htab_find_slot, but without several unwanted side effects: - Does not call htab->eq_f when it finds an existing entry. - Does not change the count of elements/searches/collisions in the hash table. This function also assumes there are no deleted entries in the table. HASH is the hash value for the element to be inserted. */ static PTR * find_empty_slot_for_expand (htab_t htab, hashval_t hash) { hashval_t index = htab_mod (hash, htab); size_t size = htab_size (htab); PTR *slot = htab->entries + index; hashval_t hash2; if (*slot == HTAB_EMPTY_ENTRY) return slot; else if (*slot == HTAB_DELETED_ENTRY) abort (); hash2 = htab_mod_m2 (hash, htab); for (;;) { index += hash2; if (index >= size) index -= size; slot = htab->entries + index; if (*slot == HTAB_EMPTY_ENTRY) return slot; else if (*slot == HTAB_DELETED_ENTRY) abort (); } } /* The following function changes size of memory allocated for the entries and repeatedly inserts the table elements. The occupancy of the table after the call will be about 50%. Naturally the hash table must already exist. Remember also that the place of the table entries is changed. If memory allocation failures are allowed, this function will return zero, indicating that the table could not be expanded. If all goes well, it will return a non-zero value. */ static int htab_expand (htab_t htab) { PTR *oentries; PTR *olimit; PTR *p; PTR *nentries; size_t nsize, osize, elts; unsigned int oindex, nindex; oentries = htab->entries; oindex = htab->size_prime_index; osize = htab->size; olimit = oentries + osize; elts = htab_elements (htab); /* Resize only when table after removal of unused elements is either too full or too empty. */ if (elts * 2 > osize || (elts * 8 < osize && osize > 32)) { nindex = higher_prime_index (elts * 2); nsize = prime_tab[nindex].prime; } else { nindex = oindex; nsize = osize; } if (htab->alloc_with_arg_f != NULL) nentries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, sizeof (PTR *)); else nentries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR *)); if (nentries == NULL) return 0; htab->entries = nentries; htab->size = nsize; htab->size_prime_index = nindex; htab->n_elements -= htab->n_deleted; htab->n_deleted = 0; p = oentries; do { PTR x = *p; if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY) { PTR *q = find_empty_slot_for_expand (htab, (*htab->hash_f) (x)); *q = x; } p++; } while (p < olimit); if (htab->free_f != NULL) (*htab->free_f) (oentries); else if (htab->free_with_arg_f != NULL) (*htab->free_with_arg_f) (htab->alloc_arg, oentries); return 1; } /* This function searches for a hash table entry equal to the given element. It cannot be used to insert or delete an element. */ PTR htab_find_with_hash (htab_t htab, const PTR element, hashval_t hash) { hashval_t index, hash2; size_t size; PTR entry; htab->searches++; size = htab_size (htab); index = htab_mod (hash, htab); entry = htab->entries[index]; if (entry == HTAB_EMPTY_ENTRY || (entry != HTAB_DELETED_ENTRY && (*htab->eq_f) (entry, element))) return entry; hash2 = htab_mod_m2 (hash, htab); for (;;) { htab->collisions++; index += hash2; if (index >= size) index -= size; entry = htab->entries[index]; if (entry == HTAB_EMPTY_ENTRY || (entry != HTAB_DELETED_ENTRY && (*htab->eq_f) (entry, element))) return entry; } } /* Like htab_find_slot_with_hash, but compute the hash value from the element. */ PTR htab_find (htab_t htab, const PTR element) { return htab_find_with_hash (htab, element, (*htab->hash_f) (element)); } /* This function searches for a hash table slot containing an entry equal to the given element. To delete an entry, call this with insert=NO_INSERT, then call htab_clear_slot on the slot returned (possibly after doing some checks). To insert an entry, call this with insert=INSERT, then write the value you want into the returned slot. When inserting an entry, NULL may be returned if memory allocation fails. */ PTR * htab_find_slot_with_hash (htab_t htab, const PTR element, hashval_t hash, enum insert_option insert) { PTR *first_deleted_slot; hashval_t index, hash2; size_t size; PTR entry; size = htab_size (htab); if (insert == INSERT && size * 3 <= htab->n_elements * 4) { if (htab_expand (htab) == 0) return NULL; size = htab_size (htab); } index = htab_mod (hash, htab); htab->searches++; first_deleted_slot = NULL; entry = htab->entries[index]; if (entry == HTAB_EMPTY_ENTRY) goto empty_entry; else if (entry == HTAB_DELETED_ENTRY) first_deleted_slot = &htab->entries[index]; else if ((*htab->eq_f) (entry, element)) return &htab->entries[index]; hash2 = htab_mod_m2 (hash, htab); for (;;) { htab->collisions++; index += hash2; if (index >= size) index -= size; entry = htab->entries[index]; if (entry == HTAB_EMPTY_ENTRY) goto empty_entry; else if (entry == HTAB_DELETED_ENTRY) { if (!first_deleted_slot) first_deleted_slot = &htab->entries[index]; } else if ((*htab->eq_f) (entry, element)) return &htab->entries[index]; } empty_entry: if (insert == NO_INSERT) return NULL; if (first_deleted_slot) { htab->n_deleted--; *first_deleted_slot = HTAB_EMPTY_ENTRY; return first_deleted_slot; } htab->n_elements++; return &htab->entries[index]; } /* Like htab_find_slot_with_hash, but compute the hash value from the element. */ PTR * htab_find_slot (htab_t htab, const PTR element, enum insert_option insert) { return htab_find_slot_with_hash (htab, element, (*htab->hash_f) (element), insert); } /* This function deletes an element with the given value from hash table (the hash is computed from the element). If there is no matching element in the hash table, this function does nothing. */ void htab_remove_elt (htab_t htab, PTR element) { htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element)); } /* This function deletes an element with the given value from hash table. If there is no matching element in the hash table, this function does nothing. */ void htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash) { PTR *slot; slot = htab_find_slot_with_hash (htab, element, hash, NO_INSERT); if (*slot == HTAB_EMPTY_ENTRY) return; if (htab->del_f) (*htab->del_f) (*slot); *slot = HTAB_DELETED_ENTRY; htab->n_deleted++; } /* This function clears a specified slot in a hash table. It is useful when you've already done the lookup and don't want to do it again. */ void htab_clear_slot (htab_t htab, PTR *slot) { if (slot < htab->entries || slot >= htab->entries + htab_size (htab) || *slot == HTAB_EMPTY_ENTRY || *slot == HTAB_DELETED_ENTRY) abort (); if (htab->del_f) (*htab->del_f) (*slot); *slot = HTAB_DELETED_ENTRY; htab->n_deleted++; } /* This function scans over the entire hash table calling CALLBACK for each live entry. If CALLBACK returns false, the iteration stops. INFO is passed as CALLBACK's second argument. */ void htab_traverse_noresize (htab_t htab, htab_trav callback, PTR info) { PTR *slot; PTR *limit; slot = htab->entries; limit = slot + htab_size (htab); do { PTR x = *slot; if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY) if (!(*callback) (slot, info)) break; } while (++slot < limit); } /* Like htab_traverse_noresize, but does resize the table when it is too empty to improve effectivity of subsequent calls. */ void htab_traverse (htab_t htab, htab_trav callback, PTR info) { size_t size = htab_size (htab); if (htab_elements (htab) * 8 < size && size > 32) htab_expand (htab); htab_traverse_noresize (htab, callback, info); } /* Return the fraction of fixed collisions during all work with given hash table. */ double htab_collisions (htab_t htab) { if (htab->searches == 0) return 0.0; return (double) htab->collisions / (double) htab->searches; } /* Hash P as a null-terminated string. Copied from gcc/hashtable.c. Zack had the following to say with respect to applicability, though note that unlike hashtable.c, this hash table implementation re-hashes rather than chain buckets. http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01021.html From: Zack Weinberg Date: Fri, 17 Aug 2001 02:15:56 -0400 I got it by extracting all the identifiers from all the source code I had lying around in mid-1999, and testing many recurrences of the form "H_n = H_{n-1} * K + c_n * L + M" where K, L, M were either prime numbers or the appropriate identity. This was the best one. I don't remember exactly what constituted "best", except I was looking at bucket-length distributions mostly. So it should be very good at hashing identifiers, but might not be as good at arbitrary strings. I'll add that it thoroughly trounces the hash functions recommended for this use at http://burtleburtle.net/bob/hash/index.html, both on speed and bucket distribution. I haven't tried it against the function they just started using for Perl's hashes. */ hashval_t htab_hash_string (const PTR p) { const unsigned char *str = (const unsigned char *) p; hashval_t r = 0; unsigned char c; while ((c = *str++) != 0) r = r * 67 + c - 113; return r; } /* DERIVED FROM: -------------------------------------------------------------------- lookup2.c, by Bob Jenkins, December 1996, Public Domain. hash(), hash2(), hash3, and mix() are externally useful functions. Routines to test the hash are included if SELF_TEST is defined. You can use this free for any purpose. It has no warranty. -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- mix -- mix 3 32-bit values reversibly. For every delta with one or two bit set, and the deltas of all three high bits or all three low bits, whether the original value of a,b,c is almost all zero or is uniformly distributed, * If mix() is run forward or backward, at least 32 bits in a,b,c have at least 1/4 probability of changing. * If mix() is run forward, every bit of c will change between 1/3 and 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.) mix() was built out of 36 single-cycle latency instructions in a structure that could supported 2x parallelism, like so: a -= b; a -= c; x = (c>>13); b -= c; a ^= x; b -= a; x = (a<<8); c -= a; b ^= x; c -= b; x = (b>>13); ... Unfortunately, superscalar Pentiums and Sparcs can't take advantage of that parallelism. They've also turned some of those single-cycle latency instructions into multi-cycle latency instructions. Still, this is the fastest good hash I could find. There were about 2^^68 to choose from. I only looked at a billion or so. -------------------------------------------------------------------- */ /* same, but slower, works on systems that might have 8 byte hashval_t's */ #define mix(a,b,c) \ { \ a -= b; a -= c; a ^= (c>>13); \ b -= c; b -= a; b ^= (a<< 8); \ c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \ a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \ b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \ c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \ a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \ b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \ c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \ } /* -------------------------------------------------------------------- hash() -- hash a variable-length key into a 32-bit value k : the key (the unaligned variable-length array of bytes) len : the length of the key, counting by bytes level : can be any 4-byte value Returns a 32-bit value. Every bit of the key affects every bit of the return value. Every 1-bit and 2-bit delta achieves avalanche. About 36+6len instructions. The best hash table sizes are powers of 2. There is no need to do mod a prime (mod is sooo slow!). If you need less than 32 bits, use a bitmask. For example, if you need only 10 bits, do h = (h & hashmask(10)); In which case, the hash table should have hashsize(10) elements. If you are hashing n strings (ub1 **)k, do it like this: for (i=0, h=0; i= 12) /* aligned */ { a += *(hashval_t *)(k+0); b += *(hashval_t *)(k+4); c += *(hashval_t *)(k+8); mix(a,b,c); k += 12; len -= 12; } else /* unaligned */ #endif while (len >= 12) { a += (k[0] +((hashval_t)k[1]<<8) +((hashval_t)k[2]<<16) +((hashval_t)k[3]<<24)); b += (k[4] +((hashval_t)k[5]<<8) +((hashval_t)k[6]<<16) +((hashval_t)k[7]<<24)); c += (k[8] +((hashval_t)k[9]<<8) +((hashval_t)k[10]<<16)+((hashval_t)k[11]<<24)); mix(a,b,c); k += 12; len -= 12; } /*------------------------------------- handle the last 11 bytes */ c += length; switch(len) /* all the case statements fall through */ { case 11: c+=((hashval_t)k[10]<<24); case 10: c+=((hashval_t)k[9]<<16); case 9 : c+=((hashval_t)k[8]<<8); /* the first byte of c is reserved for the length */ case 8 : b+=((hashval_t)k[7]<<24); case 7 : b+=((hashval_t)k[6]<<16); case 6 : b+=((hashval_t)k[5]<<8); case 5 : b+=k[4]; case 4 : a+=((hashval_t)k[3]<<24); case 3 : a+=((hashval_t)k[2]<<16); case 2 : a+=((hashval_t)k[1]<<8); case 1 : a+=k[0]; /* case 0: nothing left to add */ } mix(a,b,c); /*-------------------------------------------- report the result */ return c; } /* Returns a hash code for pointer P. Simplified version of evahash */ static hashval_t hash_pointer (const PTR p) { intptr_t v = (intptr_t) p; unsigned a, b, c; a = b = 0x9e3779b9; a += v >> (sizeof (intptr_t) * CHAR_BIT / 2); b += v & (((intptr_t) 1 << (sizeof (intptr_t) * CHAR_BIT / 2)) - 1); c = 0x42135234; mix (a, b, c); return c; } tig-2.0.2/compat/hashtab.h000066400000000000000000000163551233303337700153620ustar00rootroot00000000000000/* 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). 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. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This package implements basic hash table functionality. It is possible to search for an entry, create an entry and destroy an entry. Elements in the table are generic pointers. The size of the table is not fixed; if the occupancy of the table grows too high the hash table will be expanded. The abstract data implementation is based on generalized Algorithm D from Knuth's book "The art of computer programming". Hash table is expanded by creation of new hash table and transferring elements from the old table to the new table. */ #ifndef __HASHTAB_H__ #define __HASHTAB_H__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "ansidecl.h" #ifndef GTY #define GTY(X) #endif /* The type for a hash code. */ typedef unsigned int hashval_t; /* Callback function pointer types. */ /* Calculate hash of a table entry. */ typedef hashval_t (*htab_hash) (const void *); /* Compare a table entry with a possible entry. The entry already in the table always comes first, so the second element can be of a different type (but in this case htab_find and htab_find_slot cannot be used; instead the variants that accept a hash value must be used). */ typedef int (*htab_eq) (const void *, const void *); /* 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 htab_traverse. Return 1 to continue scan, 0 to stop. */ typedef int (*htab_trav) (void **, void *); /* Memory-allocation function, with the same functionality as calloc(). Iff it returns NULL, the hash table implementation will pass an error code back to the user, so if your code doesn't handle errors, best if you use xcalloc instead. */ typedef void *(*htab_alloc) (size_t, size_t); /* We also need a free() routine. */ typedef void (*htab_free) (void *); /* Memory allocation and deallocation; variants which take an extra argument. */ typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t); typedef void (*htab_free_with_arg) (void *, void *); /* This macro defines reserved value for empty table entry. */ #define HTAB_EMPTY_ENTRY ((PTR) 0) /* This macro defines reserved value for table entry which contained a deleted element. */ #define HTAB_DELETED_ENTRY ((PTR) 1) /* Hash tables are of the following type. The structure (implementation) of this type is not needed for using the hash tables. All work with hash table should be executed only through functions mentioned below. The size of this structure is subject to change. */ struct GTY(()) htab { /* Pointer to hash function. */ htab_hash hash_f; /* Pointer to comparison function. */ htab_eq eq_f; /* Pointer to cleanup function. */ htab_del del_f; /* Table itself. */ void ** GTY ((use_param, length ("%h.size"))) entries; /* Current size (in entries) of the hash table. */ size_t size; /* Current number of elements including also deleted elements. */ size_t n_elements; /* Current number of deleted elements in the table. */ size_t n_deleted; /* The following member is used for debugging. Its value is number of all calls of `htab_find_slot' for the hash table. */ unsigned int searches; /* The following member is used for debugging. Its value is number of collisions fixed for time of work with the hash table. */ unsigned int collisions; /* Pointers to allocate/free functions. */ htab_alloc alloc_f; htab_free free_f; /* Alternate allocate/free functions, which take an extra argument. */ void * GTY((skip)) alloc_arg; htab_alloc_with_arg alloc_with_arg_f; htab_free_with_arg free_with_arg_f; /* Current size (in entries) of the hash table, as an index into the table of primes. */ unsigned int size_prime_index; }; typedef struct htab *htab_t; /* An enum saying whether we insert into the hash table or not. */ enum insert_option {NO_INSERT, INSERT}; /* The prototypes of the package functions. */ extern htab_t htab_create_alloc (size_t, htab_hash, htab_eq, htab_del, htab_alloc, htab_free); extern htab_t htab_create_alloc_ex (size_t, htab_hash, htab_eq, htab_del, void *, htab_alloc_with_arg, htab_free_with_arg); extern htab_t htab_create_typed_alloc (size_t, htab_hash, htab_eq, htab_del, htab_alloc, htab_alloc, htab_free); /* Backward-compatibility functions. */ extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del); extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del); extern void htab_set_functions_ex (htab_t, htab_hash, htab_eq, htab_del, void *, htab_alloc_with_arg, htab_free_with_arg); extern void htab_delete (htab_t); extern void htab_empty (htab_t); extern void * htab_find (htab_t, const void *); extern void ** htab_find_slot (htab_t, const void *, enum insert_option); extern void * htab_find_with_hash (htab_t, const void *, hashval_t); extern void ** htab_find_slot_with_hash (htab_t, const void *, hashval_t, enum insert_option); extern void htab_clear_slot (htab_t, void **); extern void htab_remove_elt (htab_t, void *); extern void htab_remove_elt_with_hash (htab_t, void *, hashval_t); extern void htab_traverse (htab_t, htab_trav, void *); extern void htab_traverse_noresize (htab_t, htab_trav, void *); extern size_t htab_size (htab_t); extern size_t htab_elements (htab_t); extern double htab_collisions (htab_t); /* A hash function for pointers. */ extern htab_hash htab_hash_pointer; /* An equality function for pointers. */ extern htab_eq htab_eq_pointer; /* A hash function for null-terminated strings. */ extern hashval_t htab_hash_string (const void *); /* An iterative hash function for arbitrary data. */ extern hashval_t iterative_hash (const void *, size_t, hashval_t); /* Shorthand for hashing something with an intrinsic size. */ #define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT) #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __HASHTAB_H */ tig-2.0.2/compat/mkstemps.c000066400000000000000000000074511233303337700156030ustar00rootroot00000000000000/* Copyright (C) 1991, 1992, 1996, 1998, 2004 Free Software Foundation, Inc. This file is derived from mkstemp.c from the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* * This file was copied on 2013-08-03 from: * https://raw.github.com/mirrors/gcc/master/libiberty/mkstemps.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "compat.h" #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif /* We need to provide a type for gcc_uint64_t. */ #ifdef __GNUC__ __extension__ typedef unsigned long long gcc_uint64_t; #else typedef unsigned long gcc_uint64_t; #endif #ifndef TMP_MAX #define TMP_MAX 16384 #endif #ifndef O_BINARY # define O_BINARY 0 #endif /* @deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len}) Generate a unique temporary file name from @var{pattern}. @var{pattern} has the form: @example @var{path}/ccXXXXXX@var{suffix} @end example @var{suffix_len} tells us how long @var{suffix} is (it can be zero length). The last six characters of @var{pattern} before @var{suffix} must be @samp{XXXXXX}; they are replaced with a string that makes the filename unique. Returns a file descriptor open on the file for reading and writing. @end deftypefn */ int compat_mkstemps (char *pattern, int suffix_len) { static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; static gcc_uint64_t value; #ifdef HAVE_GETTIMEOFDAY struct timeval tv; #endif char *XXXXXX; size_t len; int count; len = strlen (pattern); if ((int) len < 6 + suffix_len || strncmp (&pattern[len - 6 - suffix_len], "XXXXXX", 6)) { return -1; } XXXXXX = &pattern[len - 6 - suffix_len]; #ifdef HAVE_GETTIMEOFDAY /* Get some more or less random data. */ gettimeofday (&tv, NULL); value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); #else value += getpid (); #endif for (count = 0; count < TMP_MAX; ++count) { gcc_uint64_t v = value; int fd; /* Fill in the random bits. */ XXXXXX[0] = letters[v % 62]; v /= 62; XXXXXX[1] = letters[v % 62]; v /= 62; XXXXXX[2] = letters[v % 62]; v /= 62; XXXXXX[3] = letters[v % 62]; v /= 62; XXXXXX[4] = letters[v % 62]; v /= 62; XXXXXX[5] = letters[v % 62]; fd = open (pattern, O_BINARY|O_RDWR|O_CREAT|O_EXCL, 0600); if (fd >= 0) /* The file does not exist. */ return fd; if (errno != EEXIST #ifdef EISDIR && errno != EISDIR #endif ) /* Fatal error (EPERM, ENOSPC etc). Doesn't make sense to loop. */ break; /* This is a random value. It is only necessary that the next TMP_MAX values generated by adding 7777 to VALUE are different with (module 2^32). */ value += 7777; } /* We return the null string if we can't find a unique file name. */ pattern[0] = '\0'; return -1; } tig-2.0.2/compat/setenv.c000066400000000000000000000110471233303337700152400ustar00rootroot00000000000000/* Copyright (C) 1992, 1995, 1996, 1997, 2002, 2011 Free Software Foundation, Inc. This file based on setenv.c in the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* * This file was borrowed on 2013-08-08 from: * https://raw.github.com/mirrors/gcc/master/libiberty/setenv.c */ /* @deftypefn Supplemental int setenv (const char *@var{name}, @ const char *@var{value}, int @var{overwrite}) @deftypefnx Supplemental void unsetenv (const char *@var{name}) @code{setenv} adds @var{name} to the environment with value @var{value}. If the name was already present in the environment, the new value will be stored only if @var{overwrite} is nonzero. The companion @code{unsetenv} function removes @var{name} from the environment. This implementation is not safe for multithreaded code. @end deftypefn */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "compat.h" #include /* For `size_t' */ #include /* For `NULL' */ #include #if !defined(errno) && !defined(HAVE_DECL_ERRNO) extern int errno; #endif #define __set_errno(ev) ((errno) = (ev)) #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #define __environ environ #ifndef HAVE_DECL_ENVIRON extern char **environ; #endif /* LOCK and UNLOCK are defined as no-ops. This makes the tig * implementation MT-Unsafe. */ #define LOCK #define UNLOCK /* Below this point, it's verbatim code from the glibc-2.0 implementation */ /* If this variable is not a null pointer we allocated the current environment. */ static char **last_environ; int compat_setenv (const char *name, const char *value, int replace) { register char **ep = 0; register size_t size; const size_t namelen = strlen (name); const size_t vallen = strlen (value) + 1; LOCK; size = 0; if (__environ != NULL) { for (ep = __environ; *ep != NULL; ++ep) if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') break; else ++size; } if (__environ == NULL || *ep == NULL) { char **new_environ; if (__environ == last_environ && __environ != NULL) /* We allocated this space; we can extend it. */ new_environ = (char **) realloc (last_environ, (size + 2) * sizeof (char *)); else new_environ = (char **) malloc ((size + 2) * sizeof (char *)); if (new_environ == NULL) { UNLOCK; return -1; } new_environ[size] = (char *) malloc (namelen + 1 + vallen); if (new_environ[size] == NULL) { free ((char *) new_environ); __set_errno (ENOMEM); UNLOCK; return -1; } if (__environ != last_environ) memcpy ((char *) new_environ, (char *) __environ, size * sizeof (char *)); memcpy (new_environ[size], name, namelen); new_environ[size][namelen] = '='; memcpy (&new_environ[size][namelen + 1], value, vallen); new_environ[size + 1] = NULL; last_environ = __environ = new_environ; } else if (replace) { size_t len = strlen (*ep); if (len + 1 < namelen + 1 + vallen) { /* The existing string is too short; malloc a new one. */ char *new_string = (char *) malloc (namelen + 1 + vallen); if (new_string == NULL) { UNLOCK; return -1; } *ep = new_string; } memcpy (*ep, name, namelen); (*ep)[namelen] = '='; memcpy (&(*ep)[namelen + 1], value, vallen); } UNLOCK; return 0; } #if 0 void compat_unsetenv (const char *name) { const size_t len = strlen (name); char **ep; LOCK; for (ep = __environ; *ep; ++ep) if (!strncmp (*ep, name, len) && (*ep)[len] == '=') { /* Found it. Remove this pointer by moving later ones back. */ char **dp = ep; do dp[0] = dp[1]; while (*dp++); /* Continue the loop in case NAME appears again. */ } UNLOCK; } #endif tig-2.0.2/compat/strndup.c000066400000000000000000000027271233303337700154400ustar00rootroot00000000000000/* Implement the strndup function. Copyright (C) 2005 Free Software Foundation, Inc. Written by Kaveh R. Ghazi . This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* * This file was borrowed on 2014-05-05 and adapted from: * https://raw.github.com/mirrors/gcc/master/libiberty/strndup.c */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "compat.h" #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif char * compat_strndup (const char *s, size_t n) { char *result; size_t len = strlen (s); if (n < len) len = n; result = (char *) malloc (len + 1); if (!result) return 0; result[len] = '\0'; return (char *) memcpy (result, s, len); } tig-2.0.2/config.make.in000066400000000000000000000012651233303337700150170ustar00rootroot00000000000000# -*- makefile-gmake -*- prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ docdir = @docdir@ datarootdir = @datarootdir@ sysconfdir = @sysconfdir@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ -DHAVE_CONFIG_H LDFLAGS = @LDFLAGS@ LDLIBS = @LIBS@ @CURSES_LIB@ ASCIIDOC = @ASCIIDOC@ XMLTO = @XMLTO@ DOCBOOK2PDF = @DOCBOOK2PDF@ # Special compatibility features @NO_MKSTEMPS@ NO_MKSTEMPS = y @NO_SETENV@ NO_SETENV = y @NO_STRNDUP@ NO_STRNDUP = y # Add config.h as a dependency for all object files CONFIG_H = config.h config.status: configure ./config.status --recheck config.h config.make: config.status ./config.status $@ config.make: config.make.in tig-2.0.2/configure.ac000066400000000000000000000023661233303337700145770ustar00rootroot00000000000000AC_INIT([tig],[0],[jonas.fonseca@gmail.com],[tig]) AC_LANG([C]) AC_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(src) dnl Document where we keep our .m4 file. AC_CONFIG_MACRO_DIR([tools]) dnl Make sure aclocal actually found it! m4_pattern_forbid([^AX_]) AC_PROG_CC AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_DECLS([environ]) AC_CHECK_DECLS([errno], [], [], [#include ]) dnl Checks for compatibility flags AC_CHECK_FUNCS([mkstemps], [AC_SUBST([NO_MKSTEMPS], ["#"])]) AC_CHECK_FUNCS([setenv], [AC_SUBST([NO_SETENV], ["#"])]) AC_CHECK_FUNCS([strndup], [AC_SUBST([NO_STRNDUP], ["#"])]) AX_WITH_CURSES case "$ax_cv_ncurses" in "no") AC_MSG_ERROR([ncurses not found]) esac case "$ax_cv_ncursesw" in "no") 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) AX_LIB_READLINE(6.2) AM_ICONV AC_CHECK_PROGS(ASCIIDOC, [asciidoc], [false]) AC_CHECK_PROGS(XMLTO, [xmlto], [false]) AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf], [false]) AC_CONFIG_FILES([config.make]) AC_OUTPUT dnl Local Variables: dnl eval: (font-lock-add-keywords nil '(("\\_> ~/.tigrc bind generic B view-blame bind generic G view-grep bind generic H view-refs bind generic S view-status bind generic r screen-redraw bind generic w scroll-page-up bind generic s scroll-page-down bind generic b move-page-up bind generic g :toggle commit-title-graph bind generic i :toggle sort-field bind generic . :toggle line-number bind generic :toggle file-name bind generic F :toggle commit-title-refs tig-2.0.2/contrib/config.make000077500000000000000000000007431233303337700160550ustar00rootroot00000000000000# Example config.make. # Install files under /usr/local instead of under $HOME. prefix=/usr/local # Use ncursesw. LDLIBS = -lncursesw CPPFLAGS = -DHAVE_NCURSESW_CURSES_H # Use readline. #LDLIBS += -lreadline #CPPFLAGS += -DHAVE_READLINE # Uncomment to enable work-around for missing setenv(). #NO_SETENV=y # Uncomment to enable work-around for missing mkstemps(). #NO_MKSTEMPS=y # Uncomment to not include built-in tigrc inside the binary. #NO_BUILTIN_TIGRC=y # vim: ft=make: tig-2.0.2/contrib/config.make-CYGWIN_NT-6.1000077500000000000000000000007241233303337700177550ustar00rootroot00000000000000# Example configuration for Cygwin (`uname -s` = CYGWIN_NT-6.1) # # Use ncursesw. NCURSESW_LIBS = $(shell ncursesw5-config --libs 2>/dev/null) HAS_ICONV = $(shell test -e "/usr/include/iconv.h" && echo true) ifeq ($(NCURSESW_LIBS),) $(error Please install the libncursesw-devel package) endif ifneq ($(HAS_ICONV),true) $(error Please install the libiconv-devel package) endif LDLIBS = $(NCURSESW_LIBS) -liconv CPPFLAGS = -DHAVE_NCURSESW_CURSES_H # vim: ft=make: tig-2.0.2/contrib/config.make-Darwin000066400000000000000000000006221233303337700172700ustar00rootroot00000000000000# Example configuration for Darwin / Mac OS X. # Work-around for Homebrew-based xmlto. export XML_CATALOG_FILES=/usr/local/etc/xml/catalog LDLIBS = -lcurses -liconv CPPFLAGS = -DHAVE_CURSES_H READLINE_DIR = $(wildcard /usr/local/opt/readline) ifneq ($(READLINE_DIR),) LDFLAGS = -L$(READLINE_DIR)/lib CFLAGS = -I$(READLINE_DIR)/include -DHAVE_READLINE LDLIBS += -lreadline endif # vim: ft=make: tig-2.0.2/contrib/tig-completion.bash000077500000000000000000000127131233303337700175420ustar00rootroot00000000000000## # bash completion support for tig # # Copyright (C) 2007-2010 Jonas fonseca # Copyright (C) 2006,2007 Shawn Pearce # # Based git's git-completion.sh: http://repo.or.cz/w/git/fastimport.git # # The contained completion routines provide support for completing: # # *) local and remote branch names # *) local and remote tag names # *) tig 'subcommands' # *) tree paths within 'ref:path/to/file' expressions # # To use these routines: # # 1) Copy this file to somewhere (e.g. ~/.tig-completion.sh). # 2) Added the following line to your .bashrc: # source ~/.tig-completion.sh # # 3) You may want to make sure the git executable is available # in your PATH before this script is sourced, as some caching # is performed while the script loads. If git isn't found # at source time then all lookups will be done on demand, # which may be slightly slower. # __tigdir () { if [ -z "$1" ]; then if [ -n "$__git_dir" ]; then echo "$__git_dir" elif [ -d .git ]; then echo .git else git rev-parse --git-dir 2>/dev/null fi elif [ -d "$1/.git" ]; then echo "$1/.git" else echo "$1" fi } _tigcomp () { local all c s=$'\n' IFS=' '$'\t'$'\n' local cur="${COMP_WORDS[COMP_CWORD]}" if [ $# -gt 2 ]; then cur="$3" fi for c in $1; do case "$c$4" in --*=*) all="$all$c$4$s" ;; *.) all="$all$c$4$s" ;; *) all="$all$c$4 $s" ;; esac done IFS=$s COMPREPLY=($(compgen -P "$2" -W "$all" -- "$cur")) return } __tig_refs () { local cmd i is_hash=y dir="$(__tigdir "$1")" if [ -d "$dir" ]; then for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do if [ -e "$dir/$i" ]; then echo $i; fi done for i in $(git --git-dir="$dir" \ for-each-ref --format='%(refname)' \ refs/tags refs/heads refs/remotes); do case "$i" in refs/tags/*) echo "${i#refs/tags/}" ;; refs/heads/*) echo "${i#refs/heads/}" ;; refs/remotes/*) echo "${i#refs/remotes/}" ;; *) echo "$i" ;; esac done return fi for i in $(git-ls-remote "$dir" 2>/dev/null); do case "$is_hash,$i" in y,*) is_hash=n ;; n,*^{}) is_hash=y ;; n,refs/tags/*) is_hash=y; echo "${i#refs/tags/}" ;; n,refs/heads/*) is_hash=y; echo "${i#refs/heads/}" ;; n,refs/remotes/*) is_hash=y; echo "${i#refs/remotes/}" ;; n,*) is_hash=y; echo "$i" ;; esac done } __tig_complete_file () { local pfx ls ref cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in ?*:*) ref="${cur%%:*}" cur="${cur#*:}" case "$cur" in ?*/*) pfx="${cur%/*}" cur="${cur##*/}" ls="$ref:$pfx" pfx="$pfx/" ;; *) ls="$ref" ;; esac COMPREPLY=($(compgen -P "$pfx" \ -W "$(git --git-dir="$(__tigdir)" ls-tree "$ls" \ | sed '/^100... blob /s,^.* ,, /^040000 tree /{ s,^.* ,, s,$,/, } s/^.* //')" \ -- "$cur")) ;; *) _tigcomp "$(__tig_refs)" ;; esac } __tig_complete_revlist () { local pfx cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in *...*) pfx="${cur%...*}..." cur="${cur#*...}" _tigcomp "$(__tig_refs)" "$pfx" "$cur" ;; *..*) pfx="${cur%..*}.." cur="${cur#*..}" _tigcomp "$(__tig_refs)" "$pfx" "$cur" ;; *.) _tigcomp "$cur." ;; *) _tigcomp "$(__tig_refs)" ;; esac } _tig_options () { local cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in --pretty=*) _tigcomp " oneline short medium full fuller email raw " "" "${cur##--pretty=}" return ;; --*) _tigcomp " --max-count= --max-age= --since= --after= --min-age= --before= --until= --root --not --topo-order --date-order --no-merges --abbrev-commit --abbrev= --relative-date --author= --committer= --grep= --all-match --pretty= --name-status --name-only --not --all --help --version " return ;; -*) _tigcomp "-v -h" return ;; esac __tig_complete_revlist } _tig_blame () { local reply="" ref=HEAD cur="${COMP_WORDS[COMP_CWORD]}" if test "$COMP_CWORD" -lt 3; then reply="$(__tig_refs)" else ref="${COMP_WORDS[2]}" fi reply="$reply $(git --git-dir="$(__tigdir)" ls-tree "$ref" \ | sed '/^100... blob /s,^.* ,, /^040000 tree /{ s,^.* ,, s,$,/, } s/^.* //')" _tigcomp "$reply" } _tig_show () { local cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in --pretty=*) _tigcomp " oneline short medium full fuller email raw " "" "${cur##--pretty=}" return ;; --*) _tigcomp "--pretty=" return ;; esac __tig_complete_file } _tig () { local i c=1 command __tig_dir while [ $c -lt $COMP_CWORD ]; do i="${COMP_WORDS[c]}" case "$i" in --) command="log"; break;; -*) ;; *) command="$i"; break ;; esac c=$((++c)) done if [ $c -eq $COMP_CWORD -a -z "$command" ]; then case "${COMP_WORDS[COMP_CWORD]}" in --*=*) COMPREPLY=() ;; -*) _tig_options ;; *) _tigcomp "blame status show log stash grep $(__tig_refs)" ;; esac return fi case "$command" in blame) _tig_blame ;; show) _tig_show ;; status) ;; *) _tigcomp " $(__tig_complete_file) $(__tig_refs) " ;; esac } # Detect if current shell is ZSH, and if so, load this file in bash # compatibility mode. if [ -n "$ZSH_VERSION" ]; then autoload bashcompinit bashcompinit fi complete -o default -o nospace -F _tig tig # The following are necessary only for Cygwin, and only are needed # 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 fi tig-2.0.2/contrib/tig.spec.in000066400000000000000000000046411233303337700160130ustar00rootroot00000000000000# -*- mode: rpm-spec-mode; encoding: utf-8; -*- # Pass '--without docs' to rpmbuild if you don't want the documentation to be build Summary: Tig: text-mode interface for git Name: tig Version: @@VERSION@@ Release: @@RELEASE@@%{?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 BuildRequires: ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: git-core, ncurses %description Tig is a git repository browser that additionally can act as a pager for output from various git commands. When browsing repositories, it uses the underlying git commands to present the user with various views, such as summarized revision log and showing the commit with the log message, diffstat, and the diff. Using it as a pager, it will display input from stdin and colorize it. %prep %setup -q %build %configure CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}" %{__make} %{_smp_mflags} \ prefix=%{_prefix} \ all %{!?_without_docs: doc-man doc-html} %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}" %{__make} %{_smp_mflags} DESTDIR=$RPM_BUILD_ROOT \ prefix=%{_prefix} bindir=%{_bindir} mandir=%{_mandir} \ install %{!?_without_docs: install-doc-man} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_bindir}/* %{_sysconfdir}/* %doc README.adoc COPYING INSTALL.adoc NEWS.adoc contrib/tig-completion.bash %{!?_without_docs: %{_mandir}/man1/*.1*} %{!?_without_docs: %{_mandir}/man5/*.5*} %{!?_without_docs: %{_mandir}/man7/*.7*} %{!?_without_docs: %doc doc/*.html} %{?_without_docs: %doc doc/*.txt} %changelog * Sun 23 Feb 2014 Jonas Fonseca - Add tigrc installed in /etc * Tue Jan 8 2013 Joakim Sernbrant - Added configure * Thu Aug 16 2012 Victor Foitzik - Now also packaging man(7) pages * Sat Jun 23 2007 Jonas Fonseca - Include tig bash completion script * Fri Jun 1 2007 Jakub Narebski - Include documentation sources for --without docs - Remove PDF version of manual from being build and installed * Mon May 28 2007 Jakub Narebski - Initial tig spec file tig-2.0.2/doc/000077500000000000000000000000001233303337700130475ustar00rootroot00000000000000tig-2.0.2/doc/asciidoc.conf000066400000000000000000000027171233303337700155030ustar00rootroot00000000000000[macros] (?su)[\\]?(?Pmanpage):(?P\S*?)\[(?P.*?)\]= ifdef::backend-docbook[] [manpage-inlinemacro] {0%{target}} {0#} {0#{target}{0}} {0#} endif::backend-docbook[] ifdef::backend-xhtml11[] [manpage-inlinemacro] {target}{0?({0})} endif::backend-xhtml11[] ifdef::doctype-manpage[] ifdef::backend-docbook[] [header] template::[header-declarations] {mantitle} {manvolnum} Tig {version} Tig Manual {manname} {manpurpose} # The following two small workarounds insert a simple paragraph after screen # [listingblock] {title} | {title#} [verseblock] {title} {title%} {title#} | {title#} endif::backend-docbook[] endif::doctype-manpage[] ifdef::readme[] # No header or footers for README.html [header]

{doctitle}

[footer]
[replacements] (^|[^-\\])--($|[^-])=\1--\2 endif::readme[] tig-2.0.2/doc/manual.adoc000066400000000000000000000534721233303337700151670ustar00rootroot00000000000000ifndef::doctype-manpage[] The Tig Manual ============== Jonas Fonseca endif::doctype-manpage[] This is the manual for Tig, the ncurses-based text-mode interface for git. Tig allows you to browse changes in a Git repository and can additionally act as a pager for output of various Git commands. When used as a pager, it will display input from stdin and colorize it. When browsing repositories, Tig uses the underlying Git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff. ifdef::include-manual-toc[] *Table of Contents* include::manual.toc[] endif::include-manual-toc[] [[calling-conventions]] Calling Conventions ------------------- [[pager-mode]] Pager Mode ~~~~~~~~~~ If stdin is a pipe, any log or diff options will be ignored and the pager view will be opened loading data from stdin. The pager mode can be used for colorizing output from various Git commands. Example on how to colorize the output of git-show(1): ----------------------------------------------------------------------------- $ git show | tig ----------------------------------------------------------------------------- [[cmd-options]] Git Command Options ~~~~~~~~~~~~~~~~~~~ All Git command options specified on the command line will be passed to the given command and all will be shell quoted before they are passed to the shell. NOTE: If you specify options for the main view, you should not use the `--pretty` option as this option will be set automatically to the format expected by the main view. Example on how to view a commit and show both author and committer information: ----------------------------------------------------------------------------- $ tig show --pretty=fuller ----------------------------------------------------------------------------- See the section on <> for an introduction to revision options supported by the Git commands. For details on specific Git command options, refer to the man page of the command in question. [[viewer]] The Viewer ---------- The display consists of a status window on the last line of the screen and one or more views. The default is to only show one view at a time but it is possible to split both the main and log view to also show the commit diff. If you are in the log view and press 'Enter' when the current line is a commit line, such as: ----------------------------------------------------------------------------- commit 4d55caff4cc89335192f3e566004b4ceef572521 ----------------------------------------------------------------------------- You will split the view so that the log view is displayed in the top window and the diff view in the bottom window. You can switch between the two views by pressing 'Tab'. To maximize the log view again, simply press 'l'. [[views]] Views ~~~~~ Various 'views' of a repository are presented. Each view is based on output from an external command, most often 'git log', 'git diff', or 'git show'. The main view:: Is the default view, and it shows a one line summary of each commit in the chosen list of revisions. The summary includes commit date, author, and the first line of the log message. Additionally, any repository references, such as tags, will be shown. The log view:: Presents a more rich view of the revision log showing the whole log message and the diffstat. The diff view:: Shows either the diff of the current working tree, that is, what has changed since the last commit, or the commit diff complete with log message, diffstat and diff. The tree view:: Lists directory trees associated with the current revision allowing subdirectories to be descended or ascended and file blobs to be viewed. The blob view:: Displays the file content or "blob" of data associated with a file name. The blame view:: Displays the file content annotated or blamed by commits. The refs view:: Displays the branches, remotes and tags in the repository. The status view:: Displays status of files in the working tree and allows changes to be staged/unstaged as well as adding of untracked files. The stage view:: Displays diff changes for staged or unstaged files being tracked or file content of untracked files. The stash view:: Displays the list of stashes in the repository. The grep view:: Displays a list of files and all the lines that matches a search pattern. The pager view:: Is used for displaying both input from stdin and output from Git commands entered in the internal prompt. The help view:: Displays a quick reference of key bindings. [[commit-id]] Browsing State and User-defined Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The viewer keeps track of both what head and commit ID you are currently viewing. The commit ID will follow the cursor line and change every time you highlight a different commit. Whenever you reopen the diff view it will be reloaded, if the commit ID changed. The head ID is used when opening the main and log view to indicate from what revision to show history. Some of the commands used or provided by Tig can be configured. This goes for some of the <> as well as the <>. These user-defined commands can use arguments that refer to the current browsing state by using one of the following variables. .Browsing state variables [frame="none",grid="none",cols="25). In the stage view, when pressing this on a diff chunk line stages only that chunk for next commit, when not on a diff chunk line all changes in the displayed diff are staged. |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). |! |Checkout file with unstaged changes. This will reset the file to contain the content it had at last commit. |1 |Stage single diff line. |@ |Move to next chunk in the stage view. |] |Increase the diff context. |[ |Decrease the diff context. |============================================================================= [[cursor-nav]] Cursor Navigation ~~~~~~~~~~~~~~~~~ [frame="none",grid="none",cols="2<,8<",options="header"] |============================================================================= |Key |Action |k |Move cursor one line up. |j |Move cursor one line down. |PgUp,-,a |Move cursor one page up. |PgDown, Space |Move cursor one page down. |End |Jump to last line. |Home |Jump to first line. |============================================================================= [[view-scrolling]] Scrolling ~~~~~~~~~ [frame="none",grid="none",cols="2<,8<",options="header"] |============================================================================= |Key |Action |Insert |Scroll view one line up. |Delete |Scroll view one line down. |w |Scroll view one page up. |s |Scroll view one page down. |Left |Scroll view one column left. |Right |Scroll view one column right. |\| |Scroll view to the first column. |============================================================================= [[searching]] Searching ~~~~~~~~~ [frame="none",grid="none",cols="2<,8<",options="header"] |============================================================================= |Key |Action |/ |Search the view. Opens a prompt for entering search regexp to use. |? |Search backwards in the view. Also prompts for regexp. |n |Find next match for the current search regexp. |N |Find previous match for the current search regexp. |============================================================================= [[misc-keys]] Misc ~~~~ [frame="none",grid="none",cols="2<,8<",options="header"] |============================================================================= |Key |Action |Q |Quit. |r |Redraw screen. |z |Stop all background loading. This can be useful if you use Tig in a repository with a long history without limiting the revision log. |v |Show version. |o |Open option menu |. |Toggle line numbers on/off. |D |Toggle date display on/off/short/relative/local. |A |Toggle author display on/off/abbreviated/email/email user name. |g |Toggle revision graph visualization on/off. |~ |Toggle (line) graphics mode |F |Toggle reference display on/off (tag and branch names). |W |Toggle ignoring whitespace on/off for diffs |X |Toggle commit ID display on/off |% |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. |e |Open file in editor. |============================================================================= [[prompt]] Prompt ~~~~~~ [frame="none",grid="none",cols="2<,8<",options="header"] |============================================================================= |Key |Action |: |Jump to the specific line number, e.g. `:80`. |: |Jump to a specific commit, e.g. `:2f12bcc`. |: |Execute the corresponding key binding, e.g. `:q`. |:! |Execute a system command in a pager, e.g. `:!git log -p`. |: |Execute a Tig command, e.g. `:edit`. |============================================================================= [[external-commands]] External Commands ~~~~~~~~~~~~~~~~~ For more custom needs, external commands provide a way to easily execute a script or program. They are bound to keys and use information from the current browsing state, such as the current commit ID. Tig comes with the following built-in external commands: [frame="none",grid="none",cols="1<,1<,8<",options="header"] |============================================================================= |Keymap |Key |Action |main |C |git cherry-pick %(commit) |status |C |git commit |generic|G |git gc |============================================================================= [[refspec]] Revision Specification ---------------------- This section describes various ways to specify what revisions to display or otherwise limit the view to. Tig does not itself parse the described revision options so refer to the relevant Git man pages for further information. Relevant man pages besides git-log(1) are git-diff(1) and git-rev-list(1). You can tune the interaction with Git by making use of the options explained in this section. For example, by configuring the environment variable described in the section on <>. [[path-limiting]] Limit by Path Name ~~~~~~~~~~~~~~~~~~ If you are interested only in those revisions that made changes to a specific file (or even several files) list the files like this: ----------------------------------------------------------------------------- $ tig Makefile README ----------------------------------------------------------------------------- To avoid ambiguity with Tig's subcommands or repository references such as tag names, be sure to separate file names from other Git options using "`--`". So if you have a file named 'status' it will clash with the 'status' subcommand, and thus you will have to use: ----------------------------------------------------------------------------- $ tig -- status ----------------------------------------------------------------------------- [[date-number-limiting]] Limit by Date or Number ~~~~~~~~~~~~~~~~~~~~~~~ To speed up interaction with Git, you can limit the amount of commits to show both for the log and main view. Either limit by date using e.g. `--since=1.month` or limit by the number of commits using `-n400`. If you are only interested in changes that happened between two dates you can use: ----------------------------------------------------------------------------- $ tig --after="May 5th" --before="2006-05-16 15:44" ----------------------------------------------------------------------------- NOTE: If you want to avoid having to quote dates containing spaces you can use "." instead, e.g. `--after=May.5th`. [[commit-range-limiting]] Limiting by Commit Ranges ~~~~~~~~~~~~~~~~~~~~~~~~~ Alternatively, commits can be limited to a specific range, such as "all commits between 'tag-1.0' and 'tag-2.0'". For example: ----------------------------------------------------------------------------- $ tig tag-1.0..tag-2.0 ----------------------------------------------------------------------------- This way of commit limiting makes it trivial to only browse the commits which haven't been pushed to a remote branch. Assuming 'origin' is your upstream remote branch, using: ----------------------------------------------------------------------------- $ tig origin..HEAD ----------------------------------------------------------------------------- will list what will be pushed to the remote branch. Optionally, the ending 'HEAD' can be left out since it is implied. [[reachability-limiting]] Limiting by Reachability ~~~~~~~~~~~~~~~~~~~~~~~~ Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits reachable from 'tag-2.0' but not from 'tag-1.0'". Where reachability refers to what commits are ancestors (or part of the history) of the branch or tagged revision in question. If you prefer to specify which commit to preview in this way use the following: ----------------------------------------------------------------------------- $ tig tag-2.0 ^tag-1.0 ----------------------------------------------------------------------------- You can think of '^' as a negation operator. Using this alternate syntax, it is possible to further prune commits by specifying multiple branch cut offs. [[refspec-combi]] Combining Revisions Specification ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Revision options can to some degree be combined, which makes it possible to say "show at most 20 commits from within the last month that changed files under the Documentation/ directory." ----------------------------------------------------------------------------- $ tig --since=1.month -n20 -- Documentation/ ----------------------------------------------------------------------------- [[refspec-all]] Examining All Repository References ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In some cases, it can be useful to query changes across all references in a repository. An example is to ask "did any line of development in this repository change a particular file within the last week". This can be accomplished using: ----------------------------------------------------------------------------- $ tig --all --since=1.week -- Makefile ----------------------------------------------------------------------------- More Information ---------------- Please visit Tig's http://jonas.nitro.dk/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. [[copy-right]] Copyright --------- Copyright (c) 2006-2014 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. [[references]] See Also -------- Manpages: ifdef::version[] - manpage:tig[1] - manpage:tigrc[5] endif::version[] ifndef::version[] - link:tig.1.adoc[tig(1)] - link:tigrc.5.adoc[tigrc(5)] endif::version[] tig-2.0.2/doc/manual.html000066400000000000000000001572071233303337700152260ustar00rootroot00000000000000 The Tig Manual

This is the manual for Tig, the ncurses-based text-mode interface for git. Tig allows you to browse changes in a Git repository and can additionally act as a pager for output of various Git commands. When used as a pager, it will display input from stdin and colorize it.

When browsing repositories, Tig uses the underlying Git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff.

Table of Contents

1. Calling Conventions

1.1. Pager Mode

If stdin is a pipe, any log or diff options will be ignored and the pager view will be opened loading data from stdin. The pager mode can be used for colorizing output from various Git commands.

Example on how to colorize the output of git-show(1):

$ git show | tig

1.2. Git Command Options

All Git command options specified on the command line will be passed to the given command and all will be shell quoted before they are passed to the shell.

Note
If you specify options for the main view, you should not use the --pretty option as this option will be set automatically to the format expected by the main view.

Example on how to view a commit and show both author and committer information:

$ tig show --pretty=fuller

See the section on specifying revisions for an introduction to revision options supported by the Git commands. For details on specific Git command options, refer to the man page of the command in question.

2. The Viewer

The display consists of a status window on the last line of the screen and one or more views. The default is to only show one view at a time but it is possible to split both the main and log view to also show the commit diff.

If you are in the log view and press Enter when the current line is a commit line, such as:

commit 4d55caff4cc89335192f3e566004b4ceef572521

You will split the view so that the log view is displayed in the top window and the diff view in the bottom window. You can switch between the two views by pressing Tab. To maximize the log view again, simply press l.

2.1. Views

Various views of a repository are presented. Each view is based on output from an external command, most often git log, git diff, or git show.

The main view

Is the default view, and it shows a one line summary of each commit in the chosen list of revisions. The summary includes commit date, author, and the first line of the log message. Additionally, any repository references, such as tags, will be shown.

The log view

Presents a more rich view of the revision log showing the whole log message and the diffstat.

The diff view

Shows either the diff of the current working tree, that is, what has changed since the last commit, or the commit diff complete with log message, diffstat and diff.

The tree view

Lists directory trees associated with the current revision allowing subdirectories to be descended or ascended and file blobs to be viewed.

The blob view

Displays the file content or "blob" of data associated with a file name.

The blame view

Displays the file content annotated or blamed by commits.

The refs view

Displays the branches, remotes and tags in the repository.

The status view

Displays status of files in the working tree and allows changes to be staged/unstaged as well as adding of untracked files.

The stage view

Displays diff changes for staged or unstaged files being tracked or file content of untracked files.

The stash view

Displays the list of stashes in the repository.

The grep view

Displays a list of files and all the lines that matches a search pattern.

The pager view

Is used for displaying both input from stdin and output from Git commands entered in the internal prompt.

The help view

Displays a quick reference of key bindings.

2.2. Browsing State and User-defined Commands

The viewer keeps track of both what head and commit ID you are currently viewing. The commit ID will follow the cursor line and change every time you highlight a different commit. Whenever you reopen the diff view it will be reloaded, if the commit ID changed. The head ID is used when opening the main and log view to indicate from what revision to show history.

Some of the commands used or provided by Tig can be configured. This goes for some of the environment variables as well as the external commands. These user-defined commands can use arguments that refer to the current browsing state by using one of the following variables.

Table 1. Browsing state variables

%(head)

The currently viewed head ID. Defaults to HEAD

%(commit)

The currently selected commit ID.

%(blob)

The currently selected blob ID.

%(branch)

The currently selected branch name.

%(stash)

The currently selected stash name.

%(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.

%(revargs)

The revision arguments passed on the command line.

%(fileargs)

The file arguments passed on the command line.

%(cmdlineargs)

All other options passed on the command line.

%(diffargs)

The diff options from diff-options or TIG_DIFF_OPTS

%(prompt)

Prompt for the argument value.

Example user-defined commands:

  • Allow to amend the last commit:

    bind generic + !git commit --amend
  • Copy commit ID to clipboard:

    bind generic 9 !@sh -c "echo -n %(commit) | xclip -selection c"
  • Add/edit notes for the current commit used during a review:

    bind generic T !git notes edit %(commit)
  • Enter Git’s interactive add for fine-grained staging of file content:

    bind generic I !git add -i %(file)
  • Rebase current branch on top of the selected branch:

    bind refs 3 !git rebase -i %(branch)

2.3. Title Windows

Each view has a title window which shows the name of the view, current commit ID if available, and where the view is positioned:

[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)

By default, the title of the current view is highlighted using bold font. For long loading views (taking over 3 seconds) the time since loading started will be appended:

[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s

3. Environment Variables

Several options related to the interface with Git can be configured via environment options.

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:

TIGRC_USER

Path of the user configuration file.

TIGRC_SYSTEM

Path of the system wide configuration file.

3.2. Repository References

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

2006-03-26 19:42 Petr Baudis         | [cogito-0.17.1] Cogito 0.17.1

If you want to limit what branches are shown, say only show branches named master or those which start with the feature/ prefix, you can do it by setting the following variable:

$ TIG_LS_REMOTE="git ls-remote . master feature/*" tig

Or set the variable permanently in your environment.

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:

git ls-remote .

3.3. 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:

$ TIG_DIFF_OPTS="--relative-date" tig

Or set the variable permanently in your environment.

4. Default Keybindings

Below the default key bindings are shown.

4.1. View Switching

Key Action

m

Switch to main view.

d

Switch to diff view.

l

Switch to log view.

p

Switch to pager view.

t

Switch to (directory) tree view.

f

Switch to (file) blob view.

B

Switch to blame view.

H

Switch to refs view.

y

Switch to stash view.

h

Switch to help view

S

Switch to status view

c

Switch to stage view

4.2. View Manipulation

Key Action

q

Close view, if multiple views are open it will jump back to the previous view in the view stack. If it is the last open view it will quit. Use Q to quit all views at once.

Enter

This key is "context sensitive" depending on what view you are currently in. When in log view on a commit line or in the main view, split the view and show the commit diff. In the diff view pressing Enter will simply scroll the view one line down.

Tab

Switch to next view.

R

Reload and refresh the current view.

O

Maximize the current view to fill the whole display.

Up

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.

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 commit. For merges the parent is queried.

4.3. View Specific Actions

Key Action

u

Update status of file. In the status view, this allows you to add an untracked file or stage changes to a file for next commit (similar to running git-add <filename>). In the stage view, when pressing this on a diff chunk line stages only that chunk for next commit, when not on a diff chunk line all changes in the displayed diff are staged.

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).

!

Checkout file with unstaged changes. This will reset the file to contain the content it had at last commit.

1

Stage single diff line.

@

Move to next chunk in the stage view.

]

Increase the diff context.

[

Decrease the diff context.

4.4. Cursor Navigation

Key Action

k

Move cursor one line up.

j

Move cursor one line down.

PgUp,-,a

Move cursor one page up.

PgDown, Space

Move cursor one page down.

End

Jump to last line.

Home

Jump to first line.

4.5. Scrolling

Key Action

Insert

Scroll view one line up.

Delete

Scroll view one line down.

w

Scroll view one page up.

s

Scroll view one page down.

Left

Scroll view one column left.

Right

Scroll view one column right.

|

Scroll view to the first column.

4.6. Searching

Key Action

/

Search the view. Opens a prompt for entering search regexp to use.

?

Search backwards in the view. Also prompts for regexp.

n

Find next match for the current search regexp.

N

Find previous match for the current search regexp.

4.7. Misc

Key Action

Q

Quit.

r

Redraw screen.

z

Stop all background loading. This can be useful if you use Tig in a repository with a long history without limiting the revision log.

v

Show version.

o

Open option menu

.

Toggle line numbers on/off.

D

Toggle date display on/off/short/relative/local.

A

Toggle author display on/off/abbreviated/email/email user name.

g

Toggle revision graph visualization on/off.

~

Toggle (line) graphics mode

F

Toggle reference display on/off (tag and branch names).

W

Toggle ignoring whitespace on/off for diffs

X

Toggle commit ID display on/off

%

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.

e

Open file in editor.

4.8. Prompt

Key Action

:<number>

Jump to the specific line number, e.g. :80.

:<sha>

Jump to a specific commit, e.g. :2f12bcc.

:<x>

Execute the corresponding key binding, e.g. :q.

:!<command>

Execute a system command in a pager, e.g. :!git log -p.

:<action>

Execute a Tig command, e.g. :edit.

4.9. External Commands

For more custom needs, external commands provide a way to easily execute a script or program. They are bound to keys and use information from the current browsing state, such as the current commit ID. Tig comes with the following built-in external commands:

Keymap Key Action

main

C

git cherry-pick %(commit)

status

C

git commit

generic

G

git gc

5. Revision Specification

This section describes various ways to specify what revisions to display or otherwise limit the view to. Tig does not itself parse the described revision options so refer to the relevant Git man pages for further information. Relevant man pages besides git-log(1) are git-diff(1) and git-rev-list(1).

You can tune the interaction with Git by making use of the options explained in this section. For example, by configuring the environment variable described in the section on diff options.

5.1. Limit by Path Name

If you are interested only in those revisions that made changes to a specific file (or even several files) list the files like this:

$ tig Makefile README

To avoid ambiguity with Tig’s subcommands or repository references such as tag names, be sure to separate file names from other Git options using "--". So if you have a file named status it will clash with the status subcommand, and thus you will have to use:

$ tig -- status

5.2. Limit by Date or Number

To speed up interaction with Git, you can limit the amount of commits to show both for the log and main view. Either limit by date using e.g. --since=1.month or limit by the number of commits using -n400.

If you are only interested in changes that happened between two dates you can use:

$ tig --after="May 5th" --before="2006-05-16 15:44"
Note
If you want to avoid having to quote dates containing spaces you can use "." instead, e.g. --after=May.5th.

5.3. Limiting by Commit Ranges

Alternatively, commits can be limited to a specific range, such as "all commits between tag-1.0 and tag-2.0". For example:

$ tig tag-1.0..tag-2.0

This way of commit limiting makes it trivial to only browse the commits which haven’t been pushed to a remote branch. Assuming origin is your upstream remote branch, using:

$ tig origin..HEAD

will list what will be pushed to the remote branch. Optionally, the ending HEAD can be left out since it is implied.

5.4. Limiting by Reachability

Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits reachable from tag-2.0 but not from tag-1.0". Where reachability refers to what commits are ancestors (or part of the history) of the branch or tagged revision in question.

If you prefer to specify which commit to preview in this way use the following:

$ tig tag-2.0 ^tag-1.0

You can think of ^ as a negation operator. Using this alternate syntax, it is possible to further prune commits by specifying multiple branch cut offs.

5.5. Combining Revisions Specification

Revision options can to some degree be combined, which makes it possible to say "show at most 20 commits from within the last month that changed files under the Documentation/ directory."

$ tig --since=1.month -n20 -- Documentation/

5.6. Examining All Repository References

In some cases, it can be useful to query changes across all references in a repository. An example is to ask "did any line of development in this repository change a particular file within the last week". This can be accomplished using:

$ tig --all --since=1.week -- Makefile

6. More Information

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

7. Copyright

Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>

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.

8. See Also

Manpages:


tig-2.0.2/doc/tig.1000066400000000000000000000177241233303337700137270ustar00rootroot00000000000000'\" t .\" Title: tig .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 .\" Date: 05/08/2014 .\" Manual: Tig Manual .\" Source: Tig 2.0.2 .\" Language: English .\" .TH "TIG" "1" "05/08/2014" "Tig 2\&.0\&.2" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tig \- text\-mode interface for Git .SH "SYNOPSIS" .sp .nf tig [options] [revisions] [\-\-] [paths] tig log [options] [revisions] [\-\-] [paths] tig show [options] [revisions] [\-\-] [paths] tig blame [options] [rev] [\-\-] path tig grep [options] [pattern] tig stash tig status tig < [Git command output] .fi .sp .SH "DESCRIPTION" .sp 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\&. .PP show .RS 4 Open diff view using the given git\-show(1) options\&. .RE .PP blame .RS 4 Show given file annotated by commits\&. Takes zero or more git\-blame(1) options\&. Optionally limited from given revision\&. .RE .PP status .RS 4 Start up in status view\&. .RE .PP log .RS 4 Start up in log view, displaying git\-log(1) output\&. .RE .PP stash .RS 4 Start up in stash view\&. .RE .PP grep .RS 4 Open the grep view\&. Supports the same options as git\-grep(1)\&. .RE .PP + .RS 4 Show the first view with line visible and selected\&. .RE .PP \-v, \-\-version .RS 4 Show version and exit\&. .RE .PP \-h, \-\-help .RS 4 Show help message and exit\&. .RE .SH "PAGER MODE" .sp Tig enters pager mode when input is provided via stdin and supports the following subcommands and options: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} When the \fIshow\fR subcommand is specified and the \fI\-\-stdin\fR option is given, stdin is assumed to be a list of commit IDs and will be forwarded to the diff view\(cqs underlying git\-show(1) command\&. For example: .RE .sp .if n \{\ .RS 4 .\} .nf $ git rev\-list \-\-author=vivien HEAD | tig show \-\-stdin .fi .if n \{\ .RE .\} .sp .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} When \fI\-\-stdin\fR is given, stdin is assumed to be a list of commit IDs and will be forwarded to the main view\(cqs underlying git\-log(1) command\&. For example: .RE .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-no\-walk \-\-stdin < cherry\-picks\&.txt .fi .if n \{\ .RE .\} .sp .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} When \fI\-\-pretty=raw\fR is given, stdin is assumed to be a "pretty=raw" formatted output similar to that of git\-log(1)\&. For example: .RE .sp .if n \{\ .RS 4 .\} .nf $ git reflog \-\-pretty=raw | tig \-\-pretty=raw .fi .if n \{\ .RE .\} .sp .sp When no subcommands nor options are given, the pager view will be used for displaying the Git command input given on stdin\&. The pager view assumes the input is either from git\-log(1) or git\-diff(1) and will highlight it similar to the log and diff views\&. For example: .sp .if n \{\ .RS 4 .\} .nf $ git log \-Schange \-p \-\-raw | tig .fi .if n \{\ .RE .\} .sp .SH "EXAMPLES" .sp Display the list of commits for the current branch: .sp .if n \{\ .RS 4 .\} .nf $ tig .fi .if n \{\ .RE .\} .sp .sp Display commits from one or more branches: .sp .if n \{\ .RS 4 .\} .nf $ tig test master .fi .if n \{\ .RE .\} .sp .sp Display all branches: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-all .fi .if n \{\ .RE .\} .sp .sp Display differences between two branches: .sp .if n \{\ .RS 4 .\} .nf $ tig test\&.\&.master .fi .if n \{\ .RE .\} .sp .sp Display changes for sub\-module versions: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-submodule .fi .if n \{\ .RE .\} .sp .sp Display changes for a single file: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\- README .fi .if n \{\ .RE .\} .sp .sp Display contents of the README file in a specific revision: .sp .if n \{\ .RS 4 .\} .nf $ tig show tig\-0\&.8:README .fi .if n \{\ .RE .\} .sp .sp Display revisions between two dates for a specific file: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-after="2004\-01\-01" \-\-before="2006\-05\-16" \-\- README .fi .if n \{\ .RE .\} .sp .sp Blame file with copy detection enabled: .sp .if n \{\ .RS 4 .\} .nf $ tig blame \-C README .fi .if n \{\ .RE .\} .sp .sp Display the list of stashes: .sp .if n \{\ .RS 4 .\} .nf $ tig stash .fi .if n \{\ .RE .\} .sp .sp Grep all files for lines containing DEFINE_ENUM: .sp .if n \{\ .RS 4 .\} .nf $ tig grep \-p DEFINE_ENUM .fi .if n \{\ .RE .\} .sp .SH "ENVIRONMENT VARIABLES" .sp In addition to environment variables used by Git (e\&.g\&. GIT_DIR), Tig defines the ones below\&. The command related environment variables have access to the internal state of Tig via replacement variables, such as %(commit) and %(blob)\&. See \fBtigrc\fR(5) for a full list\&. .PP TIGRC_USER .RS 4 Path of the user configuration file (defaults to ~/\&.tigrc)\&. .RE .PP TIGRC_SYSTEM .RS 4 Path of the system wide configuration file (defaults to {sysconfdir}/tigrc)\&. Define to empty string to use built\-in configuration\&. .RE .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)\&. .RE .PP TIG_DIFF_OPTS .RS 4 The diff options to use in the diff view\&. The diff view uses git\-show(1) for formatting and always passes \-\-patch\-with\-stat\&. You may also set the diff\-options setting in the configuration file\&. .RE .PP TIG_TRACE .RS 4 Path for trace file where information about Git commands are logged\&. .RE .SH "FILES" .PP \fI~/\&.tigrc\fR .RS 4 User configuration file\&. See \fBtigrc\fR(5) for examples\&. .RE .PP \fI++SYSCONFDIR++/tigrc\fR .RS 4 System wide configuration file\&. .RE .PP \fI$GIT_DIR/config\fR, \*(Aq~/\&.gitconfig, \*(Aq++SYSCONFDIR++/gitconfig .RS 4 Git configuration files\&. Read on start\-up with the help of git\-config(1)\&. .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\&. .SH "COPYRIGHT" .sp Copyright (c) 2006\-2014 Jonas Fonseca <\m[blue]\fBjonas\&.fonseca@gmail\&.com\fR\m[]\&\s-2\u[3]\d\s+2> .sp 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\&. .SH "SEE ALSO" .sp \fBtigrc\fR(5), \fBtigmanual\fR(7), git(7) .SH "NOTES" .IP " 1." 4 home page .RS 4 \%http://jonas.nitro.dk/tig .RE .IP " 2." 4 main Git repository .RS 4 \%https://github.com/jonas/tig .RE .IP " 3." 4 jonas.fonseca@gmail.com .RS 4 \%mailto:jonas.fonseca@gmail.com .RE tig-2.0.2/doc/tig.1.adoc000066400000000000000000000176051233303337700146320ustar00rootroot00000000000000tig(1) ====== :docext: adoc :sysconfdir: /etc NAME ---- tig - text-mode interface for Git SYNOPSIS -------- [verse] _______________________________________________________________________ tig [options] [revisions] [--] [paths] tig log [options] [revisions] [--] [paths] tig show [options] [revisions] [--] [paths] tig blame [options] [rev] [--] path tig grep [options] [pattern] tig stash tig status tig < [Git command output] _______________________________________________________________________ DESCRIPTION ----------- 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. 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 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. show:: Open diff view using the given git-show(1) options. blame:: Show given file annotated by commits. Takes zero or more git-blame(1) options. Optionally limited from given revision. status:: Start up in status view. log:: Start up in log view, displaying git-log(1) output. stash:: Start up in stash view. grep:: Open the grep view. Supports the same options as git-grep(1). +:: Show the first view with line visible and selected. -v, --version:: Show version and exit. -h, --help:: Show help message and exit. PAGER MODE ---------- Tig enters pager mode when input is provided via stdin and supports the following subcommands and options: -- - When the 'show' subcommand is specified and the '--stdin' option is given, stdin is assumed to be a list of commit IDs and will be forwarded to the diff view's underlying git-show(1) command. For example: ----------------------------------------------------------------------------- $ git rev-list --author=vivien HEAD | tig show --stdin ----------------------------------------------------------------------------- - When '--stdin' is given, stdin is assumed to be a list of commit IDs and will be forwarded to the main view's underlying git-log(1) command. For example: ----------------------------------------------------------------------------- $ tig --no-walk --stdin < cherry-picks.txt ----------------------------------------------------------------------------- - When '--pretty=raw' is given, stdin is assumed to be a "pretty=raw" formatted output similar to that of git-log(1). For example: ----------------------------------------------------------------------------- $ git reflog --pretty=raw | tig --pretty=raw ----------------------------------------------------------------------------- -- When no subcommands nor options are given, the pager view will be used for displaying the Git command input given on stdin. The pager view assumes the input is either from git-log(1) or git-diff(1) and will highlight it similar to the log and diff views. For example: ----------------------------------------------------------------------------- $ git log -Schange -p --raw | tig ----------------------------------------------------------------------------- EXAMPLES -------- Display the list of commits for the current branch: ----------------------------------------------------------------------------- $ tig ----------------------------------------------------------------------------- Display commits from one or more branches: ----------------------------------------------------------------------------- $ tig test master ----------------------------------------------------------------------------- Display all branches: ----------------------------------------------------------------------------- $ tig --all ----------------------------------------------------------------------------- Display differences between two branches: ----------------------------------------------------------------------------- $ tig test..master ----------------------------------------------------------------------------- Display changes for sub-module versions: ----------------------------------------------------------------------------- $ tig --submodule ----------------------------------------------------------------------------- Display changes for a single file: ----------------------------------------------------------------------------- $ tig -- README ----------------------------------------------------------------------------- Display contents of the README file in a specific revision: ----------------------------------------------------------------------------- $ tig show tig-0.8:README ----------------------------------------------------------------------------- Display revisions between two dates for a specific file: ----------------------------------------------------------------------------- $ tig --after="2004-01-01" --before="2006-05-16" -- README ----------------------------------------------------------------------------- Blame file with copy detection enabled: ----------------------------------------------------------------------------- $ tig blame -C README ----------------------------------------------------------------------------- Display the list of stashes: ----------------------------------------------------------------------------- $ tig stash ----------------------------------------------------------------------------- Grep all files for lines containing `DEFINE_ENUM`: ----------------------------------------------------------------------------- $ tig grep -p DEFINE_ENUM ----------------------------------------------------------------------------- ENVIRONMENT VARIABLES --------------------- In addition to environment variables used by Git (e.g. GIT_DIR), Tig defines the ones below. The command related environment variables have access to the internal state of Tig via replacement variables, such as `%(commit)` and `%(blob)`. ifdef::version[] See manpage:tigrc[5] for a full list. endif::version[] ifndef::version[] See link:tigrc.5.{docext}[tigrc(5)] for a full list. endif::version[] TIGRC_USER:: Path of the user configuration file (defaults to `~/.tigrc`). TIGRC_SYSTEM:: Path of the system wide configuration file (defaults to `{sysconfdir}/tigrc`). Define to empty string to use built-in configuration. TIG_LS_REMOTE:: Set command for retrieving all repository references. The command should output data in the same format as git-ls-remote(1). TIG_DIFF_OPTS:: The diff options to use in the diff view. The diff view uses git-show(1) for formatting and always passes --patch-with-stat. You may also set the `diff-options` setting in the configuration file. TIG_TRACE:: Path for trace file where information about Git commands are logged. FILES ----- '~/.tigrc':: User configuration file. See manpage:tigrc[5] for examples. '{sysconfdir}/tigrc':: System wide configuration file. '$GIT_DIR/config':: '~/.gitconfig:: '{sysconfdir}/gitconfig:: Git configuration files. Read on start-up with the help of git-config(1). BUGS ---- Please visit Tig's http://jonas.nitro.dk/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. COPYRIGHT --------- Copyright (c) 2006-2014 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. SEE ALSO -------- ifndef::backend-docbook[] link:tigrc.5.{docext}[tigrc(5)], link:manual.{docext}[the Tig manual], endif::backend-docbook[] ifdef::backend-docbook[] manpage:tigrc[5], manpage:tigmanual[7], endif::backend-docbook[] git(7) tig-2.0.2/doc/tig.1.html000066400000000000000000000636021233303337700146660ustar00rootroot00000000000000 tig(1)

SYNOPSIS

tig        [options] [revisions] [--] [paths]
tig log    [options] [revisions] [--] [paths]
tig show   [options] [revisions] [--] [paths]
tig blame  [options] [rev] [--] path
tig grep   [options] [pattern]
tig stash
tig status
tig <      [Git command output]

DESCRIPTION

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.

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 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.

show

Open diff view using the given git-show(1) options.

blame

Show given file annotated by commits. Takes zero or more git-blame(1) options. Optionally limited from given revision.

status

Start up in status view.

log

Start up in log view, displaying git-log(1) output.

stash

Start up in stash view.

grep

Open the grep view. Supports the same options as git-grep(1).

+<number>

Show the first view with line <number> visible and selected.

-v, --version

Show version and exit.

-h, --help

Show help message and exit.

PAGER MODE

Tig enters pager mode when input is provided via stdin and supports the following subcommands and options:

  • When the show subcommand is specified and the --stdin option is given, stdin is assumed to be a list of commit IDs and will be forwarded to the diff view’s underlying git-show(1) command. For example:

$ git rev-list --author=vivien HEAD | tig show --stdin
  • When --stdin is given, stdin is assumed to be a list of commit IDs and will be forwarded to the main view’s underlying git-log(1) command. For example:

$ tig --no-walk --stdin < cherry-picks.txt
  • When --pretty=raw is given, stdin is assumed to be a "pretty=raw" formatted output similar to that of git-log(1). For example:

$ git reflog --pretty=raw | tig --pretty=raw

When no subcommands nor options are given, the pager view will be used for displaying the Git command input given on stdin. The pager view assumes the input is either from git-log(1) or git-diff(1) and will highlight it similar to the log and diff views. For example:

$ git log -Schange -p --raw | tig

EXAMPLES

Display the list of commits for the current branch:

$ tig

Display commits from one or more branches:

$ tig test master

Display all branches:

$ tig --all

Display differences between two branches:

$ tig test..master

Display changes for sub-module versions:

$ tig --submodule

Display changes for a single file:

$ tig -- README

Display contents of the README file in a specific revision:

$ tig show tig-0.8:README

Display revisions between two dates for a specific file:

$ tig --after="2004-01-01" --before="2006-05-16" -- README

Blame file with copy detection enabled:

$ tig blame -C README

Display the list of stashes:

$ tig stash

Grep all files for lines containing DEFINE_ENUM:

$ tig grep -p DEFINE_ENUM

ENVIRONMENT VARIABLES

In addition to environment variables used by Git (e.g. GIT_DIR), Tig defines the ones below. The command related environment variables have access to the internal state of Tig via replacement variables, such as %(commit) and %(blob). See tigrc(5) for a full list.

TIGRC_USER

Path of the user configuration file (defaults to ~/.tigrc).

TIGRC_SYSTEM

Path of the system wide configuration file (defaults to {sysconfdir}/tigrc). Define to empty string to use built-in configuration.

TIG_LS_REMOTE

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

TIG_DIFF_OPTS

The diff options to use in the diff view. The diff view uses git-show(1) for formatting and always passes --patch-with-stat. You may also set the diff-options setting in the configuration file.

TIG_TRACE

Path for trace file where information about Git commands are logged.

FILES

~/.tigrc

User configuration file. See tigrc(5) for examples.

++SYSCONFDIR++/tigrc

System wide configuration file.

$GIT_DIR/config
'~/.gitconfig
'++SYSCONFDIR++/gitconfig

Git configuration files. Read on start-up with the help of git-config(1).

BUGS

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

Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>

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.

SEE ALSO


tig-2.0.2/doc/tigmanual.7000066400000000000000000000552461233303337700151340ustar00rootroot00000000000000'\" t .\" Title: tigmanual .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 .\" Date: 05/08/2014 .\" Manual: Tig Manual .\" Source: Tig 2.0.2 .\" Language: English .\" .TH "TIGMANUAL" "7" "05/08/2014" "Tig 2\&.0\&.2" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tigmanual \- text\-mode interface for Git .SH "SYNOPSIS" .sp .nf tig [options] [revisions] [\-\-] [paths] tig show [options] [revisions] [\-\-] [paths] tig blame [options] [rev] [\-\-] path tig status tig < [Git command output] .fi .sp .SH "DESCRIPTION" .sp This is the manual for Tig, the ncurses\-based text\-mode interface for git\&. Tig allows you to browse changes in a Git repository and can additionally act as a pager for output of various Git commands\&. When used as a pager, it will display input from stdin and colorize it\&. .sp When browsing repositories, Tig uses the underlying Git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff\&. .SH "CALLING CONVENTIONS" .SS "Pager Mode" .sp If stdin is a pipe, any log or diff options will be ignored and the pager view will be opened loading data from stdin\&. The pager mode can be used for colorizing output from various Git commands\&. .sp Example on how to colorize the output of git\-show(1): .sp .if n \{\ .RS 4 .\} .nf $ git show | tig .fi .if n \{\ .RE .\} .sp .SS "Git Command Options" .sp All Git command options specified on the command line will be passed to the given command and all will be shell quoted before they are passed to the shell\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp If you specify options for the main view, you should not use the \-\-pretty option as this option will be set automatically to the format expected by the main view\&. .sp .5v .RE .sp Example on how to view a commit and show both author and committer information: .sp .if n \{\ .RS 4 .\} .nf $ tig show \-\-pretty=fuller .fi .if n \{\ .RE .\} .sp .sp See the section on specifying revisions for an introduction to revision options supported by the Git commands\&. For details on specific Git command options, refer to the man page of the command in question\&. .SH "THE VIEWER" .sp The display consists of a status window on the last line of the screen and one or more views\&. The default is to only show one view at a time but it is possible to split both the main and log view to also show the commit diff\&. .sp If you are in the log view and press \fIEnter\fR when the current line is a commit line, such as: .sp .if n \{\ .RS 4 .\} .nf commit 4d55caff4cc89335192f3e566004b4ceef572521 .fi .if n \{\ .RE .\} .sp .sp You will split the view so that the log view is displayed in the top window and the diff view in the bottom window\&. You can switch between the two views by pressing \fITab\fR\&. To maximize the log view again, simply press \fIl\fR\&. .SS "Views" .sp Various \fIviews\fR of a repository are presented\&. Each view is based on output from an external command, most often \fIgit log\fR, \fIgit diff\fR, or \fIgit show\fR\&. .PP The main view .RS 4 Is the default view, and it shows a one line summary of each commit in the chosen list of revisions\&. The summary includes commit date, author, and the first line of the log message\&. Additionally, any repository references, such as tags, will be shown\&. .RE .PP The log view .RS 4 Presents a more rich view of the revision log showing the whole log message and the diffstat\&. .RE .PP The diff view .RS 4 Shows either the diff of the current working tree, that is, what has changed since the last commit, or the commit diff complete with log message, diffstat and diff\&. .RE .PP The tree view .RS 4 Lists directory trees associated with the current revision allowing subdirectories to be descended or ascended and file blobs to be viewed\&. .RE .PP The blob view .RS 4 Displays the file content or "blob" of data associated with a file name\&. .RE .PP The blame view .RS 4 Displays the file content annotated or blamed by commits\&. .RE .PP The refs view .RS 4 Displays the branches, remotes and tags in the repository\&. .RE .PP The status view .RS 4 Displays status of files in the working tree and allows changes to be staged/unstaged as well as adding of untracked files\&. .RE .PP The stage view .RS 4 Displays diff changes for staged or unstaged files being tracked or file content of untracked files\&. .RE .PP The stash view .RS 4 Displays the list of stashes in the repository\&. .RE .PP The grep view .RS 4 Displays a list of files and all the lines that matches a search pattern\&. .RE .PP The pager view .RS 4 Is used for displaying both input from stdin and output from Git commands entered in the internal prompt\&. .RE .PP The help view .RS 4 Displays a quick reference of key bindings\&. .RE .SS "Browsing State and User\-defined Commands" .sp The viewer keeps track of both what head and commit ID you are currently viewing\&. The commit ID will follow the cursor line and change every time you highlight a different commit\&. Whenever you reopen the diff view it will be reloaded, if the commit ID changed\&. The head ID is used when opening the main and log view to indicate from what revision to show history\&. .sp Some of the commands used or provided by Tig can be configured\&. This goes for some of the environment variables as well as the external commands\&. These user\-defined commands can use arguments that refer to the current browsing state by using one of the following variables\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&Browsing state variables .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp %(head) T}:T{ .sp The currently viewed \fIhead\fR ID\&. Defaults to HEAD T} T{ .sp %(commit) T}:T{ .sp The currently selected commit ID\&. T} T{ .sp %(blob) T}:T{ .sp The currently selected blob ID\&. T} T{ .sp %(branch) T}:T{ .sp The currently selected branch name\&. T} T{ .sp %(stash) T}:T{ .sp The currently selected stash name\&. T} T{ .sp %(directory) T}:T{ .sp The current directory path in the tree view; empty for the root directory\&. T} T{ .sp %(file) T}:T{ .sp The currently selected file\&. T} T{ .sp %(ref) T}:T{ .sp The reference given to blame or HEAD if undefined\&. T} T{ .sp %(revargs) T}:T{ .sp The revision arguments passed on the command line\&. T} T{ .sp %(fileargs) T}:T{ .sp The file arguments passed on the command line\&. T} T{ .sp %(cmdlineargs) T}:T{ .sp All other options passed on the command line\&. T} T{ .sp %(diffargs) T}:T{ .sp The diff options from \fIdiff\-options\fR or \fITIG_DIFF_OPTS\fR T} T{ .sp %(prompt) T}:T{ .sp Prompt for the argument value\&. T} .TE .sp 1 .sp Example user\-defined commands: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Allow to amend the last commit: .sp .if n \{\ .RS 4 .\} .nf bind generic + !git commit \-\-amend .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Copy commit ID to clipboard: .sp .if n \{\ .RS 4 .\} .nf bind generic 9 !@sh \-c "echo \-n %(commit) | xclip \-selection c" .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Add/edit notes for the current commit used during a review: .sp .if n \{\ .RS 4 .\} .nf bind generic T !git notes edit %(commit) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Enter Git\(cqs interactive add for fine\-grained staging of file content: .sp .if n \{\ .RS 4 .\} .nf bind generic I !git add \-i %(file) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Rebase current branch on top of the selected branch: .sp .if n \{\ .RS 4 .\} .nf bind refs 3 !git rebase \-i %(branch) .fi .if n \{\ .RE .\} .RE .SS "Title Windows" .sp Each view has a title window which shows the name of the view, current commit ID if available, and where the view is positioned: .sp .if n \{\ .RS 4 .\} .nf [main] c622eefaa485995320bc743431bae0d497b1d875 \- commit 1 of 61 (1%) .fi .if n \{\ .RE .\} .sp .sp By default, the title of the current view is highlighted using bold font\&. For long loading views (taking over 3 seconds) the time since loading started will be appended: .sp .if n \{\ .RS 4 .\} .nf [main] 77d9e40fbcea3238015aea403e06f61542df9a31 \- commit 1 of 779 (0%) 5s .fi .if n \{\ .RE .\} .sp .SH "ENVIRONMENT VARIABLES" .sp 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: .PP TIGRC_USER .RS 4 Path of the user configuration file\&. .RE .PP TIGRC_SYSTEM .RS 4 Path of the system wide configuration file\&. .RE .SS "Repository References" .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 .if n \{\ .RS 4 .\} .nf 2006\-03\-26 19:42 Petr Baudis | [cogito\-0\&.17\&.1] Cogito 0\&.17\&.1 .fi .if n \{\ .RE .\} .sp .sp If you want to limit what branches are shown, say only show branches named master or those which start with the feature/ prefix, you can do it by setting the following variable: .sp .if n \{\ .RS 4 .\} .nf $ TIG_LS_REMOTE="git ls\-remote \&. master feature/*" tig .fi .if n \{\ .RE .\} .sp .sp Or set the variable permanently in your environment\&. .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: .RE .sp .if n \{\ .RS 4 .\} .nf git ls\-remote \&. .fi .if n \{\ .RE .\} .sp .SS "Diff options" .sp 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: .sp .if n \{\ .RS 4 .\} .nf $ TIG_DIFF_OPTS="\-\-relative\-date" tig .fi .if n \{\ .RE .\} .sp .sp Or set the variable permanently in your environment\&. .SH "DEFAULT KEYBINDINGS" .sp Below the default key bindings are shown\&. .SS "View Switching" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp m T}:T{ .sp Switch to main view\&. T} T{ .sp d T}:T{ .sp Switch to diff view\&. T} T{ .sp l T}:T{ .sp Switch to log view\&. T} T{ .sp p T}:T{ .sp Switch to pager view\&. T} T{ .sp t T}:T{ .sp Switch to (directory) tree view\&. T} T{ .sp f T}:T{ .sp Switch to (file) blob view\&. T} T{ .sp B T}:T{ .sp Switch to blame view\&. T} T{ .sp H T}:T{ .sp Switch to refs view\&. T} T{ .sp y T}:T{ .sp Switch to stash view\&. T} T{ .sp h T}:T{ .sp Switch to help view T} T{ .sp S T}:T{ .sp Switch to status view T} T{ .sp c T}:T{ .sp Switch to stage view T} .TE .sp 1 .SS "View Manipulation" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp q T}:T{ .sp Close view, if multiple views are open it will jump back to the previous view in the view stack\&. If it is the last open view it will quit\&. Use \fIQ\fR to quit all views at once\&. T} T{ .sp Enter T}:T{ .sp This key is "context sensitive" depending on what view you are currently in\&. When in log view on a commit line or in the main view, split the view and show the commit diff\&. In the diff view pressing Enter will simply scroll the view one line down\&. T} T{ .sp Tab T}:T{ .sp Switch to next view\&. T} T{ .sp R T}:T{ .sp Reload and refresh the current view\&. T} T{ .sp O T}:T{ .sp Maximize the current view to fill the whole display\&. T} T{ .sp 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\&. T} T{ .sp Down T}:T{ .sp Similar to \fIUp\fR but will move down\&. T} T{ .sp , T}:T{ .sp 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 commit\&. For merges the parent is queried\&. T} .TE .sp 1 .SS "View Specific Actions" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp u T}:T{ .sp Update status of file\&. In the status view, this allows you to add an untracked file or stage changes to a file for next commit (similar to running git\-add )\&. In the stage view, when pressing this on a diff chunk line stages only that chunk for next commit, when not on a diff chunk line all changes in the displayed diff are staged\&. T} T{ .sp M T}:T{ .sp 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)\&. T} T{ .sp ! T}:T{ .sp Checkout file with unstaged changes\&. This will reset the file to contain the content it had at last commit\&. T} T{ .sp 1 T}:T{ .sp Stage single diff line\&. T} T{ .sp @ T}:T{ .sp Move to next chunk in the stage view\&. T} T{ .sp ] T}:T{ .sp Increase the diff context\&. T} T{ .sp [ T}:T{ .sp Decrease the diff context\&. T} .TE .sp 1 .SS "Cursor Navigation" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp k T}:T{ .sp Move cursor one line up\&. T} T{ .sp j T}:T{ .sp Move cursor one line down\&. T} T{ .sp PgUp,\-,a T}:T{ .sp Move cursor one page up\&. T} T{ .sp PgDown, Space T}:T{ .sp Move cursor one page down\&. T} T{ .sp End T}:T{ .sp Jump to last line\&. T} T{ .sp Home T}:T{ .sp Jump to first line\&. T} .TE .sp 1 .SS "Scrolling" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Insert T}:T{ .sp Scroll view one line up\&. T} T{ .sp Delete T}:T{ .sp Scroll view one line down\&. T} T{ .sp w T}:T{ .sp Scroll view one page up\&. T} T{ .sp s T}:T{ .sp Scroll view one page down\&. T} T{ .sp Left T}:T{ .sp Scroll view one column left\&. T} T{ .sp Right T}:T{ .sp Scroll view one column right\&. T} T{ .sp | T}:T{ .sp Scroll view to the first column\&. T} .TE .sp 1 .SS "Searching" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt. T{ .sp / T}:T{ .sp Search the view\&. Opens a prompt for entering search regexp to use\&. T} T{ .sp ? T}:T{ .sp Search backwards in the view\&. Also prompts for regexp\&. T} T{ .sp n T}:T{ .sp Find next match for the current search regexp\&. T} T{ .sp N T}:T{ .sp Find previous match for the current search regexp\&. T} .TE .sp 1 .SS "Misc" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Q T}:T{ .sp Quit\&. T} T{ .sp r T}:T{ .sp Redraw screen\&. T} T{ .sp z T}:T{ .sp Stop all background loading\&. This can be useful if you use Tig in a repository with a long history without limiting the revision log\&. T} T{ .sp v T}:T{ .sp Show version\&. T} T{ .sp o T}:T{ .sp Open option menu T} T{ .sp \&. T}:T{ .sp Toggle line numbers on/off\&. T} T{ .sp D T}:T{ .sp Toggle date display on/off/short/relative/local\&. T} T{ .sp A T}:T{ .sp Toggle author display on/off/abbreviated/email/email user name\&. T} T{ .sp g T}:T{ .sp Toggle revision graph visualization on/off\&. T} T{ .sp ~ T}:T{ .sp Toggle (line) graphics mode T} T{ .sp F T}:T{ .sp Toggle reference display on/off (tag and branch names)\&. T} T{ .sp W T}:T{ .sp Toggle ignoring whitespace on/off for diffs T} T{ .sp X T}:T{ .sp Toggle commit ID display on/off T} T{ .sp % T}:T{ .sp Toggle file filtering in order to see the full diff instead of only the diff concerning the currently selected file\&. T} T{ .sp $ T}:T{ .sp Toggle highlighting of commit title overflow\&. T} T{ .sp : T}:T{ .sp Open prompt\&. This allows you to specify what command to run\&. T} T{ .sp e T}:T{ .sp Open file in editor\&. T} .TE .sp 1 .SS "Prompt" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt. T{ .sp : T}:T{ .sp Jump to the specific line number, e\&.g\&. :80\&. T} T{ .sp : T}:T{ .sp Jump to a specific commit, e\&.g\&. :2f12bcc\&. T} T{ .sp : T}:T{ .sp Execute the corresponding key binding, e\&.g\&. :q\&. T} T{ .sp :! T}:T{ .sp Execute a system command in a pager, e\&.g\&. :!git log \-p\&. T} T{ .sp : T}:T{ .sp Execute a Tig command, e\&.g\&. :edit\&. T} .TE .sp 1 .SS "External Commands" .sp For more custom needs, external commands provide a way to easily execute a script or program\&. They are bound to keys and use information from the current browsing state, such as the current commit ID\&. Tig comes with the following built\-in external commands: .TS tab(:); ltB ltB ltB. T{ Keymap T}:T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt. T{ .sp main T}:T{ .sp C T}:T{ .sp git cherry\-pick %(commit) T} T{ .sp status T}:T{ .sp C T}:T{ .sp git commit T} T{ .sp generic T}:T{ .sp G T}:T{ .sp git gc T} .TE .sp 1 .SH "REVISION SPECIFICATION" .sp This section describes various ways to specify what revisions to display or otherwise limit the view to\&. Tig does not itself parse the described revision options so refer to the relevant Git man pages for further information\&. Relevant man pages besides git\-log(1) are git\-diff(1) and git\-rev\-list(1)\&. .sp You can tune the interaction with Git by making use of the options explained in this section\&. For example, by configuring the environment variable described in the section on diff options\&. .SS "Limit by Path Name" .sp If you are interested only in those revisions that made changes to a specific file (or even several files) list the files like this: .sp .if n \{\ .RS 4 .\} .nf $ tig Makefile README .fi .if n \{\ .RE .\} .sp .sp To avoid ambiguity with Tig\(cqs subcommands or repository references such as tag names, be sure to separate file names from other Git options using "\-\-"\&. So if you have a file named \fIstatus\fR it will clash with the \fIstatus\fR subcommand, and thus you will have to use: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\- status .fi .if n \{\ .RE .\} .sp .SS "Limit by Date or Number" .sp To speed up interaction with Git, you can limit the amount of commits to show both for the log and main view\&. Either limit by date using e\&.g\&. \-\-since=1\&.month or limit by the number of commits using \-n400\&. .sp If you are only interested in changes that happened between two dates you can use: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-after="May 5th" \-\-before="2006\-05\-16 15:44" .fi .if n \{\ .RE .\} .sp .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp If you want to avoid having to quote dates containing spaces you can use "\&." instead, e\&.g\&. \-\-after=May\&.5th\&. .sp .5v .RE .SS "Limiting by Commit Ranges" .sp Alternatively, commits can be limited to a specific range, such as "all commits between \fItag\-1\&.0\fR and \fItag\-2\&.0\fR"\&. For example: .sp .if n \{\ .RS 4 .\} .nf $ tig tag\-1\&.0\&.\&.tag\-2\&.0 .fi .if n \{\ .RE .\} .sp .sp This way of commit limiting makes it trivial to only browse the commits which haven\(cqt been pushed to a remote branch\&. Assuming \fIorigin\fR is your upstream remote branch, using: .sp .if n \{\ .RS 4 .\} .nf $ tig origin\&.\&.HEAD .fi .if n \{\ .RE .\} .sp .sp will list what will be pushed to the remote branch\&. Optionally, the ending \fIHEAD\fR can be left out since it is implied\&. .SS "Limiting by Reachability" .sp Git interprets the range specifier "tag\-1\&.0\&.\&.tag\-2\&.0" as "all commits reachable from \fItag\-2\&.0\fR but not from \fItag\-1\&.0\fR"\&. Where reachability refers to what commits are ancestors (or part of the history) of the branch or tagged revision in question\&. .sp If you prefer to specify which commit to preview in this way use the following: .sp .if n \{\ .RS 4 .\} .nf $ tig tag\-2\&.0 ^tag\-1\&.0 .fi .if n \{\ .RE .\} .sp .sp You can think of \fI^\fR as a negation operator\&. Using this alternate syntax, it is possible to further prune commits by specifying multiple branch cut offs\&. .SS "Combining Revisions Specification" .sp Revision options can to some degree be combined, which makes it possible to say "show at most 20 commits from within the last month that changed files under the Documentation/ directory\&." .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-since=1\&.month \-n20 \-\- Documentation/ .fi .if n \{\ .RE .\} .sp .SS "Examining All Repository References" .sp In some cases, it can be useful to query changes across all references in a repository\&. An example is to ask "did any line of development in this repository change a particular file within the last week"\&. This can be accomplished using: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-all \-\-since=1\&.week \-\- Makefile .fi .if n \{\ .RE .\} .sp .SH "MORE INFORMATION" .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 and feature requests\&. .SH "COPYRIGHT" .sp Copyright (c) 2006\-2014 Jonas Fonseca <\m[blue]\fBjonas\&.fonseca@gmail\&.com\fR\m[]\&\s-2\u[3]\d\s+2> .sp 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\&. .SH "SEE ALSO" .sp Manpages: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBtig\fR(1) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBtigrc\fR(5) .RE .SH "NOTES" .IP " 1." 4 home page .RS 4 \%http://jonas.nitro.dk/tig .RE .IP " 2." 4 main Git repository .RS 4 \%https://github.com/jonas/tig .RE .IP " 3." 4 jonas.fonseca@gmail.com .RS 4 \%mailto:jonas.fonseca@gmail.com .RE tig-2.0.2/doc/tigmanual.7.adoc000066400000000000000000000005051233303337700160250ustar00rootroot00000000000000tigmanual(7) ============ NAME ---- tigmanual - text-mode interface for Git SYNOPSIS -------- [verse] tig [options] [revisions] [--] [paths] tig show [options] [revisions] [--] [paths] tig blame [options] [rev] [--] path tig status tig < [Git command output] DESCRIPTION ----------- include::manual.adoc[] tig-2.0.2/doc/tigrc.5000066400000000000000000001176351233303337700142620ustar00rootroot00000000000000'\" t .\" Title: tigrc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.0 .\" Date: 05/08/2014 .\" Manual: Tig Manual .\" Source: Tig 2.0.2 .\" Language: English .\" .TH "TIGRC" "5" "05/08/2014" "Tig 2\&.0\&.2" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tigrc \- Tig configuration file .SH "SYNOPSIS" .sp .nf \fBset\fR \fIvariable\fR \fB=\fR \fIvalue\fR \fBbind\fR \fIkeymap\fR \fIkey\fR \fIaction\fR \fBcolor\fR \fIarea\fR \fIfgcolor\fR \fIbgcolor\fR \fI[attributes]\fR \fBsource\fR \fIpath\fR .fi .sp .SH "DESCRIPTION" .sp You can permanently set an option by putting it in the ~/\&.tigrc file\&. The file consists of a series of \fIcommands\fR\&. Each line of the file may contain only one command\&. Commands can span multiple lines if each line is terminated by a backslash (\fI\e\fR) character\&. .sp 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\&. .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\&. .sp .if n \{\ .RS 4 .\} .nf [tig] show\-rev\-graph = true [tig "color"] cursor = yellow red bold [tig "bind"] generic = P parent .fi .if n \{\ .RE .\} .sp .sp In addition to tig\-specific options, the following Git options are read from the Git configuration: .PP \fIcolor\&.*\fR .RS 4 Colors for the various UI types\&. Can be configured via the \fIgit\-colors\fR setting\&. .RE .PP \fIcore\&.abbrev\fR .RS 4 The width of the commit ID\&. See also \fIid\-width\fR option\&. .RE .PP \fIcore\&.editor\fR .RS 4 The editor command\&. Can be overridden by setting GIT_EDITOR\&. .RE .PP \fIcore\&.worktree\fR .RS 4 The path to the root of the working tree\&. .RE .PP \fIgui\&.encoding\fR .RS 4 The encoding to use for displaying of file content\&. .RE .PP \fIi18n\&.commitencoding\fR .RS 4 The encoding used for commits\&. The default is UTF\-8\&. .RE .SH "SET COMMAND" .sp A few selective variables can be configured via the set command\&. The syntax is: .sp .if n \{\ .RS 4 .\} .nf \fBset\fR variables \fB=\fR value .fi .if n \{\ .RE .\} .sp .sp Examples: .sp .if n \{\ .RS 4 .\} .nf set commit\-order = topo # Order commits topologically set git\-colors = no # Do not read Git\*(Aqs color settings\&. set horizontal\-scroll = 33% # Scroll 33% of the view width set blame\-options = \-C \-C \-C # Blame lines from other files # Wrap branch names with () and tags with <> set reference\-format = (branch) # Configure blame view columns using command spanning multiple lines\&. set blame\-view = \e date:default \e author:abbreviated \e file\-name:auto \e id:yes,color \e line\-number:yes,interval=5 text .fi .if n \{\ .RE .\} .sp .sp Or in the Git configuration files: .sp .if n \{\ .RS 4 .\} .nf [tig] line\-graphics = no # Disable graphics characters tab\-size = 8 # Number of spaces per tab .fi .if n \{\ .RE .\} .sp .sp The type of variables is either bool, int, string, or mixed\&. .PP Valid bool values .RS 4 To set a bool variable to true use either "1", "true", or "yes"\&. Any other value will set the variable to false\&. .RE .PP Valid int values .RS 4 A non\-negative integer\&. .RE .PP Valid string values .RS 4 A string of characters\&. Optionally, use either \*(Aq or " as delimiters\&. .RE .PP Valid mixed values .RS 4 These values are composites of the above types\&. The valid values are specified in the description\&. .RE .SS "Variables" .sp The following variables can be set: .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 \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 extra blame options\&. Can be used for telling git\-blame(1) how to detect the origin of lines\&. The value is ignored when Tig is started in blame mode and given blame options on the command line\&. .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\&. [tag] and \&. If no format is specified for local\-tag, the format for tag is used\&. Similarly, if no format is specified for tracked\-remote the remote format is used\&. Prefix with hide: to not show that reference type, e\&.g\&. hide:remote\&. Supported reference types are: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} head : The current HEAD\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} tag : A signed tag\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} local\-tag : An unsigned tag\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} remote : A remote\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} tracked\-remote : The remote tracked by current HEAD\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} replace : A replaced reference\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} branch : Any other reference\&. .RE .RE .PP \fIline\-graphics\fR (mixed) [ascii|default|utf\-8|] .RS 4 What type of character graphics for line drawing\&. .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\&. \fI5\fR, or as a percentage of the view width, e\&.g\&. \fI33%\fR, where the maximum is 100%\&. For percentages it is always ensured that at least one column is scrolled\&. The default is to scroll \fI50%\fR of the view width\&. .RE .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\&. .RE .PP \fIshow\-notes\fR (mixed) [|] .RS 4 Whether to show notes for a commit\&. When set to a note reference the reference is passed to git show \-\-notes=\&. Notes are enabled by default\&. .RE .PP \fIshow\-changes\fR (bool) .RS 4 Whether to show staged and unstaged changes in the main view\&. .RE .PP \fIvertical\-split\fR (mixed) [auto|] .RS 4 Whether to split the view horizontally or vertically\&. "auto" (which is the default) means that it will depend on the window dimensions\&. When true vertical orientation is used, and false sets the orientation to horizontal\&. .RE .PP \fIsplit\-view\-height\fR (mixed) .RS 4 Height of the lower view in a split view\&. Can be specified either as the number of rows, e\&.g\&. \fI5\fR, or as a percentage of the view height, e\&.g\&. \fI80%\fR, where the maximum is 100%\&. It is always ensured that the smaller of the views is at least four rows high\&. The default is a view height of \fI66%\fR\&. .RE .PP \fIstatus\-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 \fItab\-size\fR (int) .RS 4 Number of spaces per tab\&. The default is 8 spaces\&. .RE .PP \fIdiff\-context\fR (int) .RS 4 Number of context lines to show for diffs\&. .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\&. .RE .PP \fIcommit\-order\fR (mixed) [default|topo|date|author\-date|reverse|] .RS 4 Commit ordering using the default (chronological reverse) order, topological order, date order or reverse order\&. The default order is used when the option is set to false, and topo order when set to true\&. .RE .PP \fIignore\-case\fR (bool) .RS 4 Ignore case in searches\&. By default, the search is case sensitive\&. .RE .PP \fIwrap\-lines\fR (bool) .RS 4 Wrap long lines\&. By default, lines are not wrapped\&. Not compatible with line numbers enabled\&. .RE .PP \fIfocus\-child\fR (bool) .RS 4 Whether to focus the child view when it is opened\&. When disabled the focus will remain in the parent view, avoiding reloads of the child view when navigating the parent view\&. True by default\&. .RE .PP \fIeditor\-line\-number\fR (bool) .RS 4 Whether to pass the selected line number to the editor command\&. The line number is passed as + in front of the file name\&. Example: vim +10 tig\&.c .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\&. .RE .PP \fImouse\-scroll\fR (int) .RS 4 Interval to scroll up or down using the mouse\&. The default is 3 lines\&. 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 \fImanual\fR, nothing is refreshed automatically\&. When set to \fIauto\fR, views are refreshed when a modification is detected\&. When set to \fIafter\-command\fR only refresh after returning from an external command\&. When set to \fIperiodic\fR, visible views are refreshed periodically using \fIrefresh\-interval\fR\&. .RE .PP \fIrefresh\-interval\fR (int) .RS 4 Interval in seconds between view refresh update checks when \fIrefresh\-mode\fR is set to \fIperiodic\fR\&. .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\&. .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 Examples: .sp .if n \{\ .RS 4 .\} .nf # Enable both ID and line numbers in the blame view set blame\-view = date:default author:full file\-name:auto id:yes,color \e line\-number:yes,interval=5 text # Change grep view to be similar to `git grep` format set grep\-view = file\-name:yes line\-number:yes,interval=1 text # Show file sizes as units set tree\-view = line\-number:no,interval=5 mode author:full \e file\-size:units date:default id:no file\-name # Show line numbers for every 10th line in the pager view set pager\-view = line\-number:yes,interval=10 text .fi .if n \{\ .RE .\} .sp .sp The following list shows which the available view settings and what column types they support: .PP blob\-view, diff\-view, log\-view, pager\-view, stage\-view .RS 4 line\-number, text .RE .PP blame\-view .RS 4 author, date, file\-name, id, line\-number, text .RE .PP grep\-view .RS 4 file\-name, line\-number, text .RE .PP main\-view .RS 4 author, date, commit\-title, id, line\-number .RE .PP refs\-view .RS 4 author, date, commit\-title, id, line\-number, ref .RE .PP stash\-view .RS 4 author, date, commit\-title, id, line\-number .RE .PP status\-view .RS 4 file\-name, line\-number, status .RE .PP tree\-view .RS 4 author, date, id, file\-name, file\-size, line\-number, mode .RE .sp Supported column types and their respective column options: .PP author .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (mixed) [full|abbreviated|email|email\-user|]: How to display author names\&. If set to "abbreviated" author initials will be shown\&. .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 a value between 1 and 10, the author name will be abbreviated to the author\(cqs initials\&. When set to zero, the width is automatically sized to fit the content\&. .RE .RE .PP commit\-title .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIgraph\fR (bool): Whether to show revision graph in the main view on start\-up\&. See also the \fIline\-graphics\fR options\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIrefs\fR (bool): Whether to show references (branches, tags, and remotes) in the main view\&. Can be toggled\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIoverflow\fR (bool or int): Whether to highlight text in commit titles exceeding a given width\&. When set to a boolean, it enables or disables the highlighting using the default width of 50 character\&. When set to an int, the assigned value is used as the maximum character width\&. .RE .RE .PP date .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (mixed) [relative|short|default|local|]: How to display dates\&. If set to "relative" a relative date will be used, e\&.g\&. "2 minutes ago"\&. If set to "short" no time information is shown\&. If set to "local", localtime(3) is used\&. .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 file\-name .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (mixed) [auto|always|]: When to display file names\&. If set to "auto" file names are shown only when needed, e\&.g\&. when running: tig blame \-C \&. .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 file\-size .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (mixed) [default|units|]: How to display file sizes\&. When set to "units", sizes are shown using binary prefixes, e\&.g\&. 12524 bytes is shown as "12\&.2K"\&. .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 filename column\&. When set to zero, the width is automatically sized to fit the content\&. .RE .RE .PP id .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (bool): Whether to show commit IDs in the main view\&. .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 commit ID\&. When unset Tig will use the value of \fIcore\&.abbrev\fR if found\&. See git\-config(1) on how to set \fIcore\&.abbrev\fR\&. When set to zero the width is automatically sized to fit the content of reflog (e\&.g\&. ref/stash@{4}) IDs and otherwise default to 7\&. .RE .RE .PP line\-number .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (bool): Whether to show line numbers\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIinterval\fR (int): Interval between line numbers\&. .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 mode .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (bool): Whether to show file modes\&. .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 ref .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIdisplay\fR (bool): Whether to show the reference name\&. .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 status .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \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 .RS 4 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIcommit\-title\-overflow\fR (bool or int): Whether to highlight commit titles exceeding a given width in the diff view\&. When set to a boolean, it enables or disables the highlighting using the default width of 50 character\&. When set to an int, the assigned value is used as the maximum character width\&. .RE .RE .sp All column options can be toggled\&. For \fIdisplay\fR options, use the option name as the prefix followed by a dash and the column name\&. E\&.g\&. :toggle author\-display will toggle the \fIdisplay\fR option in the \fIauthor\fR column\&. For all other options use the column name followed by a dash and then the option name as the suffix\&. E\&.g\&. :toggle commit\-title\-graph will toggle the \fIgraph\fR option in the \fIcommit\-title\fR column\&. .SH "BIND COMMAND" .sp Using bind commands, keys can be mapped to an action when pressed in a given key map\&. The syntax is: .sp .if n \{\ .RS 4 .\} .nf \fBbind\fR \fIkeymap\fR \fIkey\fR \fIaction\fR .fi .if n \{\ .RE .\} .sp .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Add keybinding to quickly jump to the next diff chunk in the stage view bind stage Enter :/^@@ # Disable the default mapping for running git\-gc bind generic G none # User\-defined external command to amend the last commit bind status + !git commit \-\-amend # User\-defined internal command that reloads ~/\&.tigrc bind generic S :source ~/\&.tigrc # UTF8\-encoded characters can be used as key values\&. bind generic \(/o @sh \-c "printf \*(Aq%s\*(Aq %(commit) | pbcopy" .fi .if n \{\ .RE .\} .sp .sp Or in the Git configuration files: .sp .if n \{\ .RS 4 .\} .nf [tig "bind"] # \*(Aqunbind\*(Aq the default quit key binding main = Q none # Cherry\-pick current commit onto current branch generic = C !git cherry\-pick %(commit) .fi .if n \{\ .RE .\} .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\&. .PP Keymaps .RS 4 Valid keymaps are: \fBmain\fR, \fBdiff\fR, \fBlog\fR, \fBhelp\fR, \fBpager\fR, \fBstatus\fR, \fBstage\fR, \fBtree\fR, \fBblob\fR, \fBblame\fR, \fBrefs\fR, \fBstash\fR, \fBgrep\fR and \fBgeneric\fR\&. Use \fBgeneric\fR to set key mapping in all keymaps\&. .RE .PP Key values .RS 4 Key values should never be quoted\&. Use either an ASCII or UTF8\-encoded character or one of the following symbolic key names\&. Symbolic key names are case insensitive and starts with "<" and ends with ">"\&. Use \fB\fR to bind to the # key, since the hash mark is used as a comment character\&. Use \fB\fR to bind to the < 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\&. .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 Examples: .sp .if n \{\ .RS 4 .\} .nf bind main R reload bind main next bind main scroll\-page\-down bind main o options .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)\&. .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 .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\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp ! T}:T{ .sp Run the command in the foreground with output shown\&. T} T{ .sp @ T}:T{ .sp Run the command in the background with no output\&. T} T{ .sp ? T}:T{ .sp Prompt the user before executing the command\&. T} T{ .sp < T}:T{ .sp Exit Tig after executing the command\&. T} .TE .sp 1 .sp Unless otherwise specified, commands are run in the foreground with their console output shown (as if \fI!\fR was specified)\&. When multiple command options are specified their behavior are combined, e\&.g\&. "? !git publish .fi .if n \{\ .RE .\} .sp .RE .SS "Internal user\-defined commands" .sp Actions beginning with a \fI:\fR will be run and interpreted as internal commands and act similar to commands run via Tig\(cqs prompt\&. Valid internal commands are configuration file options (as described in this document) and pager view commands\&. Examples: .sp .if n \{\ .RS 4 .\} .nf # Reload ~/\&.tigrc when \*(AqS\*(Aq is pressed bind generic S :source \&.tigrc # Change diff view to show all commit changes regardless of file limitations bind diff F :set diff\-options = \-\-full\-diff # Show the output of git\-reflog(1) in the pager view bind generic W :!git reflog # Search for previous diff (c)hunk and next diff header bind stage 2 :?^@@ bind stage D :/^diff \-\-(git|cc) bind main I :toggle show\-id # Show/hide the ID column bind diff D :toggle diff\-options \-\-minimal # Use minimal diff algorithm bind diff [ :toggle diff\-context \-3 # Decrease context (\-U arg) bind diff ] :toggle diff\-context +3 # Increase context bind generic V :toggle split\-view\-height \-10% # Decrease split height .fi .if n \{\ .RE .\} .sp .sp Similar to external commands, pager view commands can contain variable names that will be substituted before the command is run\&. .SS "Action names" .sp Valid action names are described below\&. Note, all action names are case\-insensitive, and you may use \fI\-\fR, \fI_\fR, and \fI\&.\fR interchangeably, e\&.g\&. "view\-main", "View\&.Main", and "VIEW_MAIN" are the same\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBView switching\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp view\-main T}:T{ .sp Show main view T} T{ .sp view\-diff T}:T{ .sp Show diff view T} T{ .sp view\-log T}:T{ .sp Show log view T} T{ .sp view\-tree T}:T{ .sp Show tree view T} T{ .sp view\-blob T}:T{ .sp Show blob view T} T{ .sp view\-blame T}:T{ .sp Show blame view T} T{ .sp view\-refs T}:T{ .sp Show refs view T} T{ .sp view\-status T}:T{ .sp Show status view T} T{ .sp view\-stage T}:T{ .sp Show stage view T} T{ .sp view\-stash T}:T{ .sp Show stash view T} T{ .sp view\-grep T}:T{ .sp Show grep view T} T{ .sp view\-pager T}:T{ .sp Show pager view T} T{ .sp view\-help T}:T{ .sp Show help view T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBView manipulation\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp enter T}:T{ .sp Enter and open selected line T} T{ .sp back T}:T{ .sp Go back to the previous view state T} T{ .sp next T}:T{ .sp Move to next T} T{ .sp previous T}:T{ .sp Move to previous T} T{ .sp parent T}:T{ .sp Move to parent T} T{ .sp view\-next T}:T{ .sp Move focus to the next view T} T{ .sp refresh T}:T{ .sp Reload and refresh view T} T{ .sp maximize T}:T{ .sp Maximize the current view T} T{ .sp view\-close T}:T{ .sp Close the current view T} T{ .sp quit T}:T{ .sp Close all views and quit T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBView specific actions\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt lt lt. T{ .sp status\-update T}:T{ .sp Stage/unstage chunk or file changes T} T{ .sp status\-revert T}:T{ .sp Revert chunk or file changes T} T{ .sp status\-merge T}:T{ .sp Merge file using external tool T} T{ .sp stage\-update\-line T}:T{ .sp Stage/unstage single line T} T{ .sp stage\-split\-chunk T}:T{ .sp Split current diff chunk T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCursor navigation\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp move\-up T}:T{ .sp Move cursor one line up T} T{ .sp move\-down T}:T{ .sp Move cursor one line down T} T{ .sp move\-page\-down T}:T{ .sp Move cursor one page down T} T{ .sp move\-page\-up T}:T{ .sp Move cursor one page up T} T{ .sp move\-first\-line T}:T{ .sp Move cursor to first line T} T{ .sp move\-last\-line T}:T{ .sp Move cursor to last line T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBScrolling\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp scroll\-line\-up T}:T{ .sp Scroll one line up T} T{ .sp scroll\-line\-down T}:T{ .sp Scroll one line down T} T{ .sp scroll\-page\-up T}:T{ .sp Scroll one page up T} T{ .sp scroll\-page\-down T}:T{ .sp Scroll one page down T} T{ .sp scroll\-first\-col T}:T{ .sp Scroll to the first line columns T} T{ .sp scroll\-left T}:T{ .sp Scroll two columns left T} T{ .sp scroll\-right T}:T{ .sp Scroll two columns right T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBSearching\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp search T}:T{ .sp Search the view T} T{ .sp search\-back T}:T{ .sp Search backwards in the view T} T{ .sp find\-next T}:T{ .sp Find next search match T} T{ .sp find\-prev T}:T{ .sp Find previous search match T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBOption manipulation\fR .RS 4 .sp In addition to the actions below, options can also be toggled with the :toggle prompt command\&. .TS tab(:); lt lt. T{ .sp options T}:T{ .sp Open the options menu T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBMisc\fR .RS 4 .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp edit T}:T{ .sp Open in editor T} T{ .sp prompt T}:T{ .sp Open the prompt T} T{ .sp screen\-redraw T}:T{ .sp Redraw the screen T} T{ .sp stop\-loading T}:T{ .sp Stop all loading views T} T{ .sp show\-version T}:T{ .sp Show version information T} T{ .sp none T}:T{ .sp Do nothing T} .TE .sp 1 .RE .SH "COLOR COMMAND" .sp Color commands control highlighting and the user interface styles\&. If your terminal supports color, these commands can be used to assign foreground and background combinations to certain areas\&. Optionally, an attribute can be given as the last parameter\&. The syntax is: .sp .if n \{\ .RS 4 .\} .nf \fBcolor\fR \fIarea\fR \fIfgcolor\fR \fIbgcolor\fR \fI[attributes]\fR .fi .if n \{\ .RE .\} .sp .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Override the default terminal colors to white on black\&. color default white black # Diff colors color diff\-header yellow default color diff\-index blue default color diff\-chunk magenta default color "Reported\-by:" green default # View specific color color tree\&.date black cyan bold .fi .if n \{\ .RE .\} .sp .sp Or in the Git configuration files: .sp .if n \{\ .RS 4 .\} .nf [tig "color"] # A strange looking cursor line cursor = red default underline # UI colors title\-blur = white blue title\-focus = white blue bold # View specific color [tig "color\&.tree"] date = cyan default bold .fi .if n \{\ .RE .\} .sp .PP Area names .RS 4 Can be either a built\-in area name or a custom quoted string\&. The latter allows custom color rules to be added for lines matching a quoted string\&. Valid built\-in area names are described below\&. Note, all names are case\-insensitive, and you may use \fI\-\fR, and \fI_\fR interchangeably, e\&.g\&. "Diff\-Header" and "DIFF_HEADER" are the same\&. View specific colors can be defined by prefixing the view name to the area name, e\&.g\&. "stage\&.diff\-chunk" and "diff\&.diff\-chunk"\&. .RE .PP Color names .RS 4 Valid colors include: \fBwhite\fR, \fBblack\fR, \fBgreen\fR, \fBmagenta\fR, \fBblue\fR, \fBcyan\fR, \fByellow\fR, \fBred\fR, \fBdefault\fR\&. Use \fBdefault\fR to refer to the default terminal colors, for example, to keep the background transparent when you are using a terminal with a transparent background\&. .sp Colors can also be specified using the keywords \fBcolor0\fR, \fBcolor1\fR, \&..., \fBcolorN\-1\fR (where \fBN\fR is the number of colors supported by your terminal)\&. This is useful when you remap the colors for your display or want to enable colors supported by 88\-color and 256\-color terminals\&. Note that the \fIcolor\fR prefix is optional\&. If you prefer, you can specify colors directly by their numbers \fB0\fR, \fB1\fR, \&..., \fBN\-1\fR instead, just like in the configuration file of Git\&. .RE .PP Attribute names .RS 4 Valid attributes include: \fBnormal\fR, \fBblink\fR, \fBbold\fR, \fBdim\fR, \fBreverse\fR, \fBstandout\fR, and \fBunderline\fR\&. Note, not all attributes may be supported by the terminal\&. .RE .SS "UI colors" .sp The colors and attributes to be used for the text that is not highlighted or that specify the use of the default terminal colors can be controlled by setting the \fBdefault\fR color option\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&General .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp default T}:T{ .sp Override default terminal colors (see above)\&. T} T{ .sp cursor T}:T{ .sp The cursor line\&. T} T{ .sp status T}:T{ .sp The status window showing info messages\&. T} T{ .sp title\-focus T}:T{ .sp The title window for the current view\&. T} T{ .sp title\-blur T}:T{ .sp The title window of any backgrounded view\&. T} T{ .sp delimiter T}:T{ .sp Delimiter shown for truncated lines\&. T} T{ .sp header T}:T{ .sp The view header lines\&. Use \fIstatus\&.header\fR to color the staged, unstaged, and untracked sections in the status view\&. Use \fIhelp\&.header\fR to color the keymap sections in the help view\&. T} T{ .sp line\-number T}:T{ .sp Line numbers\&. T} T{ .sp id T}:T{ .sp The commit ID\&. T} T{ .sp date T}:T{ .sp The commit date\&. T} T{ .sp author T}:T{ .sp The commit author\&. T} T{ .sp mode T}:T{ .sp The file mode holding the permissions and type\&. T} T{ .sp overflow T}:T{ .sp Title text overflow\&. T} T{ .sp directory T}:T{ .sp The directory name\&. T} T{ .sp file T}:T{ .sp The file name\&. T} T{ .sp file\-size T}:T{ .sp File size\&. T} .TE .sp 1 .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&2.\ \&Main view colors .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp graph\-commit T}:T{ .sp The commit dot in the revision graph\&. T} T{ .sp palette\-[0\-6] T}:T{ .sp 7 different colors, used for distinguishing branches or commits\&. example: palette\-0 = red T} T{ .sp main\-commit T}:T{ .sp The commit comment\&. T} T{ .sp main\-head T}:T{ .sp Label of the current branch\&. T} T{ .sp main\-remote T}:T{ .sp Label of a remote\&. T} T{ .sp main\-tracked T}:T{ .sp Label of the remote tracked by the current branch\&. T} T{ .sp main\-tag T}:T{ .sp Label of a signed tag\&. T} T{ .sp main\-local\-tag T}:T{ .sp Label of a local tag\&. T} T{ .sp main\-ref T}:T{ .sp Label of any other reference\&. T} T{ .sp main\-replace T}:T{ .sp Label of replaced reference\&. T} .TE .sp 1 .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&3.\ \&Status view .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp stat\-none T}:T{ .sp Empty status label\&. T} T{ .sp stat\-staged T}:T{ .sp Status flag of staged files\&. T} T{ .sp stat\-unstaged T}:T{ .sp Status flag of unstaged files\&. T} T{ .sp stat\-untracked T}:T{ .sp Status flag of untracked files\&. T} .TE .sp 1 .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&4.\ \&Help view .TS tab(:); lt lt lt lt. T{ .sp help\-group T}:T{ .sp Help group name\&. T} T{ .sp help\-action T}:T{ .sp Help action name\&. T} .TE .sp 1 .SS "Highlighting" .PP Diff markup .RS 4 Options concerning diff start, chunks and lines added and deleted\&. .RE .sp \fBdiff\-header\fR, \fBdiff\-chunk\fR, \fBdiff\-add\fR, \fBdiff\-add2\fR, \fBdiff\-del\fR, \fBdiff\-del2\fR .PP Enhanced Git diff markup .RS 4 Extra diff information emitted by the Git diff machinery, such as mode changes, rename detection, and similarity\&. .RE .sp \fBdiff\-oldmode\fR, \fBdiff\-newmode\fR, \fBdiff\-copy\-from\fR, \fBdiff\-copy\-to\fR, \fBdiff\-similarity\fR, \fBdiff\-index\fR .PP Pretty print commit headers .RS 4 Commit diffs and the revision logs are usually formatted using pretty printed headers , unless \-\-pretty=raw was given\&. This includes lines, such as merge info, commit ID, and author and committer date\&. .RE .sp \fBpp\-refs\fR, \fBpp\-reflog\fR, \fBpp\-reflogmsg\fR, \fBpp\-merge\fR .PP Raw commit header .RS 4 Usually shown when \-\-pretty=raw is given, however \fIcommit\fR is pretty much omnipresent\&. .RE .sp \fBcommit\fR, \fBparent\fR, \fBtree\fR, \fBauthor\fR, \fBcommitter\fR .PP Commit message .RS 4 Signed\-off\-by, Acked\-by, Reviewed\-by and Tested\-by lines are colorized\&. Characters in the commit title exceeding a predefined width can be highlighted\&. .RE .PP Tree markup .RS 4 Colors for information of the tree view\&. .RE .sp \fBtree\-dir\fR, \fBtree\-file\fR .SH "SOURCE COMMAND" .sp Source commands make it possible to read additional configuration files\&. Sourced files are included in\-place, meaning when a \fIsource\fR command is encountered the file will be immediately read\&. Any commands later in the current configuration file will take precedence\&. The syntax is: .sp .if n \{\ .RS 4 .\} .nf \fBsource\fR \fIpath\fR .fi .if n \{\ .RE .\} .sp .sp Examples: .sp .if n \{\ .RS 4 .\} .nf source ~/\&.tig/colorscheme\&.tigrc source ~/\&.tig/keybindings\&.tigrc .fi .if n \{\ .RE .\} .sp .SH "COPYRIGHT" .sp Copyright (c) 2006\-2014 Jonas Fonseca <\m[blue]\fBjonas\&.fonseca@gmail\&.com\fR\m[]\&\s-2\u[1]\d\s+2> .sp 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\&. .SH "SEE ALSO" .sp \fBtig\fR(1), \fBtigmanual\fR(7), git(7), git\-config(1) .SH "NOTES" .IP " 1." 4 jonas.fonseca@gmail.com .RS 4 \%mailto:jonas.fonseca@gmail.com .RE tig-2.0.2/doc/tigrc.5.adoc000066400000000000000000001056061233303337700151620ustar00rootroot00000000000000tigrc(5) ======== :docext: adoc NAME ---- tigrc - Tig configuration file SYNOPSIS -------- [verse] _______________________________________________________________________ *set* 'variable' *=* 'value' *bind* 'keymap' 'key' 'action' *color* 'area' 'fgcolor' 'bgcolor' '[attributes]' *source* 'path' _______________________________________________________________________ DESCRIPTION ----------- You can permanently set an option by putting it in the `~/.tigrc` file. The file consists of a series of 'commands'. Each line of the file may contain only one command. Commands can span multiple lines if each line is terminated by a backslash ('\') character. The hash mark ('#') is used as a 'comment' character. All text after the comment character to the end of the line is ignored. You can use comments to annotate your initialization file. Git configuration ----------------- 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 'git-config(1)' for which files to use. The following example show the basic syntax to use for settings, bindings and colors. -------------------------------------------------------------------------- [tig] show-rev-graph = true [tig "color"] cursor = yellow red bold [tig "bind"] generic = P parent -------------------------------------------------------------------------- In addition to tig-specific options, the following Git options are read from the Git configuration: 'color.*':: Colors for the various UI types. Can be configured via the 'git-colors' setting. 'core.abbrev':: The width of the commit ID. See also 'id-width' option. 'core.editor':: The editor command. Can be overridden by setting GIT_EDITOR. 'core.worktree':: The path to the root of the working tree. 'gui.encoding':: The encoding to use for displaying of file content. 'i18n.commitencoding':: The encoding used for commits. The default is UTF-8. Set command ----------- A few selective variables can be configured via the set command. The syntax is: [verse] *set* variables *=* value Examples: -------------------------------------------------------------------------- set commit-order = topo # Order commits topologically set git-colors = no # Do not read Git's color settings. set horizontal-scroll = 33% # Scroll 33% of the view width set blame-options = -C -C -C # Blame lines from other files # Wrap branch names with () and tags with <> set reference-format = (branch) # Configure blame view columns using command spanning multiple lines. set blame-view = \ date:default \ author:abbreviated \ file-name:auto \ id:yes,color \ line-number:yes,interval=5 text -------------------------------------------------------------------------- Or in the Git configuration files: -------------------------------------------------------------------------- [tig] line-graphics = no # Disable graphics characters tab-size = 8 # Number of spaces per tab -------------------------------------------------------------------------- The type of variables is either bool, int, string, or mixed. Valid bool values:: To set a bool variable to true use either "1", "true", or "yes". Any other value will set the variable to false. Valid int values:: A non-negative integer. Valid string values:: A string of characters. Optionally, use either ' or " as delimiters. Valid mixed values:: These values are composites of the above types. The valid values are specified in the description. Variables ~~~~~~~~~ The following variables can be set: 'diff-options' (string):: 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 manpage:tig[1]), but is itself overridden by diff flags given on the command line invocation. 'blame-options' (string):: A space separated string of extra blame options. Can be used for telling git-blame(1) how to detect the origin of lines. The value is ignored when Tig is started in blame mode and given blame options on the command line. 'reference-format' (string):: 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 `local-tag`, the format for `tag` is used. Similarly, if no format is specified for `tracked-remote` the `remote` format is used. Prefix with `hide:` to not show that reference type, e.g. `hide:remote`. Supported reference types are: - head : The current HEAD. - tag : A signed tag. - local-tag : An unsigned tag. - remote : A remote. - tracked-remote : The remote tracked by current HEAD. - replace : A replaced reference. - branch : Any other reference. 'line-graphics' (mixed) [ascii|default|utf-8|]:: What type of character graphics for line drawing. 'horizontal-scroll' (mixed):: Interval to scroll horizontally in each step. Can be specified either as the number of columns, e.g. '5', or as a percentage of the view width, e.g. '33%', where the maximum is 100%. For percentages it is always ensured that at least one column is scrolled. The default is to scroll '50%' of the view width. 'git-colors' (list):: 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. 'show-notes' (mixed) [|]:: Whether to show notes for a commit. When set to a note reference the reference is passed to `git show --notes=`. Notes are enabled by default. 'show-changes' (bool):: Whether to show staged and unstaged changes in the main view. 'vertical-split' (mixed) [auto|]:: Whether to split the view horizontally or vertically. "auto" (which is the default) means that it will depend on the window dimensions. When true vertical orientation is used, and false sets the orientation to horizontal. 'split-view-height' (mixed):: Height of the lower view in a split view. Can be specified either as the number of rows, e.g. '5', or as a percentage of the view height, e.g. '80%', where the maximum is 100%. It is always ensured that the smaller of the views is at least four rows high. The default is a view height of '66%'. 'status-untracked-dirs' (bool):: Show untracked directories contents in the status view (analog to `git ls-files --directory` option). On by default. 'tab-size' (int):: Number of spaces per tab. The default is 8 spaces. 'diff-context' (int):: Number of context lines to show for diffs. '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`. 'commit-order' (mixed) [default|topo|date|author-date|reverse|]:: Commit ordering using the default (chronological reverse) order, topological order, date order or reverse order. The default order is used when the option is set to false, and topo order when set to true. 'ignore-case' (bool):: Ignore case in searches. By default, the search is case sensitive. 'wrap-lines' (bool):: Wrap long lines. By default, lines are not wrapped. Not compatible with line numbers enabled. 'focus-child' (bool):: Whether to focus the child view when it is opened. When disabled the focus will remain in the parent view, avoiding reloads of the child view when navigating the parent view. True by default. 'editor-line-number' (bool):: Whether to pass the selected line number to the editor command. The line number is passed as `+` in front of the file name. Example: `vim +10 tig.c` 'mouse' (bool):: 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. 'mouse-scroll' (int):: Interval to scroll up or down using the mouse. The default is 3 lines. 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 files in the repository. When set to 'manual', nothing is refreshed automatically. When set to 'auto', views are refreshed when a modification is detected. When set to 'after-command' only refresh after returning from an external command. When set to 'periodic', visible views are refreshed periodically using 'refresh-interval'. 'refresh-interval' (int):: Interval in seconds between view refresh update checks when 'refresh-mode' is set to 'periodic'. 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. 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 with a maximum width of 20 characters: `author:email,width=20`. The first option value in a column specification is always the 'display' option. When no 'display' value is given, 'yes' is assumed. For 'display' options expecting an enumerated value this will automatically resolve to the default enum value. For example, `file-name` will automatically have its 'display' setting resolve to 'auto'. Examples: -------------------------------------------------------------------------- # Enable both ID and line numbers in the blame view set blame-view = date:default author:full file-name:auto id:yes,color \ line-number:yes,interval=5 text # Change grep view to be similar to `git grep` format set grep-view = file-name:yes line-number:yes,interval=1 text # Show file sizes as units set tree-view = line-number:no,interval=5 mode author:full \ file-size:units date:default id:no file-name # Show line numbers for every 10th line in the pager view set pager-view = line-number:yes,interval=10 text -------------------------------------------------------------------------- The following list shows which the available view settings and what column types they support: blob-view, diff-view, log-view, pager-view, stage-view:: line-number, text blame-view:: author, date, file-name, id, line-number, text grep-view:: file-name, line-number, text main-view:: author, date, commit-title, id, line-number refs-view:: author, date, commit-title, id, line-number, ref stash-view:: author, date, commit-title, id, line-number status-view:: file-name, line-number, status tree-view:: author, date, id, file-name, file-size, line-number, mode Supported column types and their respective column options: author:: - 'display' (mixed) [full|abbreviated|email|email-user|]: How to display author names. If set to "abbreviated" author initials will be shown. - 'width' (int): Width of the column. When set to a value between 1 and 10, the author name will be abbreviated to the author's initials. When set to zero, the width is automatically sized to fit the content. commit-title:: - 'graph' (bool): Whether to show revision graph in the main view on start-up. See also the 'line-graphics' options. - 'refs' (bool): Whether to show references (branches, tags, and remotes) in the main view. Can be toggled. - 'overflow' (bool or int): Whether to highlight text in commit titles exceeding a given width. When set to a boolean, it enables or disables the highlighting using the default width of 50 character. When set to an int, the assigned value is used as the maximum character width. date:: - 'display' (mixed) [relative|short|default|local|]: How to display dates. If set to "relative" a relative date will be used, e.g. "2 minutes ago". If set to "short" no time information is shown. If set to "local", localtime(3) is used. - 'width' (int): Width of the column. When set to zero, the width is automatically sized to fit the content. file-name:: - 'display' (mixed) [auto|always|]: When to display file names. If set to "auto" file names are shown only when needed, e.g. when running: tig blame -C . - 'width' (int): Width of the column. When set to zero, the width is automatically sized to fit the content. file-size:: - 'display' (mixed) [default|units|]: How to display file sizes. When set to "units", sizes are shown using binary prefixes, e.g. 12524 bytes is shown as "12.2K". - 'width' (int): Width of the filename column. When set to zero, the width is automatically sized to fit the content. id:: - 'display' (bool): Whether to show commit IDs in the main view. - 'width' (int) : Width of the commit ID. When unset Tig will use the value of 'core.abbrev' if found. See git-config(1) on how to set 'core.abbrev'. When set to zero the width is automatically sized to fit the content of reflog (e.g. `ref/stash@{4}`) IDs and otherwise default to 7. line-number:: - 'display' (bool): Whether to show line numbers. - 'interval' (int): Interval between line numbers. - 'width' (int): Width of the column. When set to zero, the width is automatically sized to fit the content. mode:: - 'display' (bool): Whether to show file modes. - 'width' (int): Width of the column. When set to zero, the width is automatically sized to fit the content. ref:: - 'display' (bool): Whether to show the reference name. - 'width' (int): Width of the column. When set to zero, the width is automatically sized to fit the content. 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 titles exceeding a given width in the diff view. When set to a boolean, it enables or disables the highlighting using the default width of 50 character. When set to an int, the assigned value is used as the maximum character width. All column options can be toggled. For 'display' options, use the option name as the prefix followed by a dash and the column name. E.g. `:toggle author-display` will toggle the 'display' option in the 'author' column. For all other options use the column name followed by a dash and then the option name as the suffix. E.g. `:toggle commit-title-graph` will toggle the 'graph' option in the 'commit-title' column. Bind command ------------ Using bind commands, keys can be mapped to an action when pressed in a given key map. The syntax is: [verse] *bind* 'keymap' 'key' 'action' Examples: -------------------------------------------------------------------------- # Add keybinding to quickly jump to the next diff chunk in the stage view bind stage Enter :/^@@ # Disable the default mapping for running git-gc bind generic G none # User-defined external command to amend the last commit bind status + !git commit --amend # User-defined internal command that reloads ~/.tigrc bind generic S :source ~/.tigrc # UTF8-encoded characters can be used as key values. bind generic ø @sh -c "printf '%s' %(commit) | pbcopy" -------------------------------------------------------------------------- Or in the Git configuration files: -------------------------------------------------------------------------- [tig "bind"] # 'unbind' the default quit key binding main = Q none # Cherry-pick current commit onto current branch generic = C !git cherry-pick %(commit) -------------------------------------------------------------------------- Keys are mapped by first searching the keybindings for the current view, then 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. -- Keymaps:: Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*, *tree*, *blob*, *blame*, *refs*, *stash*, *grep* and *generic*. Use *generic* to set key mapping in all keymaps. Key values:: Key values should never be quoted. Use either an ASCII or UTF8-encoded character or one of the following symbolic key names. Symbolic key names are case insensitive and starts with "<" and ends with ">". Use ** to bind to the `#` key, since the hash mark is used as a comment character. Use ** to bind to the `<` key. **, **, **, **, ** 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 be bound using `key`. Examples: -------------------------------------------------------------------------- bind main R reload bind main next bind main scroll-page-down bind main o options -------------------------------------------------------------------------- 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). Actions:: Actions are either specified as user-defined commands (external or internal) or using action names as described in the following sections. -- External user-defined command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ These actions start with one or more of the following option flags followed by the command that should be executed. [frame="none",grid="none",cols="25 !git publish -------------------------------------------------------------------------- Internal user-defined commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Actions beginning with a ':' will be run and interpreted as internal commands and act similar to commands run via Tig's prompt. Valid internal commands are configuration file options (as described in this document) and pager view commands. Examples: -------------------------------------------------------------------------- # Reload ~/.tigrc when 'S' is pressed bind generic S :source .tigrc # Change diff view to show all commit changes regardless of file limitations bind diff F :set diff-options = --full-diff # Show the output of git-reflog(1) in the pager view bind generic W :!git reflog # Search for previous diff (c)hunk and next diff header bind stage 2 :?^@@ bind stage D :/^diff --(git|cc) bind main I :toggle show-id # Show/hide the ID column bind diff D :toggle diff-options --minimal # Use minimal diff algorithm bind diff [ :toggle diff-context -3 # Decrease context (-U arg) bind diff ] :toggle diff-context +3 # Increase context bind generic V :toggle split-view-height -10% # Decrease split height -------------------------------------------------------------------------- Similar to external commands, pager view commands can contain variable names that will be substituted before the command is run. Action names ~~~~~~~~~~~~ Valid action names are described below. Note, all action names are case-insensitive, and you may use '-', '_', and '.' interchangeably, e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same. ifndef::DOC_GEN_ACTIONS[] View switching ^^^^^^^^^^^^^^ [frame="none",grid="none",cols="25 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. SEE ALSO -------- ifndef::backend-docbook[] link:tig.1.{docext}[tig(1)], link:manual.{docext}[the Tig manual], endif::backend-docbook[] ifdef::backend-docbook[] manpage:tig[1], manpage:tigmanual[7], endif::backend-docbook[] git(7), git-config(1) tig-2.0.2/doc/tigrc.5.html000066400000000000000000002307121233303337700152150ustar00rootroot00000000000000 tigrc(5)

SYNOPSIS

set   variable = value
bind  keymap key action
color area fgcolor bgcolor [attributes]
source path

DESCRIPTION

You can permanently set an option by putting it in the ~/.tigrc file. The file consists of a series of commands. Each line of the file may contain only one command. Commands can span multiple lines if each line is terminated by a backslash (\) character.

The hash mark (#) is used as a comment character. All text after the comment character to the end of the line is ignored. You can use comments to annotate your initialization file.

Git configuration

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 git-config(1) for which files to use. The following example show the basic syntax to use for settings, bindings and colors.

[tig] show-rev-graph = true
[tig "color"] cursor = yellow red bold
[tig "bind"] generic = P parent

In addition to tig-specific options, the following Git options are read from the Git configuration:

color.*

Colors for the various UI types. Can be configured via the git-colors setting.

core.abbrev

The width of the commit ID. See also id-width option.

core.editor

The editor command. Can be overridden by setting GIT_EDITOR.

core.worktree

The path to the root of the working tree.

gui.encoding

The encoding to use for displaying of file content.

i18n.commitencoding

The encoding used for commits. The default is UTF-8.

Set command

A few selective variables can be configured via the set command. The syntax is:

set variables = value

Examples:

set commit-order = topo         # Order commits topologically
set git-colors = no             # Do not read Git's color settings.
set horizontal-scroll = 33%     # Scroll 33% of the view width
set blame-options = -C -C -C    # Blame lines from other files

# Wrap branch names with () and tags with <>
set reference-format = (branch) <tag>

# Configure blame view columns using command spanning multiple lines.
set blame-view = \
        date:default \
        author:abbreviated \
        file-name:auto \
        id:yes,color \
        line-number:yes,interval=5 text

Or in the Git configuration files:

[tig]
        line-graphics = no      # Disable graphics characters
        tab-size = 8            # Number of spaces per tab

The type of variables is either bool, int, string, or mixed.

Valid bool values

To set a bool variable to true use either "1", "true", or "yes". Any other value will set the variable to false.

Valid int values

A non-negative integer.

Valid string values

A string of characters. Optionally, use either ' or " as delimiters.

Valid mixed values

These values are composites of the above types. The valid values are specified in the description.

Variables

The following variables can be set:

diff-options (string)

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 overridden by diff flags given on the command line invocation.

blame-options (string)

A space separated string of extra blame options. Can be used for telling git-blame(1) how to detect the origin of lines. The value is ignored when Tig is started in blame mode and given blame options on the command line.

reference-format (string)

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 format is specified for tracked-remote the remote format is used. Prefix with hide: to not show that reference type, e.g. hide:remote. Supported reference types are:

  • head : The current HEAD.

  • tag : A signed tag.

  • local-tag : An unsigned tag.

  • remote : A remote.

  • tracked-remote : The remote tracked by current HEAD.

  • replace : A replaced reference.

  • branch : Any other reference.

line-graphics (mixed) [ascii|default|utf-8|<bool>]

What type of character graphics for line drawing.

horizontal-scroll (mixed)

Interval to scroll horizontally in each step. Can be specified either as the number of columns, e.g. 5, or as a percentage of the view width, e.g. 33%, where the maximum is 100%. For percentages it is always ensured that at least one column is scrolled. The default is to scroll 50% of the view width.

git-colors (list)

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.

show-notes (mixed) [<reference>|<bool>]

Whether to show notes for a commit. When set to a note reference the reference is passed to git show --notes=. Notes are enabled by default.

show-changes (bool)

Whether to show staged and unstaged changes in the main view.

vertical-split (mixed) [auto|<bool>]

Whether to split the view horizontally or vertically. "auto" (which is the default) means that it will depend on the window dimensions. When true vertical orientation is used, and false sets the orientation to horizontal.

split-view-height (mixed)

Height of the lower view in a split view. Can be specified either as the number of rows, e.g. 5, or as a percentage of the view height, e.g. 80%, where the maximum is 100%. It is always ensured that the smaller of the views is at least four rows high. The default is a view height of 66%.

status-untracked-dirs (bool)

Show untracked directories contents in the status view (analog to git ls-files --directory option). On by default.

tab-size (int)

Number of spaces per tab. The default is 8 spaces.

diff-context (int)

Number of context lines to show for diffs.

ignore-space (mixed) [no|all|some|at-eol|<bool>]

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.

commit-order (mixed) [default|topo|date|author-date|reverse|<bool>]

Commit ordering using the default (chronological reverse) order, topological order, date order or reverse order. The default order is used when the option is set to false, and topo order when set to true.

ignore-case (bool)

Ignore case in searches. By default, the search is case sensitive.

wrap-lines (bool)

Wrap long lines. By default, lines are not wrapped. Not compatible with line numbers enabled.

focus-child (bool)

Whether to focus the child view when it is opened. When disabled the focus will remain in the parent view, avoiding reloads of the child view when navigating the parent view. True by default.

editor-line-number (bool)

Whether to pass the selected line number to the editor command. The line number is passed as +<line-number> in front of the file name. Example: vim +10 tig.c

mouse (bool)

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.

mouse-scroll (int)

Interval to scroll up or down using the mouse. The default is 3 lines. 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>]

Configures how views are refreshed based on modifications to watched files in the repository. When set to manual, nothing is refreshed automatically. When set to auto, views are refreshed when a modification is detected. When set to after-command only refresh after returning from an external command. When set to periodic, visible views are refreshed periodically using refresh-interval.

refresh-interval (int)

Interval in seconds between view refresh update checks when refresh-mode is set to periodic.

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. 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 with a maximum width of 20 characters: author:email,width=20.

The first option value in a column specification is always the display option. When no display value is given, yes is assumed. For display options expecting an enumerated value this will automatically resolve to the default enum value. For example, file-name will automatically have its display setting resolve to auto.

Examples:

# Enable both ID and line numbers in the blame view
set blame-view = date:default author:full file-name:auto id:yes,color \
                 line-number:yes,interval=5 text

# Change grep view to be similar to `git grep` format
set grep-view = file-name:yes line-number:yes,interval=1 text

# Show file sizes as units
set tree-view = line-number:no,interval=5 mode author:full \
                file-size:units date:default id:no file-name

# Show line numbers for every 10th line in the pager view
set pager-view = line-number:yes,interval=10 text

The following list shows which the available view settings and what column types they support:

blob-view, diff-view, log-view, pager-view, stage-view

line-number, text

blame-view

author, date, file-name, id, line-number, text

grep-view

file-name, line-number, text

main-view

author, date, commit-title, id, line-number

refs-view

author, date, commit-title, id, line-number, ref

stash-view

author, date, commit-title, id, line-number

status-view

file-name, line-number, status

tree-view

author, date, id, file-name, file-size, line-number, mode

Supported column types and their respective column options:

author
  • display (mixed) [full|abbreviated|email|email-user|<bool>]: How to display author names. If set to "abbreviated" author initials will be shown.

  • width (int): Width of the column. When set to a value between 1 and 10, the author name will be abbreviated to the author’s initials. When set to zero, the width is automatically sized to fit the content.

commit-title
  • graph (bool): Whether to show revision graph in the main view on start-up. See also the line-graphics options.

  • refs (bool): Whether to show references (branches, tags, and remotes) in the main view. Can be toggled.

  • overflow (bool or int): Whether to highlight text in commit titles exceeding a given width. When set to a boolean, it enables or disables the highlighting using the default width of 50 character. When set to an int, the assigned value is used as the maximum character width.

date
  • display (mixed) [relative|short|default|local|<bool>]: How to display dates. If set to "relative" a relative date will be used, e.g. "2 minutes ago". If set to "short" no time information is shown. If set to "local", localtime(3) is used.

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

file-name
  • display (mixed) [auto|always|<bool>]: When to display file names. If set to "auto" file names are shown only when needed, e.g. when running: tig blame -C <file>.

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

file-size
  • display (mixed) [default|units|<bool>]: How to display file sizes. When set to "units", sizes are shown using binary prefixes, e.g. 12524 bytes is shown as "12.2K".

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

id
  • display (bool): Whether to show commit IDs in the main view.

  • width (int) : Width of the commit ID. When unset Tig will use the value of core.abbrev if found. See git-config(1) on how to set core.abbrev. When set to zero the width is automatically sized to fit the content of reflog (e.g. ref/stash@{4}) IDs and otherwise default to 7.

line-number
  • display (bool): Whether to show line numbers.

  • interval (int): Interval between line numbers.

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

mode
  • display (bool): Whether to show file modes.

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

ref
  • display (bool): Whether to show the reference name.

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

status
  • display (mixed) [no|short|long|<bool>]: 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 titles exceeding a given width in the diff view. When set to a boolean, it enables or disables the highlighting using the default width of 50 character. When set to an int, the assigned value is used as the maximum character width.

All column options can be toggled. For display options, use the option name as the prefix followed by a dash and the column name. E.g. :toggle author-display will toggle the display option in the author column. For all other options use the column name followed by a dash and then the option name as the suffix. E.g. :toggle commit-title-graph will toggle the graph option in the commit-title column.

Bind command

Using bind commands, keys can be mapped to an action when pressed in a given key map. The syntax is:

bind keymap key action

Examples:

# Add keybinding to quickly jump to the next diff chunk in the stage view
bind stage Enter :/^@@

# Disable the default mapping for running git-gc
bind generic G none

# User-defined external command to amend the last commit
bind status + !git commit --amend

# User-defined internal command that reloads ~/.tigrc
bind generic S :source ~/.tigrc

# UTF8-encoded characters can be used as key values.
bind generic ø @sh -c "printf '%s' %(commit) | pbcopy"

Or in the Git configuration files:

[tig "bind"]
        # 'unbind' the default quit key binding
        main = Q none
        # Cherry-pick current commit onto current branch
        generic = C !git cherry-pick %(commit)

Keys are mapped by first searching the keybindings for the current view, then 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.

Keymaps

Valid keymaps are: main, diff, log, help, pager, status, stage, tree, blob, blame, refs, stash, grep and generic. Use generic to set key mapping in all keymaps.

Key values

Key values should never be quoted. Use either an ASCII or UTF8-encoded character or one of the following symbolic key names. Symbolic key names are case insensitive and starts with "<" and ends with ">". Use <Hash> to bind to the # key, since the hash mark is used as a comment character. Use <LessThan> to bind to the < key.

<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>.

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.

Examples:

bind main R             reload
bind main <Down>        next
bind main <Ctrl-f>      scroll-page-down
bind main <Esc>o        options

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).

Actions

Actions are either specified as user-defined commands (external or internal) or using action names as described in the following sections.

External user-defined command

These actions start with one or more of the following option flags followed by the command that should be executed.

!

Run the command in the foreground with output shown.

@

Run the command in the background with no output.

?

Prompt the user before executing the command.

<

Exit Tig after executing the command.

Unless otherwise specified, commands are run in the foreground with their console output shown (as if ! was specified). When multiple command options are specified their behavior are combined, e.g. "?<git commit" will prompt the user whether to execute the command and will exit Tig after completion.

Browsing state variables

User-defined commands can optionally refer to Tig’s internal state using the following variable names, which are substituted before commands are run:

%(head)

The currently viewed head ID. Defaults to HEAD

%(commit)

The currently selected commit ID.

%(blob)

The currently selected blob ID.

%(branch)

The currently selected branch name.

%(remote)

The currently selected remote name. For remote branches %(branch) will contain the branch name.

%(tag)

The currently selected tag name.

%(stash)

The currently selected stash name.

%(directory)

The current directory path in the tree view or "." if undefined.

%(file)

The currently selected file.

%(ref)

The reference given to blame or HEAD if undefined.

%(revargs)

The revision arguments passed on the command line.

%(fileargs)

The file arguments passed on the command line.

%(cmdlineargs)

All other options passed on the command line.

%(diffargs)

The diff options from diff-options or TIG_DIFF_OPTS

%(prompt)

Prompt for the argument value. Optionally specify a custom prompt using "%(prompt Enter branch name: )"

Examples:

# Save 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: )"

Advanced shell-like commands

If your command requires use of dynamic features, such as subshells, expansion of environment variables and process control, this can be achieved by using a shell command:

Configure a binding to copy the current commit ID to the clipboard.
bind generic I @sh -c "echo -n %(commit) | xclip -selection c"

Or by using a combination of Git aliases and Tig external commands. The following example entries can be put in either the .gitconfig or .git/config file:

Git configuration which binds Tig keys to Git command aliases.
[alias]
        gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
        publish = !"for i in origin public; do git push $i; done"
[tig "bind"]
        # @-prefix means that the console output will not be shown.
        generic = V !@git gitk-bg
        generic = > !git publish

Internal user-defined commands

Actions beginning with a : will be run and interpreted as internal commands and act similar to commands run via Tig’s prompt. Valid internal commands are configuration file options (as described in this document) and pager view commands. Examples:

# Reload ~/.tigrc when 'S' is pressed
bind generic S :source .tigrc

# Change diff view to show all commit changes regardless of file limitations
bind diff F :set diff-options = --full-diff

# Show the output of git-reflog(1) in the pager view
bind generic W :!git reflog

# Search for previous diff (c)hunk and next diff header
bind stage 2 :?^@@
bind stage D :/^diff --(git|cc)

bind main I :toggle show-id                     # Show/hide the ID column
bind diff D :toggle diff-options --minimal      # Use minimal diff algorithm
bind diff [ :toggle diff-context -3             # Decrease context (-U arg)
bind diff ] :toggle diff-context +3             # Increase context
bind generic V :toggle split-view-height -10%   # Decrease split height

Similar to external commands, pager view commands can contain variable names that will be substituted before the command is run.

Action names

Valid action names are described below. Note, all action names are case-insensitive, and you may use -, _, and . interchangeably, e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.

View switching

view-main

Show main view

view-diff

Show diff view

view-log

Show log view

view-tree

Show tree view

view-blob

Show blob view

view-blame

Show blame view

view-refs

Show refs view

view-status

Show status view

view-stage

Show stage view

view-stash

Show stash view

view-grep

Show grep view

view-pager

Show pager view

view-help

Show help view

View manipulation

enter

Enter and open selected line

back

Go back to the previous view state

next

Move to next

previous

Move to previous

parent

Move to parent

view-next

Move focus to the next view

refresh

Reload and refresh view

maximize

Maximize the current view

view-close

Close the current view

quit

Close all views and quit

View specific actions

status-update

Stage/unstage chunk or file changes

status-revert

Revert chunk or file changes

status-merge

Merge file using external tool

stage-update-line

Stage/unstage single line

stage-split-chunk

Split current diff chunk

Cursor navigation

move-up

Move cursor one line up

move-down

Move cursor one line down

move-page-down

Move cursor one page down

move-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

find-next

Find next search match

find-prev

Find previous search match

Option manipulation

In addition to the actions below, options can also be toggled with the :toggle prompt command.

options

Open the options menu

Misc

edit

Open in editor

prompt

Open the prompt

screen-redraw

Redraw the screen

stop-loading

Stop all loading views

show-version

Show version information

none

Do nothing

Color command

Color commands control highlighting and the user interface styles. If your terminal supports color, these commands can be used to assign foreground and background combinations to certain areas. Optionally, an attribute can be given as the last parameter. The syntax is:

color area fgcolor bgcolor [attributes]

Examples:

# Override the default terminal colors to white on black.
color default           white   black
# Diff colors
color diff-header       yellow  default
color diff-index        blue    default
color diff-chunk        magenta default
color "Reported-by:"    green   default
# View specific color
color tree.date         black   cyan    bold

Or in the Git configuration files:

[tig "color"]
        # A strange looking cursor line
        cursor          = red   default underline
        # UI colors
        title-blur      = white blue
        title-focus     = white blue    bold
# View specific color
[tig "color.tree"]
        date            = cyan  default bold
Area names

Can be either a built-in area name or a custom quoted string. The latter allows custom color rules to be added for lines matching a quoted string. 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 the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".

Color names

Valid colors include: white, black, green, magenta, blue, cyan, yellow, red, default. Use default to refer to the default terminal colors, for example, to keep the background transparent when you are using a terminal with a transparent background.

Colors can also be specified using the keywords color0, color1, …, colorN-1 (where N is the number of colors supported by your terminal). This is useful when you remap the colors for your display or want to enable colors supported by 88-color and 256-color terminals. Note that the color prefix is optional. If you prefer, you can specify colors directly by their numbers 0, 1, …, N-1 instead, just like in the configuration file of Git.

Attribute names

Valid attributes include: normal, blink, bold, dim, reverse, standout, and underline. Note, not all attributes may be supported by the terminal.

UI colors

The colors and attributes to be used for the text that is not highlighted or that specify the use of the default terminal colors can be controlled by setting the default color option.

Table 1. General

default

Override default terminal colors (see above).

cursor

The cursor line.

status

The status window showing info messages.

title-focus

The title window for the current view.

title-blur

The title window of any backgrounded view.

delimiter

Delimiter shown for truncated lines.

header

The view header lines. Use status.header to color the staged, unstaged, and untracked sections in the status view. Use help.header to color the keymap sections in the help view.

line-number

Line numbers.

id

The commit ID.

date

The commit date.

author

The commit author.

mode

The file mode holding the permissions and type.

overflow

Title text overflow.

directory

The directory name.

file

The file name.

file-size

File size.

Table 2. Main view colors

graph-commit

The commit dot in the revision graph.

palette-[0-6]

7 different colors, used for distinguishing branches or commits. example: palette-0 = red

main-commit

The commit comment.

main-head

Label of the current branch.

main-remote

Label of a remote.

main-tracked

Label of the remote tracked by the current branch.

main-tag

Label of a signed tag.

main-local-tag

Label of a local tag.

main-ref

Label of any other reference.

main-replace

Label of replaced reference.

Table 3. Status view

stat-none

Empty status label.

stat-staged

Status flag of staged files.

stat-unstaged

Status flag of unstaged files.

stat-untracked

Status flag of untracked files.

Table 4. Help view

help-group

Help group name.

help-action

Help action name.

Highlighting

Diff markup

Options concerning diff start, chunks and lines added and deleted.

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

Enhanced Git diff markup

Extra diff information emitted by the Git diff machinery, such as mode changes, rename detection, and similarity.

diff-oldmode, diff-newmode, diff-copy-from, diff-copy-to, diff-similarity, diff-index

Pretty print commit headers

Commit diffs and the revision logs are usually formatted using pretty printed headers , unless --pretty=raw was given. This includes lines, such as merge info, commit ID, and author and committer date.

pp-refs, pp-reflog, pp-reflogmsg, pp-merge

Raw commit header

Usually shown when --pretty=raw is given, however commit is pretty much omnipresent.

commit, parent, tree, author, committer

Commit message

Signed-off-by, Acked-by, Reviewed-by and Tested-by lines are colorized. Characters in the commit title exceeding a predefined width can be highlighted.

Tree markup

Colors for information of the tree view.

tree-dir, tree-file

Source command

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:

source path

Examples:

source ~/.tig/colorscheme.tigrc
source ~/.tig/keybindings.tigrc

Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>

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.

SEE ALSO

tig(1), the Tig manual, git(7), git-config(1)


tig-2.0.2/include/000077500000000000000000000000001233303337700137255ustar00rootroot00000000000000tig-2.0.2/include/tig/000077500000000000000000000000001233303337700145105ustar00rootroot00000000000000tig-2.0.2/include/tig/argv.h000066400000000000000000000044001233303337700156160ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_ARGV_H #define TIG_ARGV_H #include "tig/tig.h" /* * Argument array helpers. */ #define SIZEOF_ARG 32 /* Default argument array size. */ bool argv_to_string(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); bool argv_from_env(const char **argv, const char *name); void argv_free(const char *argv[]); size_t argv_size(const char **argv); bool argv_append(const char ***argv, const char *arg); bool argv_append_array(const char ***dst_argv, const char *src_argv[]); bool argv_copy(const char ***dst, const char *src[]); bool argv_remove_quotes(const char *argv[]); bool argv_contains(const char **argv, const char *arg); #define ARGV_ENV_INFO(_) \ _(commit, "", "HEAD"), \ _(blob, "", ""), \ _(branch, "", ""), \ _(directory, ".", ""), \ _(file, "", ""), \ _(head, "", "HEAD"), \ _(ref, "HEAD", ""), \ _(remote, "origin", ""), \ _(stash, "", ""), \ _(status, "", ""), \ _(tag, "", "") #define ARGV_ENV_FIELDS(name, ifempty, initval) name[SIZEOF_STR] struct argv_env { char ARGV_ENV_INFO(ARGV_ENV_FIELDS); unsigned long lineno; char search[SIZEOF_STR]; char none[1]; }; extern struct argv_env argv_env; bool argv_format(struct argv_env *argv_env, const char ***dst_argv, const char *src_argv[], bool first, bool file_filter); char *argv_format_arg(struct argv_env *argv_env, const char *src_arg); struct rev_flags { size_t search_offset; bool with_graph; bool with_reflog; }; bool argv_parse_rev_flag(const char *arg, struct rev_flags *flags); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/blame.h000066400000000000000000000015051233303337700157420ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_BLAME_H #define TIG_BLAME_H #include "tig/view.h" extern struct view blame_view; static inline void open_blame_view(struct view *prev, enum open_flags flags) { open_view(prev, &blame_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/blob.h000066400000000000000000000015001233303337700155730ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_BLOB_H #define TIG_BLOB_H #include "tig/view.h" extern struct view blob_view; static inline void open_blob_view(struct view *prev, enum open_flags flags) { open_view(prev, &blob_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/diff.h000066400000000000000000000026461233303337700156010ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_DIFF_H #define TIG_DIFF_H #include "tig/view.h" struct diff_state { bool after_commit_title; bool after_diff; bool reading_diff_stat; bool combined_diff; }; enum request diff_common_edit(struct view *view, enum request request, struct line *line); bool diff_common_read(struct view *view, const char *data, struct diff_state *state); enum request diff_common_enter(struct view *view, enum request request, struct line *line); struct line *diff_common_add_diff_stat(struct view *view, const char *text, size_t offset); unsigned int diff_get_lineno(struct view *view, struct line *line); const char *diff_get_pathname(struct view *view, struct line *line); extern struct view diff_view; static inline void open_diff_view(struct view *prev, enum open_flags flags) { open_view(prev, &diff_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/display.h000066400000000000000000000033411233303337700163270ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_DISPLAY_H #define TIG_DISPLAY_H #include "tig/tig.h" #include "tig/keys.h" enum input_status { INPUT_OK, INPUT_SKIP, INPUT_DELETE, INPUT_STOP, INPUT_CANCEL }; int get_input(int prompt_position, struct key *key, bool modifiers); extern WINDOW *status_win; extern FILE *opt_tty; void update_status(const char *msg, ...); void report(const char *msg, ...) PRINTF_LIKE(1, 2); #define report_clear() report("%s", "") /* * Display management. */ /* The display array of active views and the index of the current view. */ extern struct view *display[2]; extern unsigned int current_view; #define foreach_displayed_view(view, i) \ for (i = 0; i < ARRAY_SIZE(display) && (view = display[i]); i++) #define displayed_views() (display[1] != NULL ? 2 : 1) #define view_is_displayed(view) \ (view == display[0] || view == display[1]) void init_display(void); void resize_display(void); void redraw_display(bool clear); bool open_external_viewer(const char *argv[], const char *dir, bool confirm, bool refresh, const char *notice); void open_editor(const char *file, unsigned int lineno); void enable_mouse(bool enable); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/draw.h000066400000000000000000000032241233303337700156170ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_DRAW_H #define TIG_DRAW_H #include "tig/tig.h" #include "tig/line.h" #include "tig/view.h" #include "tig/refdb.h" #include "tig/util.h" struct graph_canvas; enum align { ALIGN_LEFT, ALIGN_RIGHT }; #define VIEW_MAX_LEN(view) ((view)->width + (view)->pos.col - (view)->col) bool draw_text(struct view *view, enum line_type type, const char *string); bool PRINTF_LIKE(3, 4) draw_formatted(struct view *view, enum line_type type, const char *format, ...); bool draw_graphic(struct view *view, enum line_type type, const chtype graphic[], size_t size, bool separator); bool draw_field(struct view *view, enum line_type type, const char *text, int width, enum align align, bool trim); bool draw_lineno(struct view *view, struct view_column *column, unsigned int lineno); bool view_column_draw(struct view *view, struct line *line, unsigned int lineno); void redraw_view(struct view *view); void redraw_view_from(struct view *view, int lineno); void redraw_view_dirty(struct view *view); bool draw_view_line(struct view *view, unsigned int lineno); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/git.h000066400000000000000000000055151233303337700154520ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_GIT_H #define TIG_GIT_H /* * Argv-style git command macros. */ #define GIT_DIFF_INITIAL(encoding_arg, cached_arg, context_arg, space_arg, old_name, new_name) \ "git", "diff", (encoding_arg), "--no-color", "--patch-with-stat", \ (cached_arg), (context_arg), (space_arg), "--", (old_name), (new_name), NULL #define GIT_DIFF_STAGED_INITIAL(encoding_arg, context_arg, space_arg, new_name) \ GIT_DIFF_INITIAL(encoding_arg, "--cached", context_arg, space_arg, "", new_name) #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", \ "--", (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 /* Don't show staged unmerged entries. */ #define GIT_DIFF_STAGED_FILES(output_arg) \ "git", "diff-index", (output_arg), "--diff-filter=ACDMRTXB", "-C", "--cached", "HEAD", "--", NULL #define GIT_DIFF_UNSTAGED_FILES(output_arg) \ "git", "diff-files", (output_arg), NULL #define GIT_DIFF_BLAME(encoding_arg, context_arg, space_arg, new_name) \ GIT_DIFF_UNSTAGED(encoding_arg, context_arg, space_arg, "", new_name) #define GIT_DIFF_BLAME_NO_PARENT(encoding_arg, context_arg, space_arg, new_name) \ GIT_DIFF_INITIAL(encoding_arg, "", context_arg, space_arg, "/dev/null", new_name) #define GIT_MAIN_LOG(encoding_arg, commit_order_arg, diffargs, revargs, fileargs, pretty_arg) \ "git", "log", (encoding_arg), \ (commit_order_arg), (diffargs), (revargs), "--date=raw", "--parents", \ "--no-color", (pretty_arg), "--", (fileargs), NULL #define GIT_MAIN_LOG_CUSTOM(encoding_arg, commit_order_arg, diffargs, revargs, fileargs) \ GIT_MAIN_LOG(encoding_arg, commit_order_arg, diffargs, revargs, fileargs, \ "--pretty=format:commit %H %P%x00%an <%ae> %ad%x00%s") #define GIT_MAIN_LOG_RAW(encoding_arg, commit_order_arg, diffargs, revargs, fileargs) \ GIT_MAIN_LOG(encoding_arg, commit_order_arg, diffargs, revargs, fileargs, \ "--pretty=raw") #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/graph.h000066400000000000000000000047171233303337700157730ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_GRAPH_H #define TIG_GRAPH_H #include "compat/hashtab.h" #define GRAPH_COLORS 7 struct graph_symbol { unsigned int color:8; unsigned int commit:1; unsigned int boundary:1; unsigned int initial:1; unsigned int merge:1; unsigned int continued_down:1; unsigned int continued_up:1; unsigned int continued_right:1; unsigned int continued_left:1; unsigned int continued_up_left:1; unsigned int parent_down:1; unsigned int parent_right:1; unsigned int below_commit:1; unsigned int flanked:1; unsigned int next_right:1; unsigned int matches_commit:1; unsigned int shift_left:1; unsigned int continue_shift:1; unsigned int below_shift:1; unsigned int new_column:1; unsigned int empty:1; }; struct graph_canvas { size_t size; /* The width of the graph array. */ struct graph_symbol *symbols; /* Symbols for this row. */ }; struct graph_column { struct graph_symbol symbol; char id[SIZEOF_REV]; /* Parent SHA1 ID. */ }; struct graph_row { size_t size; struct graph_column *columns; }; struct colors { htab_t id_map; size_t count[GRAPH_COLORS]; }; struct graph { struct graph_row row; struct graph_row parents; struct graph_row prev_row; struct graph_row next_row; size_t position; size_t prev_position; size_t expanded; char id[SIZEOF_REV]; struct graph_canvas *canvas; struct colors colors; bool has_parents; bool is_boundary; }; void done_graph(struct graph *graph); bool graph_render_parents(struct graph *graph); bool graph_add_commit(struct graph *graph, struct graph_canvas *canvas, const char *id, const char *parents, bool is_boundary); struct graph_column *graph_add_parent(struct graph *graph, const char *parent); const char *graph_symbol_to_ascii(struct graph_symbol *symbol); const char *graph_symbol_to_utf8(struct graph_symbol *symbol); const chtype *graph_symbol_to_chtype(struct graph_symbol *symbol); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/grep.h000066400000000000000000000013621233303337700156200ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_GREP_H #define TIG_GREP_H #include "tig/view.h" void open_grep_view(struct view *prev); extern struct view grep_view; #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/help.h000066400000000000000000000015001233303337700156050ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_HELP_H #define TIG_HELP_H #include "tig/view.h" extern struct view help_view; static inline void open_help_view(struct view *prev, enum open_flags flags) { open_view(prev, &help_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/io.h000066400000000000000000000072031233303337700152720ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_IO_H #define TIG_IO_H #include "tig/tig.h" struct buffer { char *data; size_t size; }; /* * Encoding conversion. */ #define ENCODING_UTF8 "UTF-8" struct encoding; struct encoding *encoding_open(const char *fromcode); bool encoding_convert(struct encoding *encoding, struct buffer *buf); const char *encoding_iconv(iconv_t iconv_out, const char *string, size_t length); struct encoding *get_path_encoding(const char *path, struct encoding *default_encoding); extern char encoding_arg[]; extern struct encoding *default_encoding; /* * Executing external commands. */ enum io_flags { IO_RD_FORWARD_STDIN, /* Forward stdin from parent process to child. */ IO_RD_WITH_STDERR, /* Redirect stderr to stdin. */ }; 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_WR, /* Write only fork+exec IO. */ IO_AP, /* Append fork+exec output to file. */ }; struct io { int pipe; /* Pipe end for reading or writing. */ pid_t pid; /* PID of spawned process. */ int error; /* Error status. */ char *buf; /* Read buffer. */ size_t bufalloc; /* Allocated buffer size. */ 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. */ }; typedef int (*io_read_fn)(char *, size_t, char *, size_t, void *data); bool io_open(struct io *io, const char *fmt, ...) PRINTF_LIKE(2, 3); bool io_from_string(struct io *io, const char *str); bool io_kill(struct io *io); bool io_done(struct io *io); bool io_exec(struct io *io, enum io_type type, const char *dir, char * const env[], const char *argv[], int custom); bool io_run(struct io *io, enum io_type type, const char *dir, char * const env[], const char *argv[]); bool io_run_bg(const char **argv); bool io_run_fg(const char **argv, const char *dir); bool io_run_append(const char **argv, int fd); bool io_eof(struct io *io); int io_error(struct io *io); char * io_strerror(struct io *io); bool io_can_read(struct io *io, bool can_block); ssize_t io_read(struct io *io, void *buf, size_t bufsize); bool io_get(struct io *io, struct buffer *buf, int c, bool can_read); 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 io_run_buf(const char **argv, char buf[], size_t bufsize); int io_load(struct io *io, const char *separators, io_read_fn read_property, void *data); int io_load_span(struct io *io, const char *separators, size_t *lineno, io_read_fn read_property, void *data); int io_run_load(const char **argv, const char *separators, io_read_fn read_property, void *data); char *io_memchr(struct buffer *buf, char *data, int c); const char *get_temp_dir(void); bool io_trace(const char *fmt, ...); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/keys.h000066400000000000000000000042441233303337700156400ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_KEYS_H #define TIG_KEYS_H #include "tig/tig.h" #include "tig/request.h" /* * Keys */ struct keybinding; struct keymap { const char *name; struct keybinding **data; size_t size; bool hidden; }; struct key { union { int value; char bytes[7]; } data; struct { bool escape:1; bool control:1; bool multibytes:1; } modifiers; }; static inline unsigned long key_to_unicode(struct key *key) { return key->modifiers.multibytes ? utf8_to_unicode(key->data.bytes, strlen(key->data.bytes)) : 0; } struct keymap *get_keymap(const char *name, size_t namelen); struct keymap *get_keymap_by_index(int i); const char *get_key_name(const struct key key[], size_t keys); enum status_code get_key_value(const char **name, struct key *key); /* Looks for a key binding first in the given map, then in the generic map, and * lastly in the default keybindings. */ enum request get_keybinding(struct keymap *keymap, struct key key[], size_t keys); enum status_code add_keybinding(struct keymap *table, enum request request, struct key key[], size_t keys); const char *get_keys(struct keymap *keymap, enum request request, bool all); #define get_view_key(view, request) get_keys((view)->keymap, request, FALSE) struct run_request_flags { bool silent; bool confirm; bool exit; bool internal; }; struct run_request { struct keymap *keymap; struct run_request_flags flags; const char **argv; }; struct run_request *get_run_request(enum request request); enum status_code add_run_request(struct keymap *keymap, struct key key[], size_t keys, const char **argv); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/line.h000066400000000000000000000066651233303337700156250ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_LINE_H #define TIG_LINE_H #include "tig/tig.h" struct ref; /* * Line-oriented content detection. */ #define LINE_INFO(_) \ _(DIFF_HEADER, "diff --"), \ _(DIFF_CHUNK, "@@"), \ _(DIFF_ADD, "+"), \ _(DIFF_ADD2, " +"), \ _(DIFF_DEL, "-"), \ _(DIFF_DEL2, " -"), \ _(DIFF_INDEX, "index "), \ _(DIFF_OLDMODE, "old file mode "), \ _(DIFF_NEWMODE, "new file mode "), \ _(DIFF_SIMILARITY, "similarity "), \ _(PP_MERGE, "Merge: "), \ _(PP_REFS, "Refs: "), \ _(PP_REFLOG, "Reflog: "), \ _(PP_REFLOGMSG, "Reflog message: "), \ _(COMMIT, "commit "), \ _(PARENT, "parent "), \ _(TREE, "tree "), \ _(AUTHOR, "author "), \ _(COMMITTER, "committer "), \ _(DEFAULT, ""), \ _(CURSOR, ""), \ _(STATUS, ""), \ _(DELIMITER, ""), \ _(DATE, ""), \ _(MODE, ""), \ _(ID, ""), \ _(OVERFLOW, ""), \ _(DIRECTORY, ""), \ _(FILE, ""), \ _(FILE_SIZE, ""), \ _(LINE_NUMBER, ""), \ _(TITLE_BLUR, ""), \ _(TITLE_FOCUS, ""), \ _(HEADER, ""), \ _(SECTION, ""), \ _(MAIN_COMMIT, ""), \ _(MAIN_TAG, ""), \ _(MAIN_LOCAL_TAG, ""), \ _(MAIN_REMOTE, ""), \ _(MAIN_REPLACE, ""), \ _(MAIN_TRACKED, ""), \ _(MAIN_REF, ""), \ _(MAIN_HEAD, ""), \ _(STAT_NONE, ""), \ _(STAT_STAGED, ""), \ _(STAT_UNSTAGED, ""), \ _(STAT_UNTRACKED, ""), \ _(HELP_GROUP, ""), \ _(HELP_ACTION, ""), \ _(DIFF_STAT, ""), \ _(PALETTE_0, ""), \ _(PALETTE_1, ""), \ _(PALETTE_2, ""), \ _(PALETTE_3, ""), \ _(PALETTE_4, ""), \ _(PALETTE_5, ""), \ _(PALETTE_6, ""), \ _(GRAPH_COMMIT, "") enum line_type { #define DEFINE_LINE_ENUM(type, line) LINE_##type LINE_INFO(DEFINE_LINE_ENUM), LINE_NONE }; struct line_info { struct line_info *next; /* List of line info matching this line type. */ const char *prefix; /* View (or keymap) name. */ int fg, bg, attr; /* Color and text attributes for the lines. */ int color_pair; }; struct line_rule { const char *name; /* Option name. */ int namelen; /* Size of option name. */ const char *line; /* The start of line to match. */ int linelen; /* Size of string to match. */ struct line_info info; /* List of line info matching this rule. */ }; enum line_type get_line_type(const char *line); enum line_type get_line_type_from_ref(const struct ref *ref); 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); /* Color IDs must be 1 or higher. [GH #15] */ #define COLOR_ID(line_type) ((line_type) + 1) static inline int get_line_color(const char *prefix, enum line_type type) { return COLOR_ID(get_line_info(prefix, type)->color_pair); } static inline int 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; } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/log.h000066400000000000000000000014731233303337700154470ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_LOG_H #define TIG_LOG_H #include "tig/view.h" extern struct view log_view; static inline void open_log_view(struct view *prev, enum open_flags flags) { open_view(prev, &log_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/main.h000066400000000000000000000032721233303337700156110ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_MAIN_H #define TIG_MAIN_H #include "tig/view.h" #include "tig/graph.h" #include "tig/util.h" struct commit { char id[SIZEOF_REV]; /* SHA1 ID. */ const struct ident *author; /* Author of the commit. */ struct time time; /* Date from the author ident. */ struct graph_canvas graph; /* Ancestry chain graphics. */ char title[1]; /* First line of the commit message. */ }; struct main_state { struct graph graph; struct commit current; char **reflog; size_t reflogs; int reflog_width; char reflogmsg[SIZEOF_STR / 2]; bool in_header; bool with_graph; bool add_changes_parents; }; bool main_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data); bool main_read(struct view *view, struct buffer *buf); enum request main_request(struct view *view, enum request request, struct line *line); void main_select(struct view *view, struct line *line); void main_done(struct view *view); extern struct view main_view; static inline void open_main_view(struct view *prev, enum open_flags flags) { open_view(prev, &main_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/options.h000066400000000000000000000143121233303337700163550ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_OPTIONS_H #define TIG_OPTIONS_H #include "tig/tig.h" #include "tig/util.h" #include "tig/line.h" /* * Option variables. */ #define OPTION_INFO(_) \ _(blame_options, const char **, VIEW_BLAME_LIKE) \ _(blame_view, const char **, VIEW_NO_FLAGS) \ _(blob_view, const char **, VIEW_NO_FLAGS) \ _(commit_order, enum commit_order, VIEW_LOG_LIKE) \ _(diff_context, int, VIEW_DIFF_LIKE) \ _(diff_options, const char **, VIEW_DIFF_LIKE) \ _(diff_view, const char **, VIEW_NO_FLAGS) \ _(editor_line_number, bool, VIEW_NO_FLAGS) \ _(file_filter, bool, VIEW_DIFF_LIKE | VIEW_LOG_LIKE) \ _(focus_child, bool, VIEW_NO_FLAGS) \ _(git_colors, const char **, VIEW_NO_FLAGS) \ _(grep_view, const char **, VIEW_NO_FLAGS) \ _(horizontal_scroll, double, VIEW_NO_FLAGS) \ _(id_width, int, VIEW_NO_FLAGS) \ _(ignore_case, bool, VIEW_NO_FLAGS) \ _(ignore_space, enum ignore_space, VIEW_DIFF_LIKE) \ _(line_graphics, enum graphic, VIEW_NO_FLAGS) \ _(log_view, const char **, VIEW_NO_FLAGS) \ _(main_view, const char **, VIEW_NO_FLAGS) \ _(mouse, bool, VIEW_NO_FLAGS) \ _(mouse_scroll, int, VIEW_NO_FLAGS) \ _(pager_view, const char **, VIEW_NO_FLAGS) \ _(refs_view, const char **, VIEW_NO_FLAGS) \ _(show_changes, bool, VIEW_NO_FLAGS) \ _(show_notes, bool, VIEW_NO_FLAGS) \ _(split_view_height, double, VIEW_RESET_DISPLAY) \ _(stage_view, const char **, VIEW_NO_FLAGS) \ _(status_untracked_dirs, bool, VIEW_STATUS_LIKE) \ _(status_view, const char **, VIEW_NO_FLAGS) \ _(stash_view, const char **, VIEW_NO_FLAGS) \ _(tab_size, int, VIEW_NO_FLAGS) \ _(tree_view, const char **, VIEW_NO_FLAGS) \ _(refresh_mode, enum refresh_mode, VIEW_NO_FLAGS) \ _(refresh_interval, int, VIEW_NO_FLAGS) \ _(vertical_split, enum vertical_split, VIEW_RESET_DISPLAY | VIEW_DIFF_LIKE) \ _(wrap_lines, bool, VIEW_NO_FLAGS) \ #define DEFINE_OPTION_EXTERNS(name, type, flags) extern type opt_##name; OPTION_INFO(DEFINE_OPTION_EXTERNS); /* * View column options. */ #define AUTHOR_COLUMN_OPTIONS(_) \ _(display, enum author, VIEW_NO_FLAGS) \ _(width, int, VIEW_NO_FLAGS) \ #define COMMIT_TITLE_COLUMN_OPTIONS(_) \ _(display, bool, VIEW_NO_FLAGS) \ _(graph, bool, 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) \ _(width, int, VIEW_NO_FLAGS) \ #define FILE_NAME_COLUMN_OPTIONS(_) \ _(display, enum filename, VIEW_GREP_LIKE) \ _(width, int, VIEW_NO_FLAGS) \ #define FILE_SIZE_COLUMN_OPTIONS(_) \ _(display, enum file_size, VIEW_NO_FLAGS) \ _(width, int, VIEW_NO_FLAGS) \ #define ID_COLUMN_OPTIONS(_) \ _(display, bool, VIEW_NO_FLAGS) \ _(color, bool, VIEW_NO_FLAGS) \ _(width, int, VIEW_NO_FLAGS) \ #define LINE_NUMBER_COLUMN_OPTIONS(_) \ _(display, bool, VIEW_NO_FLAGS) \ _(interval, int, VIEW_NO_FLAGS) \ _(width, int, VIEW_NO_FLAGS) \ #define MODE_COLUMN_OPTIONS(_) \ _(display, bool, VIEW_NO_FLAGS) \ _(width, int, VIEW_NO_FLAGS) \ #define REF_COLUMN_OPTIONS(_) \ _(display, bool, VIEW_NO_FLAGS) \ _(width, int, VIEW_NO_FLAGS) \ #define SECTION_COLUMN_OPTIONS(_) \ _(type, enum line_type, VIEW_NO_FLAGS) \ _(text, const char *, VIEW_NO_FLAGS) \ #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) \ _(commit_title, COMMIT_TITLE, COMMIT_TITLE_COLUMN_OPTIONS) \ _(date, DATE, DATE_COLUMN_OPTIONS) \ _(file_name, FILE_NAME, FILE_NAME_COLUMN_OPTIONS) \ _(file_size, FILE_SIZE, FILE_SIZE_COLUMN_OPTIONS) \ _(id, ID, ID_COLUMN_OPTIONS) \ _(line_number, LINE_NUMBER, LINE_NUMBER_COLUMN_OPTIONS) \ _(mode, MODE, MODE_COLUMN_OPTIONS) \ _(ref, REF, REF_COLUMN_OPTIONS) \ _(section, SECTION, SECTION_COLUMN_OPTIONS) \ _(status, STATUS, STATUS_COLUMN_OPTIONS) \ _(text, TEXT, TEXT_COLUMN_OPTIONS) \ #define DEFINE_COLUMN_OPTIONS_STRUCT_VALUE(name, type, flags) type name; #define DEFINE_COLUMN_OPTIONS_STRUCT(name, id, options) \ struct name##_options { \ options(DEFINE_COLUMN_OPTIONS_STRUCT_VALUE) \ } name; union view_column_options { COLUMN_OPTIONS(DEFINE_COLUMN_OPTIONS_STRUCT); }; /* * Global state variables. */ extern iconv_t opt_iconv_out; extern char opt_editor[SIZEOF_STR]; extern const char **opt_cmdline_argv; extern const char **opt_rev_argv; extern const char **opt_file_argv; extern char opt_env_lines[64]; extern char opt_env_columns[64]; extern char *opt_env[]; /* * Mapping between options and command argument mapping. */ void update_options_from_argv(const char *argv[]); const char *ignore_space_arg(); const char *commit_order_arg(); const char *diff_context_arg(); const char *show_notes_arg(); /* * Option loading and parsing. */ struct option_info { const char *name; size_t namelen; const char *type; void *value; bool seen; }; struct option_info *find_option_info(struct option_info *option, size_t options, const char *name); enum status_code parse_option(struct option_info *option, const char *prefix, const char *arg); enum status_code parse_int(int *opt, const char *arg, int min, int max); enum status_code parse_step(double *opt, const char *arg); enum status_code set_option(const char *opt, int argc, const char *argv[]); int load_options(void); int load_git_config(void); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/pager.h000066400000000000000000000023431233303337700157610ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_PAGER_H #define TIG_PAGER_H #include "tig/view.h" bool pager_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data); bool pager_read(struct view *view, struct buffer *buf); bool pager_common_read(struct view *view, const char *data, enum line_type type, struct line **line); enum request pager_request(struct view *view, enum request request, struct line *line); void pager_select(struct view *view, struct line *line); extern struct view pager_view; static inline void open_pager_view(struct view *prev, enum open_flags flags) { open_view(prev, &pager_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/parse.h000066400000000000000000000040461233303337700157770ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_PARSE_H #define TIG_PARSE_H #include "tig/tig.h" #include "tig/util.h" struct chunk_header_position { unsigned long position; unsigned long lines; }; struct chunk_header { struct chunk_header_position old; struct chunk_header_position new; }; bool parse_chunk_header(struct chunk_header *header, const char *line); bool parse_chunk_lineno(unsigned long *lineno, const char *chunk, int marker); struct blame_commit { char id[SIZEOF_REV]; /* SHA1 ID. */ char title[128]; /* First line of the commit message. */ const struct ident *author; /* Author of the commit. */ struct time time; /* Date from the author ident. */ const char *filename; /* Name of file. */ char parent_id[SIZEOF_REV]; /* Parent/previous SHA1 ID. */ const char *parent_filename; /* Parent/previous name of file. */ }; struct blame_header { char id[SIZEOF_REV]; /* SHA1 ID. */ size_t orig_lineno; size_t lineno; size_t group; }; bool parse_blame_header(struct blame_header *header, const char *text, size_t max_lineno); bool parse_blame_info(struct blame_commit *commit, char author[SIZEOF_STR], char *line); /* Parse author lines where the name may be empty: * author 1138474660 +0100 */ void parse_author_line(char *ident, const struct ident **author, struct time *time); size_t parse_size(const char *text); /* * Caches. */ const char *get_path(const char *path); struct ident *get_author(const char *name, const char *email); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/prompt.h000066400000000000000000000025351233303337700162070ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_PROMPT_H #define TIG_PROMPT_H #include "tig/tig.h" #include "tig/keys.h" struct view; struct input; struct menu_item { int hotkey; const char *text; void *data; }; typedef enum input_status (*input_handler)(struct input *input, struct key *key); struct input { input_handler handler; void *data; char buf[SIZEOF_STR]; }; char *read_prompt_incremental(const char *prompt, bool edit_mode, input_handler handler, void *data); char *read_prompt(const char *prompt); void prompt_init(void); bool prompt_yesno(const char *prompt); bool prompt_menu(const char *prompt, const struct menu_item *items, int *selected); enum request run_prompt_command(struct view *view, const char *argv[]); enum request open_prompt(struct view *view); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/refdb.h000066400000000000000000000037731233303337700157550ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_REFDB_H #define TIG_REFDB_H #include "tig/tig.h" #include "tig/types.h" struct argv_env; struct ref { enum reference_type type; char id[SIZEOF_REV]; /* Commit SHA1 ID */ unsigned int valid:1; /* Is the ref still valid? */ char name[1]; /* Ref name; tag or head names are shortened. */ }; struct ref_list { char id[SIZEOF_REV]; /* Commit SHA1 ID */ size_t size; /* Number of refs. */ struct ref **refs; /* References for this ID. */ }; #define is_initial_commit() (!get_ref_head()) #define is_head_commit(rev) (!strcmp((rev), "HEAD") || (get_ref_head() && !strncmp(rev, get_ref_head()->id, SIZEOF_REV - 1))) #define ref_is_tag(ref) ((ref)->type == REFERENCE_TAG || (ref)->type == REFERENCE_LOCAL_TAG) #define ref_is_remote(ref) ((ref)->type == REFERENCE_REMOTE || (ref)->type == REFERENCE_TRACKED_REMOTE) struct ref *get_ref_head(); struct ref_list *get_ref_list(const char *id); void foreach_ref(bool (*visitor)(void *data, const struct ref *ref), void *data); int load_refs(bool force); int add_ref(const char *id, char *name, const char *remote_name, const char *head); int ref_compare(const struct ref *ref1, const struct ref *ref2); void ref_update_env(struct argv_env *env, const struct ref *ref, bool clear); struct ref_format { const char *start; const char *end; }; const struct ref_format *get_ref_format(struct ref *ref); enum status_code parse_ref_formats(const char *argv[]); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/refs.h000066400000000000000000000015001233303337700156140ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_REFS_H #define TIG_REFS_H #include "tig/view.h" extern struct view refs_view; static inline void open_refs_view(struct view *prev, enum open_flags flags) { open_view(prev, &refs_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/repo.h000066400000000000000000000020751233303337700156320ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_REPO_H #define TIG_REPO_H #include "tig/tig.h" struct repo_info { char head[SIZEOF_REF]; char remote[SIZEOF_REF]; char cdup[SIZEOF_STR]; char prefix[SIZEOF_STR]; char git_dir[SIZEOF_STR]; bool is_inside_work_tree; }; extern struct repo_info repo; int load_repo_info(void); struct index_diff { int staged; int unstaged; int untracked; }; bool index_diff(struct index_diff *diff, bool untracked, bool count_all); bool update_index(void); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/request.h000066400000000000000000000071371233303337700163610ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_REQUEST_H #define TIG_REQUEST_H #include "tig/tig.h" /* * User requests */ #define VIEW_REQ(id, name) REQ_(VIEW_##id, "Show " #name " view") #define REQ_INFO \ REQ_GROUP("View switching") \ VIEW_INFO(VIEW_REQ), \ \ REQ_GROUP("View manipulation") \ REQ_(ENTER, "Enter and open selected line"), \ REQ_(BACK, "Go back to the previous view state"), \ REQ_(NEXT, "Move to next"), \ REQ_(PREVIOUS, "Move to previous"), \ REQ_(PARENT, "Move to parent"), \ REQ_(VIEW_NEXT, "Move focus to the next view"), \ REQ_(REFRESH, "Reload and refresh view"), \ REQ_(MAXIMIZE, "Maximize the current view"), \ REQ_(VIEW_CLOSE, "Close the current view"), \ REQ_(QUIT, "Close all views and quit"), \ \ 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"), \ REQ_(STAGE_UPDATE_LINE, "Stage/unstage single line"), \ REQ_(STAGE_SPLIT_CHUNK, "Split current diff chunk"), \ \ REQ_GROUP("Cursor navigation") \ REQ_(MOVE_UP, "Move cursor one line up"), \ REQ_(MOVE_DOWN, "Move cursor one line down"), \ REQ_(MOVE_PAGE_DOWN, "Move cursor one page down"), \ REQ_(MOVE_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_GROUP("Scrolling") \ REQ_(SCROLL_LINE_UP, "Scroll one line up"), \ REQ_(SCROLL_LINE_DOWN, "Scroll one line down"), \ REQ_(SCROLL_PAGE_UP, "Scroll one page up"), \ REQ_(SCROLL_PAGE_DOWN, "Scroll one page down"), \ REQ_(SCROLL_FIRST_COL, "Scroll to the first line columns"), \ REQ_(SCROLL_LEFT, "Scroll two columns left"), \ REQ_(SCROLL_RIGHT, "Scroll two columns right"), \ \ REQ_GROUP("Searching") \ REQ_(SEARCH, "Search the view"), \ REQ_(SEARCH_BACK, "Search backwards in the view"), \ REQ_(FIND_NEXT, "Find next search match"), \ REQ_(FIND_PREV, "Find previous search match"), \ \ REQ_GROUP("Option manipulation") \ REQ_(OPTIONS, "Open the options menu"), \ \ REQ_GROUP("Misc") \ REQ_(EDIT, "Open in editor"), \ REQ_(PROMPT, "Open the prompt"), \ REQ_(SCREEN_REDRAW, "Redraw the screen"), \ REQ_(STOP_LOADING, "Stop all loading views"), \ REQ_(SHOW_VERSION, "Show version information"), \ REQ_(NONE, "Do nothing") /* User action requests. */ enum request { #define REQ_GROUP(help) #define REQ_(req, help) REQ_##req /* Offset all requests to avoid conflicts with ncurses getch values. */ REQ_UNKNOWN = KEY_MAX + 1, REQ_OFFSET, REQ_INFO, /* Internal requests. */ REQ_SCROLL_WHEEL_DOWN, REQ_SCROLL_WHEEL_UP, /* Start of the run request IDs */ REQ_RUN_REQUESTS #undef REQ_GROUP #undef REQ_ }; struct request_info { enum request request; const char *name; int namelen; const char *help; }; enum request get_request(const char *name); const char *get_request_name(enum request request); bool foreach_request(bool (*visitor)(void *data, const struct request_info *req_info, const char *group), void *data); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/stage.h000066400000000000000000000015121233303337700157630ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_STAGE_H #define TIG_STAGE_H #include "tig/view.h" struct status; extern struct view stage_view; void open_stage_view(struct view *prev, struct status *status, enum line_type type, enum open_flags flags); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/stash.h000066400000000000000000000015051233303337700160040ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_STASH_H #define TIG_STASH_H #include "tig/view.h" extern struct view stash_view; static inline void open_stash_view(struct view *prev, enum open_flags flags) { open_view(prev, &stash_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/status.h000066400000000000000000000030251233303337700162040ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_STATUS_H #define TIG_STATUS_H #include "tig/view.h" #include "tig/line.h" struct status { char status; struct { mode_t mode; char rev[SIZEOF_REV]; char name[SIZEOF_STR]; } old; struct { mode_t mode; char rev[SIZEOF_REV]; char name[SIZEOF_STR]; } new; }; bool status_update_file(struct status *status, enum line_type type); bool status_update_files(struct view *view, struct line *line); bool status_revert(struct status *status, enum line_type type, bool has_none); bool status_exists(struct view *view, struct status *status, enum line_type type); bool status_stage_info_(char *buf, size_t bufsize, enum line_type type, struct status *status); #define status_stage_info(buf, type, status) \ status_stage_info_(buf, sizeof(buf), type, status) extern struct view status_view; static inline void open_status_view(struct view *prev, enum open_flags flags) { open_view(prev, &status_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/string.h000066400000000000000000000073001233303337700161670ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_STRING_H #define TIG_STRING_H #include "tig/tig.h" #include "tig/string.h" /* * Strings. */ #define prefixcmp(str1, str2) \ strncmp(str1, str2, STRING_SIZE(str2)) bool string_isnumber(const char *str); bool iscommit(const char *str); #define get_graph_indent(str) strspn(str, "*|\\/_ ") static inline int ascii_toupper(int c) { if (c >= 'a' && c <= 'z') c &= ~0x20; return c; } static inline int ascii_tolower(int c) { if (c >= 'A' && c <= 'Z') c |= 0x20; return c; } int suffixcmp(const char *str, int slen, const char *suffix); void string_ncopy_do(char *dst, size_t dstlen, const char *src, size_t srclen); /* Shorthands for safely copying into a fixed buffer. */ #define FORMAT_BUFFER(buf, bufsize, fmt, retval, allow_truncate) \ do { \ va_list args; \ va_start(args, fmt); \ retval = vsnprintf(buf, bufsize, fmt, args); \ va_end(args); \ if (retval >= (bufsize) && allow_truncate) { \ (buf)[(bufsize) - 1] = 0; \ (buf)[(bufsize) - 2] = '.'; \ (buf)[(bufsize) - 3] = '.'; \ (buf)[(bufsize) - 4] = '.'; \ retval = (bufsize) - 1; \ } else if (retval < 0 || retval >= (bufsize)) { \ retval = -1; \ } \ } while (0) #define string_copy(dst, src) \ string_ncopy_do(dst, sizeof(dst), src, sizeof(src)) #define string_ncopy(dst, src, srclen) \ string_ncopy_do(dst, sizeof(dst), src, srclen) void string_copy_rev(char *dst, const char *src); void string_copy_rev_from_commit_line(char *dst, const char *src); #define string_rev_is_null(rev) !strncmp(rev, NULL_ID, STRING_SIZE(NULL_ID)) #define string_add(dst, from, src) \ string_ncopy_do(dst + (from), sizeof(dst) - (from), src, sizeof(src)) 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 tabsize); char *chomp_string(char *name); bool PRINTF_LIKE(4, 5) string_nformat(char *buf, size_t bufsize, size_t *bufpos, const char *fmt, ...); #define string_format(buf, fmt, args...) \ string_nformat(buf, sizeof(buf), NULL, fmt, args) #define string_format_from(buf, from, fmt, args...) \ string_nformat(buf, sizeof(buf), from, fmt, args) int strcmp_null(const char *s1, const char *s2); int strcmp_numeric(const char *s1, const char *s2); /* * Unicode / UTF-8 handling */ int unicode_width(unsigned long c, int tab_size); unsigned char utf8_char_length(const char *string); /* Decode UTF-8 multi-byte representation into a Unicode character. */ unsigned long utf8_to_unicode(const char *string, size_t length); /* Calculates how much of string can be shown within the given maximum width * and sets trimmed parameter to non-zero value if all of string could not be * shown. If the reserve flag is TRUE, it will reserve at least one * trailing character, which can be useful when drawing a delimiter. * * Returns the number of bytes to output from string to satisfy max_width. */ size_t utf8_length(const char **start, size_t skip, int *width, size_t max_width, int *trimmed, bool reserve, int tab_size); int utf8_width_max(const char *text, int max); #define utf8_width(text) utf8_width_max(text, -1) #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/tig.h000066400000000000000000000072311233303337700154470ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_H #define TIG_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "compat/compat.h" #ifndef TIG_VERSION #define TIG_VERSION "unknown-version" #endif #ifndef DEBUG #define NDEBUG #endif /* necessary on Snow Leopard to use WINDOW struct */ #ifdef NCURSES_OPAQUE #undef NCURSES_OPAQUE #endif #define NCURSES_OPAQUE 0 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* ncurses(3): Must be defined to have extended wide-character functions. */ #define _XOPEN_SOURCE_EXTENDED #if defined HAVE_NCURSESW_CURSES_H # include #elif defined HAVE_NCURSESW_H # include #elif defined HAVE_NCURSES_CURSES_H # include #elif defined HAVE_NCURSES_H # include #elif defined HAVE_CURSES_H # include #else #ifdef WARN_MISSING_CURSES_CONFIGURATION # warning SysV or X/Open-compatible Curses installation is required. # warning Will assume Curses is found in default include and library path. # warning To fix any build issues please use autotools to configure Curses. # warning See INSTALL.adoc file for instructions. #endif # include #endif #if __GNUC__ >= 3 #define TIG_NORETURN __attribute__((__noreturn__)) #define PRINTF_LIKE(fmt, args) __attribute__((format (printf, fmt, args))) #else #define TIG_NORETURN #define PRINTF_LIKE(fmt, args) #endif #include "tig/string.h" #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y)) #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define STRING_SIZE(x) (sizeof(x) - 1) #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. */ /* This color name can be used to refer to the default term colors. */ #define COLOR_DEFAULT (-1) #define ICONV_NONE ((iconv_t) -1) #ifndef ICONV_CONST #define ICONV_CONST /* nothing */ #endif #define ICONV_TRANSLIT "//TRANSLIT" #define MIN_VIEW_HEIGHT 4 #define MIN_VIEW_WIDTH 4 #define VSPLIT_SCALE 0.5 #define NULL_ID "0000000000000000000000000000000000000000" #define S_ISGITLINK(mode) (((mode) & S_IFMT) == 0160000) /* Some ASCII-shorthands fitted into the ncurses namespace. */ #define KEY_CTL(x) ((x) & 0x1f) /* KEY_CTL(A) == ^A == \1 */ #define KEY_TAB '\t' #define KEY_RETURN '\r' #define KEY_ESC 27 void TIG_NORETURN usage(const char *message); /* * Global view definition. */ #define VIEW_INFO(_) \ _(MAIN, main), \ _(DIFF, diff), \ _(LOG, log), \ _(TREE, tree), \ _(BLOB, blob), \ _(BLAME, blame), \ _(REFS, refs), \ _(STATUS, status), \ _(STAGE, stage), \ _(STASH, stash), \ _(GREP, grep), \ _(PAGER, pager), \ _(HELP, help) #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/tree.h000066400000000000000000000016171233303337700156250ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_TREE_H #define TIG_TREE_H #include "tig/view.h" void open_blob_editor(const char *id, const char *name, unsigned int lineno); extern struct view tree_view; static inline void open_tree_view(struct view *prev, enum open_flags flags) { open_view(prev, &tree_view, flags); } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/types.h000066400000000000000000000105661233303337700160350ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_TYPES_H #define TIG_TYPES_H #include "tig/tig.h" /* * Enumerations */ struct enum_map_entry { const char *name; int namelen; int value; }; struct enum_map { const struct enum_map_entry *entries; const int size; }; int string_enum_compare(const char *str1, const char *str2, int len); #define enum_equals(entry, str, len) \ ((entry).namelen == (len) && !string_enum_compare((entry).name, str, len)) #define enum_equals_static(str, name, namelen) \ (namelen == STRING_SIZE(str) && !string_enum_compare(str, name, namelen)) const char *enum_name(const char *name); bool enum_name_copy(char *buf, size_t bufsize, const char *name); bool enum_name_prefixed(char buf[], size_t bufsize, const char *prefix, const char *name); const struct enum_map *find_enum_map(const char *type); bool map_enum_do(const struct enum_map_entry *map, size_t map_size, int *value, const char *name); #define map_enum(attr, map, name) \ map_enum_do(map, ARRAY_SIZE(map), attr, name) #define ENUM_MAP_ENTRY(name, value) { name, STRING_SIZE(name), value } #define ENUM_SYM_MACRO(prefix, name) prefix##_##name #define ENUM_MAP_MACRO(prefix, name) ENUM_MAP_ENTRY(#name, ENUM_SYM_MACRO(prefix, name)) #define DEFINE_ENUM(name, info) \ enum name { info(ENUM_SYM_MACRO) }; \ extern const struct enum_map name##_map[]; #define DEFINE_ENUM_MAP(name, info) \ const struct enum_map_entry name##_map_entries[] = { info(ENUM_MAP_MACRO) }; \ const struct enum_map name##_map[] = { { name##_map_entries, ARRAY_SIZE(name##_map_entries) } } #define VERTICAL_SPLIT_ENUM(_) \ _(VERTICAL_SPLIT, HORIZONTAL), \ _(VERTICAL_SPLIT, VERTICAL), \ _(VERTICAL_SPLIT, AUTO) #define GRAPHIC_ENUM(_) \ _(GRAPHIC, ASCII), \ _(GRAPHIC, DEFAULT), \ _(GRAPHIC, UTF_8) #define DATE_ENUM(_) \ _(DATE, NO), \ _(DATE, DEFAULT), \ _(DATE, LOCAL), \ _(DATE, RELATIVE), \ _(DATE, SHORT) #define FILE_SIZE_ENUM(_) \ _(FILE_SIZE, NO), \ _(FILE_SIZE, DEFAULT), \ _(FILE_SIZE, UNITS) #define AUTHOR_ENUM(_) \ _(AUTHOR, NO), \ _(AUTHOR, FULL), \ _(AUTHOR, ABBREVIATED), \ _(AUTHOR, EMAIL), \ _(AUTHOR, EMAIL_USER) #define FILENAME_ENUM(_) \ _(FILENAME, NO), \ _(FILENAME, AUTO), \ _(FILENAME, ALWAYS) #define IGNORE_SPACE_ENUM(_) \ _(IGNORE_SPACE, NO), \ _(IGNORE_SPACE, ALL), \ _(IGNORE_SPACE, SOME), \ _(IGNORE_SPACE, AT_EOL) #define COMMIT_ORDER_ENUM(_) \ _(COMMIT_ORDER, DEFAULT), \ _(COMMIT_ORDER, TOPO), \ _(COMMIT_ORDER, DATE), \ _(COMMIT_ORDER, AUTHOR_DATE), \ _(COMMIT_ORDER, REVERSE) #define VIEW_COLUMN_ENUM(_) \ _(VIEW_COLUMN, AUTHOR), \ _(VIEW_COLUMN, COMMIT_TITLE), \ _(VIEW_COLUMN, DATE), \ _(VIEW_COLUMN, FILE_NAME), \ _(VIEW_COLUMN, FILE_SIZE), \ _(VIEW_COLUMN, ID), \ _(VIEW_COLUMN, LINE_NUMBER), \ _(VIEW_COLUMN, MODE), \ _(VIEW_COLUMN, REF), \ _(VIEW_COLUMN, SECTION), \ _(VIEW_COLUMN, STATUS), \ _(VIEW_COLUMN, TEXT) #define REFERENCE_ENUM(_) \ _(REFERENCE, HEAD), \ _(REFERENCE, BRANCH), \ _(REFERENCE, TRACKED_REMOTE), \ _(REFERENCE, REMOTE), \ _(REFERENCE, TAG), \ _(REFERENCE, LOCAL_TAG), \ _(REFERENCE, REPLACE), \ #define STATUS_LABEL_ENUM(_) \ _(STATUS_LABEL, NO), \ _(STATUS_LABEL, SHORT), \ _(STATUS_LABEL, LONG), \ #define REFRESH_MODE_ENUM(_) \ _(REFRESH_MODE, MANUAL), \ _(REFRESH_MODE, AUTO), \ _(REFRESH_MODE, AFTER_COMMAND), \ _(REFRESH_MODE, PERIODIC), \ #define ENUM_INFO(_) \ _(author, AUTHOR_ENUM) \ _(commit_order, COMMIT_ORDER_ENUM) \ _(date, DATE_ENUM) \ _(file_size, FILE_SIZE_ENUM) \ _(filename, FILENAME_ENUM) \ _(graphic, GRAPHIC_ENUM) \ _(ignore_space, IGNORE_SPACE_ENUM) \ _(vertical_split, VERTICAL_SPLIT_ENUM) \ _(view_column_type, VIEW_COLUMN_ENUM) \ _(reference_type, REFERENCE_ENUM) \ _(refresh_mode, REFRESH_MODE_ENUM) \ _(status_label, STATUS_LABEL_ENUM) \ #define DEFINE_ENUMS(name, macro) DEFINE_ENUM(name, macro); ENUM_INFO(DEFINE_ENUMS); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/util.h000066400000000000000000000062451233303337700156450ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_UTIL_H #define TIG_UTIL_H #include "tig/tig.h" #include "tig/types.h" /* * Error handling. */ #define STATUS_CODE_INFO(_) \ _(CUSTOM_MESSAGE, NULL), \ _(NO_OPTION_VALUE, "No option value"), \ _(OUT_OF_MEMORY, "Out of memory"), \ _(FILE_DOES_NOT_EXIST, "File does not exist"), \ _(UNMATCHED_QUOTATION, "Unmatched quotation"), \ enum status_code { SUCCESS, #define STATUS_CODE_ENUM(name, msg) ERROR_ ## name STATUS_CODE_INFO(STATUS_CODE_ENUM) }; const char *get_status_message(enum status_code code); enum status_code error(const char *fmt, ...) PRINTF_LIKE(1, 2); enum status_code success(const char *fmt, ...) PRINTF_LIKE(1, 2); typedef void (*die_fn)(void); extern die_fn die_callback; void TIG_NORETURN die(const char *err, ...) PRINTF_LIKE(1, 2); void warn(const char *msg, ...) PRINTF_LIKE(1, 2); static inline int count_digits(unsigned long i) { int digits; if (!i) return 1; for (digits = 0; i; digits++) i /= 10; return digits; } static inline int apply_step(double step, int value) { if (step >= 1) return (int) step; value *= step + 0.01; return value ? value : 1; } /* * Git data formatters. */ struct time { time_t sec; int tz; }; struct ident { const char *name; const char *email; }; extern const struct ident unknown_ident; int timecmp(const struct time *t1, const struct time *t2); int ident_compare(const struct ident *i1, const struct ident *i2); const char *mkdate(const struct time *time, enum date date); const char *mkfilesize(unsigned long size, enum file_size format); const char *mkauthor(const struct ident *ident, int cols, enum author author); const char *mkmode(mode_t mode); const char *mkstatus(const char status, enum status_label label); #define author_trim(cols) (cols == 0 || cols > 10) /* * Allocation helper. */ #define DEFINE_ALLOCATOR(name, type, chunk_size) \ static type * \ name(type **mem, size_t size, size_t increase) \ { \ size_t num_chunks = (size + chunk_size - 1) / chunk_size; \ size_t num_chunks_new = (size + increase + chunk_size - 1) / chunk_size;\ type *tmp = *mem; \ \ if (mem == NULL || num_chunks != num_chunks_new) { \ size_t newsize = num_chunks_new * chunk_size * sizeof(type); \ \ tmp = realloc(tmp, newsize); \ if (tmp) { \ *mem = tmp; \ if (num_chunks_new > num_chunks) { \ size_t offset = num_chunks * chunk_size; \ size_t oldsize = offset * sizeof(type); \ \ memset(tmp + offset, 0, newsize - oldsize); \ } \ } \ } \ \ return tmp; \ } #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/view.h000066400000000000000000000256061233303337700156440ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_VIEW_H #define TIG_VIEW_H #include "tig/tig.h" #include "tig/types.h" #include "tig/argv.h" #include "tig/watch.h" #include "tig/io.h" #include "tig/line.h" #include "tig/keys.h" #include "tig/options.h" struct view_ops; struct line { enum line_type type; unsigned int lineno:24; /* State flags */ unsigned int selected:1; unsigned int dirty:1; unsigned int cleareol:1; unsigned int wrapped:1; unsigned int commit_title:1; unsigned int no_commit_refs:1; unsigned int graph_indent:1; void *data; /* User data */ }; enum view_flag { VIEW_NO_FLAGS = 0, VIEW_CUSTOM_STATUS = 1 << 1, VIEW_ADD_DESCRIBE_REF = 1 << 2, VIEW_ADD_PAGER_REFS = 1 << 3, VIEW_OPEN_DIFF = 1 << 4, VIEW_NO_REF = 1 << 5, VIEW_NO_GIT_DIR = 1 << 6, VIEW_DIFF_LIKE = 1 << 7, VIEW_BLAME_LIKE = 1 << 8, VIEW_SEND_CHILD_ENTER = 1 << 9, VIEW_FILE_FILTER = 1 << 10, VIEW_LOG_LIKE = 1 << 11, VIEW_STATUS_LIKE = 1 << 12, VIEW_REFRESH = 1 << 13, VIEW_GREP_LIKE = 1 << 14, VIEW_SORTABLE = 1 << 15, VIEW_RESET_DISPLAY = 1 << 31, }; #define view_has_flags(view, flag) ((view)->ops->flags & (flag)) #define view_can_refresh(view) \ (view_has_flags(view, VIEW_REFRESH) && !(view)->unrefreshable) struct position { unsigned long offset; /* Offset of the window top */ unsigned long col; /* Offset from the window side. */ unsigned long lineno; /* Current line number */ }; struct sort_state { struct view_column *current; bool reverse; }; struct view_column { struct view_column *next; enum view_column_type type; int width; union view_column_options prev_opt; union view_column_options opt; bool hidden; }; struct view { const char *name; /* View name */ struct view_ops *ops; /* View operations */ struct argv_env *env; /* View variables. */ char ref[SIZEOF_REF]; /* Hovered commit reference */ char vid[SIZEOF_REF]; /* View ID. Set to id member when updating. */ int height, width; /* The width and height of the main window */ WINDOW *win; /* The main window */ WINDOW *title; /* The title window */ struct keymap *keymap; /* What keymap does this view have */ struct sort_state sort; /* Sorting information. */ /* Navigation */ struct position pos; /* Current position. */ struct position prev_pos; /* Previous position. */ /* View columns rendering state */ struct view_column *columns; /* Searching */ char grep[SIZEOF_STR]; /* Search string */ regex_t *regex; /* Pre-compiled regexp */ unsigned int *matched_line; size_t matched_lines; /* If non-NULL, points to the view that opened this view. If this view * is closed tig will switch back to the parent view. */ struct view *parent; struct view *prev; /* Buffering */ size_t lines; /* Total number of lines */ struct line *line; /* Line index */ /* Number of lines with custom status, not to be counted in the * view title. */ unsigned int custom_lines; /* Drawing */ struct line *curline; /* Line currently being drawn. */ enum line_type curtype; /* Attribute currently used for drawing. */ unsigned long col; /* Column when drawing. */ bool has_scrolled; /* View was scrolled. */ bool force_redraw; /* Whether to force a redraw after reading. */ /* Loading */ const char **argv; /* Shell command arguments. */ const char *dir; /* Directory from which to execute. */ struct io io; struct io *pipe; time_t start_time; time_t update_secs; struct encoding *encoding; bool unrefreshable; struct watch watch; /* Private data */ void *private; }; #define DEFINE_VIEW(name) struct view name ##_view = { #name, &name##_ops, &argv_env } enum open_flags { OPEN_DEFAULT = 0, /* Use default view switching. */ OPEN_STDIN = 1, /* Open in pager mode. */ OPEN_FORWARD_STDIN = 2, /* Forward stdin to I/O process. */ OPEN_SPLIT = 4, /* Split current view. */ OPEN_RELOAD = 8, /* Reload view even if it is the current. */ OPEN_REFRESH = 16, /* Refresh view using previous command. */ OPEN_PREPARED = 32, /* Open already prepared command. */ OPEN_EXTRA = 64, /* Open extra data from command. */ OPEN_WITH_STDERR = 128, /* Redirect stderr to stdin. */ OPEN_PAGER_MODE = OPEN_STDIN | OPEN_FORWARD_STDIN, OPEN_ALWAYS_LOAD = OPEN_RELOAD | OPEN_REFRESH | OPEN_PREPARED | OPEN_EXTRA | OPEN_PAGER_MODE, }; #define open_in_pager_mode(flags) ((flags) & OPEN_PAGER_MODE) #define open_from_stdin(flags) ((flags) & OPEN_STDIN) struct view_column_data { struct view_column *section; const struct ident *author; const char *commit_title; const struct time *date; const char *file_name; const unsigned long *file_size; const struct graph_canvas *graph; const char *id; const unsigned long *line_number; const mode_t *mode; const struct ref *ref; const char *reflog; const struct ref_list *refs; const char *status; const char *text; }; #define view_column_bit(id) (1 << VIEW_COLUMN_##id) #define view_has_column(view, id) ((view)->ops->column_bits & view_column_bit(id)) #define view_column_name(id) enum_name(view_column_type_map->entries[id].name) struct view_ops { /* What type of content being displayed. Used in the title bar. */ const char *type; /* Points to either of ref_{head,commit,blob} */ const char *id; /* Flags to control the view behavior. */ enum view_flag flags; /* Size of private data. */ size_t private_size; /* Open and reads in all view content. */ bool (*open)(struct view *view, enum open_flags flags); /* Read one line; updates view->line. */ bool (*read)(struct view *view, struct buffer *buf); /* Draw one line; @lineno must be < view->height. */ 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 regexp in a line. */ bool (*grep)(struct view *view, struct line *line); /* Select line */ void (*select)(struct view *view, struct line *line); /* Release resources when reloading the view */ void (*done)(struct view *view); /* Supported view columns. */ unsigned long column_bits; /* Extract line information. */ bool (*get_column_data)(struct view *view, const struct line *line, struct view_column_data *column_data); }; /* * Global view state. */ struct view *get_view(int index); #define foreach_view(view, i) \ for (i = 0; (view = get_view(i)); i++) #define view_has_line(view, line_) \ ((view)->line <= (line_) && (line_) < (view)->line + (view)->lines) /* * Navigation */ bool goto_view_line(struct view *view, unsigned long offset, unsigned long lineno); void select_view_line(struct view *view, unsigned long lineno); void do_scroll_view(struct view *view, int lines); void scroll_view(struct view *view, enum request request); void move_view(struct view *view, enum request request); /* * Searching */ void search_view(struct view *view, enum request request); void find_next(struct view *view, enum request request); bool grep_text(struct view *view, const char *text[]); /* * View history */ struct view_state { struct view_state *prev; /* Entry below this in the stack */ struct position position; /* View position to restore */ void *data; /* View specific state */ }; struct view_history { size_t state_alloc; struct view_state *stack; struct position position; }; struct view_state *push_view_history_state(struct view_history *history, struct position *position, void *data); bool pop_view_history_state(struct view_history *history, struct position *position, void *data); void reset_view_history(struct view_history *history); /* * View opening */ void split_view(struct view *prev, struct view *view); void maximize_view(struct view *view, bool redraw); void load_view(struct view *view, struct view *prev, enum open_flags flags); #define refresh_view(view) load_view(view, NULL, OPEN_REFRESH) #define reload_view(view) load_view(view, NULL, OPEN_RELOAD) void open_view(struct view *prev, struct view *view, enum open_flags flags); void open_argv(struct view *prev, struct view *view, const char *argv[], const char *dir, enum open_flags flags); /* * Various utilities. */ #define get_sort_field(view) ((view)->sort.current->type) void sort_view(struct view *view, bool change_field); struct view_column *get_view_column(struct view *view, enum view_column_type type); bool view_column_grep(struct view *view, struct line *line); bool view_column_info_changed(struct view *view, bool update); void view_column_reset(struct view *view); bool view_column_info_update(struct view *view, struct line *line); enum status_code parse_view_config(const char *view_name, const char *argv[]); struct line * find_line_by_type(struct view *view, struct line *line, enum line_type type, int direction); #define find_prev_line_by_type(view, line, type) \ find_line_by_type(view, line, type, -1) #define find_next_line_by_type(view, line, type) \ find_line_by_type(view, line, type, 1) #define is_initial_view(view) (!(view)->prev && !(view)->argv) #define failed_to_load_initial_view(view) (!(view)->prev && !(view)->lines) #define get_view_color(view, type) get_line_color((view)->keymap->name, type) #define get_view_attr(view, type) get_line_attr((view)->keymap->name, type) /* * Incremental updating */ static inline bool check_position(struct position *pos) { return pos->lineno || pos->col || pos->offset; } static inline void clear_position(struct position *pos) { memset(pos, 0, sizeof(*pos)); } void reset_view(struct view *view); bool 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); /* * Line utilities. */ struct line *add_line_at(struct view *view, unsigned long pos, const void *data, enum line_type type, size_t data_size, bool custom); struct line *add_line(struct view *view, const void *data, enum line_type type, size_t data_size, bool custom); struct line *add_line_alloc_(struct view *view, void **ptr, enum line_type type, size_t data_size, bool custom); #define add_line_alloc(view, data_ptr, type, extra_size, custom) \ add_line_alloc_(view, (void **) data_ptr, type, sizeof(**data_ptr) + extra_size, custom) struct line *add_line_nodata(struct view *view, enum line_type type); struct line *add_line_text(struct view *view, const char *text, enum line_type type); struct line * PRINTF_LIKE(3, 4) add_line_format(struct view *view, enum line_type type, const char *fmt, ...); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/include/tig/watch.h000066400000000000000000000034271233303337700157750ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #ifndef TIG_WATCH_H #define TIG_WATCH_H #include "tig/tig.h" #include "tig/types.h" enum watch_event { WATCH_EVENT_SWITCH_VIEW, WATCH_EVENT_AFTER_EXTERNAL, WATCH_EVENT_LOAD, WATCH_EVENT_PERIODIC, }; enum watch_trigger { WATCH_NONE = 0, WATCH_INDEX_STAGED_YES = 1 << 0, WATCH_INDEX_STAGED_NO = 1 << 1, WATCH_INDEX_UNSTAGED_YES = 1 << 2, WATCH_INDEX_UNSTAGED_NO = 1 << 3, WATCH_HEAD = 1 << 4, WATCH_STASH = 1 << 5, WATCH_REFS = 1 << 6, WATCH_INDEX_STAGED = WATCH_INDEX_STAGED_YES | WATCH_INDEX_STAGED_NO, WATCH_INDEX_UNSTAGED = WATCH_INDEX_UNSTAGED_YES | WATCH_INDEX_UNSTAGED_NO, WATCH_INDEX = WATCH_INDEX_STAGED | WATCH_INDEX_UNSTAGED, }; struct watch { struct watch *next; enum watch_trigger triggers; enum watch_trigger changed; enum watch_trigger state; }; void watch_register(struct watch *watch, enum watch_trigger triggers); void watch_unregister(struct watch *watch); bool watch_dirty(struct watch *watch); enum watch_trigger watch_update(enum watch_event event); enum watch_trigger watch_update_single(struct watch *watch, enum watch_event event); void watch_apply(struct watch *source, enum watch_trigger changed); int watch_periodic(int interval); #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/manual.html000066400000000000000000001510271233303337700144530ustar00rootroot00000000000000 The tig Manual

This is the manual for tig, the ncurses-based text-mode interface for git. Tig allows you to browse changes in a git repository and can additionally act as a pager for output of various git commands. When used as a pager, it will display input from stdin and colorize it.

When browsing repositories, tig uses the underlying git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff.

Table of Contents

1. Calling Conventions

1.1. Pager Mode

If stdin is a pipe, any log or diff options will be ignored and the pager view will be opened loading data from stdin. The pager mode can be used for colorizing output from various git commands.

Example on how to colorize the output of git-show(1):

$ git show | tig

1.2. Git Command Options

All git command options specified on the command line will be passed to the given command and all will be shell quoted before they are passed to the shell.

Note
If you specify options for the main view, you should not use the --pretty option as this option will be set automatically to the format expected by the main view.

Example on how to view a commit and show both author and committer information:

$ tig show --pretty=fuller

See the section on specifying revisions for an introduction to revision options supported by the git commands. For details on specific git command options, refer to the man page of the command in question.

2. The Viewer

The display consists of a status window on the last line of the screen and one or more views. The default is to only show one view at a time but it is possible to split both the main and log view to also show the commit diff.

If you are in the log view and press Enter when the current line is a commit line, such as:

commit 4d55caff4cc89335192f3e566004b4ceef572521

You will split the view so that the log view is displayed in the top window and the diff view in the bottom window. You can switch between the two views by pressing Tab. To maximize the log view again, simply press l.

2.1. Views

Various views of a repository are presented. Each view is based on output from an external command, most often git log, git diff, or git show.

The main view

Is the default view, and it shows a one line summary of each commit in the chosen list of revisions. The summary includes commit date, author, and the first line of the log message. Additionally, any repository references, such as tags, will be shown.

The log view

Presents a more rich view of the revision log showing the whole log message and the diffstat.

The diff view

Shows either the diff of the current working tree, that is, what has changed since the last commit, or the commit diff complete with log message, diffstat and diff.

The tree view

Lists directory trees associated with the current revision allowing subdirectories to be descended or ascended and file blobs to be viewed.

The blob view

Displays the file content or "blob" of data associated with a file name.

The blame view

Displays the file content annotated or blamed by commits.

The branch view

Displays the branches in the repository.

The status view

Displays status of files in the working tree and allows changes to be staged/unstaged as well as adding of untracked files.

The stage view

Displays diff changes for staged or unstaged files being tracked or file content of untracked files.

The stash view

Displays the list of stashes in the repository.

The pager view

Is used for displaying both input from stdin and output from git commands entered in the internal prompt.

The help view

Displays a quick reference of key bindings.

2.2. Browsing State and User-defined Commands

The viewer keeps track of both what head and commit ID you are currently viewing. The commit ID will follow the cursor line and change every time you highlight a different commit. Whenever you reopen the diff view it will be reloaded, if the commit ID changed. The head ID is used when opening the main and log view to indicate from what revision to show history.

Some of the commands used or provided by tig can be configured. This goes for some of the environment variables as well as the external commands. These user-defined commands can use arguments that refer to the current browsing state by using one of the following variables.

Table 1. Browsing state variables

%(head)

The currently viewed head ID. Defaults to HEAD

%(commit)

The currently selected commit ID.

%(blob)

The currently selected blob ID.

%(branch)

The currently selected branch name.

%(stash)

The currently selected stash name.

%(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.

%(revargs)

The revision arguments passed on the command line.

%(fileargs)

The file arguments passed on the command line.

%(diffargs)

The diff options passed on the command line.

%(prompt)

Prompt for the argument value.

Example user-defined commands:

  • Allow to amend the last commit:

    bind generic + !git commit --amend
  • Copy commit ID to clipboard:

    bind generic 9 !@sh -c "echo -n %(commit) | xclip -selection c"
  • Add/edit notes for the current commit used during a review:

    bind generic T !git notes edit %(commit)
  • Enter git’s interactive add for fine-grained staging of file content:

    bind generic I !git add -i %(file)
  • Rebase current branch on top of the selected branch:

    bind branch 3 !git rebase -i %(branch)

2.3. Title Windows

Each view has a title window which shows the name of the view, current commit ID if available, and where the view is positioned:

[main] c622eefaa485995320bc743431bae0d497b1d875 - commit 1 of 61 (1%)

By default, the title of the current view is highlighted using bold font. For long loading views (taking over 3 seconds) the time since loading started will be appended:

[main] 77d9e40fbcea3238015aea403e06f61542df9a31 - commit 1 of 779 (0%) 5s

3. Environment Variables

Several options related to the interface with git can be configured via environment options.

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:

TIGRC_USER

Path of the user configuration file.

TIGRC_SYSTEM

Path of the system wide configuration file.

3.2. Repository References

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

2006-03-26 19:42 Petr Baudis         | [cogito-0.17.1] Cogito 0.17.1

If you want to limit what branches are shown, say only show branches named master or those which start with the jf/ prefix, you can do it by setting the following variable:

$ TIG_LS_REMOTE="git ls-remote . master jf/*" tig

Or set the variable permanently in your environment.

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:

git ls-remote .

3.3. 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:

$ TIG_DIFF_OPTS="--relative-date" tig

Or set the variable permanently in your environment.

4. Default Keybindings

Below the default key bindings are shown.

4.1. View Switching

Key Action

m

Switch to main view.

d

Switch to diff view.

l

Switch to log view.

p

Switch to pager view.

t

Switch to (directory) tree view.

f

Switch to (file) blob view.

B

Switch to blame view.

H

Switch to branch view.

y

Switch to stash view.

h

Switch to help view

S

Switch to status view

c

Switch to stage view

4.2. View Manipulation

Key Action

q

Close view, if multiple views are open it will jump back to the previous view in the view stack. If it is the last open view it will quit. Use Q to quit all views at once.

Enter

This key is "context sensitive" depending on what view you are currently in. When in log view on a commit line or in the main view, split the view and show the commit diff. In the diff view pressing Enter will simply scroll the view one line down.

Tab

Switch to next view.

R

Reload and refresh the current view.

O

Maximize the current view to fill the whole display.

Up

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.

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 commit. For merges the parent is queried.

4.3. View Specific Actions

Key Action

u

Update status of file. In the status view, this allows you to add an untracked file or stage changes to a file for next commit (similar to running git-add <filename>). In the stage view, when pressing this on a diff chunk line stages only that chunk for next commit, when not on a diff chunk line all changes in the displayed diff are staged.

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).

!

Checkout file with unstaged changes. This will reset the file to contain the content it had at last commit.

1

Stage single diff line.

@

Move to next chunk in the stage view.

]

Increase the diff context.

[

Decrease the diff context.

4.4. Cursor Navigation

Key Action

k

Move cursor one line up.

j

Move cursor one line down.

PgUp,-,a

Move cursor one page up.

PgDown, Space

Move cursor one page down.

End

Jump to last line.

Home

Jump to first line.

4.5. Scrolling

Key Action

Insert

Scroll view one line up.

Delete

Scroll view one line down.

w

Scroll view one page up.

s

Scroll view one page down.

Left

Scroll view one column left.

Right

Scroll view one column right.

|

Scroll view to the first column.

4.6. Searching

Key Action

/

Search the view. Opens a prompt for entering search regexp to use.

?

Search backwards in the view. Also prompts for regexp.

n

Find next match for the current search regexp.

N

Find previous match for the current search regexp.

4.7. Misc

Key Action

Q

Quit.

r

Redraw screen.

z

Stop all background loading. This can be useful if you use tig in a repository with a long history without limiting the revision log.

v

Show version.

o

Open option menu

.

Toggle line numbers on/off.

D

Toggle date display on/off/short/relative/local.

A

Toggle author display on/off/abbreviated/email/email user name.

g

Toggle revision graph visualization on/off.

~

Toggle (line) graphics mode

F

Toggle reference display on/off (tag and branch names).

W

Toggle ignoring whitespace on/off for diffs

X

Toggle commit ID display on/off

%

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.

e

Open file in editor.

4.8. Prompt

Key Action

:<number>

Jump to the specific line number, e.g. :80.

:<sha>

Jump to a specific commit, e.g. :2f12bcc.

:<x>

Execute the corresponding key binding, e.g. :q.

:!<command>

Execute a system command in a pager, e.g. :!git log -p.

:<action>

Execute a tig command, e.g. :edit.

4.9. External Commands

For more custom needs, external commands provide a way to easily execute a script or program. They are bound to keys and use information from the current browsing state, such as the current commit ID. Tig comes with the following built-in external commands:

Keymap Key Action

main

C

git cherry-pick %(commit)

status

C

git commit

generic

G

git gc

5. Revision Specification

This section describes various ways to specify what revisions to display or otherwise limit the view to. Tig does not itself parse the described revision options so refer to the relevant git man pages for further information. Relevant man pages besides git-log(1) are git-diff(1) and git-rev-list(1).

You can tune the interaction with git by making use of the options explained in this section. For example, by configuring the environment variable described in the section on diff options.

5.1. Limit by Path Name

If you are interested only in those revisions that made changes to a specific file (or even several files) list the files like this:

$ tig Makefile README

To avoid ambiguity with tig’s subcommands or repository references such as tag names, be sure to separate file names from other git options using "--". So if you have a file named status it will clash with the status subcommand, and thus you will have to use:

$ tig -- status

5.2. Limit by Date or Number

To speed up interaction with git, you can limit the amount of commits to show both for the log and main view. Either limit by date using e.g. --since=1.month or limit by the number of commits using -n400.

If you are only interested in changes that happened between two dates you can use:

$ tig --after="May 5th" --before="2006-05-16 15:44"
Note
If you want to avoid having to quote dates containing spaces you can use "." instead, e.g. --after=May.5th.

5.3. Limiting by Commit Ranges

Alternatively, commits can be limited to a specific range, such as "all commits between tag-1.0 and tag-2.0". For example:

$ tig tag-1.0..tag-2.0

This way of commit limiting makes it trivial to only browse the commits which haven’t been pushed to a remote branch. Assuming origin is your upstream remote branch, using:

$ tig origin..HEAD

will list what will be pushed to the remote branch. Optionally, the ending HEAD can be left out since it is implied.

5.4. Limiting by Reachability

Git interprets the range specifier "tag-1.0..tag-2.0" as "all commits reachable from tag-2.0 but not from tag-1.0". Where reachability refers to what commits are ancestors (or part of the history) of the branch or tagged revision in question.

If you prefer to specify which commit to preview in this way use the following:

$ tig tag-2.0 ^tag-1.0

You can think of ^ as a negation operator. Using this alternate syntax, it is possible to further prune commits by specifying multiple branch cut offs.

5.5. Combining Revisions Specification

Revision options can to some degree be combined, which makes it possible to say "show at most 20 commits from within the last month that changed files under the Documentation/ directory."

$ tig --since=1.month -n20 -- Documentation/

5.6. Examining All Repository References

In some cases, it can be useful to query changes across all references in a repository. An example is to ask "did any line of development in this repository change a particular file within the last week". This can be accomplished using:

$ tig --all --since=1.week -- Makefile

6. BUGS

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.

7. Copyright

Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>

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.

8. See Also

Manpages:

Online resources:


tig-2.0.2/src/000077500000000000000000000000001233303337700130715ustar00rootroot00000000000000tig-2.0.2/src/argv.c000066400000000000000000000242241233303337700142000ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/argv.h" #include "tig/options.h" #include "tig/prompt.h" bool argv_to_string(const char *argv[SIZEOF_ARG], char *buf, size_t buflen, const char *sep) { size_t bufpos, argc; for (bufpos = 0, argc = 0; argv[argc]; argc++) if (!string_nformat(buf, buflen, &bufpos, "%s%s", argc ? sep : "", argv[argc])) return FALSE; return TRUE; } static inline int get_arg_valuelen(const char *arg, char *quoted) { if (*arg == '"' || *arg == '\'') { const char *end = *arg == '"' ? "\"" : "'"; int valuelen = strcspn(arg + 1, end); if (quoted) *quoted = *arg; return valuelen > 0 ? valuelen + 2 : strlen(arg); } else { if (quoted) *quoted = 0; return strcspn(arg, " \t"); } } static bool split_argv_string(const char *argv[SIZEOF_ARG], int *argc, char *cmd, bool remove_quotes) { while (*cmd && *argc < SIZEOF_ARG) { char quoted = 0; int valuelen = get_arg_valuelen(cmd, "ed); bool advance = cmd[valuelen] != 0; int quote_offset = !!(quoted && remove_quotes); cmd[valuelen - quote_offset] = 0; argv[(*argc)++] = chomp_string(cmd + quote_offset); cmd = chomp_string(cmd + valuelen + advance); } if (*argc < SIZEOF_ARG) argv[*argc] = NULL; return *argc < SIZEOF_ARG; } bool argv_from_string_no_quotes(const char *argv[SIZEOF_ARG], int *argc, char *cmd) { return split_argv_string(argv, argc, cmd, TRUE); } bool argv_from_string(const char *argv[SIZEOF_ARG], int *argc, char *cmd) { return split_argv_string(argv, argc, cmd, FALSE); } bool argv_from_env(const char **argv, const char *name) { char *env = argv ? getenv(name) : NULL; int argc = 0; if (env && *env) env = strdup(env); return !env || argv_from_string(argv, &argc, env); } void argv_free(const char *argv[]) { int argc; if (!argv) return; for (argc = 0; argv[argc]; argc++) free((void *) argv[argc]); argv[0] = NULL; } size_t argv_size(const char **argv) { int argc = 0; while (argv && argv[argc]) argc++; return argc; } bool argv_contains(const char **argv, const char *arg) { int i; for (i = 0; argv && argv[i]; i++) if (!strcmp(argv[i], arg)) return TRUE; return FALSE; } DEFINE_ALLOCATOR(argv_realloc, const char *, SIZEOF_ARG) bool argv_append(const char ***argv, const char *arg) { size_t argc = argv_size(*argv); char *alloc; if (!*arg && argc > 0) return TRUE; if (!argv_realloc(argv, argc, 2)) return FALSE; alloc = strdup(arg); (*argv)[argc++] = alloc; (*argv)[argc] = NULL; return alloc != NULL; } bool argv_append_array(const char ***dst_argv, const char *src_argv[]) { int i; for (i = 0; src_argv && src_argv[i]; i++) if (!argv_append(dst_argv, src_argv[i])) return FALSE; return TRUE; } bool argv_remove_quotes(const char *argv[]) { int argc; for (argc = 0; argv[argc]; argc++) { char quoted = 0; const char *arg = argv[argc]; const int arglen = get_arg_valuelen(arg, "ed); const int unquotedlen = arglen - 1 - (arg[arglen - 1] == quoted); char *unquoted; if (!quoted) continue; unquoted = strndup(arg + 1, unquotedlen); if (!unquoted) return FALSE; free((void *) arg); argv[argc] = unquoted; } return TRUE; } bool argv_copy(const char ***dst, const char *src[]) { int argc; argv_free(*dst); for (argc = 0; src[argc]; argc++) if (!argv_append(dst, src[argc])) return FALSE; return TRUE; } /* * Argument formatting. */ struct format_var { const char *name; size_t namelen; const char *value; const char *value_if_empty; }; struct format_context { struct format_var *vars; size_t vars_size; char buf[SIZEOF_STR]; size_t bufpos; bool file_filter; }; #define ARGV_ENV_INIT(name, ifempty, initval) initval struct argv_env argv_env = { ARGV_ENV_INFO(ARGV_ENV_INIT) }; static bool format_expand_arg(struct format_context *format, const char *name, const char *end) { struct format_var *vars = format->vars; int i; if (!prefixcmp(name, "%(prompt")) { const char *prompt = "Command argument: "; char msgbuf[SIZEOF_STR]; const char *value; const char *msgstart = name + STRING_SIZE("%(prompt"); int msglen = end - msgstart - 1; if (end && msglen > 0 && string_format(msgbuf, "%.*s", msglen, msgstart)) { const char *msg = msgbuf; while (isspace(*msg)) msg++; if (*msg) prompt = msg; } value = read_prompt(prompt); if (value == NULL) return FALSE; return string_format_from(format->buf, &format->bufpos, "%s", value); } for (i = 0; i < format->vars_size; i++) { const char *value; if (strncmp(name, vars[i].name, vars[i].namelen)) continue; if (vars[i].value == argv_env.file && !format->file_filter) return TRUE; value = *vars[i].value ? vars[i].value : vars[i].value_if_empty; if (!*value) return TRUE; return string_format_from(format->buf, &format->bufpos, "%s", value); } return FALSE; } static bool format_append_arg(struct format_context *format, const char ***dst_argv, const char *arg) { memset(format->buf, 0, sizeof(format->buf)); format->bufpos = 0; while (arg) { char *var = strstr(arg, "%("); int len = var ? var - arg : strlen(arg); char *next = var ? strchr(var, ')') + 1 : NULL; if (len && !string_format_from(format->buf, &format->bufpos, "%.*s", len, arg)) return FALSE; if (var && !format_expand_arg(format, var, next)) return FALSE; arg = next; } return argv_append(dst_argv, format->buf); } static bool format_append_argv(struct format_context *format, const char ***dst_argv, const char *src_argv[]) { int argc; if (!src_argv) return TRUE; for (argc = 0; src_argv[argc]; argc++) if (!format_append_arg(format, dst_argv, src_argv[argc])) return FALSE; return src_argv[argc] == NULL; } bool argv_format(struct argv_env *argv_env, const char ***dst_argv, const char *src_argv[], bool first, bool file_filter) { struct format_var vars[] = { #define FORMAT_VAR(name, ifempty, initval) \ { "%(" #name ")", STRING_SIZE("%(" #name ")"), argv_env->name, ifempty } ARGV_ENV_INFO(FORMAT_VAR) }; struct format_context format = { vars, ARRAY_SIZE(vars), "", 0, file_filter }; int argc; argv_free(*dst_argv); for (argc = 0; src_argv[argc]; argc++) { const char *arg = src_argv[argc]; if (!strcmp(arg, "%(fileargs)")) { if (file_filter && !argv_append_array(dst_argv, opt_file_argv)) break; } else if (!strcmp(arg, "%(diffargs)")) { if (!format_append_argv(&format, dst_argv, opt_diff_options)) break; } else if (!strcmp(arg, "%(blameargs)")) { if (!format_append_argv(&format, dst_argv, opt_blame_options)) break; } else if (!strcmp(arg, "%(cmdlineargs)")) { if (!format_append_argv(&format, dst_argv, opt_cmdline_argv)) break; } else if (!strcmp(arg, "%(revargs)") || (first && !strcmp(arg, "%(commit)"))) { if (!argv_append_array(dst_argv, opt_rev_argv)) break; } else if (!format_append_arg(&format, dst_argv, arg)) { break; } } return src_argv[argc] == NULL; } static inline bool argv_find_rev_flag(const char *argv[], size_t argc, const char *arg, size_t arglen, size_t *search_offset, bool *with_graph, bool *with_reflog) { int i; for (i = 0; i < argc; i++) { const char *flag = argv[i]; size_t flaglen = strlen(flag); if (flaglen > arglen || strncmp(arg, flag, flaglen)) continue; if (search_offset) *search_offset = flaglen; else if (flaglen != arglen && flag[flaglen - 1] != '=') continue; if (with_graph) *with_graph = FALSE; if (with_reflog) *with_reflog = TRUE; return TRUE; } return FALSE; } bool argv_parse_rev_flag(const char *arg, struct rev_flags *rev_flags) { static const char *with_graph[] = { "--after=", "--all", "--all-match", "--ancestry-path", "--author-date-order", "--author=", "--basic-regexp", "--before=", "--boundary", "--branches", "--branches=", "--cherry", "--cherry-mark", "--cherry-pick", "--committer=", "--date-order", "--dense", "--extended-regexp", "--first-parent", "--fixed-strings", "--full-history", "--graph", "--glob=", "--left-only", "--max-parents=", "--merge", "--merges", "--min-parents=", "--no-max-parents", "--no-merges", "--no-min-parents", "--no-walk", "--perl-regexp", "--pickaxe-all", "--pickaxe-regex", "--regexp-ignore-case", "--remotes", "--remotes=", "--remove-empty", "--reverse", "--right-only", "--simplify-by-decoration", "--simplify-merges", "--since=", "--skip=", "--sparse", "--stdin", "--tags", "--tags=", "--topo-order", "--until=", "-E", "-F", "-i", }; static const char *no_graph[] = { "--follow", }; static const char *with_reflog[] = { "--walk-reflogs", "-g", }; static const char *search_no_graph[] = { "--grep-reflog=", "--grep=", "-G", "-S", }; size_t arglen = strlen(arg); bool graph = TRUE; bool reflog = FALSE; size_t search = 0; if (argv_find_rev_flag(with_graph, ARRAY_SIZE(with_graph), arg, arglen, NULL, NULL, NULL) || argv_find_rev_flag(no_graph, ARRAY_SIZE(no_graph), arg, arglen, NULL, &graph, NULL) || argv_find_rev_flag(with_reflog, ARRAY_SIZE(with_reflog), arg, arglen, NULL, NULL, &reflog) || argv_find_rev_flag(search_no_graph, ARRAY_SIZE(search_no_graph), arg, arglen, &search, &graph, NULL)) { if (rev_flags) { rev_flags->search_offset = search ? search : arglen; rev_flags->with_graph = graph; rev_flags->with_reflog = reflog; } return TRUE; } return FALSE; } char * argv_format_arg(struct argv_env *argv_env, const char *src_arg) { const char *src_argv[] = { src_arg, NULL }; const char **dst_argv = NULL; char *dst_arg = NULL; if (argv_format(argv_env, &dst_argv, src_argv, FALSE, TRUE)) dst_arg = (char *) dst_argv[0]; free(dst_argv); return dst_arg; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/blame.c000066400000000000000000000314771233303337700143310ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/io.h" #include "tig/refdb.h" #include "tig/repo.h" #include "tig/options.h" #include "tig/parse.h" #include "tig/display.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/git.h" #include "tig/diff.h" /* * Blame backend * * Loading the blame view is a two phase job: * * 1. File content is read either using argv_env.file from the * filesystem or using git-cat-file. * 2. Then blame information is incrementally added by * reading output from git-blame. */ struct blame_history_state { char id[SIZEOF_REV]; /* SHA1 ID. */ const char *filename; /* Name of file. */ }; static struct view_history blame_view_history = { sizeof(struct blame_history_state) }; struct blame { struct blame_commit *commit; unsigned long lineno; char text[1]; }; struct blame_state { struct blame_commit *commit; char author[SIZEOF_STR]; int blamed; bool done_reading; bool auto_filename_display; const char *filename; /* The history state for the current view is cached in the view * state so it always matches what was used to load the current blame * view. */ struct blame_history_state history_state; }; static void blame_update_file_name_visibility(struct view *view) { struct blame_state *state = view->private; struct view_column *column = get_view_column(view, VIEW_COLUMN_FILE_NAME); if (!column) return; column->hidden = column->opt.file_name.display == FILENAME_NO || (column->opt.file_name.display == FILENAME_AUTO && !state->auto_filename_display); } static bool blame_open(struct view *view, enum open_flags flags) { struct blame_state *state = view->private; const char *file_argv[] = { repo.cdup, view->env->file , NULL }; 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_argv || opt_file_argv[1] || (opt_rev_argv && opt_rev_argv[1])) usage("Invalid number of options to blame"); if (opt_rev_argv) { string_ncopy(view->env->ref, opt_rev_argv[0], strlen(opt_rev_argv[0])); } string_ncopy(view->env->file, opt_file_argv[0], strlen(opt_file_argv[0])); opt_blame_options = opt_cmdline_argv; opt_cmdline_argv = NULL; } 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 (!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 (*view->env->ref || !begin_update(view, repo.cdup, file_argv, flags)) { const char *blame_cat_file_argv[] = { "git", "cat-file", "blob", "%(ref):%(file)", NULL }; if (!begin_update(view, repo.cdup, blame_cat_file_argv, flags)) return FALSE; } /* First pass: remove multiple references to the same commit. */ for (i = 0; i < view->lines; i++) { struct blame *blame = view->line[i].data; if (blame->commit && blame->commit->id[0]) blame->commit->id[0] = 0; else blame->commit = NULL; } /* Second pass: free existing references. */ for (i = 0; i < view->lines; i++) { struct blame *blame = view->line[i].data; if (blame->commit) free(blame->commit); } if (!(flags & OPEN_RELOAD)) reset_view_history(&blame_view_history); 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; string_format(view->vid, "%s", view->env->file); string_format(view->ref, "%s ...", view->env->file); return TRUE; } static struct blame_commit * get_blame_commit(struct view *view, const char *id) { size_t i; for (i = 0; i < view->lines; i++) { struct blame *blame = view->line[i].data; if (!blame->commit) continue; if (!strncmp(blame->commit->id, id, SIZEOF_REV - 1)) return blame->commit; } { struct blame_commit *commit = calloc(1, sizeof(*commit)); if (commit) string_ncopy(commit->id, id, SIZEOF_REV); return commit; } } static struct blame_commit * read_blame_commit(struct view *view, const char *text, struct blame_state *state) { struct blame_header header; struct blame_commit *commit; struct blame *blame; if (!parse_blame_header(&header, text, view->lines)) return NULL; commit = get_blame_commit(view, text); if (!commit) return NULL; state->blamed += header.group; while (header.group--) { struct line *line = &view->line[header.lineno + header.group - 1]; blame = line->data; blame->commit = commit; blame->lineno = header.orig_lineno + header.group - 1; line->dirty = 1; } return commit; } static bool blame_read_file(struct view *view, struct buffer *buf, struct blame_state *state) { if (!buf) { const char *blame_argv[] = { "git", "blame", encoding_arg, "%(blameargs)", "--incremental", *view->env->ref ? view->env->ref : "--incremental", "--", view->env->file, NULL }; 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)) { report("Failed to load blame data"); return TRUE; } if (view->env->lineno > 0) { select_view_line(view, view->env->lineno); view->env->lineno = 0; } state->done_reading = TRUE; return FALSE; } else { struct blame *blame; if (!add_line_alloc(view, &blame, LINE_DEFAULT, buf->size, FALSE)) return FALSE; blame->commit = NULL; strncpy(blame->text, buf->data, buf->size); blame->text[buf->size] = 0; return TRUE; } } static bool blame_read(struct view *view, struct buffer *buf) { struct blame_state *state = view->private; if (!state->done_reading) return blame_read_file(view, buf, state); if (!buf) { string_format(view->ref, "%s", view->vid); if (view_is_displayed(view)) { update_view_title(view); redraw_view_from(view, 0); } return TRUE; } 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); } else if (parse_blame_info(state->commit, state->author, buf->data)) { bool update_view_columns = TRUE; int i; if (!state->commit->filename) return FALSE; if (!state->filename) { state->filename = state->commit->filename; } else if (strcmp(state->filename, state->commit->filename)) { state->auto_filename_display = TRUE; view->force_redraw = TRUE; blame_update_file_name_visibility(view); } for (i = 0; i < view->lines; i++) { struct line *line = &view->line[i]; struct blame *blame = line->data; if (blame && blame->commit == state->commit) { line->dirty = 1; if (update_view_columns) view_column_info_update(view, line); update_view_columns = FALSE; } } state->commit = NULL; } return TRUE; } bool blame_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { struct blame *blame = line->data; if (blame->commit) { column_data->id = blame->commit->id; column_data->author = blame->commit->author; column_data->file_name = blame->commit->filename; column_data->date = &blame->commit->time; column_data->commit_title = blame->commit->title; } column_data->text = blame->text; return TRUE; } static bool check_blame_commit(struct blame *blame, bool check_null_id) { if (!blame->commit) report("Commit data not loaded yet"); else if (check_null_id && string_rev_is_null(blame->commit->id)) report("No commit exist for the selected line"); else return TRUE; return FALSE; } static void setup_blame_parent_line(struct view *view, struct blame *blame) { char from[SIZEOF_REF + SIZEOF_STR]; char to[SIZEOF_REF + SIZEOF_STR]; const char *diff_tree_argv[] = { "git", "diff", encoding_arg, "--no-textconv", "--no-extdiff", "--no-color", "-U0", from, to, "--", NULL }; struct io io; int parent_lineno = -1; int blamed_lineno = -1; struct buffer buf; if (!string_format(from, "%s:%s", view->env->ref, view->env->file) || !string_format(to, "%s:%s", blame->commit->id, blame->commit->filename) || !io_run(&io, IO_RD, NULL, opt_env, diff_tree_argv)) return; while (io_get(&io, &buf, '\n', TRUE)) { char *line = buf.data; if (*line == '@') { char *pos = strchr(line, '+'); parent_lineno = atoi(line + 4); if (pos) blamed_lineno = atoi(pos + 1); } else if (*line == '+' && parent_lineno != -1) { if (blame->lineno == blamed_lineno - 1 && !strcmp(blame->text, line + 1)) { view->pos.lineno = parent_lineno ? parent_lineno - 1 : 0; break; } blamed_lineno++; } } io_done(&io); } static void blame_go_forward(struct view *view, struct blame *blame, bool parent) { struct blame_state *state = view->private; struct blame_history_state *history_state = &state->history_state; struct blame_commit *commit = blame->commit; const char *id = parent ? commit->parent_id : commit->id; const char *filename = parent ? commit->parent_filename : commit->filename; if (!*id && parent) { report("The selected commit has no parents"); return; } if (!strcmp(history_state->id, id) && !strcmp(history_state->filename, filename)) { report("The selected commit is already displayed"); return; } if (!push_view_history_state(&blame_view_history, &view->pos, history_state)) { report("Failed to save current view state"); return; } string_ncopy(view->env->ref, id, sizeof(commit->id)); string_ncopy(view->env->file, filename, strlen(filename)); if (parent) setup_blame_parent_line(view, blame); view->env->lineno = blame->lineno; reload_view(view); } static void blame_go_back(struct view *view) { struct blame_history_state history_state; if (!pop_view_history_state(&blame_view_history, &view->pos, &history_state)) { report("Already at start of history"); return; } string_copy(view->env->ref, history_state.id); string_ncopy(view->env->file, history_state.filename, strlen(history_state.filename)); view->env->lineno = view->pos.lineno; reload_view(view); } static enum request blame_request(struct view *view, enum request request, struct line *line) { enum open_flags flags = view_is_displayed(view) ? OPEN_SPLIT : OPEN_DEFAULT; struct blame *blame = line->data; struct view *diff = &diff_view; switch (request) { case REQ_VIEW_BLAME: case REQ_PARENT: if (!check_blame_commit(blame, TRUE)) break; blame_go_forward(view, blame, request == REQ_PARENT); break; case REQ_BACK: blame_go_back(view); break; case REQ_ENTER: if (!check_blame_commit(blame, FALSE)) break; if (view_is_displayed(diff) && !strcmp(blame->commit->id, diff->ref)) break; if (string_rev_is_null(blame->commit->id)) { const char *diff_parent_argv[] = { GIT_DIFF_BLAME(encoding_arg, diff_context_arg(), ignore_space_arg(), blame->commit->filename) }; const char *diff_no_parent_argv[] = { GIT_DIFF_BLAME_NO_PARENT(encoding_arg, diff_context_arg(), ignore_space_arg(), blame->commit->filename) }; const char **diff_index_argv = *blame->commit->parent_id ? diff_parent_argv : diff_no_parent_argv; open_argv(view, diff, diff_index_argv, NULL, flags); if (diff->pipe) string_copy_rev(diff->ref, NULL_ID); } else { open_diff_view(view, flags); } break; default: return request; } return REQ_NONE; } static void blame_select(struct view *view, struct line *line) { struct blame *blame = line->data; struct blame_commit *commit = blame->commit; if (!commit) return; if (string_rev_is_null(commit->id)) string_ncopy(view->env->commit, "HEAD", 4); else string_copy_rev(view->env->commit, commit->id); } static struct view_ops blame_ops = { "line", argv_env.commit, VIEW_SEND_CHILD_ENTER | VIEW_BLAME_LIKE, sizeof(struct blame_state), blame_open, blame_read, view_column_draw, blame_request, view_column_grep, blame_select, NULL, view_column_bit(AUTHOR) | view_column_bit(DATE) | view_column_bit(FILE_NAME) | view_column_bit(ID) | view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), blame_get_column_data, }; DEFINE_VIEW(blame); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/blob.c000066400000000000000000000065441233303337700141640ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/refdb.h" #include "tig/parse.h" #include "tig/display.h" #include "tig/draw.h" #include "tig/log.h" #include "tig/pager.h" #include "tig/tree.h" struct blob_state { char commit[SIZEOF_REF]; const char *file; }; static bool blob_open(struct view *view, enum open_flags flags) { struct blob_state *state = view->private; static const char *blob_argv[] = { "git", "cat-file", "blob", "%(blob)", NULL }; const char **argv = (flags & (OPEN_PREPARED | OPEN_REFRESH)) ? view->argv : blob_argv; if (argv != blob_argv) { state->file = get_path(view->env->file); state->commit[0] = 0; } if (!state->file && !view->env->blob[0] && view->env->file[0]) { const char *commit = view->env->commit[0] ? view->env->commit : "HEAD"; char blob_spec[SIZEOF_STR]; const char *rev_parse_argv[] = { "git", "rev-parse", blob_spec, NULL }; if (!string_format(blob_spec, "%s:%s", commit, view->env->file) || !io_run_buf(rev_parse_argv, view->env->blob, sizeof(view->env->blob))) { report("Failed to resolve blob from file name"); return FALSE; } 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; } view->encoding = get_path_encoding(view->env->file, default_encoding); string_copy(view->ref, view->env->file); return begin_update(view, NULL, argv, flags); } static bool blob_read(struct view *view, struct buffer *buf) { if (!buf) { if (view->env->lineno > 0) { select_view_line(view, view->env->lineno); view->env->lineno = 0; } return TRUE; } return add_line_text(view, buf->data, LINE_DEFAULT) != NULL; } static enum request blob_request(struct view *view, enum request request, struct line *line) { struct blob_state *state = view->private; switch (request) { case REQ_REFRESH: if (!state->file) { report("Cannot reload immutable blob"); } else { string_ncopy(view->env->file, state->file, strlen(state->file)); refresh_view(view); } return REQ_NONE; case REQ_VIEW_BLAME: string_ncopy(view->env->ref, state->commit, strlen(state->commit)); view->env->lineno = line - view->line; return request; case REQ_EDIT: if (state->file) open_editor(state->file, (line - view->line) + 1); else open_blob_editor(view->vid, NULL, (line - view->line) + 1); return REQ_NONE; default: return pager_request(view, request, line); } } static struct view_ops blob_ops = { "line", argv_env.blob, VIEW_NO_FLAGS | VIEW_REFRESH, sizeof(struct blob_state), blob_open, blob_read, view_column_draw, blob_request, view_column_grep, pager_select, NULL, view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), pager_get_column_data, }; DEFINE_VIEW(blob); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/diff.c000066400000000000000000000260311233303337700141470ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/argv.h" #include "tig/refdb.h" #include "tig/repo.h" #include "tig/options.h" #include "tig/display.h" #include "tig/parse.h" #include "tig/pager.h" #include "tig/diff.h" #include "tig/draw.h" static bool diff_open(struct view *view, enum open_flags flags) { const char *diff_argv[] = { "git", "show", encoding_arg, "--pretty=fuller", "--root", "--patch-with-stat", show_notes_arg(), diff_context_arg(), ignore_space_arg(), "%(diffargs)", "%(cmdlineargs)", "--no-color", "%(commit)", "--", "%(fileargs)", NULL }; return begin_update(view, NULL, diff_argv, flags); } struct line * diff_common_add_diff_stat(struct view *view, const char *text, size_t offset) { const char *start = text + offset; const char *data = start + strspn(start, " "); size_t len = strlen(data); char *pipe = strchr(data, '|'); /* Ensure that '|' is present and the file name part contains * non-space characters. */ if (!pipe || pipe == data || strcspn(data, " ") == 0) return NULL; /* Detect remaining part of a diff stat line: * * added | 40 +++++++++++ * remove | 124 -------------------------- * updated | 14 +---- * rename.from => rename.to | 0 * .../truncated file name | 11 ++--- * binary add | Bin 0 -> 1234 bytes * binary update | Bin 1234 -> 2345 bytes * unmerged | Unmerged */ if ((data[len - 1] == '-' || data[len - 1] == '+') || strstr(pipe, " 0") || (strstr(pipe, "Bin") && strstr(pipe, "->")) || strstr(pipe, "Unmerged") || (data[len - 1] == '0' && (strstr(data, "=>") || !prefixcmp(data, "...")))) return add_line_text(view, text, LINE_DIFF_STAT); return NULL; } bool diff_common_read(struct view *view, const char *data, struct diff_state *state) { enum line_type type = get_line_type(data); if (!view->lines && type != LINE_COMMIT) state->reading_diff_stat = TRUE; if (state->combined_diff && !state->after_diff && data[0] == ' ' && data[1] != ' ') state->reading_diff_stat = TRUE; if (state->reading_diff_stat) { if (diff_common_add_diff_stat(view, data, 0)) return TRUE; state->reading_diff_stat = FALSE; } else if (!strcmp(data, "---")) { state->reading_diff_stat = TRUE; } if (!state->after_commit_title && !prefixcmp(data, " ")) { struct line *line = add_line_text(view, data, LINE_DEFAULT); if (line) line->commit_title = 1; state->after_commit_title = TRUE; return line != NULL; } if (type == LINE_DIFF_HEADER) { const int len = STRING_SIZE("diff --"); state->after_diff = TRUE; if (!strncmp(data + len, "combined ", strlen("combined ")) || !strncmp(data + len, "cc ", strlen("cc "))) state->combined_diff = TRUE; } else if (type == LINE_PP_MERGE) { state->combined_diff = TRUE; } /* ADD2 and DEL2 are only valid in combined diff hunks */ if (!state->combined_diff && (type == LINE_DIFF_ADD2 || type == LINE_DIFF_DEL2)) type = LINE_DEFAULT; return pager_common_read(view, data, type, NULL); } static bool diff_find_stat_entry(struct view *view, struct line *line, enum line_type type) { struct line *marker = find_next_line_by_type(view, line, type); return marker && line == find_prev_line_by_type(view, marker, LINE_DIFF_HEADER); } enum request diff_common_enter(struct view *view, enum request request, struct line *line) { if (line->type == LINE_DIFF_STAT) { int file_number = 0; while (view_has_line(view, line) && line->type == LINE_DIFF_STAT) { file_number++; line--; } for (line = view->line; view_has_line(view, line); line++) { line = find_next_line_by_type(view, line, LINE_DIFF_HEADER); if (!line) break; if (diff_find_stat_entry(view, line, LINE_DIFF_INDEX) || diff_find_stat_entry(view, line, LINE_DIFF_SIMILARITY)) { if (file_number == 1) { break; } file_number--; } } if (!line) { report("Failed to find file diff"); return REQ_NONE; } select_view_line(view, line - view->line); report_clear(); return REQ_NONE; } else { return pager_request(view, request, line); } } static bool diff_read(struct view *view, struct buffer *buf) { struct diff_state *state = view->private; if (!buf) { /* Fall back to retry if no diff will be shown. */ if (view->lines == 0 && opt_file_argv) { int pos = argv_size(view->argv) - argv_size(opt_file_argv) - 1; if (pos > 0 && !strcmp(view->argv[pos], "--")) { for (; view->argv[pos]; pos++) { free((void *) view->argv[pos]); view->argv[pos] = NULL; } if (view->pipe) io_done(view->pipe); if (io_run(&view->io, IO_RD, view->dir, opt_env, view->argv)) return FALSE; } } return TRUE; } return diff_common_read(view, buf->data, state); } static bool diff_blame_line(const char *ref, const char *file, unsigned long lineno, struct blame_header *header, struct blame_commit *commit) { char author[SIZEOF_STR] = ""; char line_arg[SIZEOF_STR]; const char *blame_argv[] = { "git", "blame", encoding_arg, "-p", line_arg, ref, "--", file, NULL }; struct io io; bool ok = FALSE; struct buffer buf; if (!string_format(line_arg, "-L%ld,+1", lineno)) return FALSE; if (!io_run(&io, IO_RD, repo.cdup, opt_env, blame_argv)) return FALSE; while (io_get(&io, &buf, '\n', TRUE)) { if (header) { if (!parse_blame_header(header, buf.data, 9999999)) break; header = NULL; } else if (parse_blame_info(commit, author, buf.data)) { ok = commit->filename != NULL; break; } } if (io_error(&io)) ok = FALSE; io_done(&io); return ok; } unsigned int diff_get_lineno(struct view *view, struct line *line) { const struct line *header, *chunk; unsigned int lineno; struct chunk_header chunk_header; /* Verify that we are after a diff header and one of its chunks */ header = find_prev_line_by_type(view, line, LINE_DIFF_HEADER); chunk = find_prev_line_by_type(view, line, LINE_DIFF_CHUNK); if (!header || !chunk || chunk < header) return 0; /* * In a chunk header, the number after the '+' sign is the number of its * following line, in the new version of the file. We increment this * number for each non-deletion line, until the given line position. */ if (!parse_chunk_header(&chunk_header, chunk->data)) return 0; lineno = chunk_header.new.position; for (chunk++; chunk < line; chunk++) if (chunk->type != LINE_DIFF_DEL && chunk->type != LINE_DIFF_DEL2) lineno++; return lineno; } static enum request diff_trace_origin(struct view *view, struct line *line) { struct line *diff = find_prev_line_by_type(view, line, LINE_DIFF_HEADER); struct line *chunk = find_prev_line_by_type(view, line, LINE_DIFF_CHUNK); const char *chunk_data; int chunk_marker = line->type == LINE_DIFF_DEL ? '-' : '+'; unsigned long lineno = 0; const char *file = NULL; char ref[SIZEOF_REF]; struct blame_header header; struct blame_commit commit; if (!diff || !chunk || chunk == line) { report("The line to trace must be inside a diff chunk"); return REQ_NONE; } for (; diff < line && !file; diff++) { const char *data = diff->data; if (!prefixcmp(data, "--- a/")) { file = data + STRING_SIZE("--- a/"); break; } } if (diff == line || !file) { report("Failed to read the file name"); return REQ_NONE; } chunk_data = chunk->data; if (!parse_chunk_lineno(&lineno, chunk_data, chunk_marker)) { report("Failed to read the line number"); return REQ_NONE; } if (lineno == 0) { report("This is the origin of the line"); return REQ_NONE; } for (chunk += 1; chunk < line; chunk++) { if (chunk->type == LINE_DIFF_ADD) { lineno += chunk_marker == '+'; } else if (chunk->type == LINE_DIFF_DEL) { lineno += chunk_marker == '-'; } else { lineno++; } } if (chunk_marker == '+') string_copy(ref, view->vid); else string_format(ref, "%s^", view->vid); if (string_rev_is_null(ref)) { string_ncopy(view->env->file, file, strlen(file)); string_copy(view->env->ref, ""); view->env->lineno = lineno - 1; } else { if (!diff_blame_line(ref, file, lineno, &header, &commit)) { report("Failed to read blame data"); return REQ_NONE; } string_ncopy(view->env->file, commit.filename, strlen(commit.filename)); string_copy(view->env->ref, header.id); view->env->lineno = header.orig_lineno - 1; } return REQ_VIEW_BLAME; } const char * diff_get_pathname(struct view *view, struct line *line) { const struct line *header; const char *dst = NULL; const char *prefixes[] = { " b/", "cc ", "combined " }; int i; header = find_prev_line_by_type(view, line, LINE_DIFF_HEADER); if (!header) return NULL; for (i = 0; i < ARRAY_SIZE(prefixes) && !dst; i++) dst = strstr(header->data, prefixes[i]); return dst ? dst + strlen(prefixes[--i]) : NULL; } enum request diff_common_edit(struct view *view, enum request request, struct line *line) { const char *file = diff_get_pathname(view, line); char path[SIZEOF_STR]; bool has_path = file && string_format(path, "%s%s", repo.cdup, file); if (has_path && access(path, R_OK)) { report("Failed to open file: %s", file); return REQ_NONE; } open_editor(file, diff_get_lineno(view, line)); return REQ_NONE; } static enum request diff_request(struct view *view, enum request request, struct line *line) { switch (request) { case REQ_VIEW_BLAME: return diff_trace_origin(view, line); case REQ_EDIT: return diff_common_edit(view, request, line); case REQ_ENTER: return diff_common_enter(view, request, line); case REQ_REFRESH: if (string_rev_is_null(view->vid)) refresh_view(view); else reload_view(view); return REQ_NONE; default: return pager_request(view, request, line); } } static void diff_select(struct view *view, struct line *line) { if (line->type == LINE_DIFF_STAT) { string_format(view->ref, "Press '%s' to jump to file diff", get_view_key(view, REQ_ENTER)); } else { const char *file = diff_get_pathname(view, line); if (file) { string_format(view->ref, "Changes to '%s'", file); string_format(view->env->file, "%s", file); view->env->blob[0] = 0; } else { string_ncopy(view->ref, view->ops->id, strlen(view->ops->id)); pager_select(view, line); } } } static struct view_ops diff_ops = { "line", argv_env.commit, VIEW_DIFF_LIKE | VIEW_ADD_DESCRIBE_REF | VIEW_ADD_PAGER_REFS | VIEW_FILE_FILTER | VIEW_REFRESH, sizeof(struct diff_state), diff_open, diff_read, view_column_draw, diff_request, view_column_grep, diff_select, NULL, view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), pager_get_column_data, }; DEFINE_VIEW(diff); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/display.c000066400000000000000000000305021233303337700147020ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/argv.h" #include "tig/io.h" #include "tig/repo.h" #include "tig/options.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/display.h" #include "tig/watch.h" struct view *display[2]; unsigned int current_view; static WINDOW *display_win[2]; static WINDOW *display_title[2]; static WINDOW *display_sep; FILE *opt_tty; bool open_external_viewer(const char *argv[], const char *dir, bool confirm, bool refresh, const char *notice) { bool ok; def_prog_mode(); /* save current tty modes */ endwin(); /* restore original tty modes */ ok = io_run_fg(argv, dir); if (confirm || !ok) { if (!ok && *notice) fprintf(stderr, "%s", notice); fprintf(stderr, "Press Enter to continue"); getc(opt_tty); } reset_prog_mode(); if (watch_update(WATCH_EVENT_AFTER_EXTERNAL) && refresh) { struct view *view; int i; foreach_displayed_view (view, i) { if (watch_dirty(&view->watch)) refresh_view(view); } } redraw_display(TRUE); return ok; } #define EDITOR_LINENO_MSG \ "*** Your editor reported an error while opening the file.\n" \ "*** This is probably because it doesn't support the line\n" \ "*** number argument added automatically. The line number\n" \ "*** has been disabled for now. You can permanently disable\n" \ "*** it by adding the following line to ~/.tigrc\n" \ "*** set editor-line-number = no\n" void open_editor(const char *file, unsigned int lineno) { const char *editor_argv[SIZEOF_ARG + 3] = { "vi", file, NULL }; char editor_cmd[SIZEOF_STR]; char lineno_cmd[SIZEOF_STR]; const char *editor; int argc = 0; editor = getenv("GIT_EDITOR"); if (!editor && *opt_editor) editor = opt_editor; if (!editor) editor = getenv("VISUAL"); if (!editor) editor = getenv("EDITOR"); if (!editor) editor = "vi"; string_ncopy(editor_cmd, editor, strlen(editor)); if (!argv_from_string_no_quotes(editor_argv, &argc, editor_cmd)) { report("Failed to read editor command"); return; } 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, TRUE, EDITOR_LINENO_MSG)) opt_editor_line_number = FALSE; } static void apply_horizontal_split(struct view *base, struct view *view) { view->width = base->width; view->height = apply_step(opt_split_view_height, base->height); view->height = MAX(view->height, MIN_VIEW_HEIGHT); view->height = MIN(view->height, base->height - MIN_VIEW_HEIGHT); base->height -= view->height; } static void apply_vertical_split(struct view *base, struct view *view) { view->height = base->height; view->width = apply_step(VSPLIT_SCALE, base->width); view->width = MAX(view->width, MIN_VIEW_WIDTH); view->width = MIN(view->width, base->width - MIN_VIEW_WIDTH); base->width -= view->width; } static bool vertical_split_is_enabled(void) { if (opt_vertical_split == VERTICAL_SPLIT_AUTO) { int height, width; getmaxyx(stdscr, height, width); return width > 160 || width * VSPLIT_SCALE > (height - 1) * 2; } return opt_vertical_split == VERTICAL_SPLIT_VERTICAL; } static void redraw_display_separator(bool clear) { if (displayed_views() > 1 && vertical_split_is_enabled()) { chtype separator = opt_line_graphics ? ACS_VLINE : '|'; if (clear) wclear(display_sep); wbkgd(display_sep, separator + get_line_attr(NULL, LINE_TITLE_BLUR)); wnoutrefresh(display_sep); } } void resize_display(void) { int x, y, i; struct view *base = display[0]; struct view *view = display[1] ? display[1] : display[0]; bool vsplit; /* Setup window dimensions */ getmaxyx(stdscr, base->height, base->width); /* Make room for the status window. */ base->height -= 1; vsplit = vertical_split_is_enabled(); if (view != base) { if (vsplit) { apply_vertical_split(base, view); /* Make room for the separator bar. */ view->width -= 1; } else { apply_horizontal_split(base, view); } /* Make room for the title bar. */ view->height -= 1; } string_format(opt_env_columns, "COLUMNS=%d", base->width); string_format(opt_env_lines, "LINES=%d", base->height); /* Make room for the title bar. */ base->height -= 1; x = y = 0; foreach_displayed_view (view, i) { if (!display_win[i]) { display_win[i] = newwin(view->height, view->width, y, x); if (!display_win[i]) die("Failed to create %s view", view->name); scrollok(display_win[i], FALSE); display_title[i] = newwin(1, view->width, y + view->height, x); if (!display_title[i]) die("Failed to create title window"); } else { wresize(display_win[i], view->height, view->width); mvwin(display_win[i], y, x); wresize(display_title[i], 1, view->width); mvwin(display_title[i], y + view->height, x); } if (i > 0 && vsplit) { if (!display_sep) { display_sep = newwin(view->height, 1, 0, x - 1); if (!display_sep) die("Failed to create separator window"); } else { wresize(display_sep, view->height, 1); mvwin(display_sep, 0, x - 1); } } view->win = display_win[i]; view->title = display_title[i]; if (vsplit) x += view->width + 1; else y += view->height + 1; } redraw_display_separator(FALSE); } void redraw_display(bool clear) { struct view *view; int i; foreach_displayed_view (view, i) { if (clear) wclear(view->win); redraw_view(view); update_view_title(view); } redraw_display_separator(clear); } /* * Status management */ /* Whether or not the curses interface has been initialized. */ static bool cursed = FALSE; /* Terminal hacks and workarounds. */ static bool use_scroll_redrawwin; static bool use_scroll_status_wclear; /* The status window is used for polling keystrokes. */ WINDOW *status_win; /* Reading from the prompt? */ static bool input_mode = FALSE; static bool status_empty = FALSE; /* Update status and title window. */ static bool update_status_window(struct view *view, const char *msg, va_list args) { if (input_mode) return FALSE; if (!status_empty || *msg) { wmove(status_win, 0, 0); if (view && view->has_scrolled && use_scroll_status_wclear) wclear(status_win); if (*msg) { vwprintw(status_win, msg, args); status_empty = FALSE; } else { status_empty = TRUE; } wclrtoeol(status_win); return TRUE; } return FALSE; } void update_status(const char *msg, ...) { va_list args; va_start(args, msg); update_status_window(display[current_view], msg, args); va_end(args); } void report(const char *msg, ...) { struct view *view = display[current_view]; va_list args; if (!view) { char buf[SIZEOF_STR]; int retval; FORMAT_BUFFER(buf, sizeof(buf), msg, retval, TRUE); die("%s", buf); } va_start(args, msg); if (update_status_window(view, msg, args)) wnoutrefresh(status_win); va_end(args); update_view_title(view); } static void done_display(void) { endwin(); } void init_display(void) { const char *term; int x, y; die_callback = done_display; /* XXX: Restore tty modes and let the OS cleanup the rest! */ if (atexit(done_display)) die("Failed to register done_display"); /* Initialize the curses library */ if (isatty(STDIN_FILENO)) { cursed = !!initscr(); opt_tty = stdin; } else { /* Leave stdin and stdout alone when acting as a pager. */ opt_tty = fopen("/dev/tty", "r+"); if (!opt_tty) die("Failed to open /dev/tty"); cursed = !!newterm(NULL, opt_tty, opt_tty); } 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); if (has_colors()) init_colors(); getmaxyx(stdscr, y, x); status_win = newwin(1, x, y - 1, 0); if (!status_win) die("Failed to create status window"); /* Enable keyboard mapping */ keypad(status_win, TRUE); wbkgdset(status_win, get_line_attr(NULL, LINE_STATUS)); enable_mouse(opt_mouse); #if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119) set_tabsize(opt_tab_size); #else TABSIZE = opt_tab_size; #endif term = getenv("XTERM_VERSION") ? NULL : getenv("COLORTERM"); if (term && !strcmp(term, "gnome-terminal")) { /* In the gnome-terminal-emulator, the message from * scrolling up one line when impossible followed by * scrolling down one line causes corruption of the * status line. This is fixed by calling wclear. */ 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. */ use_scroll_status_wclear = use_scroll_redrawwin = FALSE; } else { /* When scrolling in (u)xterm the last line in the * scrolling direction will update slowly. */ use_scroll_redrawwin = TRUE; use_scroll_status_wclear = FALSE; } } int get_input(int prompt_position, struct key *key, bool modifiers) { struct view *view; int i, key_value, cursor_y, cursor_x; if (prompt_position) input_mode = TRUE; memset(key, 0, sizeof(*key)); while (TRUE) { int delay = -1; if (opt_refresh_mode == REFRESH_MODE_PERIODIC) { delay = watch_periodic(opt_refresh_interval); foreach_displayed_view (view, i) { if (view_can_refresh(view) && watch_dirty(&view->watch)) refresh_view(view); } } foreach_view (view, i) { update_view(view); if (view_is_displayed(view) && view->has_scrolled && use_scroll_redrawwin) redrawwin(view->win); view->has_scrolled = FALSE; if (view->pipe) delay = 0; } /* Update the cursor position. */ if (prompt_position) { getbegyx(status_win, cursor_y, cursor_x); cursor_x = prompt_position; } else { view = display[current_view]; getbegyx(view->win, cursor_y, cursor_x); cursor_x = view->width - 1; cursor_y += view->pos.lineno - view->pos.offset; } setsyx(cursor_y, cursor_x); /* Refresh, accept single keystroke of input */ doupdate(); wtimeout(status_win, delay); key_value = wgetch(status_win); /* wgetch() with nodelay() enabled returns ERR when * there's no input. */ if (key_value == ERR) { } else if (key_value == KEY_ESC && modifiers) { key->modifiers.escape = 1; } else if (key_value == KEY_RESIZE) { int height, width; getmaxyx(stdscr, height, width); wresize(status_win, 1, width); mvwin(status_win, height - 1, 0); wnoutrefresh(status_win); resize_display(); redraw_display(TRUE); } else { int pos, key_length; input_mode = FALSE; if (key_value == erasechar()) key_value = KEY_BACKSPACE; /* * Ctrl- values are represented using a 0x1F * bitmask on the key value. To 'unmap' we assume that: * * - Ctrl-Z is handled by Ncurses. * - Ctrl-m is the same as Return/Enter. * - Ctrl-i is the same as Tab. * * For all other key values in the range the Ctrl flag * is set and the key value is updated to the proper * ASCII value. */ if (KEY_CTL('a') <= key_value && key_value <= KEY_CTL('y') && key_value != KEY_RETURN && key_value != KEY_TAB) { key->modifiers.control = 1; key_value = key_value | 0x40; } if ((key_value >= KEY_MIN && key_value < KEY_MAX) || key_value < 0x1F) { key->data.value = key_value; return key->data.value; } key->modifiers.multibytes = 1; key->data.bytes[0] = key_value; key_length = utf8_char_length(key->data.bytes); nodelay(status_win, TRUE); for (pos = 1; pos < key_length && pos < sizeof(key->data.bytes) - 1; pos++) { key->data.bytes[pos] = wgetch(status_win); } return OK; } } } void enable_mouse(bool enable) { #ifdef NCURSES_MOUSE_VERSION static bool enabled = FALSE; if (enable != enabled) { mmask_t mask = enable ? ALL_MOUSE_EVENTS : 0; if (mousemask(mask, NULL)) mouseinterval(0); enabled = enable; } #endif } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/draw.c000066400000000000000000000402611233303337700141750ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/graph.h" #include "tig/draw.h" #include "tig/options.h" /* * View drawing. */ static inline void set_view_attr(struct view *view, enum line_type type) { if (!view->curline->selected && view->curtype != type) { (void) wattrset(view->win, get_view_attr(view, type)); wchgat(view->win, -1, 0, get_view_color(view, type), NULL); view->curtype = type; } } #define VIEW_MAX_LEN(view) ((view)->width + (view)->pos.col - (view)->col) static bool 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; size_t skip = view->pos.col > view->col ? view->pos.col - view->col : 0; if (max_len <= 0) return VIEW_MAX_LEN(view) <= 0; len = utf8_length(&string, skip, &col, max_len, &trimmed, use_tilde, opt_tab_size); if (opt_iconv_out != ICONV_NONE) { string = encoding_iconv(opt_iconv_out, string, len); if (!string) return VIEW_MAX_LEN(view) <= 0; } set_view_attr(view, type); if (len > 0) { waddnstr(view->win, string, len); if (trimmed && use_tilde) { set_view_attr(view, LINE_DELIMITER); waddch(view->win, '~'); col++; } } view->col += col; return VIEW_MAX_LEN(view) <= 0; } static bool draw_space(struct view *view, enum line_type type, int max, int spaces) { static char space[] = " "; spaces = MIN(max, spaces); while (spaces > 0) { int len = MIN(spaces, sizeof(space) - 1); if (draw_chars(view, type, space, len, FALSE)) return TRUE; spaces -= len; } return VIEW_MAX_LEN(view) <= 0; } static bool draw_text_expanded(struct view *view, enum line_type type, const char *string, int max_len, bool use_tilde) { static char text[SIZEOF_STR]; do { size_t pos = string_expand(text, sizeof(text), string, opt_tab_size); if (draw_chars(view, type, text, max_len, use_tilde)) return TRUE; string += pos; } while (*string); return VIEW_MAX_LEN(view) <= 0; } bool draw_text(struct view *view, enum line_type type, const char *string) { return draw_text_expanded(view, type, string, VIEW_MAX_LEN(view), FALSE); } static bool draw_text_overflow(struct view *view, const char *text, enum line_type type, int overflow_length, int offset) { bool on = overflow_length > 0; if (on) { int overflow = overflow_length + offset; int max = MIN(VIEW_MAX_LEN(view), overflow); int len = strlen(text); if (draw_text_expanded(view, type, text, max, max < overflow)) return TRUE; text = len > overflow ? text + overflow : ""; type = LINE_OVERFLOW; } if (*text && draw_text(view, type, text)) return TRUE; return VIEW_MAX_LEN(view) <= 0; } bool PRINTF_LIKE(3, 4) draw_formatted(struct view *view, enum line_type type, const char *format, ...) { char text[SIZEOF_STR]; int retval; FORMAT_BUFFER(text, sizeof(text), format, retval, TRUE); return retval >= 0 ? draw_text(view, type, text) : VIEW_MAX_LEN(view) <= 0; } bool draw_graphic(struct view *view, enum line_type type, const chtype graphic[], size_t size, bool separator) { size_t skip = view->pos.col > view->col ? view->pos.col - view->col : 0; int max = VIEW_MAX_LEN(view); int i; if (max < size) size = max; set_view_attr(view, type); /* Using waddch() instead of waddnstr() ensures that * they'll be rendered correctly for the cursor line. */ for (i = skip; i < size; i++) waddch(view->win, graphic[i]); view->col += size; if (separator) { if (size < max && skip <= size) waddch(view->win, ' '); view->col++; } return VIEW_MAX_LEN(view) <= 0; } bool draw_field(struct view *view, enum line_type type, const char *text, int width, enum align align, bool trim) { int max = MIN(VIEW_MAX_LEN(view), width + 1); int col = view->col; if (!text) return draw_space(view, type, max, max); if (align == ALIGN_RIGHT) { int textlen = utf8_width_max(text, max); int leftpad = max - textlen - 1; if (leftpad > 0) { if (draw_space(view, type, leftpad, leftpad)) return TRUE; max -= leftpad; col += leftpad;; } } return draw_chars(view, type, text, max - 1, trim) || draw_space(view, LINE_DEFAULT, max - (view->col - col), max); } static bool draw_date(struct view *view, struct view_column *column, const struct time *time) { enum date date = column->opt.date.display; const char *text = mkdate(time, date); enum align align = date == DATE_RELATIVE ? ALIGN_RIGHT : ALIGN_LEFT; if (date == DATE_NO) return FALSE; return draw_field(view, LINE_DATE, text, column->width, align, FALSE); } static bool draw_author(struct view *view, struct view_column *column, const struct ident *author) { bool trim = author_trim(column->width); const char *text = mkauthor(author, column->opt.author.width, column->opt.author.display); if (column->opt.author.display == AUTHOR_NO) return FALSE; return draw_field(view, LINE_AUTHOR, text, column->width, ALIGN_LEFT, trim); } static bool draw_id(struct view *view, struct view_column *column, const char *id) { static const enum line_type colors[] = { LINE_PALETTE_0, LINE_PALETTE_1, LINE_PALETTE_2, LINE_PALETTE_3, LINE_PALETTE_4, LINE_PALETTE_5, LINE_PALETTE_6, }; enum line_type type = LINE_ID; if (!column->opt.id.display) return FALSE; if (column->opt.id.color) type = colors[((long) id) % ARRAY_SIZE(colors)]; return draw_field(view, type, id, column->width, ALIGN_LEFT, FALSE); } static bool draw_filename(struct view *view, struct view_column *column, const char *filename, mode_t mode) { size_t width = filename ? utf8_width(filename) : 0; bool trim = width >= column->width; enum line_type type = S_ISDIR(mode) ? LINE_DIRECTORY : LINE_FILE; int column_width = column->width ? column->width : width; if (column->opt.file_name.display == FILENAME_NO) return FALSE; return draw_field(view, type, filename, column_width, ALIGN_LEFT, trim); } static bool draw_file_size(struct view *view, struct view_column *column, unsigned long size, mode_t mode) { const char *str = S_ISDIR(mode) ? NULL : mkfilesize(size, column->opt.file_size.display); if (!column->width || column->opt.file_size.display == FILE_SIZE_NO) return FALSE; return draw_field(view, LINE_FILE_SIZE, str, column->width, ALIGN_RIGHT, FALSE); } static bool draw_mode(struct view *view, struct view_column *column, mode_t mode) { const char *str = mkmode(mode); if (!column->width || !column->opt.mode.display) return FALSE; return draw_field(view, LINE_MODE, str, column->width, ALIGN_LEFT, FALSE); } static bool 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; int max = MIN(VIEW_MAX_LEN(view), digits3); char *text = NULL; chtype separator = opt_line_graphics ? ACS_VLINE : '|'; if (!column->opt.line_number.display) return FALSE; if (lineno == 1 || (lineno % column->opt.line_number.interval) == 0) { static char fmt[] = "%ld"; fmt[1] = '0' + (digits3 <= 9 ? digits3 : 1); if (string_format(number, fmt, lineno)) text = number; } if (text) draw_chars(view, LINE_LINE_NUMBER, text, max, TRUE); else draw_space(view, LINE_LINE_NUMBER, max, digits3); return draw_graphic(view, LINE_DEFAULT, &separator, 1, TRUE); } bool draw_lineno(struct view *view, struct view_column *column, unsigned int lineno) { lineno += view->pos.offset + 1; return draw_lineno_custom(view, column, lineno); } static bool draw_ref(struct view *view, struct view_column *column, const struct ref *ref) { enum line_type type = !ref || !ref->valid ? LINE_DEFAULT : get_line_type_from_ref(ref); const char *name = ref ? ref->name : NULL; return draw_field(view, type, name, column->width, ALIGN_LEFT, FALSE); } static bool draw_refs(struct view *view, struct view_column *column, const struct ref_list *refs) { size_t i; if (!column->opt.commit_title.refs || !refs) return FALSE; for (i = 0; i < refs->size; i++) { struct ref *ref = refs->refs[i]; enum line_type type = get_line_type_from_ref(ref); const struct ref_format *format = get_ref_format(ref); if (!strcmp(format->start, "hide:") && !*format->end) continue; if (draw_formatted(view, type, "%s%s%s", format->start, ref->name, format->end)) return TRUE; if (draw_text(view, LINE_DEFAULT, " ")) return TRUE; } return FALSE; } static bool draw_status(struct view *view, struct view_column *column, enum line_type type, const char *status) { const char *label = mkstatus(status ? *status : 0, column->opt.status.display); return draw_field(view, type, label, column->width, ALIGN_LEFT, FALSE); } /* * Revision graph */ static const enum line_type graph_colors[] = { LINE_PALETTE_0, LINE_PALETTE_1, LINE_PALETTE_2, LINE_PALETTE_3, LINE_PALETTE_4, LINE_PALETTE_5, LINE_PALETTE_6, }; static enum line_type get_graph_color(struct graph_symbol *symbol) { if (symbol->commit) return LINE_GRAPH_COMMIT; assert(symbol->color < ARRAY_SIZE(graph_colors)); return graph_colors[symbol->color]; } static bool draw_graph_utf8(struct view *view, struct graph_symbol *symbol, enum line_type color, bool first) { const char *chars = graph_symbol_to_utf8(symbol); return draw_text(view, color, chars + !!first); } static bool draw_graph_ascii(struct view *view, struct graph_symbol *symbol, enum line_type color, bool first) { const char *chars = graph_symbol_to_ascii(symbol); return draw_text(view, color, chars + !!first); } static bool draw_graph_chtype(struct view *view, struct graph_symbol *symbol, enum line_type color, bool first) { const chtype *chars = graph_symbol_to_chtype(symbol); return draw_graphic(view, color, chars + !!first, 2 - !!first, FALSE); } typedef bool (*draw_graph_fn)(struct view *, struct graph_symbol *, enum line_type, bool); static bool draw_graph(struct view *view, const struct graph_canvas *canvas) { static const draw_graph_fn fns[] = { draw_graph_ascii, draw_graph_chtype, draw_graph_utf8 }; draw_graph_fn fn = fns[opt_line_graphics]; int i; for (i = 0; i < canvas->size; i++) { struct graph_symbol *symbol = &canvas->symbols[i]; enum line_type color = get_graph_color(symbol); if (fn(view, symbol, color, i == 0)) return TRUE; } return draw_text(view, LINE_DEFAULT, " "); } static bool draw_commit_title(struct view *view, struct view_column *column, const struct graph_canvas *graph, const struct ref_list *refs, const char *commit_title) { if (graph && column->opt.commit_title.graph && draw_graph(view, graph)) return TRUE; if (draw_refs(view, column, refs)) return TRUE; return draw_text_overflow(view, commit_title, LINE_DEFAULT, column->opt.commit_title.overflow, 0); } static bool draw_diff_stat_part(struct view *view, enum line_type *type, const char **text, char c, enum line_type next_type) { const char *sep = c == '|' ? strrchr(*text, c) : strchr(*text, c); if (sep != NULL) { draw_text_expanded(view, *type, *text, sep - *text, FALSE); *text = sep; *type = next_type; } return sep != NULL; } static void draw_diff_stat(struct view *view, enum line_type *type, const char **text) { draw_diff_stat_part(view, type, text, '|', LINE_DEFAULT); if (draw_diff_stat_part(view, type, text, 'B', LINE_DEFAULT)) { /* Handle binary diffstat: Bin -> bytes */ draw_diff_stat_part(view, type, text, ' ', LINE_DIFF_DEL); draw_diff_stat_part(view, type, text, '-', LINE_DEFAULT); draw_diff_stat_part(view, type, text, ' ', LINE_DIFF_ADD); draw_diff_stat_part(view, type, text, 'b', LINE_DEFAULT); } else { draw_diff_stat_part(view, type, text, '+', LINE_DIFF_ADD); draw_diff_stat_part(view, type, text, '-', LINE_DIFF_DEL); } } bool view_column_draw(struct view *view, struct line *line, unsigned int lineno) { struct view_column *column = view->columns; struct view_column_data column_data = {}; if (!view->ops->get_column_data(view, line, &column_data)) return TRUE; if (column_data.section) column = column_data.section; for (; column; column = column->next) { mode_t mode = column_data.mode ? *column_data.mode : 0; if (column->hidden) continue; switch (column->type) { case VIEW_COLUMN_DATE: if (draw_date(view, column, column_data.date)) return TRUE; continue; case VIEW_COLUMN_AUTHOR: if (draw_author(view, column, column_data.author)) return TRUE; continue; case VIEW_COLUMN_REF: if (draw_ref(view, column, column_data.ref)) return TRUE; continue; case VIEW_COLUMN_ID: if (draw_id(view, column, column_data.reflog ? column_data.reflog : column_data.id)) return TRUE; continue; case VIEW_COLUMN_LINE_NUMBER: if (draw_lineno(view, column, column_data.line_number ? *column_data.line_number : lineno)) return TRUE; continue; case VIEW_COLUMN_MODE: if (draw_mode(view, column, mode)) return TRUE; continue; case VIEW_COLUMN_FILE_SIZE: if (draw_file_size(view, column, column_data.file_size ? *column_data.file_size : 0, mode)) return TRUE; continue; case VIEW_COLUMN_COMMIT_TITLE: if (draw_commit_title(view, column, column_data.graph, column_data.refs, column_data.commit_title)) return TRUE; continue; case VIEW_COLUMN_FILE_NAME: if (draw_filename(view, column, column_data.file_name, mode)) return TRUE; continue; case VIEW_COLUMN_SECTION: if (draw_text(view, column->opt.section.type, column->opt.section.text)) return TRUE; continue; case VIEW_COLUMN_STATUS: if (draw_status(view, column, line->type, column_data.status)) return TRUE; continue; case VIEW_COLUMN_TEXT: { enum line_type type = line->type; const char *text = column_data.text; if (line->wrapped && draw_text(view, LINE_DELIMITER, "+")) return TRUE; if (line->graph_indent) { size_t indent = get_graph_indent(text); if (draw_text_expanded(view, LINE_DEFAULT, text, indent, FALSE)) return TRUE; text += indent; } if (type == LINE_DIFF_STAT) draw_diff_stat(view, &type, &text); if (line->commit_title) { if (draw_text_overflow(view, text, LINE_DEFAULT, column->opt.text.commit_title_overflow, 4)) return TRUE; } else if (draw_text(view, type, text)) { return TRUE; } } continue; } } return TRUE; } bool draw_view_line(struct view *view, unsigned int lineno) { struct line *line; bool selected = (view->pos.offset + lineno == view->pos.lineno); /* FIXME: Disabled during code split. assert(view_is_displayed(view)); */ if (view->pos.offset + lineno >= view->lines) return FALSE; line = &view->line[view->pos.offset + lineno]; wmove(view->win, lineno, 0); if (line->cleareol) wclrtoeol(view->win); view->col = 0; view->curline = line; view->curtype = LINE_NONE; line->selected = FALSE; line->dirty = line->cleareol = 0; if (selected) { set_view_attr(view, LINE_CURSOR); line->selected = TRUE; view->ops->select(view, line); } return view->ops->draw(view, line, lineno); } void redraw_view_dirty(struct view *view) { bool dirty = FALSE; int lineno; for (lineno = 0; lineno < view->height; lineno++) { if (view->pos.offset + lineno >= view->lines) break; if (!view->line[view->pos.offset + lineno].dirty) continue; dirty = TRUE; if (!draw_view_line(view, lineno)) break; } if (!dirty) return; wnoutrefresh(view->win); } void redraw_view_from(struct view *view, int lineno) { assert(0 <= lineno && lineno < view->height); if (view->columns && view_column_info_changed(view, FALSE)) { int i; view_column_reset(view); for (i = 0; i < view->lines; i++) { view_column_info_update(view, &view->line[i]); } } for (; lineno < view->height; lineno++) { if (!draw_view_line(view, lineno)) break; } wnoutrefresh(view->win); } void redraw_view(struct view *view) { werase(view->win); redraw_view_from(view, 0); } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/graph.c000066400000000000000000000510261233303337700143420ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/util.h" #include "tig/graph.h" DEFINE_ALLOCATOR(realloc_graph_columns, struct graph_column, 32) DEFINE_ALLOCATOR(realloc_graph_symbols, struct graph_symbol, 1) struct id_color { char *id; size_t color; }; struct id_color * id_color_new(const char *id, size_t color) { struct id_color *node = malloc(sizeof(struct id_color)); node->id = (char *) malloc(strlen(id) + 1); strcpy(node->id, id); node->color = color; return node; } static void id_color_delete(struct id_color *node) { free(node->id); free(node); } static int id_color_eq(const void *entry, const void *element) { return strcmp(((const struct id_color *) entry)->id, ((const struct id_color *) element)->id) == 0; } static void key_del(void *key) { id_color_delete((struct id_color *) key); } static hashval_t id_color_hash(const void *node) { return htab_hash_string(((const struct id_color*) node)->id); } static void colors_add_id(struct colors *colors, const char *id, const size_t color) { struct id_color *node = id_color_new(id, color); void **slot = htab_find_slot(colors->id_map, node, INSERT); if (slot != NULL && *slot == NULL) { *slot = node; colors->count[color]++; } else { id_color_delete(node); } } static void colors_remove_id(struct colors *colors, const char *id) { struct id_color *node = id_color_new(id, 0); void **slot = htab_find_slot(colors->id_map, node, NO_INSERT); if (slot != NULL && *slot != NULL) { colors->count[((struct id_color *) *slot)->color]--; htab_clear_slot(colors->id_map, slot); } id_color_delete(node); } static size_t colors_get_color(struct colors *colors, const char *id) { struct id_color *key = id_color_new(id, 0); struct id_color *node = (struct id_color *) htab_find(colors->id_map, key); id_color_delete(key); if (node == NULL) { return (size_t) -1; // Max value of size_t. ID not found. } return node->color; } static size_t colors_get_free_color(struct colors *colors) { size_t free_color = 0; size_t lowest = (size_t) -1; // Max value of size_t int i; for (i = 0; i < ARRAY_SIZE(colors->count); i++) { if (colors->count[i] < lowest) { lowest = colors->count[i]; free_color = i; } } return free_color; } static void colors_init(struct colors *colors) { if (colors->id_map == NULL) { uint size = 500; colors->id_map = htab_create_alloc(size, id_color_hash, id_color_eq, key_del, calloc, free); } } static size_t get_color(struct graph *graph, char *new_id) { size_t color; colors_init(&graph->colors); color = colors_get_color(&graph->colors, new_id); if (color < (size_t) -1) { return color; } color = colors_get_free_color(&graph->colors); colors_add_id(&graph->colors, new_id, color); return color; } void done_graph(struct graph *graph) { free(graph->prev_row.columns); free(graph->row.columns); free(graph->next_row.columns); free(graph->parents.columns); memset(graph, 0, sizeof(*graph)); } #define graph_column_has_commit(col) ((col)->id[0]) static size_t graph_find_column_by_id(struct graph_row *row, const char *id) { size_t free_column = row->size; size_t i; 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)) return i; } return free_column; } static size_t graph_find_free_column(struct graph_row *row) { size_t i; for (i = 0; i < row->size; i++) { if (!graph_column_has_commit(&row->columns[i])) return i; } return row->size; } static struct graph_column * graph_insert_column(struct graph *graph, struct graph_row *row, size_t pos, const char *id) { struct graph_column *column; if (!realloc_graph_columns(&row->columns, row->size, 1)) return NULL; column = &row->columns[pos]; if (pos < row->size) { memmove(column + 1, column, sizeof(*column) * (row->size - pos)); } row->size++; memset(column, 0, sizeof(*column)); string_copy_rev(column->id, id); column->symbol.boundary = !!graph->is_boundary; return column; } struct graph_column * graph_add_parent(struct graph *graph, const char *parent) { return graph_insert_column(graph, &graph->parents, graph->parents.size, parent); } static bool graph_needs_expansion(struct graph *graph) { return graph->position + graph->parents.size > graph->row.size; } static bool graph_expand(struct graph *graph) { while (graph_needs_expansion(graph)) { if (!graph_insert_column(graph, &graph->prev_row, graph->prev_row.size, "")) return FALSE; if (!graph_insert_column(graph, &graph->row, graph->row.size, "")) return FALSE; if (!graph_insert_column(graph, &graph->next_row, graph->next_row.size, "")) return FALSE; } return TRUE; } static bool graph_needs_collapsing(struct graph *graph) { return graph->row.size > 1 && !graph_column_has_commit(&graph->row.columns[graph->row.size - 1]); } static bool graph_collapse(struct graph *graph) { while (graph_needs_collapsing(graph)) { graph->prev_row.size--; graph->row.size--; graph->next_row.size--; } return TRUE; } static void graph_canvas_append_symbol(struct graph *graph, struct graph_symbol *symbol) { struct graph_canvas *canvas = graph->canvas; if (realloc_graph_symbols(&canvas->symbols, canvas->size, 1)) canvas->symbols[canvas->size++] = *symbol; } static void graph_row_clear_commit(struct graph_row *row, const char *id) { int i; for (i = 0; i < row->size; i++) { if (strcmp(row->columns[i].id, id) == 0) { row->columns[i].id[0] = 0; } } } static void graph_insert_parents(struct graph *graph) { struct graph_row *prev_row = &graph->prev_row; struct graph_row *row = &graph->row; struct graph_row *next_row = &graph->next_row; struct graph_row *parents = &graph->parents; int i; for (i = 0; i < parents->size; i++) { struct graph_column *new = &parents->columns[i]; 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) { 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, ""); } else { next_row->columns[match] = *new; } } } } static bool commit_is_in_row(const char *id, struct graph_row *row) { int i; for (i = 0; i < row->size; i++) { if (!graph_column_has_commit(&row->columns[i])) continue; if (strcmp(id, row->columns[i].id) == 0) return true; } return false; } static void graph_remove_collapsed_columns(struct graph *graph) { struct graph_row *row = &graph->next_row; int i; for (i = row->size - 1; i > 0; i--) { if (i == graph->position) continue; if (i == graph->position + 1) continue; if (strcmp(row->columns[i].id, graph->id) == 0) continue; if (strcmp(row->columns[i].id, row->columns[i - 1].id) != 0) 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) row->columns[i] = row->columns[i + 1]; } } static void graph_fill_empty_columns(struct graph *graph) { struct graph_row *row = &graph->next_row; int i; for (i = row->size - 2; i >= 0; i--) { if (!graph_column_has_commit(&row->columns[i])) { row->columns[i] = row->columns[i + 1]; } } } static void graph_generate_next_row(struct graph *graph) { graph_row_clear_commit(&graph->next_row, graph->id); graph_insert_parents(graph); graph_remove_collapsed_columns(graph); graph_fill_empty_columns(graph); } static int commits_in_row(struct graph_row *row) { int count = 0; int i; for (i = 0; i < row->size;i++) { if (graph_column_has_commit(&row->columns[i])) count++; } return count; } static void graph_commit_next_row(struct graph *graph) { int i; for (i = 0; i < graph->row.size; i++) { graph->prev_row.columns[i] = graph->row.columns[i]; if (i == graph->position && commits_in_row(&graph->parents) > 0) graph->prev_row.columns[i] = graph->next_row.columns[i]; if (!graph_column_has_commit(&graph->prev_row.columns[i])) graph->prev_row.columns[i] = graph->next_row.columns[i]; graph->row.columns[i] = graph->next_row.columns[i]; } graph->prev_position = graph->position; } 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) return false; if (row->columns[pos].symbol.shift_left) return false; return true; } static bool shift_left(struct graph_row *row, struct graph_row *prev_row, int pos) { int i; if (!graph_column_has_commit(&row->columns[pos])) return false; for (i = pos - 1; i >= 0; i--) { if (!graph_column_has_commit(&row->columns[i])) continue; if (strcmp(row->columns[i].id, row->columns[pos].id) != 0) continue; if (!continued_down(prev_row, row, i)) return true; break; } return false; } static bool new_column(struct graph_row *row, struct graph_row *prev_row, int pos) { int i; if (!graph_column_has_commit(&prev_row->columns[pos])) return true; for (i = pos; i < row->size; i++) { if (strcmp(row->columns[pos].id, prev_row->columns[i].id) == 0) return false; } return true; } static bool continued_right(struct graph_row *row, int pos, int commit_pos) { int i, end; if (pos < commit_pos) end = commit_pos; else end = row->size; for (i = pos + 1; i < end; i++) { if (strcmp(row->columns[pos].id, row->columns[i].id) == 0) return true; } return false; } static bool continued_left(struct graph_row *row, int pos, int commit_pos) { int i, start; if (pos < commit_pos) start = 0; else start = commit_pos; for (i = start; i < pos; i++) { if (!graph_column_has_commit(&row->columns[i])) continue; if (strcmp(row->columns[pos].id, row->columns[i].id) == 0) return true; } return false; } static bool parent_down(struct graph_row *parents, struct graph_row *next_row, int pos) { int parent; for (parent = 0; parent < parents->size; parent++) { if (!graph_column_has_commit(&parents->columns[parent])) continue; if (strcmp(parents->columns[parent].id, next_row->columns[pos].id) == 0) return true; } return false; } static bool parent_right(struct graph_row *parents, struct graph_row *row, struct graph_row *next_row, int pos) { int parent, i; for (parent = 0; parent < parents->size; parent++) { if (!graph_column_has_commit(&parents->columns[parent])) continue; for (i = pos + 1; i < next_row->size; i++) { if (strcmp(parents->columns[parent].id, next_row->columns[i].id) != 0) continue; if (strcmp(parents->columns[parent].id, row->columns[i].id) != 0) return true; } } return false; } static bool flanked(struct graph_row *row, int pos, int commit_pos, const char *commit_id) { int i, start, end; if (pos < commit_pos) { start = 0; end = pos; } else { start = pos + 1; end = row->size; } for (i = start; i < end; i++) { if (strcmp(row->columns[i].id, commit_id) == 0) return true; } return false; } static bool below_commit(int pos, struct graph *graph) { if (!pos == graph->prev_position) return false; if (!strcmp(graph->row.columns[pos].id, graph->prev_row.columns[pos].id) == 0) return false; return true; } static void graph_generate_symbols(struct graph *graph) { struct graph_row *prev_row = &graph->prev_row; struct graph_row *row = &graph->row; struct graph_row *next_row = &graph->next_row; struct graph_row *parents = &graph->parents; 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; 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->continued_down = continued_down(row, next_row, pos); symbol->continued_up = continued_down(prev_row, row, pos); symbol->continued_right = continued_right(row, pos, graph->position); symbol->continued_left = continued_left(row, pos, graph->position); symbol->continued_up_left = continued_left(prev_row, pos, prev_row->size); symbol->parent_down = parent_down(parents, next_row, pos); symbol->parent_right = (pos > graph->position && parent_right(parents, row, next_row, pos)); 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->shift_left = shift_left(row, prev_row, pos); symbol->continue_shift = shift_left(row, prev_row, pos + 1); symbol->below_shift = prev_row->columns[pos].symbol.shift_left; symbol->new_column = new_column(row, prev_row, pos); symbol->empty = (!graph_column_has_commit(&row->columns[pos])); if (graph_column_has_commit(column)) { id = column->id; } symbol->color = get_color(graph, id); graph_canvas_append_symbol(graph, symbol); } colors_remove_id(&graph->colors, graph->id); } bool graph_render_parents(struct graph *graph) { if (graph->parents.size == 0 && !graph_add_parent(graph, "")) return FALSE; if (!graph_expand(graph)) return FALSE; graph_generate_next_row(graph); graph_generate_symbols(graph); graph_commit_next_row(graph); graph->parents.size = graph->position = 0; if (!graph_collapse(graph)) return FALSE; return TRUE; } bool graph_add_commit(struct graph *graph, struct graph_canvas *canvas, const char *id, const char *parents, bool is_boundary) { graph->position = graph_find_column_by_id(&graph->row, id); string_copy_rev(graph->id, id); graph->canvas = canvas; graph->is_boundary = is_boundary; while ((parents = strchr(parents, ' '))) { parents++; if (!graph_add_parent(graph, parents)) return FALSE; graph->has_parents = TRUE; } return TRUE; } const bool graph_symbol_forks(struct graph_symbol *symbol) { if (!symbol->continued_down) return false; if (!symbol->continued_right) return false; if (!symbol->continued_up) return false; return true; } const bool graph_symbol_cross_over(struct graph_symbol *symbol) { if (symbol->empty) return false; if (!symbol->continued_down) return false; if (!symbol->continued_up && !symbol->new_column && !symbol->below_commit) return false; if (symbol->shift_left) return false; if (symbol->parent_right && symbol->merge) return true; if (symbol->flanked) return true; return false; } const bool graph_symbol_turn_left(struct graph_symbol *symbol) { if (symbol->matches_commit && symbol->continued_right && !symbol->continued_down) return false; if (symbol->continue_shift) return false; if (symbol->continued_up || symbol->new_column || symbol->below_commit) { if (symbol->matches_commit) return true; if (symbol->shift_left) return true; } return false; } const bool graph_symbol_turn_down_cross_over(struct graph_symbol *symbol) { if (!symbol->continued_down) return false; if (!symbol->continued_right) return false; if (symbol->flanked) return true; if (symbol->merge) return true; return false; } const bool graph_symbol_turn_down(struct graph_symbol *symbol) { if (!symbol->continued_down) return false; if (!symbol->continued_right) return false; return true; } const bool graph_symbol_merge(struct graph_symbol *symbol) { if (symbol->continued_down) return false; if (!symbol->parent_down) return false; if (symbol->parent_right) return false; return true; } const bool graph_symbol_multi_merge(struct graph_symbol *symbol) { if (!symbol->parent_down) return false; if (!symbol->parent_right) return false; return true; } const bool graph_symbol_vertical_bar(struct graph_symbol *symbol) { if (symbol->empty) return false; if (symbol->shift_left) return false; if (!symbol->continued_down) return false; if (symbol->continued_up) return true; if (symbol->parent_right) return false; if (symbol->flanked) return false; if (symbol->continued_right) return false; return true; } const bool graph_symbol_horizontal_bar(struct graph_symbol *symbol) { if (symbol->shift_left) return true; if (symbol->continued_down) return false; if (!symbol->parent_right && !symbol->continued_right) return false; if ((symbol->continued_up && !symbol->continued_up_left)) return false; if (!symbol->below_commit) return true; return false; } const bool graph_symbol_multi_branch(struct graph_symbol *symbol) { if (symbol->continued_down) return false; if (!symbol->continued_right) return false; if (symbol->below_shift) return false; if (symbol->continued_up || symbol->new_column || symbol->below_commit) { if (symbol->matches_commit) return true; if (symbol->shift_left) return true; } return false; } const char * graph_symbol_to_utf8(struct graph_symbol *symbol) { if (symbol->commit) { if (symbol->boundary) return " â—¯"; else if (symbol->initial) return " â—Ž"; else if (symbol->merge) return " â—"; return " â—"; } if (graph_symbol_cross_over(symbol)) return "─│"; if (graph_symbol_vertical_bar(symbol)) return " │"; if (graph_symbol_turn_left(symbol)) return "─╯"; if (graph_symbol_multi_branch(symbol)) return "─┴"; if (graph_symbol_horizontal_bar(symbol)) return "──"; if (graph_symbol_forks(symbol)) return " ├"; if (graph_symbol_turn_down_cross_over(symbol)) return "─╭"; if (graph_symbol_turn_down(symbol)) return " â•­"; if (graph_symbol_merge(symbol)) return "─╮"; if (graph_symbol_multi_merge(symbol)) return "─┬"; return " "; } const chtype * graph_symbol_to_chtype(struct graph_symbol *symbol) { static chtype graphics[2]; if (symbol->commit) { graphics[0] = ' '; if (symbol->boundary) graphics[1] = 'o'; else if (symbol->initial) graphics[1] = 'I'; else if (symbol->merge) graphics[1] = 'M'; else graphics[1] = 'o'; //ACS_DIAMOND; //'*'; return graphics; } else if (graph_symbol_cross_over(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_VLINE; } else if (graph_symbol_vertical_bar(symbol)) { graphics[0] = ' '; graphics[1] = ACS_VLINE; } else if (graph_symbol_turn_left(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_LRCORNER; } else if (graph_symbol_multi_branch(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_BTEE; } else if (graph_symbol_horizontal_bar(symbol)) { graphics[0] = graphics[1] = ACS_HLINE; } else if (graph_symbol_forks(symbol)) { graphics[0] = ' '; graphics[1] = ACS_LTEE; } else if (graph_symbol_turn_down_cross_over(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_ULCORNER; } else if (graph_symbol_turn_down(symbol)) { graphics[0] = ' '; graphics[1] = ACS_ULCORNER; } else if (graph_symbol_merge(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_URCORNER; } else if (graph_symbol_multi_merge(symbol)) { graphics[0] = ACS_HLINE; graphics[1] = ACS_TTEE; } else { graphics[0] = graphics[1] = ' '; } return graphics; } const char * graph_symbol_to_ascii(struct graph_symbol *symbol) { if (symbol->commit) { if (symbol->boundary) return " o"; else if (symbol->initial) return " I"; else if (symbol->merge) return " M"; return " *"; } if (graph_symbol_cross_over(symbol)) return "-|"; if (graph_symbol_vertical_bar(symbol)) return " |"; if (graph_symbol_turn_left(symbol)) return "-'"; if (graph_symbol_multi_branch(symbol)) return "-+"; if (graph_symbol_horizontal_bar(symbol)) return "--"; if (graph_symbol_forks(symbol)) return " +"; if (graph_symbol_turn_down_cross_over(symbol)) return "-."; if (graph_symbol_turn_down(symbol)) return " ."; if (graph_symbol_merge(symbol)) return "-."; if (graph_symbol_multi_merge(symbol)) return "-+"; return " "; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/grep.c000066400000000000000000000137221233303337700141770ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/refdb.h" #include "tig/options.h" #include "tig/parse.h" #include "tig/repo.h" #include "tig/display.h" #include "tig/prompt.h" #include "tig/draw.h" #include "tig/blob.h" #include "tig/grep.h" struct grep_line { const char *file; unsigned long lineno; char text[1]; }; struct grep_state { const char *last_file; bool no_file_group; }; #define grep_view_lineno(grep) ((grep)->lineno > 0 ? (grep)->lineno - 1 : 0) static struct grep_line * grep_get_line(const struct line *line) { static struct grep_line grep_line; if (line->type == LINE_DEFAULT) return line->data; grep_line.file = line->type == LINE_DELIMITER ? "" : get_path(line->data); return &grep_line; } static bool grep_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { struct grep_line *grep = grep_get_line(line); if (line->type == LINE_DELIMITER) { static struct view_column separator_column; separator_column.type = VIEW_COLUMN_TEXT; column_data->section = &separator_column; column_data->text = "--"; return TRUE; } if (*grep->file && !grep->lineno) { static struct view_column file_name_column; file_name_column.type = VIEW_COLUMN_FILE_NAME; file_name_column.opt.file_name.display = FILENAME_ALWAYS; column_data->section = &file_name_column; } column_data->line_number = &grep->lineno; column_data->file_name = grep->file; column_data->text = grep->text; return TRUE; } static void grep_select(struct view *view, struct line *line) { struct grep_line *grep = grep_get_line(line); if (!*grep->file) return; view->env->ref[0] = 0; string_ncopy(view->env->file, grep->file, strlen(grep->file)); string_ncopy(view->ref, grep->file, strlen(grep->file)); } static const char *grep_args[] = { "git", "grep", "--no-color", "-n", "-z", "--full-name", NULL }; static const char **grep_argv; static bool grep_prompt(void) { const char *argv[SIZEOF_ARG]; int argc = 0; char *grep = read_prompt("grep: "); if (!grep || !argv_from_string_no_quotes(argv, &argc, grep)) return FALSE; if (grep_argv) argv_free(grep_argv); return argv_append_array(&grep_argv, argv); } void open_grep_view(struct view *prev) { struct view *view = &grep_view; bool in_grep_view = prev == view; if ((!prev && is_initial_view(view)) || (view->lines && !in_grep_view)) { open_view(prev, view, OPEN_DEFAULT); } else { if (grep_prompt()) open_view(prev, view, OPEN_RELOAD); } } static bool grep_open(struct view *view, enum open_flags flags) { struct grep_state *state = view->private; const char **argv = NULL; if (is_initial_view(view)) { grep_argv = opt_cmdline_argv; opt_cmdline_argv = NULL; } if (!argv_append_array(&argv, grep_args) || !argv_append_array(&argv, grep_argv)) return FALSE; { struct view_column *column = get_view_column(view, VIEW_COLUMN_FILE_NAME); state->no_file_group = !column || column->opt.file_name.display != FILENAME_NO; } return begin_update(view, NULL, argv, flags); } static enum request grep_request(struct view *view, enum request request, struct line *line) { struct grep_state *state = view->private; struct grep_line *grep = grep_get_line(line); struct view *file_view = &blob_view; switch (request) { case REQ_REFRESH: refresh_view(view); return REQ_NONE; case REQ_ENTER: if (!*grep->file) return REQ_NONE; if (file_view->parent == view && file_view->prev == view && state->last_file == grep->file && view_is_displayed(file_view)) { if (grep_view_lineno(grep)) select_view_line(file_view, grep_view_lineno(grep)); } else { const char *file_argv[] = { repo.cdup, grep->file, NULL }; clear_position(&file_view->pos); view->env->lineno = grep_view_lineno(grep); view->env->blob[0] = 0; open_argv(view, file_view, file_argv, repo.cdup, OPEN_SPLIT | OPEN_RELOAD); } state->last_file = grep->file; return REQ_NONE; case REQ_EDIT: if (!*grep->file) return request; open_editor(grep->file, grep->lineno); return REQ_NONE; case REQ_VIEW_BLAME: view->env->ref[0] = 0; view->env->lineno = grep_view_lineno(grep); return request; default: return request; } } static bool grep_read(struct view *view, struct buffer *buf) { struct grep_state *state = view->private; struct grep_line *grep; char *lineno, *text; struct line *line; const char *file; size_t textlen; if (!buf) { state->last_file = NULL; return TRUE; } if (!strcmp(buf->data, "--")) return add_line_nodata(view, LINE_DELIMITER) != NULL; lineno = io_memchr(buf, buf->data, 0); text = io_memchr(buf, lineno, 0); if (!lineno || !text) return FALSE; textlen = strlen(text); file = get_path(buf->data); if (!file) return FALSE; if (!state->no_file_group && file != state->last_file && !add_line_text(view, file, LINE_FILE)) return FALSE; line = add_line_alloc(view, &grep, LINE_DEFAULT, textlen, FALSE); if (!line) return FALSE; grep->file = file; grep->lineno = atoi(lineno); strncpy(grep->text, text, textlen); grep->text[textlen] = 0; view_column_info_update(view, line); state->last_file = file; return TRUE; } static struct view_ops grep_ops = { "line", "", VIEW_REFRESH | VIEW_GREP_LIKE, sizeof(struct grep_state), grep_open, grep_read, view_column_draw, grep_request, view_column_grep, grep_select, NULL, view_column_bit(FILE_NAME) | view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), grep_get_column_data, }; DEFINE_VIEW(grep); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/help.c000066400000000000000000000166521233303337700141770ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/argv.h" #include "tig/view.h" #include "tig/draw.h" /* * Help backend */ struct help_state { int keys_width; int name_width; }; struct help { struct keymap *keymap; enum request request; union { const char *text; const struct request_info *req_info; } data; }; static bool help_draw(struct view *view, struct line *line, unsigned int lineno) { struct help *help = line->data; struct keymap *keymap = help->keymap; struct help_state *state = view->private; if (line->type == LINE_SECTION) { draw_formatted(view, line->type, "[%c] %s bindings", keymap->hidden ? '+' : '-', keymap->name); } else if (line->type == LINE_HELP_GROUP || !keymap) { draw_text(view, line->type, help->data.text); } else if (help->request > REQ_RUN_REQUESTS) { struct run_request *req = get_run_request(help->request); const char *key = get_keys(keymap, help->request, TRUE); char flags[8] = { req->flags.internal ? ':' : '!', 0 }; const char *sep = flags; int flagspos = req->flags.internal ? 1 : 0; int i; if (draw_field(view, LINE_DEFAULT, key, state->keys_width + 2, ALIGN_RIGHT, FALSE)) return TRUE; if (req->flags.silent) flags[flagspos++] = '@'; if (req->flags.confirm) flags[flagspos++] = '?'; if (req->flags.exit) flags[flagspos++] = '<'; if (flagspos > 1) flags[flagspos++] = 0; for (i = 0; req->argv[i]; i++) { if (draw_formatted(view, LINE_HELP_ACTION, "%s%s", sep, req->argv[i])) return TRUE; sep = " "; } } else { const struct request_info *req_info = help->data.req_info; const char *key = get_keys(keymap, req_info->request, TRUE); if (draw_field(view, LINE_DEFAULT, key, state->keys_width + 2, ALIGN_RIGHT, FALSE)) return TRUE; if (draw_field(view, LINE_HELP_ACTION, enum_name(req_info->name), state->name_width, ALIGN_LEFT, FALSE)) return TRUE; draw_text(view, LINE_DEFAULT, req_info->help); } return TRUE; } bool help_grep(struct view *view, struct line *line) { struct help *help = line->data; struct keymap *keymap = help->keymap; if (line->type == LINE_SECTION) { const char *text[] = { keymap->name, NULL }; return grep_text(view, text); } else if (line->type == LINE_HELP_GROUP || !keymap) { const char *text[] = { help->data.text, NULL }; return grep_text(view, text); } else if (help->request > REQ_RUN_REQUESTS) { struct run_request *req = get_run_request(help->request); const char *key = get_keys(keymap, help->request, TRUE); char buf[SIZEOF_STR] = ""; const char *text[] = { key, buf, NULL }; if (!argv_to_string(req->argv, buf, sizeof(buf), " ")) return FALSE; return grep_text(view, text); } else { const struct request_info *req_info = help->data.req_info; const char *key = get_keys(keymap, req_info->request, TRUE); const char *text[] = { key, enum_name(req_info->name), req_info->help, NULL }; return grep_text(view, text); } } struct help_request_iterator { struct view *view; struct keymap *keymap; bool add_title; const char *group; }; static bool add_help_line(struct view *view, struct help **help_ptr, struct keymap *keymap, enum line_type type) { struct help *help; if (!add_line_alloc(view, &help, type, 0, FALSE)) return FALSE; help->keymap = keymap; if (help_ptr) *help_ptr = help; return TRUE; } static bool add_help_headers(struct help_request_iterator *iterator, const char *group) { struct help *help; if (iterator->add_title) { iterator->add_title = FALSE; if (!add_help_line(iterator->view, &help, iterator->keymap, LINE_SECTION)) return FALSE; } if (iterator->keymap->hidden) return FALSE; if (iterator->group != group) { iterator->group = group; if (!add_help_line(iterator->view, &help, iterator->keymap, LINE_HELP_GROUP)) return FALSE; help->data.text = group; } return TRUE; } static bool help_open_keymap(void *data, const struct request_info *req_info, const char *group) { struct help_request_iterator *iterator = data; struct help_state *state = iterator->view->private; struct keymap *keymap = iterator->keymap; const char *key = get_keys(keymap, req_info->request, TRUE); struct help *help; if (req_info->request == REQ_NONE || !key || !*key) return TRUE; if (!add_help_headers(iterator, group) || !add_help_line(iterator->view, &help, iterator->keymap, LINE_DEFAULT)) return FALSE; state->keys_width = MAX(state->keys_width, strlen(key)); state->name_width = MAX(state->name_width, strlen(enum_name(req_info->name))); help->data.req_info = req_info; help->request = req_info->request; return TRUE; } static void help_open_keymap_run_requests(struct help_request_iterator *iterator, bool internal, bool toggles) { struct view *view = iterator->view; struct help_state *state = view->private; struct keymap *keymap = iterator->keymap; const char *group = !internal ? "External commands:" : toggles ? "Option toggling:" : "Internal commands:"; enum request request = REQ_RUN_REQUESTS + 1; struct help *help; for (; TRUE; request++) { struct run_request *req = get_run_request(request); const char *key; if (!req) break; if (req->flags.internal != !!internal || req->keymap != keymap || !*(key = get_keys(keymap, request, TRUE))) continue; if (toggles != !strcmp(req->argv[0], "toggle")) continue; if (!add_help_headers(iterator, group) || !add_help_line(view, &help, keymap, LINE_DEFAULT)) return; state->keys_width = MAX(state->keys_width, strlen(key)); help->request = request; } } static bool help_open(struct view *view, enum open_flags flags) { struct keymap *keymap; struct help *help; int i; reset_view(view); if (!add_help_line(view, &help, NULL, LINE_HEADER)) return FALSE; help->data.text = "Quick reference for tig keybindings:"; if (!add_help_line(view, &help, NULL, LINE_DEFAULT)) return FALSE; help->data.text = ""; for (i = 0; (keymap = get_keymap_by_index(i)); i++) { struct help_request_iterator iterator = { view, keymap, TRUE }; if (foreach_request(help_open_keymap, &iterator)) { help_open_keymap_run_requests(&iterator, TRUE, TRUE); help_open_keymap_run_requests(&iterator, TRUE, FALSE); help_open_keymap_run_requests(&iterator, FALSE, FALSE); } } return TRUE; } static enum request help_request(struct view *view, enum request request, struct line *line) { struct help *help = line->data; switch (request) { case REQ_ENTER: if (line->type == LINE_SECTION) { struct keymap *keymap = help->keymap; keymap->hidden = !keymap->hidden; refresh_view(view); } return REQ_NONE; case REQ_REFRESH: refresh_view(view); return REQ_NONE; default: return request; } } void help_select(struct view *view, struct line *line) { } static struct view_ops help_ops = { "line", "", VIEW_NO_GIT_DIR | VIEW_REFRESH, sizeof(struct help_state), help_open, NULL, help_draw, help_request, help_grep, help_select, NULL, }; DEFINE_VIEW(help); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/io.c000066400000000000000000000313351233303337700136510ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/util.h" #include "tig/io.h" /* * Encoding conversion. */ #define ENCODING_SEP ": encoding: " #define ENCODING_ARG "--encoding=" ENCODING_UTF8 #define CHARSET_SEP "; charset=" struct encoding { struct encoding *next; iconv_t cd; char fromcode[1]; }; char encoding_arg[] = ENCODING_ARG; struct encoding *default_encoding; static struct encoding *encodings; struct encoding * encoding_open(const char *fromcode) { struct encoding *encoding; size_t len = strlen(fromcode); if (!*fromcode) return NULL; for (encoding = encodings; encoding; encoding = encoding->next) { if (!strcasecmp(encoding->fromcode, fromcode)) return encoding; } encoding = calloc(1, sizeof(*encoding) + len); strncpy(encoding->fromcode, fromcode, len); encoding->cd = iconv_open(ENCODING_UTF8, fromcode); if (encoding->cd == ICONV_NONE) { free(encoding); return NULL; } encoding->next = encodings; encodings = encoding; return encoding; } static bool encoding_convert_string(iconv_t iconv_cd, struct buffer *buf) { static char out_buffer[BUFSIZ * 2]; ICONV_CONST char *inbuf = buf->data; size_t inlen = buf->size + 1; char *outbuf = out_buffer; size_t outlen = sizeof(out_buffer); size_t ret = iconv(iconv_cd, &inbuf, &inlen, &outbuf, &outlen); if (ret != (size_t) -1) { buf->data = out_buffer; buf->size = sizeof(out_buffer) - outlen; } return (ret != (size_t) -1); } bool encoding_convert(struct encoding *encoding, struct buffer *buf) { return encoding_convert_string(encoding->cd, buf); } const char * encoding_iconv(iconv_t iconv_cd, const char *string, size_t length) { char *instr = strndup(string, length); struct buffer buf = { instr, length }; const char *ret = buf.data && encoding_convert_string(iconv_cd, &buf) ? buf.data : string; free(instr); return ret == instr ? string : ret; } struct encoding * get_path_encoding(const char *path, struct encoding *default_encoding) { const char *check_attr_argv[] = { "git", "check-attr", "encoding", "--", path, NULL }; char buf[SIZEOF_STR]; char *encoding; /* : encoding: */ if (!*path || !io_run_buf(check_attr_argv, buf, sizeof(buf)) || !(encoding = strstr(buf, ENCODING_SEP))) return default_encoding; encoding += STRING_SIZE(ENCODING_SEP); if (!strcmp(encoding, ENCODING_UTF8) || !strcmp(encoding, "unspecified") || !strcmp(encoding, "set")) { const char *file_argv[] = { "file", "-I", "--", path, NULL }; if (!*path || !io_run_buf(file_argv, buf, sizeof(buf)) || !(encoding = strstr(buf, CHARSET_SEP))) return default_encoding; encoding += STRING_SIZE(CHARSET_SEP); } return encoding_open(encoding); } /* * Executing external commands. */ static void io_init(struct io *io) { memset(io, 0, sizeof(*io)); io->pipe = -1; } bool io_open(struct io *io, const char *fmt, ...) { char name[SIZEOF_STR] = ""; int retval; io_init(io); FORMAT_BUFFER(name, sizeof(name), fmt, retval, FALSE); if (retval < 0) { io->error = ENAMETOOLONG; return FALSE; } io->pipe = *name ? open(name, O_RDONLY) : dup(STDIN_FILENO); if (io->pipe == -1) io->error = errno; return io->pipe != -1; } bool io_kill(struct io *io) { return io->pid == 0 || kill(io->pid, SIGKILL) != -1; } bool io_done(struct io *io) { pid_t pid = io->pid; if (io->pipe != -1) close(io->pipe); free(io->buf); io_init(io); while (pid > 0) { int status; pid_t waiting = waitpid(pid, &status, 0); if (waiting < 0) { if (errno == EINTR) continue; io->error = errno; return FALSE; } if (WEXITSTATUS(status)) { io->status = WEXITSTATUS(status); } return waiting == pid && !WIFSIGNALED(status) && !io->status; } return TRUE; } static int open_trace(int devnull, const char *argv[]) { static const char *trace_file; if (!trace_file) { trace_file = getenv("TIG_TRACE"); if (!trace_file) trace_file = ""; } if (*trace_file) { int fd = open(trace_file, O_RDWR | O_CREAT | O_APPEND, 0666); int i; 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) { close(fd); return devnull; } return fd; } return devnull; } bool io_trace(const char *fmt, ...) { static FILE *trace_out; /* Intensionally leaked. */ va_list args; int retval; if (!trace_out) { const char *trace_file = getenv("TIG_TRACE"); if (trace_file) trace_out = fopen(trace_file, "a"); if (!trace_out) return FALSE; } va_start(args, fmt); retval = vfprintf(trace_out, fmt, args); va_end(args); fflush(trace_out); return retval != -1; } bool io_exec(struct io *io, enum io_type type, const char *dir, char * const env[], const char *argv[], int custom) { int pipefds[2] = { -1, -1 }; bool read_from_stdin = type == IO_RD && (custom & IO_RD_FORWARD_STDIN); bool read_with_stderr = type == IO_RD && (custom & IO_RD_WITH_STDERR); io_init(io); 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) { io->error = errno; return FALSE; } else if (type == IO_AP) { pipefds[1] = custom; } if ((io->pid = fork())) { if (io->pid == -1) io->error = errno; if (pipefds[!(type == IO_WR)] != -1) close(pipefds[!(type == IO_WR)]); if (io->pid != -1) { io->pipe = pipefds[!!(type == IO_WR)]; return TRUE; } } 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 errorfd = open_trace(devnull, argv); /* Inject stdin given on the command line. */ if (read_from_stdin) readfd = dup(STDIN_FILENO); dup2(readfd, STDIN_FILENO); dup2(writefd, STDOUT_FILENO); if (read_with_stderr) dup2(writefd, STDERR_FILENO); else dup2(errorfd, STDERR_FILENO); if (devnull != errorfd) close(errorfd); close(devnull); if (pipefds[0] != -1) close(pipefds[0]); if (pipefds[1] != -1) close(pipefds[1]); } if (dir && *dir && chdir(dir) == -1) exit(errno); if (env) { int i; for (i = 0; env[i]; i++) if (*env[i]) putenv(env[i]); } execvp(argv[0], (char *const*) argv); exit(errno); } if (pipefds[!!(type == IO_WR)] != -1) close(pipefds[!!(type == IO_WR)]); return FALSE; } bool io_run(struct io *io, enum io_type type, const char *dir, char * const env[], const char *argv[]) { return io_exec(io, type, dir, env, argv, 0); } bool io_complete(enum io_type type, const char **argv, const char *dir, int fd) { struct io io; return io_exec(&io, type, dir, NULL, argv, fd) && io_done(&io); } bool io_run_bg(const char **argv) { return io_complete(IO_BG, argv, NULL, -1); } bool io_run_fg(const char **argv, const char *dir) { return io_complete(IO_FG, argv, dir, -1); } bool io_run_append(const char **argv, int fd) { return io_complete(IO_AP, argv, NULL, fd); } bool io_eof(struct io *io) { return io->eof; } int io_error(struct io *io) { return io->error; } char * io_strerror(struct io *io) { return strerror(io->error); } bool io_can_read(struct io *io, bool can_block) { struct timeval tv = { 0, 500 }; fd_set fds; FD_ZERO(&fds); FD_SET(io->pipe, &fds); return select(io->pipe + 1, &fds, NULL, NULL, can_block ? NULL : &tv) > 0; } ssize_t io_read(struct io *io, void *buf, size_t bufsize) { do { ssize_t readsize = read(io->pipe, buf, bufsize); if (readsize < 0 && (errno == EAGAIN || errno == EINTR)) continue; else if (readsize == -1) io->error = errno; else if (readsize == 0) io->eof = 1; return readsize; } while (1); } char * io_memchr(struct buffer *buf, char *data, int c) { char *pos; if (!buf || data < buf->data || buf->data + buf->size <= data) return NULL; pos = memchr(data, c, buf->size - (data - buf->data)); return pos ? pos + 1 : NULL; } 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) { char *eol; ssize_t readsize; while (TRUE) { if (io->bufsize > 0) { eol = memchr(io->bufpos, c, io->bufsize); while (io->span && io->bufpos < eol && eol[-1] == '\\') { if (lineno) (*lineno)++; eol[-1] = eol[0] = ' '; eol = memchr(io->bufpos, c, io->bufsize); } if (eol) { buf->data = io->bufpos; buf->size = eol - buf->data; *eol = 0; io->bufpos = eol + 1; io->bufsize -= io->bufpos - buf->data; if (lineno) (*lineno)++; return TRUE; } } if (io_eof(io)) { if (io->bufsize) { buf->data = io->bufpos; buf->size = io->bufsize; io->bufpos[io->bufsize] = 0; io->bufpos += io->bufsize; io->bufsize = 0; if (lineno) (*lineno)++; return TRUE; } return FALSE; } if (!can_read) return FALSE; if (io->bufsize > 0 && io->bufpos > io->buf) memmove(io->buf, io->bufpos, io->bufsize); if (io->bufalloc == io->bufsize) { if (!io_realloc_buf(&io->buf, io->bufalloc, BUFSIZ)) return FALSE; io->bufalloc += BUFSIZ; } io->bufpos = io->buf; readsize = io_read(io, io->buf + io->bufsize, io->bufalloc - io->bufsize); if (io_error(io)) return NULL; io->bufsize += readsize; } } bool io_get(struct io *io, struct buffer *buf, int c, bool can_read) { return io_get_line(io, buf, c, NULL, can_read); } bool io_write(struct io *io, const void *buf, size_t bufsize) { size_t written = 0; while (!io_error(io) && written < bufsize) { ssize_t size; size = write(io->pipe, buf + written, bufsize - written); if (size < 0 && (errno == EAGAIN || errno == EINTR)) continue; else if (size == -1) io->error = errno; else written += size; } return written == bufsize; } bool io_printf(struct io *io, const char *fmt, ...) { char buf[SIZEOF_STR] = ""; int retval; FORMAT_BUFFER(buf, sizeof(buf), fmt, retval, FALSE); if (retval < 0) { io->error = ENAMETOOLONG; return FALSE; } return io_write(io, buf, retval); } bool io_read_buf(struct io *io, char buf[], size_t bufsize) { struct buffer result = {}; if (io_get(io, &result, '\n', TRUE)) { result.data = chomp_string(result.data); string_ncopy_do(buf, bufsize, result.data, strlen(result.data)); } return io_done(io) && result.data; } bool io_run_buf(const char **argv, char buf[], size_t bufsize) { struct io io; return io_run(&io, IO_RD, NULL, NULL, argv) && io_read_buf(&io, buf, bufsize); } bool io_from_string(struct io *io, const char *str) { size_t len = strlen(str); io_init(io); if (!io_realloc_buf(&io->buf, io->bufalloc, len)) return FALSE; io->bufsize = io->bufalloc = len; io->bufpos = io->buf; io->eof = TRUE; strncpy(io->buf, str, len); return TRUE; } static int io_load_file(struct io *io, const char *separators, size_t *lineno, io_read_fn read_property, void *data) { struct buffer buf; int state = OK; while (state == OK && io_get_line(io, &buf, '\n', lineno, TRUE)) { char *name; char *value; size_t namelen; size_t valuelen; name = chomp_string(buf.data); namelen = strcspn(name, separators); if (name[namelen]) { name[namelen] = 0; value = chomp_string(name + namelen + 1); valuelen = strlen(value); } else { value = ""; valuelen = 0; } state = read_property(name, namelen, value, valuelen, data); } if (state != ERR && io_error(io)) state = ERR; io_done(io); return state; } int 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); } int io_load(struct io *io, const char *separators, io_read_fn read_property, void *data) { return io_load_file(io, separators, NULL, read_property, data); } int io_run_load(const char **argv, const char *separators, io_read_fn read_property, void *data) { struct io io; if (!io_run(&io, IO_RD, NULL, NULL, argv)) return ERR; return io_load(&io, separators, read_property, data); } const char * get_temp_dir(void) { static const char *tmp; if (tmp) return tmp; if (!tmp) tmp = getenv("TMPDIR"); if (!tmp) tmp = getenv("TEMP"); if (!tmp) tmp = getenv("TMP"); if (!tmp) tmp = "/tmp"; return tmp; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/keys.c000066400000000000000000000254311233303337700142150ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/types.h" #include "tig/argv.h" #include "tig/io.h" #include "tig/keys.h" #include "tig/util.h" struct keybinding { enum request request; size_t keys; struct key key[1]; }; static struct keymap keymaps[] = { { "generic" }, #define VIEW_KEYMAP(id, name) { #name } VIEW_INFO(VIEW_KEYMAP) }; static struct keymap *generic_keymap = keymaps; #define is_generic_keymap(keymap) ((keymap) == generic_keymap) struct keymap * get_keymap_by_index(int i) { return 0 <= i && i < ARRAY_SIZE(keymaps) ? &keymaps[i] : NULL; } struct keymap * get_keymap(const char *name, size_t namelen) { int i; for (i = 0; i < ARRAY_SIZE(keymaps); i++) if (!strncasecmp(keymaps[i].name, name, namelen)) return &keymaps[i]; return NULL; } static bool keybinding_equals(struct keybinding *keybinding, struct key key[], size_t keys, bool *conflict_ptr) { bool conflict = FALSE; int i; if (keybinding->keys != keys) return FALSE; for (i = 0; i < keys; i++) { struct key *key1 = &keybinding->key[i]; struct key *key2 = &key[i]; if (key1->modifiers.control && key1->modifiers.multibytes && !memcmp(&key1->modifiers, &key2->modifiers, sizeof(key1->modifiers)) && strlen(key1->data.bytes) == 1 && strlen(key2->data.bytes) == 1) { int c1 = key1->data.bytes[0]; int c2 = key2->data.bytes[0]; if (ascii_toupper(c1) != ascii_toupper(c2)) return FALSE; if (c1 != c2) conflict = TRUE; } else { if (memcmp(key1, key2, sizeof(*key1))) return FALSE; } } if (conflict_ptr) *conflict_ptr = conflict; return TRUE; } enum status_code add_keybinding(struct keymap *table, enum request request, struct key key[], size_t keys) { struct keybinding *keybinding; char buf[SIZEOF_STR]; bool conflict = FALSE; size_t i; for (i = 0; i < table->size; i++) { if (keybinding_equals(table->data[i], key, keys, &conflict)) { enum request old_request = table->data[i]->request; const char *old_name; table->data[i]->request = request; if (!conflict) return SUCCESS; old_name = get_request_name(old_request); string_ncopy(buf, old_name, strlen(old_name)); return error("Key binding for %s and %s conflict; " "keys using Ctrl are case insensitive", buf, get_request_name(request)); } } table->data = realloc(table->data, (table->size + 1) * sizeof(*table->data)); keybinding = calloc(1, sizeof(*keybinding) + (sizeof(*key) * (keys - 1))); if (!table->data || !keybinding) die("Failed to allocate keybinding"); memcpy(keybinding->key, key, sizeof(*key) * keys); keybinding->keys = keys; keybinding->request = request; table->data[table->size++] = keybinding; return SUCCESS; } /* Looks for a key binding first in the given map, then in the generic map, and * lastly in the default keybindings. */ enum request get_keybinding(struct keymap *keymap, struct key key[], size_t keys) { size_t i; for (i = 0; i < keymap->size; i++) if (keybinding_equals(keymap->data[i], key, keys, NULL)) return keymap->data[i]->request; for (i = 0; i < generic_keymap->size; i++) if (keybinding_equals(generic_keymap->data[i], key, keys, NULL)) return generic_keymap->data[i]->request; return REQ_NONE; } struct key_mapping { const char *name; int value; }; static const struct key_mapping key_mappings[] = { { "Enter", KEY_RETURN }, { "Space", ' ' }, { "Backspace", KEY_BACKSPACE }, { "Tab", KEY_TAB }, { "Escape", KEY_ESC }, { "Esc", KEY_ESC }, { "Left", KEY_LEFT }, { "Right", KEY_RIGHT }, { "Up", KEY_UP }, { "Down", KEY_DOWN }, { "Insert", KEY_IC }, { "Ins", KEY_IC }, { "Delete", KEY_DC }, { "Del", KEY_DC }, { "Hash", '#' }, { "Home", KEY_HOME }, { "End", KEY_END }, { "PageUp", KEY_PPAGE }, { "PgUp", KEY_PPAGE }, { "PageDown", KEY_NPAGE }, { "PgDown", KEY_NPAGE }, { "LessThan", '<' }, { "LT", '<' }, { "F1", KEY_F(1) }, { "F2", KEY_F(2) }, { "F3", KEY_F(3) }, { "F4", KEY_F(4) }, { "F5", KEY_F(5) }, { "F6", KEY_F(6) }, { "F7", KEY_F(7) }, { "F8", KEY_F(8) }, { "F9", KEY_F(9) }, { "F10", KEY_F(10) }, { "F11", KEY_F(11) }, { "F12", KEY_F(12) }, { "ScrollBack", KEY_SR }, { "SBack", KEY_SR }, { "ScrollFwd", KEY_SF }, { "SFwd", KEY_SF }, }; static const struct key_mapping * get_key_mapping(const char *name, size_t namelen) { int i; for (i = 0; i < ARRAY_SIZE(key_mappings); i++) { if (namelen == strlen(key_mappings[i].name) && !strncasecmp(key_mappings[i].name, name, namelen)) return &key_mappings[i]; } return NULL; } static enum status_code parse_key_value(struct key *key, const char **name_ptr, size_t offset, const char *replacement, const char *end) { const char *name = replacement ? replacement : *name_ptr + offset; size_t namelen = utf8_char_length(name); const char *nameend = name + namelen; if (strlen(name) < namelen || utf8_to_unicode(name, namelen) == 0) return error("Error parsing UTF-8 bytes: %s", name); strncpy(key->data.bytes, name, namelen); key->modifiers.multibytes = 1; if (end) { *name_ptr = end + 1; if (!replacement && nameend + 1 < end) return success("Ignoring text after key mapping: %.*s", (int) (end - nameend), nameend); } else { *name_ptr = nameend; } return SUCCESS; } enum status_code get_key_value(const char **name_ptr, struct key *key) { const char *name = *name_ptr; const char *end = NULL; memset(key, 0, sizeof(*key)); if (*name == '<') { end = strchr(name + 1, '>'); if (!end) return error("Missing '>' from key mapping: %s", name); if (!prefixcmp(name, "modifiers.control = 1; return parse_key_value(key, name_ptr, 6, NULL, end); } else if (!prefixcmp(name, "modifiers.control = 1; return parse_key_value(key, name_ptr, 3, NULL, end); } else { const struct key_mapping *mapping; const char *start = name + 1; int len = end - start; mapping = get_key_mapping(start, len); if (!mapping) return error("Unknown key mapping: %.*s", len, start); if (mapping->value == ' ') return parse_key_value(key, name_ptr, 0, " ", end); if (mapping->value == '#') return parse_key_value(key, name_ptr, 0, "#", end); if (mapping->value == '<') return parse_key_value(key, name_ptr, 0, "<", end); if (mapping->value == KEY_ESC) { size_t offset = (end - name) + 1; key->modifiers.escape = 1; return parse_key_value(key, name_ptr, offset, NULL, NULL); } *name_ptr = end + 1; key->data.value = mapping->value; return SUCCESS; } } if (name[0] == '^' && name[1] == '[') { return error("Escape key combo must now use '%s' " "instead of '%s'", name + 2, name); } else if (name[0] == '^' && name[1] != '\0') { return error("Control key mapping must now use '' " "instead of '%s'", name + 1, name); } return parse_key_value(key, name_ptr, 0, NULL, end); } const char * get_key_name(const struct key key[], size_t keys) { static char buf[SIZEOF_STR]; size_t pos = 0; int i; for (i = 0; i < keys; i++) { bool multibytes = key[i].modifiers.multibytes; const char *name = multibytes ? key[i].data.bytes : ""; const char *start = ""; const char *end = ""; if (key[i].modifiers.escape) { start = ""; } else if (key[i].modifiers.control) { start = "<" : "<"; end = ">"; name = key_mappings[j].name; break; } } if (!string_format_from(buf, &pos, "%s%s%s", start, name, end)) return "(no key)"; } return buf; } static bool append_key(char *buf, size_t *pos, const struct keybinding *keybinding) { const char *sep = *pos > 0 ? ", " : ""; const char *keyname = get_key_name(keybinding->key, keybinding->keys); return string_nformat(buf, BUFSIZ, pos, "%s%s", sep, keyname); } static bool append_keymap_request_keys(char *buf, size_t *pos, enum request request, struct keymap *keymap, bool all) { int i; for (i = 0; i < keymap->size; i++) { if (keymap->data[i]->request == request) { if (!append_key(buf, pos, keymap->data[i])) return FALSE; if (!all) break; } } return TRUE; } const char * get_keys(struct keymap *keymap, enum request request, bool all) { static char buf[BUFSIZ]; size_t pos = 0; buf[pos] = 0; if (!append_keymap_request_keys(buf, &pos, request, keymap, all)) return "Too many keybindings!"; if (pos > 0 && !all) return buf; if (!is_generic_keymap(keymap)) { /* Only the generic keymap includes the default keybindings when * listing all keys. */ if (all) return buf; if (!append_keymap_request_keys(buf, &pos, request, generic_keymap, all)) return "Too many keybindings!"; if (pos) return buf; } return buf; } static struct run_request *run_request; static size_t run_requests; DEFINE_ALLOCATOR(realloc_run_requests, struct run_request, 8) enum status_code add_run_request(struct keymap *keymap, struct key key[], size_t keys, const char **argv) { struct run_request *req; struct run_request_flags flags = {}; if (!strchr(":!?@<", *argv[0])) return error("Unknown request name: %s", argv[0]); while (*argv[0]) { if (*argv[0] == ':') { flags.internal = 1; argv[0]++; break; } else if (*argv[0] == '@') { flags.silent = 1; } else if (*argv[0] == '?') { flags.confirm = 1; } else if (*argv[0] == '<') { flags.exit = 1; } else if (*argv[0] != '!') { break; } argv[0]++; } if (!realloc_run_requests(&run_request, run_requests, 1)) return ERROR_OUT_OF_MEMORY; if (!argv_copy(&run_request[run_requests].argv, argv)) return ERROR_OUT_OF_MEMORY; req = &run_request[run_requests++]; req->flags = flags; req->keymap = keymap; return add_keybinding(keymap, REQ_RUN_REQUESTS + run_requests, key, keys); } struct run_request * get_run_request(enum request request) { if (request <= REQ_RUN_REQUESTS || request > REQ_RUN_REQUESTS + run_requests) return NULL; return &run_request[request - REQ_RUN_REQUESTS - 1]; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/line.c000066400000000000000000000121131233303337700141620ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/types.h" #include "tig/refdb.h" #include "tig/line.h" #include "tig/util.h" static struct line_rule *line_rule; static size_t line_rules; static struct line_info **color_pair; static size_t color_pairs; DEFINE_ALLOCATOR(realloc_line_rule, struct line_rule, 8) DEFINE_ALLOCATOR(realloc_color_pair, struct line_info *, 8) enum line_type get_line_type(const char *line) { int linelen = strlen(line); enum line_type type; for (type = 0; type < line_rules; type++) { struct line_rule *rule = &line_rule[type]; /* Case insensitive search matches Signed-off-by lines better. */ if (rule->linelen && linelen >= rule->linelen && !strncasecmp(rule->line, line, rule->linelen)) return type; } return LINE_DEFAULT; } enum line_type get_line_type_from_ref(const struct ref *ref) { if (ref->type == REFERENCE_HEAD) return LINE_MAIN_HEAD; else if (ref->type == REFERENCE_LOCAL_TAG) return LINE_MAIN_LOCAL_TAG; else if (ref->type == REFERENCE_TAG) return LINE_MAIN_TAG; else if (ref->type == REFERENCE_TRACKED_REMOTE) return LINE_MAIN_TRACKED; else if (ref->type == REFERENCE_REMOTE) return LINE_MAIN_REMOTE; else if (ref->type == REFERENCE_REPLACE) return LINE_MAIN_REPLACE; return LINE_MAIN_REF; } 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); rule = &line_rule[type]; for (info = &rule->info; info; info = info->next) { if (prefix && info->prefix == prefix) return info; if (!prefix && !info->prefix) return info; } return &rule->info; } static struct line_info * init_line_info(const char *prefix, const char *name, size_t namelen, const char *line, size_t linelen) { struct line_rule *rule; if (!realloc_line_rule(&line_rule, line_rules, 1)) die("Failed to allocate line info"); rule = &line_rule[line_rules++]; rule->name = name; rule->namelen = namelen; rule->line = line; rule->linelen = linelen; rule->info.prefix = prefix; rule->info.fg = COLOR_DEFAULT; rule->info.bg = COLOR_DEFAULT; return &rule->info; } #define INIT_BUILTIN_LINE_INFO(type, line) \ init_line_info(NULL, #type, STRING_SIZE(#type), (line), STRING_SIZE(line)) static struct line_rule * find_line_rule(struct line_rule *query) { enum line_type type; if (!line_rules) { LINE_INFO(INIT_BUILTIN_LINE_INFO); } for (type = 0; type < line_rules; type++) { struct line_rule *rule = &line_rule[type]; if (query->namelen && enum_equals(*rule, query->name, query->namelen)) return rule; if (query->linelen && query->linelen == rule->linelen && !strncasecmp(rule->line, query->line, rule->linelen)) return rule; } return NULL; } struct line_info * add_line_rule(const char *prefix, struct line_rule *query) { struct line_rule *rule = find_line_rule(query); struct line_info *info, *last; if (!rule) { if (query->name) return NULL; /* Quoted line. */ query->line = strndup(query->line, query->linelen); if (!query->line) return NULL; return init_line_info(prefix, "", 0, query->line, query->linelen); } for (info = &rule->info; info; last = info, info = info->next) if (info->prefix == prefix) return info; info = calloc(1, sizeof(*info)); if (info) info->prefix = prefix; last->next = info; return info; } static void init_line_info_color_pair(struct line_info *info, enum line_type type, int default_bg, int default_fg) { int bg = info->bg == COLOR_DEFAULT ? default_bg : info->bg; int fg = info->fg == COLOR_DEFAULT ? default_fg : info->fg; int i; for (i = 0; i < color_pairs; i++) { if (color_pair[i]->fg == info->fg && color_pair[i]->bg == info->bg) { info->color_pair = i; return; } } if (!realloc_color_pair(&color_pair, color_pairs, 1)) die("Failed to alloc color pair"); color_pair[color_pairs] = info; info->color_pair = color_pairs++; init_pair(COLOR_ID(info->color_pair), fg, bg); } void init_colors(void) { struct line_rule query = { "default", STRING_SIZE("default") }; struct line_rule *rule = find_line_rule(&query); int default_bg = rule->info.bg; int default_fg = rule->info.fg; enum line_type type; start_color(); if (assume_default_colors(default_fg, default_bg) == ERR) { default_bg = COLOR_BLACK; default_fg = COLOR_WHITE; } for (type = 0; type < line_rules; type++) { struct line_rule *rule = &line_rule[type]; struct line_info *info; for (info = &rule->info; info; info = info->next) { init_line_info_color_pair(info, type, default_bg, default_fg); } } } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/log.c000066400000000000000000000100211233303337700140100ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/refdb.h" #include "tig/display.h" #include "tig/draw.h" #include "tig/log.h" #include "tig/diff.h" #include "tig/pager.h" struct log_state { /* Used for tracking when we need to recalculate the previous * commit, for example when the user scrolls up or uses the page * up/down in the log view. */ int last_lineno; size_t graph_indent; enum line_type last_type; bool commit_title_read; bool after_commit_header; bool reading_diff_stat; }; static inline void log_copy_rev(struct view *view, struct line *line) { const char *text = line->data; size_t offset = get_graph_indent(text); string_copy_rev_from_commit_line(view->ref, text + offset); } static void log_select(struct view *view, struct line *line) { struct log_state *state = view->private; int last_lineno = state->last_lineno; if (!last_lineno || abs(last_lineno - line->lineno) > 1 || (state->last_type == LINE_COMMIT && last_lineno > line->lineno)) { struct line *commit_line = find_prev_line_by_type(view, line, LINE_COMMIT); if (commit_line) log_copy_rev(view, commit_line); } if (line->type == LINE_COMMIT && !view_has_flags(view, VIEW_NO_REF)) log_copy_rev(view, line); string_copy_rev(view->env->commit, view->ref); state->last_lineno = line->lineno; state->last_type = line->type; } static bool log_open(struct view *view, enum open_flags flags) { const char *log_argv[] = { "git", "log", encoding_arg, commit_order_arg(), "--cc", "--stat", "%(cmdlineargs)", "%(revargs)", "--no-color", "--", "%(fileargs)", NULL }; return begin_update(view, NULL, log_argv, flags); } static enum request log_request(struct view *view, enum request request, struct line *line) { switch (request) { case REQ_REFRESH: load_refs(TRUE); refresh_view(view); return REQ_NONE; case REQ_ENTER: if (!display[1] || strcmp(display[1]->vid, view->ref)) open_diff_view(view, OPEN_SPLIT); return REQ_NONE; default: return request; } } static bool log_read(struct view *view, struct buffer *buf) { struct line *line = NULL; enum line_type type; struct log_state *state = view->private; size_t len; char *commit; char *data; if (!buf) return TRUE; data = buf->data; commit = strstr(data, "commit "); if (commit && get_graph_indent(data) == commit - data) state->graph_indent = commit - data; type = get_line_type(data + state->graph_indent); len = strlen(data + state->graph_indent); if (type == LINE_COMMIT) state->commit_title_read = TRUE; else if (state->commit_title_read && len < 1) { state->commit_title_read = FALSE; state->after_commit_header = TRUE; } else if (state->after_commit_header && len < 1) { state->after_commit_header = FALSE; state->reading_diff_stat = TRUE; } else if (state->reading_diff_stat) { line = diff_common_add_diff_stat(view, data, state->graph_indent); if (line) { if (state->graph_indent) line->graph_indent = 1; return TRUE; } state->reading_diff_stat = FALSE; } if (!pager_common_read(view, data, type, &line)) return FALSE; if (line && state->graph_indent) line->graph_indent = 1; return TRUE; } static struct view_ops log_ops = { "line", argv_env.head, VIEW_ADD_PAGER_REFS | VIEW_OPEN_DIFF | VIEW_SEND_CHILD_ENTER | VIEW_LOG_LIKE | VIEW_REFRESH, sizeof(struct log_state), log_open, log_read, view_column_draw, log_request, view_column_grep, log_select, NULL, view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), pager_get_column_data, }; DEFINE_VIEW(log); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/main.c000066400000000000000000000314331233303337700141650ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/repo.h" #include "tig/options.h" #include "tig/parse.h" #include "tig/watch.h" #include "tig/graph.h" #include "tig/display.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/git.h" #include "tig/status.h" #include "tig/stage.h" #include "tig/main.h" #include "tig/diff.h" /* * Main view backend */ DEFINE_ALLOCATOR(realloc_reflogs, char *, 32) static void main_register_commit(struct view *view, struct commit *commit, const char *ids, bool is_boundary) { struct main_state *state = view->private; string_copy_rev(commit->id, ids); if (state->with_graph) graph_add_commit(&state->graph, &commit->graph, commit->id, ids, is_boundary); } static struct commit * main_add_commit(struct view *view, enum line_type type, struct commit *template, const char *title, bool custom) { struct main_state *state = view->private; size_t titlelen; struct commit *commit; char buf[SIZEOF_STR / 2]; struct line *line; /* FIXME: More graceful handling of titles; append "..." to * shortened titles, etc. */ string_expand(buf, sizeof(buf), title, 1); title = buf; titlelen = strlen(title); line = add_line_alloc(view, &commit, type, titlelen, custom); if (!line) return NULL; *commit = *template; strncpy(commit->title, title, titlelen); state->graph.canvas = &commit->graph; memset(template, 0, sizeof(*template)); state->reflogmsg[0] = 0; view_column_info_update(view, line); return commit; } static inline void main_flush_commit(struct view *view, struct commit *commit) { if (*commit->id) main_add_commit(view, LINE_MAIN_COMMIT, commit, "", FALSE); } static bool main_add_changes_commit(struct view *view, enum line_type type, const char *parent, const char *title) { char ids[SIZEOF_STR] = NULL_ID " "; struct main_state *state = view->private; struct commit commit = {}; struct timeval now; struct timezone tz; if (!parent) return TRUE; if (*parent) string_copy_rev(ids + STRING_SIZE(NULL_ID " "), parent); else ids[STRING_SIZE(NULL_ID)] = 0; if (!gettimeofday(&now, &tz)) { commit.time.tz = tz.tz_minuteswest * 60; commit.time.sec = now.tv_sec - commit.time.tz; } commit.author = &unknown_ident; main_register_commit(view, &commit, ids, FALSE); if (!main_add_commit(view, type, &commit, title, TRUE)) return FALSE; if (state->with_graph) { if (*parent) return graph_render_parents(&state->graph); state->add_changes_parents = TRUE; } return TRUE; } static bool main_add_changes_commits(struct view *view, struct main_state *state, const char *parent) { const char *staged_parent = NULL_ID; const char *unstaged_parent = parent; struct index_diff diff; if (!index_diff(&diff, FALSE, FALSE)) return FALSE; if (!diff.unstaged) { unstaged_parent = NULL; staged_parent = parent; watch_apply(&view->watch, WATCH_INDEX_UNSTAGED_NO); } else { watch_apply(&view->watch, WATCH_INDEX_UNSTAGED_YES); } if (!diff.staged) { staged_parent = NULL; watch_apply(&view->watch, WATCH_INDEX_STAGED_NO); } else { watch_apply(&view->watch, WATCH_INDEX_STAGED_YES); } return main_add_changes_commit(view, LINE_STAT_STAGED, staged_parent, "Staged changes") && main_add_changes_commit(view, LINE_STAT_UNSTAGED, unstaged_parent, "Unstaged changes"); } static bool main_check_argv(struct view *view, const char *argv[]) { struct main_state *state = view->private; bool with_reflog = FALSE; int i; for (i = 0; argv[i]; i++) { const char *arg = argv[i]; struct rev_flags rev_flags = {}; if (!strcmp(arg, "--graph")) { struct view_column *column = get_view_column(view, VIEW_COLUMN_COMMIT_TITLE); if (column) { column->opt.commit_title.graph = TRUE; if (opt_commit_order != COMMIT_ORDER_REVERSE) state->with_graph = TRUE; } argv[i] = ""; continue; } if (!argv_parse_rev_flag(arg, &rev_flags)) continue; if (rev_flags.with_reflog) with_reflog = TRUE; if (!rev_flags.with_graph) state->with_graph = FALSE; arg += rev_flags.search_offset; if (*arg && !*view->env->search) string_ncopy(view->env->search, arg, strlen(arg)); } return with_reflog; } static bool main_open(struct view *view, enum open_flags flags) { const char *pretty_custom_argv[] = { GIT_MAIN_LOG_CUSTOM(encoding_arg, commit_order_arg(), "%(cmdlineargs)", "%(revargs)", "%(fileargs)") }; const char *pretty_raw_argv[] = { GIT_MAIN_LOG_RAW(encoding_arg, commit_order_arg(), "%(cmdlineargs)", "%(revargs)", "%(fileargs)") }; struct main_state *state = view->private; const char **main_argv = pretty_custom_argv; struct view_column *column; enum watch_trigger changes_triggers = WATCH_NONE; if (opt_show_changes && repo.is_inside_work_tree) changes_triggers |= WATCH_INDEX; column = get_view_column(view, VIEW_COLUMN_COMMIT_TITLE); state->with_graph = column && column->opt.commit_title.graph && opt_commit_order != COMMIT_ORDER_REVERSE; if (opt_rev_argv && main_check_argv(view, opt_rev_argv)) main_argv = pretty_raw_argv; if (open_in_pager_mode(flags)) { changes_triggers = WATCH_NONE; state->with_graph = FALSE; } /* This calls reset_view() so must be before adding changes commits. */ if (!begin_update(view, NULL, main_argv, flags)) return FALSE; /* Register watch before changes commits are added to record the * start. */ if (view_can_refresh(view)) watch_register(&view->watch, WATCH_HEAD | WATCH_REFS | changes_triggers); if (changes_triggers) main_add_changes_commits(view, state, ""); return TRUE; } void main_done(struct view *view) { struct main_state *state = view->private; int i; for (i = 0; i < view->lines; i++) { struct commit *commit = view->line[i].data; free(commit->graph.symbols); } for (i = 0; i < state->reflogs; i++) free(state->reflog[i]); free(state->reflog); } #define main_check_commit_refs(line) !((line)->no_commit_refs) #define main_mark_no_commit_refs(line) (((struct line *) (line))->no_commit_refs = 1) static inline struct ref_list * main_get_commit_refs(const struct line *line, struct commit *commit) { struct ref_list *refs = NULL; if (main_check_commit_refs(line) && !(refs = get_ref_list(commit->id))) main_mark_no_commit_refs(line); return refs; } bool main_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { struct main_state *state = view->private; struct commit *commit = line->data; struct ref_list *refs = NULL; column_data->author = commit->author; column_data->date = &commit->time; column_data->id = commit->id; if (state->reflogs) column_data->reflog = state->reflog[line->lineno - 1]; column_data->commit_title = commit->title; if (state->with_graph) column_data->graph = &commit->graph; if ((refs = main_get_commit_refs(line, commit))) column_data->refs = refs; return TRUE; } static bool main_add_reflog(struct view *view, struct main_state *state, char *reflog) { char *end = strchr(reflog, ' '); int id_width; if (!end) return FALSE; *end = 0; if (!realloc_reflogs(&state->reflog, state->reflogs, 1) || !(reflog = strdup(reflog))) return FALSE; state->reflog[state->reflogs++] = reflog; id_width = strlen(reflog); if (state->reflog_width < id_width) { struct view_column *column = get_view_column(view, VIEW_COLUMN_ID); state->reflog_width = id_width; if (column && column->opt.id.display) view->force_redraw = TRUE; } return TRUE; } /* Reads git log --pretty=raw output and parses it into the commit struct. */ bool main_read(struct view *view, struct buffer *buf) { struct main_state *state = view->private; struct graph *graph = &state->graph; enum line_type type; struct commit *commit = &state->current; char *line; if (!buf) { main_flush_commit(view, commit); if (failed_to_load_initial_view(view)) die("No revisions match the given arguments."); if (view->lines > 0) { struct commit *last = view->line[view->lines - 1].data; view->line[view->lines - 1].dirty = 1; if (!last->author) { view->lines--; free(last); } } if (state->with_graph) done_graph(graph); return TRUE; } line = buf->data; type = get_line_type(line); if (type == LINE_COMMIT) { bool is_boundary; char *author; state->in_header = TRUE; line += STRING_SIZE("commit "); is_boundary = *line == '-'; while (*line && !isalnum(*line)) line++; if (state->add_changes_parents) { state->add_changes_parents = FALSE; if (!graph_add_parent(graph, line)) return FALSE; graph->has_parents = TRUE; graph_render_parents(graph); } main_flush_commit(view, commit); main_register_commit(view, &state->current, line, is_boundary); author = io_memchr(buf, line, 0); if (author) { char *title = io_memchr(buf, author, 0); parse_author_line(author, &commit->author, &commit->time); if (state->with_graph) graph_render_parents(graph); if (title) main_add_commit(view, LINE_MAIN_COMMIT, commit, title, FALSE); } return TRUE; } if (!*commit->id) return TRUE; /* Empty line separates the commit header from the log itself. */ if (*line == '\0') state->in_header = FALSE; switch (type) { case LINE_PP_REFLOG: if (!main_add_reflog(view, state, line + STRING_SIZE("Reflog: "))) return FALSE; break; case LINE_PP_REFLOGMSG: line += STRING_SIZE("Reflog message: "); string_ncopy(state->reflogmsg, line, strlen(line)); break; case LINE_PARENT: if (state->with_graph && !graph->has_parents) graph_add_parent(graph, line + STRING_SIZE("parent ")); break; case LINE_AUTHOR: parse_author_line(line + STRING_SIZE("author "), &commit->author, &commit->time); if (state->with_graph) graph_render_parents(graph); break; default: /* Fill in the commit title if it has not already been set. */ if (*commit->title) break; /* Skip lines in the commit header. */ if (state->in_header) break; /* Require titles to start with a non-space character at the * offset used by git log. */ if (strncmp(line, " ", 4)) break; line += 4; /* Well, if the title starts with a whitespace character, * try to be forgiving. Otherwise we end up with no title. */ while (isspace(*line)) line++; if (*line == '\0') break; if (*state->reflogmsg) line = state->reflogmsg; main_add_commit(view, LINE_MAIN_COMMIT, commit, line, FALSE); } return TRUE; } enum request main_request(struct view *view, enum request request, struct line *line) { enum open_flags flags = (view_is_displayed(view) && request != REQ_VIEW_DIFF) ? OPEN_SPLIT : OPEN_DEFAULT; switch (request) { case REQ_NEXT: case REQ_PREVIOUS: if (view_is_displayed(view) && display[0] != view) return request; /* Do not pass navigation requests to the branch view * when the main view is maximized. (GH #38) */ return request == REQ_NEXT ? REQ_MOVE_DOWN : REQ_MOVE_UP; case REQ_VIEW_DIFF: case REQ_ENTER: if (view_is_displayed(view) && display[0] != view) maximize_view(view, TRUE); if (line->type == LINE_STAT_UNSTAGED || line->type == LINE_STAT_STAGED) open_stage_view(view, NULL, line->type, flags); else open_diff_view(view, flags); break; case REQ_REFRESH: load_refs(TRUE); refresh_view(view); break; default: return request; } return REQ_NONE; } static void main_update_env(struct view *view, struct line *line, struct commit *commit) { struct ref_list *list = main_get_commit_refs(line, commit); size_t i; for (i = 0; list && i < list->size; i++) ref_update_env(view->env, list->refs[list->size - i - 1], !i); } void main_select(struct view *view, struct line *line) { struct commit *commit = line->data; if (line->type == LINE_STAT_STAGED || line->type == LINE_STAT_UNSTAGED) { string_ncopy(view->ref, commit->title, strlen(commit->title)); status_stage_info(view->env->status, line->type, NULL); } else { string_copy_rev(view->ref, commit->id); main_update_env(view, line, commit); } string_copy_rev(view->env->commit, commit->id); } static struct view_ops main_ops = { "commit", argv_env.head, VIEW_SEND_CHILD_ENTER | VIEW_FILE_FILTER | VIEW_LOG_LIKE | VIEW_REFRESH, sizeof(struct main_state), main_open, main_read, view_column_draw, main_request, view_column_grep, main_select, main_done, view_column_bit(AUTHOR) | view_column_bit(COMMIT_TITLE) | view_column_bit(DATE) | view_column_bit(ID) | view_column_bit(LINE_NUMBER), main_get_column_data, }; DEFINE_VIEW(main); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/options.c000066400000000000000000000654151233303337700147430ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/types.h" #include "tig/argv.h" #include "tig/io.h" #include "tig/repo.h" #include "tig/refdb.h" #include "tig/options.h" #include "tig/request.h" #include "tig/line.h" #include "tig/keys.h" #include "tig/view.h" /* * Option variables. */ #define DEFINE_OPTION_VARIABLES(name, type, flags) type opt_##name; OPTION_INFO(DEFINE_OPTION_VARIABLES); static struct option_info option_info[] = { #define DEFINE_OPTION_INFO(name, type, flags) { #name, STRING_SIZE(#name), #type, &opt_##name }, OPTION_INFO(DEFINE_OPTION_INFO) }; struct option_info * find_option_info(struct option_info *option, size_t options, const char *name) { size_t namelen = strlen(name); int i; for (i = 0; i < options; i++) if (enum_equals(option[i], name, namelen)) return &option[i]; return NULL; } static struct option_info * find_option_info_by_value(void *value) { int i; for (i = 0; i < ARRAY_SIZE(option_info); i++) if (option_info[i].value == value) return &option_info[i]; return NULL; } static void mark_option_seen(void *value) { struct option_info *option = find_option_info_by_value(value); if (option) option->seen = TRUE; } /* * State variables. */ iconv_t opt_iconv_out = ICONV_NONE; char opt_editor[SIZEOF_STR] = ""; const char **opt_cmdline_argv = NULL; const char **opt_rev_argv = NULL; const char **opt_file_argv = NULL; char opt_env_lines[64] = ""; char opt_env_columns[64] = ""; char *opt_env[] = { opt_env_lines, opt_env_columns, NULL }; /* * Mapping between options and command argument mapping. */ const char * diff_context_arg() { static char opt_diff_context_arg[9] = ""; if (opt_diff_context < 0 || !string_format(opt_diff_context_arg, "-U%u", opt_diff_context)) return ""; return opt_diff_context_arg; } #define ENUM_ARG(enum_name, arg_string) ENUM_MAP_ENTRY(arg_string, enum_name) static const struct enum_map_entry ignore_space_arg_map[] = { ENUM_ARG(IGNORE_SPACE_NO, ""), ENUM_ARG(IGNORE_SPACE_ALL, "--ignore-all-space"), ENUM_ARG(IGNORE_SPACE_SOME, "--ignore-space-change"), ENUM_ARG(IGNORE_SPACE_AT_EOL, "--ignore-space-at-eol"), }; const char * ignore_space_arg() { return ignore_space_arg_map[opt_ignore_space].name; } static const struct enum_map_entry commit_order_arg_map[] = { ENUM_ARG(COMMIT_ORDER_DEFAULT, ""), ENUM_ARG(COMMIT_ORDER_TOPO, "--topo-order"), ENUM_ARG(COMMIT_ORDER_DATE, "--date-order"), ENUM_ARG(COMMIT_ORDER_AUTHOR_DATE, "--author-date-order"), ENUM_ARG(COMMIT_ORDER_REVERSE, "--reverse"), }; const char * commit_order_arg() { return commit_order_arg_map[opt_commit_order].name; } /* Use --show-notes to support Git >= 1.7.6 */ #define NOTES_ARG "--show-notes" #define NOTES_EQ_ARG NOTES_ARG "=" static char opt_notes_arg[SIZEOF_STR] = NOTES_ARG; const char * show_notes_arg() { if (opt_show_notes) return opt_notes_arg; /* Notes are disabled by default when passing --pretty args. */ return ""; } void update_options_from_argv(const char *argv[]) { int next, flags_pos; for (next = flags_pos = 0; argv[next]; next++) { const char *flag = argv[next]; int value = -1; if (map_enum(&value, commit_order_arg_map, flag)) { opt_commit_order = value; mark_option_seen(&opt_commit_order); continue; } if (map_enum(&value, ignore_space_arg_map, flag)) { opt_ignore_space = value; mark_option_seen(&opt_ignore_space); continue; } if (!strcmp(flag, "--no-notes")) { opt_show_notes = FALSE; mark_option_seen(&opt_show_notes); continue; } if (!prefixcmp(flag, "--show-notes") || !prefixcmp(flag, "--notes")) { opt_show_notes = TRUE; string_ncopy(opt_notes_arg, flag, strlen(flag)); mark_option_seen(&opt_show_notes); continue; } if (!prefixcmp(flag, "-U") && parse_int(&value, flag + 2, 0, 999999) == SUCCESS) { opt_diff_context = value; mark_option_seen(&opt_diff_context); continue; } argv[flags_pos++] = flag; } argv[flags_pos] = NULL; } /* * User config file handling. */ static const struct enum_map_entry color_map[] = { #define COLOR_MAP(name) ENUM_MAP_ENTRY(#name, COLOR_##name) COLOR_MAP(DEFAULT), COLOR_MAP(BLACK), COLOR_MAP(BLUE), COLOR_MAP(CYAN), COLOR_MAP(GREEN), COLOR_MAP(MAGENTA), COLOR_MAP(RED), COLOR_MAP(WHITE), COLOR_MAP(YELLOW), }; static const struct enum_map_entry attr_map[] = { #define ATTR_MAP(name) ENUM_MAP_ENTRY(#name, A_##name) ATTR_MAP(NORMAL), ATTR_MAP(BLINK), ATTR_MAP(BOLD), ATTR_MAP(DIM), ATTR_MAP(REVERSE), ATTR_MAP(STANDOUT), ATTR_MAP(UNDERLINE), }; #define set_attribute(attr, name) map_enum(attr, attr_map, name) enum status_code parse_step(double *opt, const char *arg) { *opt = atoi(arg); if (!strchr(arg, '%')) return SUCCESS; /* "Shift down" so 100% and 1 does not conflict. */ *opt = (*opt - 1) / 100; if (*opt >= 1.0) { *opt = 0.99; return error("Percentage is larger than 100%%"); } if (*opt < 0.0) { *opt = 1; return error("Percentage is less than 0%%"); } return SUCCESS; } enum status_code parse_int(int *opt, const char *arg, int min, int max) { int value = atoi(arg); if (min <= value && value <= max) { *opt = value; return SUCCESS; } return error("Value must be between %d and %d", min, max); } static bool set_color(int *color, const char *name) { if (map_enum(color, color_map, name)) return TRUE; if (!prefixcmp(name, "color")) return parse_int(color, name + 5, 0, 255) == SUCCESS; /* Used when reading git colors. Git expects a plain int w/o prefix. */ return parse_int(color, name, 0, 255) == SUCCESS; } #define is_quoted(c) ((c) == '"' || (c) == '\'') static enum status_code parse_color_name(const char *color, struct line_rule *rule, const char **prefix_ptr) { const char *prefixend = is_quoted(*color) ? NULL : strchr(color, '.'); if (prefixend) { struct keymap *keymap = get_keymap(color, prefixend - color); if (!keymap) return error("Unknown key map: %.*s", (int) (prefixend - color), color); if (prefix_ptr) *prefix_ptr = keymap->name; color = prefixend + 1; } memset(rule, 0, sizeof(*rule)); if (is_quoted(*color)) { rule->line = color + 1; rule->linelen = strlen(color) - 2; } else { rule->name = color; rule->namelen = strlen(color); } return SUCCESS; } static int find_remapped(const char *remapped[][2], size_t remapped_size, const char *arg) { size_t arglen = strlen(arg); int i; for (i = 0; i < remapped_size; i++) { const char *name = remapped[i][0]; size_t namelen = strlen(name); if (arglen == namelen && !string_enum_compare(arg, name, namelen)) return i; } return -1; } /* Wants: object fgcolor bgcolor [attribute] */ static enum status_code option_color_command(int argc, const char *argv[]) { struct line_rule rule = {}; const char *prefix = NULL; struct line_info *info; enum status_code code; if (argc < 3) return error("Invalid color mapping: color area fgcolor bgcolor [attrs]"); code = parse_color_name(argv[0], &rule, &prefix); if (code != SUCCESS) return code; info = add_line_rule(prefix, &rule); if (!info) { static const char *obsolete[][2] = { { "acked", "' Acked-by'" }, { "diff-copy-from", "'copy from '" }, { "diff-copy-to", "'copy to '" }, { "diff-deleted-file-mode", "'deleted file mode '" }, { "diff-dissimilarity", "'dissimilarity '" }, { "diff-rename-from", "'rename from '" }, { "diff-rename-to", "'rename to '" }, { "diff-tree", "'diff-tree '" }, { "filename", "file" }, { "help-keymap", "help.section" }, { "pp-adate", "'AuthorDate: '" }, { "pp-author", "'Author: '" }, { "pp-cdate", "'CommitDate: '" }, { "pp-commit", "'Commit: '" }, { "pp-date", "'Date: '" }, { "reviewed", "' Reviewed-by'" }, { "signoff", "' Signed-off-by'" }, { "stat-head", "status.header" }, { "stat-section", "status.section" }, { "tested", "' Tested-by'" }, { "tree-dir", "tree.directory" }, { "tree-file", "tree.file" }, { "tree-head", "tree.header" }, }; int index; index = find_remapped(obsolete, ARRAY_SIZE(obsolete), rule.name); if (index != -1) { /* Keep the initial prefix if defined. */ code = parse_color_name(obsolete[index][1], &rule, prefix ? NULL : &prefix); if (code != SUCCESS) return code; info = add_line_rule(prefix, &rule); } if (!info) return error("Unknown color name: %s", argv[0]); code = error("%s has been replaced by %s", obsolete[index][0], obsolete[index][1]); } if (!set_color(&info->fg, argv[1])) return error("Unknown color: %s", argv[1]); if (!set_color(&info->bg, argv[2])) return error("Unknown color: %s", argv[2]); info->attr = 0; while (argc-- > 3) { int attr; if (!set_attribute(&attr, argv[argc])) return error("Unknown color attribute: %s", argv[argc]); info->attr |= attr; } return code; } static enum status_code parse_bool(bool *opt, const char *arg) { *opt = (!strcmp(arg, "1") || !strcmp(arg, "true") || !strcmp(arg, "yes")) ? TRUE : FALSE; if (*opt || !strcmp(arg, "0") || !strcmp(arg, "false") || !strcmp(arg, "no")) return SUCCESS; return error("Non-boolean value treated as false: %s", arg); } static enum status_code parse_enum(unsigned int *opt, const char *arg, const struct enum_map *map) { bool is_true; assert(map->size > 1); if (map_enum_do(map->entries, map->size, (int *) opt, arg)) return SUCCESS; parse_bool(&is_true, arg); *opt = is_true ? map->entries[1].value : map->entries[0].value; return SUCCESS; } static enum status_code parse_string(char *opt, const char *arg, size_t optsize) { int arglen = strlen(arg); switch (arg[0]) { case '\"': case '\'': if (arglen == 1 || arg[arglen - 1] != arg[0]) return ERROR_UNMATCHED_QUOTATION; arg += 1; arglen -= 2; default: string_ncopy_do(opt, optsize, arg, arglen); return SUCCESS; } } static enum status_code parse_encoding(struct encoding **encoding_ref, const char *arg, bool priority) { char buf[SIZEOF_STR]; enum status_code code = parse_string(buf, arg, sizeof(buf)); if (code == SUCCESS) { struct encoding *encoding = *encoding_ref; if (encoding && !priority) return code; encoding = encoding_open(buf); if (encoding) *encoding_ref = encoding; } return code; } static enum status_code parse_args(const char ***args, const char *argv[]) { if (!argv_copy(args, argv)) return ERROR_OUT_OF_MEMORY; return SUCCESS; } enum status_code parse_option(struct option_info *option, const char *prefix, const char *arg) { char name[SIZEOF_STR]; if (!enum_name_prefixed(name, sizeof(name), prefix, option->name)) return error("Failed to parse option"); if (!strcmp("show-notes", name)) { bool *value = option->value; enum status_code res; if (parse_bool(option->value, arg) == SUCCESS) return SUCCESS; *value = TRUE; string_copy(opt_notes_arg, NOTES_EQ_ARG); res = parse_string(opt_notes_arg + STRING_SIZE(NOTES_EQ_ARG), arg, sizeof(opt_notes_arg) - STRING_SIZE(NOTES_EQ_ARG)); if (res == SUCCESS && !opt_notes_arg[STRING_SIZE(NOTES_EQ_ARG)]) opt_notes_arg[STRING_SIZE(NOTES_ARG)] = 0; return res; } if (!strcmp(option->type, "bool")) return parse_bool(option->value, arg); if (!strcmp(option->type, "double")) return parse_step(option->value, arg); if (!strncmp(option->type, "enum", 4)) { const char *type = option->type + STRING_SIZE("enum "); const struct enum_map *map = find_enum_map(type); return parse_enum(option->value, arg, map); } if (!strcmp(option->type, "int")) { if (strstr(name, "title-overflow")) { bool enabled = FALSE; int *value = option->value; /* We try to parse it as a boolean (and set the * value to 0 if fale), otherwise we parse it as * an integer and use the given value. */ if (parse_bool(&enabled, arg) == SUCCESS) { if (!enabled) { *value = 0; return SUCCESS; } arg = "50"; } } if (!strcmp(name, "line-number-interval") || !strcmp(name, "tab-size")) return parse_int(option->value, arg, 1, 1024); else if (!strcmp(name, "id-width")) return parse_int(option->value, arg, 0, SIZEOF_REV - 1); else return parse_int(option->value, arg, 0, 1024); } return error("Unhandled option: %s", name); } struct view_config { const char *name; const char ***argv; }; static struct view_config view_configs[] = { { "blame-view", &opt_blame_view }, { "blob-view", &opt_blob_view }, { "diff-view", &opt_diff_view }, { "grep-view", &opt_grep_view }, { "log-view", &opt_log_view }, { "main-view", &opt_main_view }, { "pager-view", &opt_pager_view }, { "refs-view", &opt_refs_view }, { "stage-view", &opt_stage_view }, { "stash-view", &opt_stash_view }, { "status-view", &opt_status_view }, { "tree-view", &opt_tree_view }, }; static enum status_code check_view_config(struct option_info *option, const char *argv[]) { const char *name = enum_name(option->name); int i; for (i = 0; i < ARRAY_SIZE(view_configs); i++) if (!strcmp(name, view_configs[i].name)) return parse_view_config(name, argv); return SUCCESS; } /* Wants: name = value */ static enum status_code option_set_command(int argc, const char *argv[]) { struct option_info *option; if (argc < 3) return error("Invalid set command: set option = value"); if (strcmp(argv[1], "=")) return error("No value assigned to %s", argv[0]); if (!strcmp(argv[0], "reference-format")) return parse_ref_formats(argv + 2); option = find_option_info(option_info, ARRAY_SIZE(option_info), argv[0]); if (option) { enum status_code code; if (option->seen) return SUCCESS; if (!strcmp(option->type, "const char **")) { code = check_view_config(option, argv + 2); if (code != SUCCESS) return code; return parse_args(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] = { { "author-width", "author" }, { "filename-width", "file-name" }, { "line-number-interval", "line-number" }, { "show-author", "author" }, { "show-date", "date" }, { "show-file-size", "file-size" }, { "show-filename", "file-name" }, { "show-id", "id" }, { "show-line-numbers", "line-number" }, { "show-refs", "commit-title" }, { "show-rev-graph", "commit-title" }, { "title-overflow", "commit-title and text" }, }; int index = find_remapped(obsolete, ARRAY_SIZE(obsolete), argv[0]); if (index != -1) return error("%s is obsolete; see tigrc(5) for how to set the %s column option", obsolete[index][0], obsolete[index][1]); if (!strcmp(argv[0], "read-git-colors")) return error("read-git-colors has been obsoleted by the git-colors option"); } return error("Unknown option name: %s", argv[0]); } /* Wants: mode request key */ static enum status_code option_bind_command(int argc, const char *argv[]) { struct key key[1]; size_t keys = 0; enum request request; struct keymap *keymap; const char *key_arg; if (argc < 3) return error("Invalid key binding: bind keymap key action"); if (!(keymap = get_keymap(argv[0], strlen(argv[0])))) { if (!strcmp(argv[0], "branch")) keymap = get_keymap("refs", strlen("refs")); if (!keymap) return error("Unknown key map: %s", argv[0]); } for (keys = 0, key_arg = argv[1]; *key_arg && keys < ARRAY_SIZE(key); keys++) { enum status_code code = get_key_value(&key_arg, &key[keys]); if (code != SUCCESS) return code; } if (*key_arg && keys == ARRAY_SIZE(key)) return error("Except for combos only one key is allowed " "in key combos: %s", argv[1]); request = get_request(argv[2]); if (request == REQ_UNKNOWN) { static const char *obsolete[][2] = { { "view-branch", "view-refs" }, }; static const char *toggles[][2] = { { "diff-context-down", "diff-context" }, { "diff-context-up", "diff-context" }, { "toggle-author", "author" }, { "toggle-changes", "show-changes" }, { "toggle-commit-order", "show-commit-order" }, { "toggle-date", "date" }, { "toggle-file-filter", "file-filter" }, { "toggle-file-size", "file-size" }, { "toggle-filename", "filename" }, { "toggle-graphic", "show-graphic" }, { "toggle-id", "id" }, { "toggle-ignore-space", "show-ignore-space" }, { "toggle-lineno", "line-number" }, { "toggle-refs", "commit-title-refs" }, { "toggle-rev-graph", "commit-title-graph" }, { "toggle-sort-field", "sort-field" }, { "toggle-sort-order", "sort-order" }, { "toggle-title-overflow", "commit-title-overflow" }, { "toggle-untracked-dirs", "status-untracked-dirs" }, { "toggle-vertical-split", "show-vertical-split" }, }; int alias; alias = find_remapped(obsolete, ARRAY_SIZE(obsolete), argv[2]); if (alias != -1) { const char *action = obsolete[alias][1]; add_keybinding(keymap, get_request(action), key, keys); return error("%s has been renamed to %s", obsolete[alias][0], action); } alias = find_remapped(toggles, ARRAY_SIZE(toggles), argv[2]); if (alias != -1) { const char *action = toggles[alias][0]; const char *arg = prefixcmp(action, "diff-context-") ? NULL : (strstr(action, "-down") ? "-1" : "+1"); const char *toggle[] = { ":toggle", toggles[alias][1], arg, NULL}; enum status_code code = add_run_request(keymap, key, keys, toggle); if (code == SUCCESS) code = error("%s has been replaced by `:toggle %s%s%s'", action, toggles[alias][1], arg ? " " : "", arg ? arg : ""); return code; } } if (request == REQ_UNKNOWN) return add_run_request(keymap, key, keys, argv + 2); return add_keybinding(keymap, request, key, keys); } static enum status_code load_option_file(const char *path); static enum status_code option_source_command(int argc, const char *argv[]) { enum status_code code; if (argc < 1) return error("Invalid source command: source path"); code = load_option_file(argv[0]); return code == ERROR_FILE_DOES_NOT_EXIST ? error("File does not exist: %s", argv[0]) : code; } enum status_code set_option(const char *opt, int argc, const char *argv[]) { if (!strcmp(opt, "color")) return option_color_command(argc, argv); if (!strcmp(opt, "set")) return option_set_command(argc, argv); if (!strcmp(opt, "bind")) return option_bind_command(argc, argv); if (!strcmp(opt, "source")) return option_source_command(argc, argv); return error("Unknown option command: %s", opt); } struct config_state { const char *path; size_t lineno; bool errors; }; static int read_option(char *opt, size_t optlen, char *value, size_t valuelen, void *data) { struct config_state *config = data; enum status_code status = ERROR_NO_OPTION_VALUE; /* Check for comment markers, since read_properties() will * only ensure opt and value are split at first " \t". */ optlen = strcspn(opt, "#"); if (optlen == 0) return OK; if (opt[optlen] == 0) { /* Look for comment endings in the value. */ size_t len = strcspn(value, "#"); const char *argv[SIZEOF_ARG]; int argc = 0; if (len < valuelen) { valuelen = len; value[valuelen] = 0; } if (!argv_from_string(argv, &argc, value)) status = error("Too many option arguments for %s", opt); else status = set_option(opt, argc, argv); } if (status != SUCCESS) { warn("%s:%zu: %s", config->path, config->lineno, get_status_message(status)); config->errors = TRUE; } /* Always keep going if errors are encountered. */ return OK; } static enum status_code load_option_file(const char *path) { struct config_state config = { path, 0, FALSE }; struct io io; char buf[SIZEOF_STR]; /* Do not read configuration from stdin if set to "" */ 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; } /* It's OK that the file doesn't exist. */ if (!io_open(&io, "%s", path)) { /* 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, strerror(io_error(&io))); } if (io_load_span(&io, " \t", &config.lineno, read_option, &config) == ERR || config.errors == TRUE) warn("Errors while loading %s.", path); return SUCCESS; } extern const char *builtin_config; int load_options(void) { const char *tigrc_user = getenv("TIGRC_USER"); const char *tigrc_system = getenv("TIGRC_SYSTEM"); const char *tig_diff_opts = getenv("TIG_DIFF_OPTS"); const bool diff_opts_from_args = !!opt_diff_options; bool custom_tigrc_system = !!tigrc_system; opt_file_filter = TRUE; if (!find_option_info_by_value(&opt_diff_context)->seen) opt_diff_context = -3; if (!custom_tigrc_system) tigrc_system = SYSCONFDIR "/tigrc"; if (!*tigrc_system || (load_option_file(tigrc_system) == ERROR_FILE_DOES_NOT_EXIST && !custom_tigrc_system)) { struct config_state config = { "", 0, FALSE }; struct io io; if (!io_from_string(&io, builtin_config)) die("Failed to get built-in config"); if (!io_load_span(&io, " \t", &config.lineno, read_option, &config) == ERR || config.errors == TRUE) die("Error in built-in config"); } if (!tigrc_user) tigrc_user = "~/.tigrc"; load_option_file(tigrc_user); if (!diff_opts_from_args && tig_diff_opts && *tig_diff_opts) { static const char *diff_opts[SIZEOF_ARG] = { NULL }; char buf[SIZEOF_STR]; int argc = 0; if (!string_format(buf, "%s", tig_diff_opts) || !argv_from_string(diff_opts, &argc, buf)) die("TIG_DIFF_OPTS contains too many arguments"); else if (!argv_copy(&opt_diff_options, diff_opts)) die("Failed to format TIG_DIFF_OPTS arguments"); } return OK; } /* * Repository properties */ static void set_remote_branch(const char *name, const char *value, size_t valuelen) { if (!strcmp(name, ".remote")) { string_ncopy(repo.remote, value, valuelen); } else if (*repo.remote && !strcmp(name, ".merge")) { size_t from = strlen(repo.remote); if (!prefixcmp(value, "refs/heads/")) value += STRING_SIZE("refs/heads/"); if (!string_format_from(repo.remote, &from, "/%s", value)) repo.remote[0] = 0; } } static void set_repo_config_option(char *name, char *value, enum status_code (*cmd)(int, const char **)) { const char *argv[SIZEOF_ARG] = { name, "=" }; int argc = 1 + (cmd == option_set_command); enum status_code code; if (!argv_from_string(argv, &argc, value)) code = error("Too many arguments"); else code = cmd(argc, argv); if (code != SUCCESS) warn("Option 'tig.%s': %s", name, get_status_message(code)); } static void set_work_tree(const char *value) { char cwd[SIZEOF_STR]; if (!getcwd(cwd, sizeof(cwd))) die("Failed to get cwd path: %s", strerror(errno)); if (chdir(cwd) < 0) die("Failed to chdir(%s): %s", cwd, strerror(errno)); if (chdir(repo.git_dir) < 0) die("Failed to chdir(%s): %s", repo.git_dir, strerror(errno)); if (!getcwd(repo.git_dir, sizeof(repo.git_dir))) die("Failed to get git path: %s", strerror(errno)); if (chdir(value) < 0) die("Failed to chdir(%s): %s", value, strerror(errno)); if (!getcwd(cwd, sizeof(cwd))) die("Failed to get cwd path: %s", strerror(errno)); if (setenv("GIT_WORK_TREE", cwd, TRUE)) die("Failed to set GIT_WORK_TREE to '%s'", cwd); if (setenv("GIT_DIR", repo.git_dir, TRUE)) die("Failed to set GIT_DIR to '%s'", repo.git_dir); repo.is_inside_work_tree = TRUE; } static struct line_info * parse_git_color_option(struct line_info *info, char *value) { const char *argv[SIZEOF_ARG]; int argc = 0; bool first_color = TRUE; int i; if (!argv_from_string(argv, &argc, value)) return NULL; info->fg = COLOR_DEFAULT; info->bg = COLOR_DEFAULT; info->attr = 0; for (i = 0; i < argc; i++) { int attr = 0; if (set_attribute(&attr, argv[i])) { info->attr |= attr; } else if (set_color(&attr, argv[i])) { if (first_color) info->fg = attr; else info->bg = attr; first_color = FALSE; } } return info; } static void set_git_color_option(const char *name, char *value) { struct line_info parsed = {}; struct line_info *color = NULL; size_t namelen = strlen(name); int i; if (!opt_git_colors) return; for (i = 0; opt_git_colors[i]; i++) { struct line_rule rule = {}; const char *prefix = NULL; struct line_info *info; const char *alias = opt_git_colors[i]; const char *sep = strchr(alias, '='); if (!sep || namelen != sep - alias || string_enum_compare(name, alias, namelen)) continue; if (!color) { color = parse_git_color_option(&parsed, value); if (!color) return; } if (parse_color_name(sep + 1, &rule, &prefix) == SUCCESS && (info = add_line_rule(prefix, &rule))) { info->fg = parsed.fg; info->bg = parsed.bg; info->attr = parsed.attr; } } } static void set_encoding(struct encoding **encoding_ref, const char *arg, bool priority) { if (!strcasecmp(arg, "utf-8") || !strcasecmp(arg, "utf8")) return; if (parse_encoding(encoding_ref, arg, priority) == SUCCESS) encoding_arg[0] = 0; } static int read_repo_config_option(char *name, size_t namelen, char *value, size_t valuelen, void *data) { if (!strcmp(name, "i18n.commitencoding")) set_encoding(&default_encoding, value, FALSE); else if (!strcmp(name, "gui.encoding")) set_encoding(&default_encoding, value, TRUE); else if (!strcmp(name, "core.editor")) string_ncopy(opt_editor, value, valuelen); else if (!strcmp(name, "core.worktree")) set_work_tree(value); else if (!strcmp(name, "core.abbrev")) parse_int(&opt_id_width, value, 0, SIZEOF_REV - 1); else if (!prefixcmp(name, "tig.color.")) set_repo_config_option(name + 10, value, option_color_command); else if (!prefixcmp(name, "tig.bind.")) set_repo_config_option(name + 9, value, option_bind_command); else if (!prefixcmp(name, "tig.")) set_repo_config_option(name + 4, value, option_set_command); else if (!prefixcmp(name, "color.")) set_git_color_option(name + STRING_SIZE("color."), value); else if (*repo.head && !prefixcmp(name, "branch.") && !strncmp(name + 7, repo.head, strlen(repo.head))) set_remote_branch(name + 7 + strlen(repo.head), value, valuelen); else if (!strcmp(name, "diff.context")) { if (!find_option_info_by_value(&opt_diff_context)->seen) opt_diff_context = -atoi(value); } return OK; } int load_git_config(void) { const char *config_list_argv[] = { "git", "config", "--list", NULL }; return io_run_load(config_list_argv, "=", read_repo_config_option, NULL); } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/pager.c000066400000000000000000000125331233303337700143370ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/options.h" #include "tig/request.h" #include "tig/line.h" #include "tig/keys.h" #include "tig/display.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/diff.h" /* * Pager backend */ bool pager_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { column_data->text = line->data; return TRUE; } static bool add_describe_ref(char *buf, size_t *bufpos, const char *commit_id, const char *sep) { const char *describe_argv[] = { "git", "describe", commit_id, NULL }; char ref[SIZEOF_STR]; if (!io_run_buf(describe_argv, ref, sizeof(ref)) || !*ref) return TRUE; /* This is the only fatal call, since it can "corrupt" the buffer. */ if (!string_nformat(buf, SIZEOF_STR, bufpos, "%s%s", sep, ref)) return FALSE; return TRUE; } static void add_pager_refs(struct view *view, const char *commit_id) { char buf[SIZEOF_STR]; struct ref_list *list; size_t bufpos = 0, i; const char *sep = "Refs: "; bool is_tag = FALSE; list = get_ref_list(commit_id); if (!list) { if (view_has_flags(view, VIEW_ADD_DESCRIBE_REF)) goto try_add_describe_ref; return; } for (i = 0; i < list->size; i++) { struct ref *ref = list->refs[i]; const struct ref_format *fmt = get_ref_format(ref); if (!string_format_from(buf, &bufpos, "%s%s%s%s", sep, fmt->start, ref->name, fmt->end)) return; sep = ", "; if (ref_is_tag(ref)) is_tag = TRUE; } if (!is_tag && view_has_flags(view, VIEW_ADD_DESCRIBE_REF)) { try_add_describe_ref: /* Add -g "fake" reference. */ if (!add_describe_ref(buf, &bufpos, commit_id, sep)) return; } if (bufpos == 0) return; add_line_text(view, buf, LINE_PP_REFS); } static struct line * pager_wrap_line(struct view *view, const char *data, enum line_type type) { size_t first_line = 0; bool has_first_line = FALSE; size_t datalen = strlen(data); size_t lineno = 0; while (datalen > 0 || !has_first_line) { bool wrapped = !!first_line; size_t linelen = string_expanded_length(data, datalen, opt_tab_size, view->width - !!wrapped); struct line *line; char *text; line = add_line(view, NULL, type, linelen + 1, wrapped); if (!line) break; if (!has_first_line) { first_line = view->lines - 1; has_first_line = TRUE; } if (!wrapped) lineno = line->lineno; line->wrapped = wrapped; line->lineno = lineno; text = line->data; if (linelen) strncpy(text, data, linelen); text[linelen] = 0; datalen -= linelen; data += linelen; } return has_first_line ? &view->line[first_line] : NULL; } bool pager_common_read(struct view *view, const char *data, enum line_type type, struct line **line_ptr) { struct line *line; if (!data) return TRUE; if (opt_wrap_lines) { line = pager_wrap_line(view, data, type); } else { line = add_line_text(view, data, type); } if (!line) return FALSE; if (line_ptr) *line_ptr = line; if (line->type == LINE_COMMIT && view_has_flags(view, VIEW_ADD_PAGER_REFS)) add_pager_refs(view, data + STRING_SIZE("commit ")); return TRUE; } bool pager_read(struct view *view, struct buffer *buf) { if (!buf) return TRUE; return pager_common_read(view, buf->data, get_line_type(buf->data), NULL); } enum request pager_request(struct view *view, enum request request, struct line *line) { int split = 0; if (request != REQ_ENTER) return request; if (line->type == LINE_COMMIT && view_has_flags(view, VIEW_OPEN_DIFF)) { open_diff_view(view, OPEN_SPLIT); split = 1; } /* Always scroll the view even if it was split. That way * you can use Enter to scroll through the log view and * split open each commit diff. */ scroll_view(view, REQ_SCROLL_LINE_DOWN); /* FIXME: A minor workaround. Scrolling the view will call report_clear() * but if we are scrolling a non-current view this won't properly * update the view title. */ if (split) update_view_title(view); return REQ_NONE; } void pager_select(struct view *view, struct line *line) { if (line->type == LINE_COMMIT) { string_copy_rev_from_commit_line(view->env->commit, line->data); if (!view_has_flags(view, VIEW_NO_REF)) string_copy_rev(view->ref, view->env->commit); } } static bool 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; } return begin_update(view, NULL, NULL, flags); } static struct view_ops pager_ops = { "line", "", VIEW_OPEN_DIFF | VIEW_NO_REF | VIEW_NO_GIT_DIR, 0, pager_open, pager_read, view_column_draw, pager_request, view_column_grep, pager_select, NULL, view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), pager_get_column_data, }; DEFINE_VIEW(pager); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/parse.c000066400000000000000000000157771233303337700143700ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/util.h" #include "tig/parse.h" size_t parse_size(const char *text) { size_t size = 0; while (*text == ' ') text++; while (isdigit(*text)) size = (size * 10) + (*text++ - '0'); return size; } /* * Parsing of ident lines. */ static void parse_timesec(struct time *time, const char *sec) { time->sec = (time_t) atol(sec); } static void parse_timezone(struct time *time, const char *zone) { long tz; tz = ('0' - zone[1]) * 60 * 60 * 10; tz += ('0' - zone[2]) * 60 * 60; tz += ('0' - zone[3]) * 60 * 10; tz += ('0' - zone[4]) * 60; if (zone[0] == '-') tz = -tz; time->tz = tz; time->sec -= tz; } void parse_author_line(char *ident, const struct ident **author, struct time *time) { char *nameend = strchr(ident, '<'); char *emailend = strchr(ident, '>'); const char *name, *email = ""; if (nameend && emailend) *nameend = *emailend = 0; name = chomp_string(ident); if (nameend) email = chomp_string(nameend + 1); if (!*name) name = *email ? email : unknown_ident.name; if (!*email) email = *name ? name : unknown_ident.email; *author = get_author(name, email); /* Parse epoch and timezone */ if (time && emailend && emailend[1] == ' ') { char *secs = emailend + 2; char *zone = strchr(secs, ' '); parse_timesec(time, secs); if (zone && strlen(zone) == STRING_SIZE(" +0700")) parse_timezone(time, zone + 1); } } /* * Blame. */ static bool parse_number(const char **posref, size_t *number, size_t min, size_t max) { const char *pos = *posref; *posref = NULL; pos = strchr(pos + 1, ' '); if (!pos || !isdigit(pos[1])) return FALSE; *number = atoi(pos + 1); if (*number < min || *number > max) return FALSE; *posref = pos; return TRUE; } bool parse_blame_header(struct blame_header *header, const char *text, size_t max_lineno) { const char *pos = text + SIZEOF_REV - 2; if (strlen(text) <= SIZEOF_REV || pos[1] != ' ') return FALSE; string_ncopy(header->id, text, SIZEOF_REV); if (!parse_number(&pos, &header->orig_lineno, 1, 9999999) || !parse_number(&pos, &header->lineno, 1, max_lineno) || !parse_number(&pos, &header->group, 1, max_lineno - header->lineno + 1)) return FALSE; return TRUE; } static bool match_blame_header(const char *name, char **line) { size_t namelen = strlen(name); bool matched = !strncmp(name, *line, namelen); if (matched) *line += namelen; return matched; } bool parse_blame_info(struct blame_commit *commit, char author[SIZEOF_STR], char *line) { if (match_blame_header("author ", &line)) { string_ncopy_do(author, SIZEOF_STR, line, strlen(line)); } else if (match_blame_header("author-mail ", &line)) { char *end = strchr(line, '>'); if (end) *end = 0; if (*line == '<') line++; commit->author = get_author(author, line); author[0] = 0; } else if (match_blame_header("author-time ", &line)) { parse_timesec(&commit->time, line); } else if (match_blame_header("author-tz ", &line)) { parse_timezone(&commit->time, line); } else if (match_blame_header("summary ", &line)) { string_ncopy(commit->title, line, strlen(line)); } else if (match_blame_header("previous ", &line)) { if (strlen(line) <= SIZEOF_REV) return FALSE; string_copy_rev(commit->parent_id, line); line += SIZEOF_REV; commit->parent_filename = get_path(line); if (!commit->parent_filename) return TRUE; } else if (match_blame_header("filename ", &line)) { commit->filename = get_path(line); return TRUE; } return FALSE; } /* * Diff. */ static bool parse_ulong(const char **pos_ptr, unsigned long *value, const char *skip) { const char *start = *pos_ptr; char *end; if (!isdigit(*start)) return 0; *value = strtoul(start, &end, 10); if (end == start) return FALSE; start = end; while (skip && *start && strchr(skip, *start)) start++; *pos_ptr = start; return TRUE; } bool parse_chunk_header(struct chunk_header *header, const char *line) { memset(header, 0, sizeof(*header)); if (!prefixcmp(line, "@@ -")) line += STRING_SIZE("@@ -"); else if (!prefixcmp(line, "@@@ -") && (line = strchr(line + STRING_SIZE("@@@ -"), '-'))) line += 1; else return FALSE; return parse_ulong(&line, &header->old.position, ",") && parse_ulong(&line, &header->old.lines, " +") && parse_ulong(&line, &header->new.position, ",") && parse_ulong(&line, &header->new.lines, NULL); } bool parse_chunk_lineno(unsigned long *lineno, const char *chunk, int marker) { struct chunk_header chunk_header; *lineno = 0; if (!parse_chunk_header(&chunk_header, chunk)) return FALSE; *lineno = marker == '-' ? chunk_header.old.position : chunk_header.new.position; return TRUE; } /* * Caches. */ DEFINE_ALLOCATOR(realloc_paths, const char *, 256) /* Small cache to reduce memory consumption. It uses binary search to * lookup or find place to position new entries. No entries are ever * freed. */ const char * get_path(const char *path) { static const char **paths; static size_t paths_size; int from = 0, to = paths_size - 1; char *entry; while (from <= to) { size_t pos = (to + from) / 2; int cmp = strcmp(path, paths[pos]); if (!cmp) return paths[pos]; if (cmp < 0) to = pos - 1; else from = pos + 1; } if (!realloc_paths(&paths, paths_size, 1)) return NULL; entry = strdup(path); if (!entry) return NULL; memmove(paths + from + 1, paths + from, (paths_size - from) * sizeof(*paths)); paths[from] = entry; paths_size++; return entry; } DEFINE_ALLOCATOR(realloc_authors, struct ident *, 256) /* Small author cache to reduce memory consumption. It uses binary * search to lookup or find place to position new entries. No entries * are ever freed. */ struct ident * get_author(const char *name, const char *email) { static struct ident **authors; static size_t authors_size; int from = 0, to = authors_size - 1; struct ident *ident; while (from <= to) { size_t pos = (to + from) / 2; int cmp = strcmp(email, authors[pos]->email); if (!cmp) return authors[pos]; if (cmp < 0) to = pos - 1; else from = pos + 1; } if (!realloc_authors(&authors, authors_size, 1)) return NULL; ident = calloc(1, sizeof(*ident)); if (!ident) return NULL; ident->name = strdup(name); ident->email = strdup(email); if (!ident->name || !ident->email) { free((void *) ident->name); free(ident); return NULL; } memmove(authors + from + 1, authors + from, (authors_size - from) * sizeof(*authors)); authors[from] = ident; authors_size++; return ident; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/prompt.c000066400000000000000000000477251233303337700145750ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/display.h" #include "tig/options.h" #include "tig/prompt.h" #include "tig/pager.h" #include "tig/types.h" #ifdef HAVE_READLINE #include #include #endif /* HAVE_READLINE */ static char * prompt_input(const char *prompt, struct input *input) { enum input_status status = INPUT_OK; unsigned char chars_length[SIZEOF_STR]; struct key key; size_t promptlen = strlen(prompt); int pos = 0, chars = 0; input->buf[pos] = 0; while (status == INPUT_OK || status == INPUT_SKIP) { update_status("%s%.*s", prompt, pos, input->buf); if (get_input(pos + promptlen, &key, FALSE) == OK) { int len = strlen(key.data.bytes); if (pos + len >= sizeof(input->buf)) { report("Input string too long"); return NULL; } string_ncopy_do(input->buf + pos, sizeof(input->buf) - pos, key.data.bytes, len); pos += len; chars_length[chars++] = len; status = input->handler(input, &key); if (status != INPUT_OK) { pos -= len; chars--; } else { int changed_pos = strlen(input->buf); if (changed_pos != pos) { pos = changed_pos; chars_length[chars - 1] = changed_pos - (pos - len); } } } else { status = input->handler(input, &key); if (status == INPUT_DELETE) { int len = chars_length[--chars]; pos -= len; status = INPUT_OK; } else { int changed_pos = strlen(input->buf); if (changed_pos != pos) { pos = changed_pos; chars_length[chars++] = changed_pos - pos; } } } input->buf[pos] = 0; } report_clear(); if (status == INPUT_CANCEL) return NULL; input->buf[pos++] = 0; return input->buf; } static enum input_status prompt_default_handler(struct input *input, struct key *key) { if (key->modifiers.multibytes) return INPUT_SKIP; switch (key->data.value) { case KEY_RETURN: case KEY_ENTER: case '\n': return *input->buf ? INPUT_STOP : INPUT_CANCEL; case KEY_BACKSPACE: return *input->buf ? INPUT_DELETE : INPUT_CANCEL; case KEY_ESC: return INPUT_CANCEL; default: return INPUT_SKIP; } } static enum input_status prompt_yesno_handler(struct input *input, struct key *key) { unsigned long c = key_to_unicode(key); if (c == 'y' || c == 'Y') return INPUT_STOP; if (c == 'n' || c == 'N') return INPUT_CANCEL; return prompt_default_handler(input, key); } bool prompt_yesno(const char *prompt) { char prompt2[SIZEOF_STR]; struct input input = { prompt_yesno_handler, NULL }; if (!string_format(prompt2, "%s [Yy/Nn]", prompt)) return FALSE; return !!prompt_input(prompt2, &input); } struct incremental_input { struct input input; input_handler handler; bool edit_mode; }; static enum input_status read_prompt_handler(struct input *input, struct key *key) { struct incremental_input *incremental = (struct incremental_input *) input; if (incremental->edit_mode && !key->modifiers.multibytes) return prompt_default_handler(input, key); if (!unicode_width(key_to_unicode(key), 8)) return INPUT_SKIP; if (!incremental->handler) return INPUT_OK; return incremental->handler(input, key); } char * read_prompt_incremental(const char *prompt, bool edit_mode, input_handler handler, void *data) { static struct incremental_input incremental = { { read_prompt_handler } }; incremental.input.data = data; incremental.handler = handler; incremental.edit_mode = edit_mode; return prompt_input(prompt, (struct input *) &incremental); } #ifdef HAVE_READLINE static void readline_display(void) { wmove(status_win, 0, 0); waddstr(status_win, rl_display_prompt); waddstr(status_win, rl_line_buffer); wclrtoeol(status_win); wmove(status_win, 0, strlen(rl_display_prompt) + rl_point); wrefresh(status_win); } static char * readline_variable_generator(const char *text, int state) { static const char *vars[] = { #define FORMAT_VAR(name, ifempty, initval) "%(" #name ")" ARGV_ENV_INFO(FORMAT_VAR), #undef FORMAT_VAR NULL }; static int index, len; const char *name; char *variable = NULL; /* No match */ /* If it is a new word to complete, initialize */ if (!state) { index = 0; len = strlen(text); } /* Return the next name which partially matches */ while ((name = vars[index])) { index++; /* Complete or format a variable */ if (strncmp(name, text, len) == 0) { if (strlen(name) > len) variable = strdup(name); else variable = argv_format_arg(&argv_env, text); break; } } return variable; } static char * readline_action_generator(const char *text, int state) { static const char *actions[] = { "!", "source", "color", "bind", "set", "toggle", #define REQ_GROUP(help) #define REQ_(req, help) #req REQ_INFO, #undef REQ_GROUP #undef REQ_ NULL }; static int index, len; const char *name; char *match = NULL; /* No match */ /* If it is a new word to complete, initialize */ if (!state) { index = 0; len = strlen(text); } /* Return the next name which partially matches */ while ((name = actions[index])) { name = enum_name(name); index++; if (strncmp(name, text, len) == 0) { /* Ignore exact completion */ if (strlen(name) > len) match = strdup(name); break; } } return match; } static char * readline_set_generator(const char *text, int state) { static const char *words[] = { #define DEFINE_OPTION_NAME(name, type, flags) #name " = ", OPTION_INFO(DEFINE_OPTION_NAME) #undef DEFINE_OPTION_NAME NULL }; static int index, len; const char *name; char *match = NULL; /* No match */ /* If it is a new word to complete, initialize */ if (!state) { index = 0; len = strlen(text); } /* Return the next name which partially matches */ while ((name = words[index])) { name = enum_name(name); index++; if (strncmp(name, text, len) == 0) { /* Ignore exact completion */ if (strlen(name) > len) match = strdup(name); break; } } return match; } static char * readline_toggle_generator(const char *text, int state) { static const char **words; static int index, len; const char *name; char *match = NULL; /* No match */ if (!words) { /* TODO: Only complete column options that are defined * for the view. */ #define DEFINE_OPTION_WORD(name, type, flags) argv_append(&words, #name); #define DEFINE_COLUMN_OPTIONS_WORD(name, type, flags) #name, #define DEFINE_COLUMN_OPTIONS_WORDS(name, id, options) \ if (VIEW_COLUMN_##id != VIEW_COLUMN_SECTION) { \ const char *vars[] = { \ options(DEFINE_COLUMN_OPTIONS_WORD) \ }; \ char buf[SIZEOF_STR]; \ int i; \ for (i = 0; i < ARRAY_SIZE(vars); i++) { \ if (enum_name_prefixed(buf, sizeof(buf), #name, vars[i])) \ argv_append(&words, buf); \ } \ } OPTION_INFO(DEFINE_OPTION_WORD) COLUMN_OPTIONS(DEFINE_COLUMN_OPTIONS_WORDS); } /* If it is a new word to complete, initialize */ if (!state) { index = 0; len = strlen(text); } /* Return the next name which partially matches */ while ((name = words[index])) { name = enum_name(name); index++; if (strncmp(name, text, len) == 0) { /* Ignore exact completion */ if (strlen(name) > len) match = strdup(name); break; } } return match; } static int readline_getc(FILE *stream) { return getc(opt_tty); } static char ** readline_completion(const char *text, int start, int end) { /* Do not append a space after a completion */ rl_completion_suppress_append = 1; /* * If the word is at the start of the line, * then it is a tig action to complete. */ if (start == 0) return rl_completion_matches(text, readline_action_generator); /* * If the line begins with "toggle", then we complete toggle options. */ if (start >= 7 && strncmp(rl_line_buffer, "toggle ", 7) == 0) return rl_completion_matches(text, readline_toggle_generator); /* * If the line begins with "set", then we complete set options. * (unless it is already completed) */ if (start >= 4 && strncmp(rl_line_buffer, "set ", 4) == 0 && !strchr(rl_line_buffer, '=')) return rl_completion_matches(text, readline_set_generator); /* * Otherwise it might be a variable name... */ if (strncmp(text, "%(", 2) == 0) return rl_completion_matches(text, readline_variable_generator); /* * ... or finally fall back to filename completion. */ return NULL; } static void readline_display_matches(char **matches, int num_matches, int max_length) { unsigned int i; wmove(status_win, 0, 0); waddstr(status_win, "matches: "); /* matches[0] is the incomplete word */ for (i = 1; i < num_matches + 1; ++i) { waddstr(status_win, matches[i]); waddch(status_win, ' '); } wgetch(status_win); wrefresh(status_win); } static void readline_init(void) { /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "tig"; /* Word break caracters (we removed '(' to match variables) */ rl_basic_word_break_characters = " \t\n\"\\'`@$><=;|&{"; /* Custom display function */ rl_redisplay_function = readline_display; rl_getc_function = readline_getc; /* Completion support */ rl_attempted_completion_function = readline_completion; rl_completion_display_matches_hook = readline_display_matches; } char * read_prompt(const char *prompt) { static char *line = NULL; if (line) { free(line); line = NULL; } line = readline(prompt); if (line && *line) add_history(line); return line; } void prompt_init(void) { readline_init(); } #else char * read_prompt(const char *prompt) { return read_prompt_incremental(prompt, TRUE, NULL, NULL); } void prompt_init(void) { } #endif /* HAVE_READLINE */ bool prompt_menu(const char *prompt, const struct menu_item *items, int *selected) { enum input_status status = INPUT_OK; struct key key; int size = 0; while (items[size].text) size++; assert(size > 0); while (status == INPUT_OK) { const struct menu_item *item = &items[*selected]; 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); switch (get_input(COLS - 1, &key, FALSE)) { case KEY_RETURN: case KEY_ENTER: case '\n': status = INPUT_STOP; break; case KEY_LEFT: case KEY_UP: *selected = *selected - 1; if (*selected < 0) *selected = size - 1; break; case KEY_RIGHT: case KEY_DOWN: *selected = (*selected + 1) % size; break; case KEY_ESC: status = INPUT_CANCEL; break; default: for (i = 0; items[i].text; i++) if (items[i].hotkey == key.data.bytes[0]) { *selected = i; status = INPUT_STOP; break; } } } report_clear(); return status != INPUT_CANCEL; } struct prompt_toggle { const char *name; const char *type; enum view_flag flags; void *opt; }; static bool find_arg(const char *argv[], const char *arg) { int i; for (i = 0; argv[i]; i++) if (!strcmp(argv[i], arg)) return TRUE; return FALSE; } static enum status_code prompt_toggle_option(struct view *view, const char *argv[], const char *prefix, struct prompt_toggle *toggle, enum view_flag *flags) { char name[SIZEOF_STR]; if (!enum_name_prefixed(name, sizeof(name), prefix, toggle->name)) return error("Failed to toggle option %s", toggle->name); *flags = toggle->flags; if (!strcmp(toggle->type, "bool")) { bool *opt = toggle->opt; *opt = !*opt; if (opt == &opt_mouse) enable_mouse(*opt); return success("set %s = %s", name, *opt ? "yes" : "no"); } else if (!strncmp(toggle->type, "enum", 4)) { const char *type = toggle->type + STRING_SIZE("enum "); enum author *opt = toggle->opt; const struct enum_map *map = find_enum_map(type); *opt = (*opt + 1) % map->size; return success("set %s = %s", name, enum_name(map->entries[*opt].name)); } else if (!strcmp(toggle->type, "int")) { const char *arg = argv[2] ? argv[2] : "1"; int diff = atoi(arg); int *opt = toggle->opt; if (!diff) diff = *arg == '-' ? -1 : 1; if (opt == &opt_diff_context && *opt < 0) *opt = -*opt; if (opt == &opt_diff_context && diff < 0) { if (!*opt) return error("Diff context cannot be less than zero"); if (*opt < -diff) diff = -*opt; } if (strstr(name, "commit-title-overflow")) { *opt = *opt ? -*opt : 50; if (*opt < 0) return success("set %s = no", name); diff = 0; } *opt += diff; return success("set %s = %d", name, *opt); } else if (!strcmp(toggle->type, "double")) { const char *arg = argv[2] ? argv[2] : "1.0"; double *opt = toggle->opt; int sign = 1; double diff; if (*arg == '-') { sign = -1; arg++; } if (parse_step(&diff, arg) != SUCCESS) diff = strtod(arg, NULL); *opt += sign * diff; return success("set %s = %.2f", name, *opt); } else if (!strcmp(toggle->type, "const char **")) { const char ***opt = toggle->opt; bool found = TRUE; int i; for (i = 2; argv[i]; i++) { if (!find_arg(*opt, argv[i])) { found = FALSE; break; } } if (found) { int next, pos; for (next = 0, pos = 0; (*opt)[pos]; pos++) { const char *arg = (*opt)[pos]; if (find_arg(argv + 2, arg)) { free((void *) arg); continue; } (*opt)[next++] = arg; } (*opt)[next] = NULL; } else if (!argv_copy(opt, argv + 2)) { return ERROR_OUT_OF_MEMORY; } return SUCCESS; } else { return error("Unsupported `:toggle %s` (%s)", name, toggle->type); } } static struct prompt_toggle * find_prompt_toggle(struct prompt_toggle toggles[], size_t toggles_size, const char *prefix, const char *name, size_t namelen) { char prefixed[SIZEOF_STR]; int i; if (*prefix && namelen == strlen(prefix) && !string_enum_compare(prefix, name, namelen)) { name = "display"; namelen = strlen(name); } for (i = 0; i < toggles_size; i++) { struct prompt_toggle *toggle = &toggles[i]; if (namelen == strlen(toggle->name) && !string_enum_compare(toggle->name, name, namelen)) return toggle; if (enum_name_prefixed(prefixed, sizeof(prefixed), prefix, toggle->name) && namelen == strlen(prefixed) && !string_enum_compare(prefixed, name, namelen)) return toggle; } return NULL; } static enum status_code prompt_toggle(struct view *view, const char *argv[], enum view_flag *flags) { struct prompt_toggle option_toggles[] = { #define DEFINE_OPTION_TOGGLES(name, type, flags) { #name, #type, flags, &opt_ ## name }, OPTION_INFO(DEFINE_OPTION_TOGGLES) }; const char *option = argv[1]; size_t optionlen = option ? strlen(option) : 0; struct prompt_toggle *toggle; struct view_column *column; if (!option) return error("%s", "No option name given to :toggle"); if (enum_equals_static("sort-field", option, optionlen) || enum_equals_static("sort-order", option, optionlen)) { if (!view_has_flags(view, VIEW_SORTABLE)) { return error("Sorting is not yet supported for the %s view", view->name); } else { bool sort_field = enum_equals_static("sort-field", option, optionlen); struct sort_state *sort = &view->sort; sort_view(view, sort_field); return success("set %s = %s", option, sort_field ? view_column_name(get_sort_field(view)) : sort->reverse ? "descending" : "ascending"); } } toggle = find_prompt_toggle(option_toggles, ARRAY_SIZE(option_toggles), "", option, optionlen); if (toggle) return prompt_toggle_option(view, argv, "", toggle, flags); #define DEFINE_COLUMN_OPTIONS_TOGGLE(name, type, flags) \ { #name, #type, flags, &opt->name }, #define DEFINE_COLUMN_OPTIONS_CHECK(name, id, options) \ if (column->type == VIEW_COLUMN_##id) { \ struct name##_options *opt = &column->opt.name; \ struct prompt_toggle toggles[] = { \ options(DEFINE_COLUMN_OPTIONS_TOGGLE) \ }; \ toggle = find_prompt_toggle(toggles, ARRAY_SIZE(toggles), #name, option, optionlen); \ if (toggle) \ return prompt_toggle_option(view, argv, #name, toggle, flags); \ } for (column = view->columns; column; column = column->next) { COLUMN_OPTIONS(DEFINE_COLUMN_OPTIONS_CHECK); } return error("`:toggle %s` not supported", option); } enum request run_prompt_command(struct view *view, const char *argv[]) { enum request request; const char *cmd = argv[0]; size_t cmdlen = cmd ? strlen(cmd) : 0; if (!cmd) return REQ_NONE; if (string_isnumber(cmd)) { int lineno = view->pos.lineno + 1; if (parse_int(&lineno, cmd, 0, view->lines + 1) == SUCCESS) { if (!lineno) lineno = 1; select_view_line(view, lineno - 1); report_clear(); } else { report("Unable to parse '%s' as a line number", cmd); } } else if (iscommit(cmd)) { int lineno; if (!(view->ops->column_bits & view_column_bit(ID))) { report("Jumping to commits is not supported by the %s view", view->name); return REQ_NONE; } for (lineno = 0; lineno < view->lines; lineno++) { struct view_column_data column_data = {}; struct line *line = &view->line[lineno]; if (view->ops->get_column_data(view, line, &column_data) && column_data.id && !strncasecmp(column_data.id, cmd, cmdlen)) { string_ncopy(view->env->search, cmd, cmdlen); select_view_line(view, lineno); report_clear(); return REQ_NONE; } } report("Unable to find commit '%s'", view->env->search); return REQ_NONE; } else if (cmdlen > 1 && (cmd[0] == '/' || cmd[0] == '?')) { char search[SIZEOF_STR]; if (!argv_to_string(argv, search, sizeof(search), " ")) { report("Failed to copy search string"); return REQ_NONE; } if (!strcmp(search + 1, view->env->search)) return cmd[0] == '/' ? REQ_FIND_NEXT : REQ_FIND_PREV; string_ncopy(view->env->search, search + 1, strlen(search + 1)); return cmd[0] == '/' ? REQ_SEARCH : REQ_SEARCH_BACK; } else if (cmdlen > 1 && cmd[0] == '!') { struct view *next = &pager_view; bool copied; /* Trim the leading '!'. */ argv[0] = cmd + 1; copied = argv_format(view->env, &next->argv, argv, FALSE, TRUE); argv[0] = cmd; if (!copied) { report("Argument formatting failed"); } else { /* When running random commands, initially show the * command in the title. However, it maybe later be * overwritten if a commit line is selected. */ argv_to_string(next->argv, next->ref, sizeof(next->ref), " "); next->dir = NULL; open_pager_view(view, OPEN_PREPARED | OPEN_WITH_STDERR); } } else if (!strcmp(cmd, "toggle")) { enum view_flag flags = VIEW_NO_FLAGS; enum status_code code = prompt_toggle(view, argv, &flags); const char *action = get_status_message(code); int i; if (code != SUCCESS) { report("%s", action); return REQ_NONE; } if (flags & VIEW_RESET_DISPLAY) { resize_display(); redraw_display(TRUE); } foreach_displayed_view(view, i) { if (view_has_flags(view, flags) && view_can_refresh(view)) reload_view(view); else redraw_view(view); } if (*action) report("%s", action); } else { struct key key = {}; /* Try : */ key.modifiers.multibytes = 1; string_ncopy(key.data.bytes, cmd, cmdlen); request = get_keybinding(view->keymap, &key, 1); if (request != REQ_NONE) return request; /* Try : */ request = get_request(cmd); if (request != REQ_UNKNOWN) return request; if (set_option(argv[0], argv_size(argv + 1), &argv[1]) == SUCCESS) { request = view_can_refresh(view) ? REQ_REFRESH : REQ_SCREEN_REDRAW; if (!strcmp(cmd, "color")) init_colors(); resize_display(); redraw_display(TRUE); } return request; } return REQ_NONE; } enum request open_prompt(struct view *view) { char *cmd = read_prompt(":"); const char *argv[SIZEOF_ARG] = { NULL }; int argc = 0; if (cmd && !argv_from_string(argv, &argc, cmd)) { report("Too many arguments"); return REQ_NONE; } return run_prompt_command(view, argv); } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/refdb.c000066400000000000000000000217031233303337700143220ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/argv.h" #include "tig/util.h" #include "tig/io.h" #include "tig/watch.h" #include "tig/options.h" #include "tig/repo.h" #include "tig/refdb.h" static struct ref **refs = NULL; static size_t refs_size = 0; static struct ref *refs_head = NULL; static struct ref_list **ref_lists = NULL; static size_t ref_lists_size = 0; DEFINE_ALLOCATOR(realloc_refs, struct ref *, 256) DEFINE_ALLOCATOR(realloc_refs_list, struct ref *, 8) DEFINE_ALLOCATOR(realloc_ref_lists, struct ref_list *, 8) static int compare_refs(const void *ref1_, const void *ref2_) { const struct ref *ref1 = *(const struct ref **)ref1_; const struct ref *ref2 = *(const struct ref **)ref2_; return ref_compare(ref1, ref2); } int ref_compare(const struct ref *ref1, const struct ref *ref2) { if (ref1->type != ref2->type) return ref1->type - ref2->type; return strcmp_numeric(ref1->name, ref2->name); } void foreach_ref(bool (*visitor)(void *data, const struct ref *ref), void *data) { size_t i; for (i = 0; i < refs_size; i++) if (refs[i]->id[0] && !visitor(data, refs[i])) break; } struct ref * get_ref_head() { return refs_head; } struct ref_list * get_ref_list(const char *id) { struct ref_list *list; size_t i; for (i = 0; i < ref_lists_size; i++) if (!strcmp(id, ref_lists[i]->id)) return ref_lists[i]; if (!realloc_ref_lists(&ref_lists, ref_lists_size, 1)) return NULL; list = calloc(1, sizeof(*list)); if (!list) return NULL; string_copy_rev(list->id, id); for (i = 0; i < refs_size; i++) { if (!strcmp(id, refs[i]->id) && realloc_refs_list(&list->refs, list->size, 1)) list->refs[list->size++] = refs[i]; } if (!list->refs) { free(list); return NULL; } qsort(list->refs, list->size, sizeof(*list->refs), compare_refs); ref_lists[ref_lists_size++] = list; return list; } struct ref_opt { const char *remote; const char *head; enum watch_trigger changed; }; static void done_ref_lists(void) { int i; for (i = 0; i < ref_lists_size; i++) { struct ref_list *list = ref_lists[i]; free(list->refs); free(list); } free(ref_lists); ref_lists = NULL; ref_lists_size = 0; } static int add_to_refs(const char *id, size_t idlen, char *name, size_t namelen, struct ref_opt *opt) { struct ref *ref = NULL; enum reference_type type = REFERENCE_BRANCH; int pos; if (!prefixcmp(name, "refs/tags/")) { type = REFERENCE_TAG; if (!suffixcmp(name, namelen, "^{}")) { namelen -= 3; name[namelen] = 0; } else { type = REFERENCE_LOCAL_TAG; } namelen -= STRING_SIZE("refs/tags/"); name += STRING_SIZE("refs/tags/"); } else if (!prefixcmp(name, "refs/remotes/")) { type = REFERENCE_REMOTE; namelen -= STRING_SIZE("refs/remotes/"); name += STRING_SIZE("refs/remotes/"); if (!strcmp(opt->remote, name)) type = REFERENCE_TRACKED_REMOTE; } else if (!prefixcmp(name, "refs/replace/")) { type = REFERENCE_REPLACE; id = name + strlen("refs/replace/"); idlen = namelen - strlen("refs/replace/"); name = "replaced"; namelen = strlen(name); } else if (!prefixcmp(name, "refs/heads/")) { namelen -= STRING_SIZE("refs/heads/"); name += STRING_SIZE("refs/heads/"); if (strlen(opt->head) == namelen && !strncmp(opt->head, name, namelen)) type = REFERENCE_HEAD; } else if (!strcmp(name, "HEAD")) { /* Handle the case of HEAD not being a symbolic ref, * i.e. during a rebase. */ if (*opt->head) return OK; type = REFERENCE_HEAD; } /* If we are reloading or it's an annotated tag, replace the * previous SHA1 with the resolved commit id; relies on the fact * git-ls-remote lists the commit id of an annotated tag right * before the commit id it points to. */ for (pos = 0; pos < refs_size; pos++) { int cmp = type == REFERENCE_REPLACE ? strcmp(id, refs[pos]->id) : strcmp(name, refs[pos]->name); if (!cmp) { ref = refs[pos]; break; } } if (!ref) { if (!realloc_refs(&refs, refs_size, 1)) return ERR; ref = calloc(1, sizeof(*ref) + namelen); if (!ref) return ERR; refs[refs_size++] = ref; strncpy(ref->name, name, namelen); } if (strncmp(ref->id, id, idlen)) opt->changed |= WATCH_REFS; ref->valid = TRUE; ref->type = type; string_ncopy_do(ref->id, SIZEOF_REV, id, idlen); if (type == REFERENCE_HEAD) { if (!refs_head || (refs_head != ref && memcmp(refs_head, ref, sizeof(*ref)))) opt->changed |= WATCH_HEAD; refs_head = ref; } return OK; } static int read_ref(char *id, size_t idlen, char *name, size_t namelen, void *data) { return add_to_refs(id, idlen, name, namelen, data); } static int reload_refs(bool force) { const char *head_argv[] = { "git", "symbolic-ref", "HEAD", NULL }; const char *ls_remote_argv[SIZEOF_ARG] = { "git", "ls-remote", repo.git_dir, NULL }; static bool init = FALSE; struct ref_opt opt = { repo.remote, repo.head, WATCH_NONE }; struct repo_info old_repo = repo; size_t i; if (!init) { if (!argv_from_env(ls_remote_argv, "TIG_LS_REMOTE")) return ERR; init = TRUE; } if (!*repo.git_dir) return OK; if ((force || !*repo.head) && io_run_buf(head_argv, repo.head, sizeof(repo.head)) && !prefixcmp(repo.head, "refs/heads/")) { char *offset = repo.head + STRING_SIZE("refs/heads/"); memmove(repo.head, offset, strlen(offset) + 1); } if (strcmp(old_repo.head, repo.head)) opt.changed |= WATCH_HEAD; refs_head = NULL; for (i = 0; i < refs_size; i++) refs[i]->valid = 0; done_ref_lists(); if (io_run_load(ls_remote_argv, "\t", read_ref, &opt) == ERR) return ERR; for (i = 0; i < refs_size; i++) if (!refs[i]->valid) { refs[i]->id[0] = 0; opt.changed |= WATCH_REFS; } if (opt.changed) watch_apply(NULL, opt.changed); qsort(refs, refs_size, sizeof(*refs), compare_refs); return OK; } int load_refs(bool force) { static bool loaded = FALSE; if (!force && loaded) return OK; loaded = TRUE; return reload_refs(force); } int add_ref(const char *id, char *name, const char *remote_name, const char *head) { struct ref_opt opt = { remote_name, head }; return add_to_refs(id, strlen(id), name, strlen(name), &opt); } void ref_update_env(struct argv_env *env, const struct ref *ref, bool clear) { if (clear) env->tag[0] = env->remote[0] = env->branch[0] = 0; string_copy_rev(env->commit, ref->id); if (ref_is_tag(ref)) { string_copy_rev(env->tag, ref->name); } else if (ref_is_remote(ref)) { const char *sep = strchr(ref->name, '/'); if (!sep) return; string_ncopy(env->remote, ref->name, sep - ref->name); string_copy_rev(env->branch, sep + 1); } else if (ref->type == REFERENCE_BRANCH) { string_copy_rev(env->branch, ref->name); } } static struct ref_format **ref_formats; const struct ref_format * get_ref_format(struct ref *ref) { static const struct ref_format default_format = { "", "" }; if (ref_formats) { struct ref_format *format = ref_formats[ref->type]; if (!format && ref_is_tag(ref)) format = ref_formats[REFERENCE_TAG]; if (!format && ref_is_remote(ref)) format = ref_formats[REFERENCE_REMOTE]; if (!format) format = ref_formats[REFERENCE_BRANCH]; if (format) return format; } return &default_format; } static enum status_code parse_ref_format_arg(const char *arg, const struct enum_map *map) { size_t arglen = strlen(arg); const char *pos; for (pos = arg; *pos && arglen > 0; pos++, arglen--) { enum reference_type type; for (type = 0; type < map->size; type++) { const struct enum_map_entry *entry = &map->entries[type]; struct ref_format *format; if (arglen < entry->namelen || string_enum_compare(pos, entry->name, entry->namelen)) continue; format = malloc(sizeof(*format)); if (!format) return ERROR_OUT_OF_MEMORY; format->start = strndup(arg, pos - arg); format->end = strdup(pos + entry->namelen); if (!format->start || !format->end) { free((void *) format->start); free((void *) format->end); free(format); return ERROR_OUT_OF_MEMORY; } ref_formats[type] = format; return SUCCESS; } } return error("Unknown ref format: %s", arg); } enum status_code parse_ref_formats(const char *argv[]) { const struct enum_map *map = reference_type_map; int argc; if (!ref_formats) { ref_formats = calloc(reference_type_map->size, sizeof(struct ref_format *)); if (!ref_formats) return ERROR_OUT_OF_MEMORY; } for (argc = 0; argv[argc]; argc++) { enum status_code code = parse_ref_format_arg(argv[argc], map); if (code != SUCCESS) return code; } return SUCCESS; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/refs.c000066400000000000000000000113621233303337700141770ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/io.h" #include "tig/options.h" #include "tig/parse.h" #include "tig/display.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/git.h" #include "tig/main.h" /* * Branch backend */ struct reference { const struct ident *author; /* Author of the last commit. */ struct time time; /* Date of the last activity. */ char title[128]; /* First line of the commit message. */ const struct ref *ref; /* Name and commit ID information. */ }; static const struct ref *refs_all; #define REFS_ALL_NAME "All references" #define refs_is_all(reference) ((reference)->ref == refs_all) static bool refs_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { const struct reference *reference = line->data; column_data->author = reference->author; column_data->date = &reference->time; column_data->id = reference->ref->id; column_data->ref = reference->ref; column_data->commit_title = reference->title; return TRUE; } static enum request refs_request(struct view *view, enum request request, struct line *line) { struct reference *reference = line->data; switch (request) { case REQ_REFRESH: load_refs(TRUE); refresh_view(view); return REQ_NONE; case REQ_ENTER: { const struct ref *ref = reference->ref; const char *all_references_argv[] = { GIT_MAIN_LOG_CUSTOM(encoding_arg, commit_order_arg(), "", refs_is_all(reference) ? "--all" : ref->name, "") }; open_argv(view, &main_view, all_references_argv, NULL, OPEN_SPLIT); return REQ_NONE; } default: return request; } } static bool refs_read(struct view *view, struct buffer *buf) { struct reference template = {}; char *author; char *title; size_t i; if (!buf) return TRUE; if (!*buf->data) return FALSE; author = io_memchr(buf, buf->data, 0); title = io_memchr(buf, author, 0); if (author) parse_author_line(author, &template.author, &template.time); for (i = 0; i < view->lines; i++) { struct reference *reference = view->line[i].data; if (strcmp(reference->ref->id, buf->data)) continue; reference->author = template.author; reference->time = template.time; if (title) string_expand(reference->title, sizeof(reference->title), title, 1); view->line[i].dirty = TRUE; view_column_info_update(view, &view->line[i]); } return TRUE; } static bool refs_open_visitor(void *data, const struct ref *ref) { struct view *view = data; struct reference *reference; bool is_all = ref == refs_all; struct line *line; line = add_line_alloc(view, &reference, LINE_DEFAULT, 0, is_all); if (!line) return FALSE; reference->ref = ref; view_column_info_update(view, line); return TRUE; } static bool refs_open(struct view *view, enum open_flags flags) { const char *refs_log[] = { "git", "log", encoding_arg, "--no-color", "--date=raw", "--pretty=format:%H%x00%an <%ae> %ad%x00%s", "--all", "--simplify-by-decoration", NULL }; 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 (!refs_all || !begin_update(view, NULL, refs_log, OPEN_RELOAD)) { report("Failed to load reference data"); return FALSE; } refs_open_visitor(view, refs_all); foreach_ref(refs_open_visitor, view); watch_register(&view->watch, WATCH_HEAD | WATCH_REFS); return TRUE; } static void refs_select(struct view *view, struct line *line) { struct reference *reference = line->data; if (refs_is_all(reference)) { string_copy(view->ref, REFS_ALL_NAME); return; } string_copy_rev(view->ref, reference->ref->id); string_copy_rev(view->env->head, reference->ref->id); string_copy_rev(view->env->ref, reference->ref->name); ref_update_env(view->env, reference->ref, TRUE); } static struct view_ops refs_ops = { "reference", argv_env.head, VIEW_REFRESH | VIEW_SORTABLE, 0, refs_open, refs_read, view_column_draw, refs_request, view_column_grep, refs_select, NULL, view_column_bit(AUTHOR) | view_column_bit(COMMIT_TITLE) | view_column_bit(DATE) | view_column_bit(ID) | view_column_bit(LINE_NUMBER) | view_column_bit(REF), refs_get_column_data, }; DEFINE_VIEW(refs); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/repo.c000066400000000000000000000101441233303337700142020ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/repo.h" #include "tig/io.h" #include "tig/refdb.h" #include "tig/git.h" #define REPO_INFO_GIT_DIR "--git-dir" #define REPO_INFO_WORK_TREE "--is-inside-work-tree" #define REPO_INFO_SHOW_CDUP "--show-cdup" #define REPO_INFO_SHOW_PREFIX "--show-prefix" #define REPO_INFO_SYMBOLIC_HEAD "--symbolic-full-name" #define REPO_INFO_RESOLVED_HEAD "HEAD" struct repo_info_state { const char **argv; char head_id[SIZEOF_REV]; }; static int read_repo_info(char *name, size_t namelen, char *value, size_t valuelen, void *data) { struct repo_info_state *state = data; const char *arg = *state->argv ? *state->argv++ : ""; if (!strcmp(arg, REPO_INFO_GIT_DIR)) { string_ncopy(repo.git_dir, name, namelen); } else if (!strcmp(arg, REPO_INFO_WORK_TREE)) { /* This can be 3 different values depending on the * version of git being used. If git-rev-parse does not * understand --is-inside-work-tree it will simply echo * the option else either "true" or "false" is printed. * Default to true for the unknown case. */ repo.is_inside_work_tree = strcmp(name, "false") ? TRUE : FALSE; } else if (!strcmp(arg, REPO_INFO_SHOW_CDUP)) { string_ncopy(repo.cdup, name, namelen); } else if (!strcmp(arg, REPO_INFO_SHOW_PREFIX)) { /* Some versions of Git does not emit anything for --show-prefix * when the user is in the repository root directory. Try to detect * this special case by looking at the emitted value. If it looks * like a commit ID and there's no cdup path assume that no value * was emitted. */ if (!*repo.cdup && namelen == 40 && iscommit(name)) return read_repo_info(name, namelen, value, valuelen, data); string_ncopy(repo.prefix, name, namelen); } else if (!strcmp(arg, REPO_INFO_RESOLVED_HEAD)) { string_ncopy(state->head_id, name, namelen); } else if (!strcmp(arg, REPO_INFO_SYMBOLIC_HEAD)) { if (!prefixcmp(name, "refs/heads/")) { char *offset = name + STRING_SIZE("refs/heads/"); string_ncopy(repo.head, offset, strlen(offset) + 1); add_ref(state->head_id, name, repo.remote, repo.head); } state->argv++; } return OK; } int load_repo_info(void) { const char *rev_parse_argv[] = { "git", "rev-parse", REPO_INFO_GIT_DIR, REPO_INFO_WORK_TREE, REPO_INFO_SHOW_CDUP, REPO_INFO_SHOW_PREFIX, \ REPO_INFO_RESOLVED_HEAD, REPO_INFO_SYMBOLIC_HEAD, "HEAD", NULL }; struct repo_info_state state = { rev_parse_argv + 2 }; return io_run_load(rev_parse_argv, "=", read_repo_info, &state); } struct repo_info repo; /* * Git index utils. */ bool update_index(void) { const char *update_index_argv[] = { "git", "update-index", "-q", "--unmerged", "--refresh", NULL }; return io_run_bg(update_index_argv); } bool index_diff(struct index_diff *diff, bool untracked, bool count_all) { const char *untracked_arg = !untracked ? "--untracked-files=no" : count_all ? "--untracked-files=all" : "--untracked-files=normal"; const char *status_argv[] = { "git", "status", "--porcelain", "-z", untracked_arg, NULL }; struct io io; struct buffer buf; bool ok = TRUE; memset(diff, 0, sizeof(*diff)); if (!io_run(&io, IO_RD, repo.cdup, NULL, status_argv)) return FALSE; while (io_get(&io, &buf, 0, TRUE) && (ok = buf.size > 3)) { if (buf.data[0] == '?') diff->untracked++; else if (buf.data[0] != ' ') diff->staged++; if (buf.data[1] != ' ') diff->unstaged++; if (!count_all && diff->staged && diff->unstaged && (!untracked || diff->untracked)) break; } if (io_error(&io)) ok = FALSE; io_done(&io); return ok; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/request.c000066400000000000000000000032401233303337700147240ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/types.h" #include "tig/request.h" static const struct request_info req_info[] = { #define REQ_GROUP(help) { 0, NULL, 0, (help) }, #define REQ_(req, help) { REQ_##req, (#req), STRING_SIZE(#req), (help) } REQ_INFO #undef REQ_GROUP #undef REQ_ }; enum request get_request(const char *name) { int namelen = strlen(name); int i; for (i = 0; i < ARRAY_SIZE(req_info); i++) if (enum_equals(req_info[i], name, namelen)) return req_info[i].request; return REQ_UNKNOWN; } const char * get_request_name(enum request request) { int i; for (i = 0; i < ARRAY_SIZE(req_info); i++) if (req_info[i].request == request) return enum_name(req_info[i].name); return "run request"; } bool foreach_request(bool (*visitor)(void *data, const struct request_info *req_info, const char *group), void *data) { const char *group = NULL; int i; for (i = 0; i < ARRAY_SIZE(req_info); i++) { if (!req_info[i].request) { group = req_info[i].help; continue; } if (!visitor(data, &req_info[i], group)) return FALSE; } return TRUE; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/stage.c000066400000000000000000000332641233303337700143500ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/repo.h" #include "tig/argv.h" #include "tig/options.h" #include "tig/parse.h" #include "tig/display.h" #include "tig/prompt.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/git.h" #include "tig/pager.h" #include "tig/diff.h" #include "tig/status.h" #include "tig/stage.h" static struct status stage_status; static enum line_type stage_line_type; void open_stage_view(struct view *prev, struct status *status, enum line_type type, enum open_flags flags) { if (type) { stage_line_type = type; if (status) stage_status = *status; else memset(&stage_status, 0, sizeof(stage_status)); } open_view(prev, &stage_view, flags); } struct stage_state { struct diff_state diff; }; static inline bool stage_diff_done(struct line *line, struct line *end) { return line >= end || line->type == LINE_DIFF_CHUNK || line->type == LINE_DIFF_HEADER; } static bool stage_diff_write(struct io *io, struct line *line, struct line *end) { while (line < end) { if (!io_write(io, line->data, strlen(line->data)) || !io_write(io, "\n", 1)) return FALSE; line++; if (stage_diff_done(line, end)) break; } return TRUE; } static bool stage_diff_single_write(struct io *io, bool staged, struct line *line, struct line *single, struct line *end) { enum line_type write_as_normal = staged ? LINE_DIFF_ADD : LINE_DIFF_DEL; enum line_type ignore = staged ? LINE_DIFF_DEL : LINE_DIFF_ADD; while (line < end) { const char *prefix = ""; const char *data = line->data; if (line == single) { /* Write the complete line. */ } else if (line->type == write_as_normal) { prefix = " "; data = data + 1; } else if (line->type == ignore) { data = NULL; } if (data && !io_printf(io, "%s%s\n", prefix, data)) return FALSE; line++; if (stage_diff_done(line, end)) break; } return TRUE; } static bool stage_apply_line(struct io *io, struct line *diff_hdr, struct line *chunk, struct line *single, struct line *end) { struct chunk_header header; bool staged = stage_line_type == LINE_STAT_STAGED; int diff = single->type == LINE_DIFF_DEL ? -1 : 1; if (!parse_chunk_header(&header, chunk->data)) return FALSE; if (staged) header.old.lines = header.new.lines - diff; else header.new.lines = header.old.lines + diff; return stage_diff_write(io, diff_hdr, chunk) && io_printf(io, "@@ -%lu,%lu +%lu,%lu @@\n", header.old.position, header.old.lines, header.new.position, header.new.lines) && stage_diff_single_write(io, staged, chunk + 1, single, end); } static bool stage_apply_chunk(struct view *view, struct line *chunk, struct line *single, bool revert) { const char *apply_argv[SIZEOF_ARG] = { "git", "apply", "--whitespace=nowarn", NULL }; struct line *diff_hdr; struct io io; int argc = 3; diff_hdr = find_prev_line_by_type(view, chunk, LINE_DIFF_HEADER); if (!diff_hdr) return FALSE; if (!revert) apply_argv[argc++] = "--cached"; if (revert || stage_line_type == LINE_STAT_STAGED) apply_argv[argc++] = "-R"; apply_argv[argc++] = "-"; apply_argv[argc++] = NULL; if (!io_run(&io, IO_WR, repo.cdup, opt_env, apply_argv)) return FALSE; if (single != NULL) { if (!stage_apply_line(&io, diff_hdr, chunk, single, view->line + view->lines)) chunk = NULL; } else { if (!stage_diff_write(&io, diff_hdr, chunk) || !stage_diff_write(&io, chunk, view->line + view->lines)) chunk = NULL; } io_done(&io); return chunk ? TRUE : FALSE; } static bool stage_update_files(struct view *view, enum line_type type) { struct line *line; if (view->parent != &status_view) { bool updated = FALSE; for (line = view->line; (line = find_next_line_by_type(view, line, LINE_DIFF_CHUNK)); line++) { if (!stage_apply_chunk(view, line, NULL, FALSE)) { report("Failed to apply chunk"); return FALSE; } updated = TRUE; } return updated; } view = view->parent; line = find_next_line_by_type(view, view->line, type); return line && status_update_files(view, line + 1); } static bool stage_update(struct view *view, struct line *line, bool single) { struct line *chunk = NULL; if (!is_initial_commit() && stage_line_type != LINE_STAT_UNTRACKED) chunk = find_prev_line_by_type(view, line, LINE_DIFF_CHUNK); if (chunk) { if (!stage_apply_chunk(view, chunk, single ? line : NULL, FALSE)) { report("Failed to apply chunk"); return FALSE; } } else if (!stage_status.status) { if (!stage_update_files(view, stage_line_type)) { report("Failed to update files"); return FALSE; } } else if (!status_update_file(&stage_status, stage_line_type)) { report("Failed to update file"); return FALSE; } return TRUE; } static bool stage_revert(struct view *view, struct line *line) { struct line *chunk = NULL; if (!is_initial_commit() && stage_line_type == LINE_STAT_UNSTAGED) chunk = find_prev_line_by_type(view, line, LINE_DIFF_CHUNK); if (chunk) { if (!prompt_yesno("Are you sure you want to revert changes?")) return FALSE; if (!stage_apply_chunk(view, chunk, NULL, TRUE)) { report("Failed to revert chunk"); return FALSE; } return TRUE; } else { return status_revert(stage_status.status ? &stage_status : NULL, stage_line_type, FALSE); } } static struct line * stage_insert_chunk(struct view *view, struct chunk_header *header, struct line *from, struct line *to, struct line *last_unchanged_line) { char buf[SIZEOF_STR]; char *chunk_line; unsigned long from_lineno = last_unchanged_line - view->line; unsigned long to_lineno = to - view->line; unsigned long after_lineno = to_lineno; if (!string_format(buf, "@@ -%lu,%lu +%lu,%lu @@", header->old.position, header->old.lines, header->new.position, header->new.lines)) return NULL; chunk_line = strdup(buf); if (!chunk_line) return NULL; free(from->data); from->data = chunk_line; if (!to) return from; if (!add_line_at(view, after_lineno++, buf, LINE_DIFF_CHUNK, strlen(buf) + 1, FALSE)) return NULL; while (from_lineno < to_lineno) { struct line *line = &view->line[from_lineno++]; if (!add_line_at(view, after_lineno++, line->data, line->type, strlen(line->data) + 1, FALSE)) return FALSE; } return view->line + after_lineno; } static void stage_split_chunk(struct view *view, struct line *chunk_start) { struct chunk_header header; struct line *last_changed_line = NULL, *last_unchanged_line = NULL, *pos; int chunks = 0; if (!chunk_start || !parse_chunk_header(&header, chunk_start->data)) { report("Failed to parse chunk header"); return; } header.old.lines = header.new.lines = 0; for (pos = chunk_start + 1; view_has_line(view, pos); pos++) { const char *chunk_line = pos->data; if (*chunk_line == '@' || *chunk_line == '\\') break; if (*chunk_line == ' ') { header.old.lines++; header.new.lines++; if (last_unchanged_line < last_changed_line) last_unchanged_line = pos; continue; } if (last_changed_line && last_changed_line < last_unchanged_line) { unsigned long chunk_start_lineno = pos - view->line; unsigned long diff = pos - last_unchanged_line; pos = stage_insert_chunk(view, &header, chunk_start, pos, last_unchanged_line); header.old.position += header.old.lines - diff; header.new.position += header.new.lines - diff; header.old.lines = header.new.lines = diff; chunk_start = view->line + chunk_start_lineno; last_changed_line = last_unchanged_line = NULL; chunks++; } if (*chunk_line == '-') { header.old.lines++; last_changed_line = pos; } else if (*chunk_line == '+') { header.new.lines++; last_changed_line = pos; } } if (chunks) { stage_insert_chunk(view, &header, chunk_start, NULL, NULL); redraw_view(view); report("Split the chunk in %d", chunks + 1); } else { report("The chunk cannot be split"); } } static bool stage_exists(struct view *view, struct status *status, enum line_type type) { struct view *parent = view->parent; struct line *line; if (parent == &status_view) return status_exists(parent, status, type); line = find_next_line_by_type(parent, parent->line, type); if (line) select_view_line(parent, line - parent->line); return line != NULL; } static enum request stage_request(struct view *view, enum request request, struct line *line) { switch (request) { case REQ_STATUS_UPDATE: if (!stage_update(view, line, FALSE)) return REQ_NONE; break; case REQ_STATUS_REVERT: if (!stage_revert(view, line)) return REQ_NONE; break; case REQ_STAGE_UPDATE_LINE: if (stage_line_type == LINE_STAT_UNTRACKED || stage_status.status == 'A') { report("Staging single lines is not supported for new files"); return REQ_NONE; } if (line->type != LINE_DIFF_DEL && line->type != LINE_DIFF_ADD) { report("Please select a change to stage"); return REQ_NONE; } if (!stage_update(view, line, TRUE)) return REQ_NONE; break; case REQ_STAGE_SPLIT_CHUNK: if (stage_line_type == LINE_STAT_UNTRACKED || !(line = find_prev_line_by_type(view, line, LINE_DIFF_CHUNK))) { report("No chunks to split in sight"); return REQ_NONE; } stage_split_chunk(view, line); return REQ_NONE; case REQ_EDIT: if (!stage_status.new.name[0]) return diff_common_edit(view, request, line); if (stage_status.status == 'D') { report("File has been deleted."); return REQ_NONE; } if (stage_line_type == LINE_STAT_UNTRACKED) { open_editor(stage_status.new.name, (line - view->line) + 1); } else { open_editor(stage_status.new.name, diff_get_lineno(view, line)); } break; case REQ_REFRESH: /* Reload everything(including current branch information) ... */ load_refs(TRUE); break; case REQ_VIEW_BLAME: if (stage_line_type == LINE_STAT_UNTRACKED) { report("Nothing to blame here"); return REQ_NONE; } if (stage_status.new.name[0]) { string_copy(view->env->file, stage_status.new.name); } else { const char *file = diff_get_pathname(view, line); if (file) string_ncopy(view->env->file, file, strlen(file)); } view->env->ref[0] = 0; view->env->lineno = diff_get_lineno(view, line); if (view->env->lineno > 0) view->env->lineno--; return request; case REQ_ENTER: return diff_common_enter(view, request, line); default: return request; } refresh_view(view->parent); /* Check whether the staged entry still exists, and close the * stage view if it doesn't. */ if (!stage_exists(view, &stage_status, stage_line_type)) return REQ_VIEW_CLOSE; refresh_view(view); return REQ_NONE; } static bool stage_open(struct view *view, enum open_flags flags) { const char *no_head_diff_argv[] = { GIT_DIFF_STAGED_INITIAL(encoding_arg, diff_context_arg(), ignore_space_arg(), stage_status.new.name) }; const char *index_show_argv[] = { GIT_DIFF_STAGED(encoding_arg, diff_context_arg(), ignore_space_arg(), stage_status.old.name, stage_status.new.name) }; const char *files_show_argv[] = { GIT_DIFF_UNSTAGED(encoding_arg, diff_context_arg(), ignore_space_arg(), stage_status.old.name, stage_status.new.name) }; /* Diffs for unmerged entries are empty when passing the new * 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(), "--", stage_status.old.name, NULL }; static const char *file_argv[] = { repo.cdup, stage_status.new.name, NULL }; const char **argv = NULL; 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; } view->encoding = NULL; switch (stage_line_type) { case LINE_STAT_STAGED: watch_register(&view->watch, WATCH_INDEX_STAGED); if (is_initial_commit()) { argv = no_head_diff_argv; } else { argv = index_show_argv; } break; case LINE_STAT_UNSTAGED: watch_register(&view->watch, WATCH_INDEX_UNSTAGED); if (stage_status.status != 'U') argv = files_show_argv; else argv = files_unmerged_argv; break; case LINE_STAT_UNTRACKED: argv = file_argv; view->encoding = get_path_encoding(stage_status.old.name, default_encoding); break; default: 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; } view->vid[0] = 0; view->dir = repo.cdup; return begin_update(view, NULL, NULL, flags); } static bool stage_read(struct view *view, struct buffer *buf) { struct stage_state *state = view->private; if (stage_line_type == LINE_STAT_UNTRACKED) return pager_common_read(view, buf ? buf->data : NULL, LINE_DEFAULT, NULL); if (!buf && !view->lines && view->parent) { maximize_view(view->parent, TRUE); return TRUE; } if (buf && diff_common_read(view, buf->data, &state->diff)) return TRUE; return pager_read(view, buf); } static struct view_ops stage_ops = { "line", argv_env.status, VIEW_DIFF_LIKE | VIEW_REFRESH, sizeof(struct stage_state), stage_open, stage_read, view_column_draw, stage_request, view_column_grep, pager_select, NULL, view_column_bit(LINE_NUMBER) | view_column_bit(TEXT), pager_get_column_data, }; DEFINE_VIEW(stage); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/stash.c000066400000000000000000000031651233303337700143640ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/draw.h" #include "tig/main.h" static bool stash_open(struct view *view, enum open_flags flags) { static const char *stash_argv[] = { "git", "stash", "list", encoding_arg, "--no-color", "--pretty=raw", NULL }; struct main_state *state = view->private; state->with_graph = FALSE; watch_register(&view->watch, WATCH_STASH); return begin_update(view, NULL, stash_argv, flags | OPEN_RELOAD); } static void stash_select(struct view *view, struct line *line) { main_select(view, line); string_format(view->env->stash, "stash@{%d}", line->lineno - 1); string_copy(view->ref, view->env->stash); } static struct view_ops stash_ops = { "stash", argv_env.stash, VIEW_SEND_CHILD_ENTER | VIEW_REFRESH, sizeof(struct main_state), stash_open, main_read, view_column_draw, main_request, view_column_grep, stash_select, main_done, view_column_bit(AUTHOR) | view_column_bit(COMMIT_TITLE) | view_column_bit(DATE) | view_column_bit(ID) | view_column_bit(LINE_NUMBER), main_get_column_data, }; DEFINE_VIEW(stash); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/status.c000066400000000000000000000427411233303337700145700ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/io.h" #include "tig/refdb.h" #include "tig/repo.h" #include "tig/options.h" #include "tig/parse.h" #include "tig/display.h" #include "tig/prompt.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/git.h" #include "tig/watch.h" #include "tig/status.h" #include "tig/stage.h" /* * Status backend */ static char status_onbranch[SIZEOF_STR]; /* This should work even for the "On branch" line. */ static inline bool status_has_none(struct view *view, struct line *line) { return view_has_line(view, line) && !line[1].data; } /* Get fields from the diff line: * :100644 100644 06a5d6ae9eca55be2e0e585a152e6b1336f2b20e 0000000000000000000000000000000000000000 M */ static inline bool status_get_diff(struct status *file, const char *buf, size_t bufsize) { const char *old_mode = buf + 1; const char *new_mode = buf + 8; const char *old_rev = buf + 15; const char *new_rev = buf + 56; const char *status = buf + 97; if (bufsize < 98 || old_mode[-1] != ':' || new_mode[-1] != ' ' || old_rev[-1] != ' ' || new_rev[-1] != ' ' || status[-1] != ' ') return FALSE; file->status = *status; string_copy_rev(file->old.rev, old_rev); string_copy_rev(file->new.rev, new_rev); file->old.mode = strtoul(old_mode, NULL, 8); file->new.mode = strtoul(new_mode, NULL, 8); file->old.name[0] = file->new.name[0] = 0; return TRUE; } static bool status_run(struct view *view, const char *argv[], char status, enum line_type type) { struct status *unmerged = NULL; struct buffer buf; struct io io; if (!io_run(&io, IO_RD, repo.cdup, opt_env, argv)) return FALSE; add_line_nodata(view, type); while (io_get(&io, &buf, 0, TRUE)) { struct line *line; struct status parsed = {}; struct status *file = &parsed; /* Parse diff info part. */ if (status) { file->status = status; if (status == 'A') string_copy(file->old.rev, NULL_ID); } else { if (!status_get_diff(&parsed, buf.data, buf.size)) goto error_out; if (!io_get(&io, &buf, 0, TRUE)) break; } /* Grab the old name for rename/copy. */ if (!*file->old.name && (file->status == 'R' || file->status == 'C')) { string_ncopy(file->old.name, buf.data, buf.size); if (!io_get(&io, &buf, 0, TRUE)) break; } /* git-ls-files just delivers a NUL separated list of * file names similar to the second half of the * git-diff-* output. */ string_ncopy(file->new.name, buf.data, buf.size); if (!*file->old.name) string_copy(file->old.name, file->new.name); /* Collapse all modified entries that follow an associated * unmerged entry. */ if (unmerged && !strcmp(unmerged->new.name, file->new.name)) { unmerged->status = 'U'; unmerged = NULL; continue; } line = add_line_alloc(view, &file, type, 0, FALSE); if (!line) goto error_out; *file = parsed; view_column_info_update(view, line); if (file->status == 'U') unmerged = file; } if (io_error(&io)) { error_out: io_done(&io); return FALSE; } if (!view->line[view->lines - 1].data) { add_line_nodata(view, LINE_STAT_NONE); if (type == LINE_STAT_STAGED) watch_apply(&view->watch, WATCH_INDEX_STAGED_NO); else if (type == LINE_STAT_UNSTAGED) watch_apply(&view->watch, WATCH_INDEX_UNSTAGED_NO); } else { if (type == LINE_STAT_STAGED) watch_apply(&view->watch, WATCH_INDEX_STAGED_YES); else if (type == LINE_STAT_UNSTAGED) watch_apply(&view->watch, WATCH_INDEX_UNSTAGED_YES); } io_done(&io); return TRUE; } static const char *status_diff_index_argv[] = { GIT_DIFF_STAGED_FILES("-z") }; static const char *status_diff_files_argv[] = { GIT_DIFF_UNSTAGED_FILES("-z") }; static const char *status_list_other_argv[] = { "git", "ls-files", "-z", "--others", "--exclude-standard", repo.prefix, NULL, NULL, NULL }; static const char *status_list_no_head_argv[] = { "git", "ls-files", "-z", "--cached", "--exclude-standard", NULL }; /* Restore the previous line number to stay in the context or select a * line with something that can be updated. */ static void status_restore(struct view *view) { if (!check_position(&view->prev_pos)) return; if (view->prev_pos.lineno >= view->lines) view->prev_pos.lineno = view->lines - 1; while (view->prev_pos.lineno < view->lines && !view->line[view->prev_pos.lineno].data) view->prev_pos.lineno++; while (view->prev_pos.lineno > 0 && !view->line[view->prev_pos.lineno].data) view->prev_pos.lineno--; /* If the above fails, always skip the "On branch" line. */ if (view->prev_pos.lineno < view->lines) view->pos.lineno = view->prev_pos.lineno; else view->pos.lineno = 1; if (view->prev_pos.offset > view->pos.lineno) view->pos.offset = view->pos.lineno; else if (view->prev_pos.offset < view->lines) view->pos.offset = view->prev_pos.offset; clear_position(&view->prev_pos); } static void status_update_onbranch(void) { static const char *paths[][2] = { { "rebase-apply/rebasing", "Rebasing" }, { "rebase-apply/applying", "Applying mailbox" }, { "rebase-apply/", "Rebasing mailbox" }, { "rebase-merge/interactive", "Interactive rebase" }, { "rebase-merge/", "Rebase merge" }, { "MERGE_HEAD", "Merging" }, { "BISECT_LOG", "Bisecting" }, { "HEAD", "On branch" }, }; char buf[SIZEOF_STR]; struct stat stat; int i; if (is_initial_commit()) { string_copy(status_onbranch, "Initial commit"); return; } for (i = 0; i < ARRAY_SIZE(paths); i++) { char *head = repo.head; if (!string_format(buf, "%s/%s", repo.git_dir, paths[i][0]) || lstat(buf, &stat) < 0) continue; if (!*repo.head) { struct io io; if (io_open(&io, "%s/rebase-merge/head-name", repo.git_dir) && io_read_buf(&io, buf, sizeof(buf))) { head = buf; if (!prefixcmp(head, "refs/heads/")) head += STRING_SIZE("refs/heads/"); } } if (!string_format(status_onbranch, "%s %s", paths[i][1], head)) string_copy(status_onbranch, repo.head); return; } string_copy(status_onbranch, "Not currently on any branch"); } /* 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 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; } reset_view(view); /* FIXME: Watch untracked files and on-branch info. */ watch_register(&view->watch, WATCH_INDEX); add_line_nodata(view, LINE_HEADER); status_update_onbranch(); 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; } /* Restore the exact position or use the specialized restore * mode? */ status_restore(view); return TRUE; } static bool status_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { struct status *status = line->data; if (!status) { static struct view_column group_column; const char *text; enum line_type type; column_data->section = &group_column; column_data->section->type = VIEW_COLUMN_SECTION; switch (line->type) { case LINE_STAT_STAGED: type = LINE_SECTION; text = "Changes to be committed:"; break; case LINE_STAT_UNSTAGED: type = LINE_SECTION; text = "Changed but not updated:"; break; case LINE_STAT_UNTRACKED: type = LINE_SECTION; text = "Untracked files:"; break; case LINE_STAT_NONE: type = LINE_DEFAULT; text = " (no files)"; break; case LINE_HEADER: type = LINE_HEADER; text = status_onbranch; break; default: return FALSE; } column_data->section->opt.section.text = text; column_data->section->opt.section.type = type; } else { column_data->status = &status->status; column_data->file_name = status->new.name; } return TRUE; } static enum request status_enter(struct view *view, struct line *line) { struct status *status = line->data; enum open_flags flags = view_is_displayed(view) ? OPEN_SPLIT : OPEN_DEFAULT; if (line->type == LINE_STAT_NONE || (!status && line[1].type == LINE_STAT_NONE)) { report("No file to diff"); return REQ_NONE; } switch (line->type) { case LINE_STAT_STAGED: case LINE_STAT_UNSTAGED: break; case LINE_STAT_UNTRACKED: if (!status) { report("No file to show"); return REQ_NONE; } if (!suffixcmp(status->new.name, -1, "/")) { report("Cannot display a directory"); return REQ_NONE; } break; default: report("Nothing to enter"); return REQ_NONE; } open_stage_view(view, status, line->type, flags); return REQ_NONE; } bool status_exists(struct view *view, struct status *status, enum line_type type) { unsigned long lineno; for (lineno = 0; lineno < view->lines; lineno++) { struct line *line = &view->line[lineno]; struct status *pos = line->data; if (line->type != type) continue; if ((!pos && (!status || !status->status) && line[1].data) || (pos && !strcmp(status->new.name, pos->new.name))) { select_view_line(view, lineno); status_restore(view); return TRUE; } } return FALSE; } static bool status_update_prepare(struct io *io, enum line_type type) { const char *staged_argv[] = { "git", "update-index", "-z", "--index-info", NULL }; const char *others_argv[] = { "git", "update-index", "-z", "--add", "--remove", "--stdin", NULL }; switch (type) { case LINE_STAT_STAGED: return io_run(io, IO_WR, repo.cdup, opt_env, staged_argv); case LINE_STAT_UNSTAGED: case LINE_STAT_UNTRACKED: return io_run(io, IO_WR, repo.cdup, opt_env, others_argv); default: die("line type %d not handled in switch", type); return FALSE; } } static bool status_update_write(struct io *io, struct status *status, enum line_type type) { switch (type) { case LINE_STAT_STAGED: return io_printf(io, "%06o %s\t%s%c", status->old.mode, status->old.rev, status->old.name, 0); case LINE_STAT_UNSTAGED: case LINE_STAT_UNTRACKED: return io_printf(io, "%s%c", status->new.name, 0); default: die("line type %d not handled in switch", type); return FALSE; } } bool status_update_file(struct status *status, enum line_type type) { const char *name = status->new.name; struct io io; bool result; if (type == LINE_STAT_UNTRACKED && !suffixcmp(name, strlen(name), "/")) { const char *add_argv[] = { "git", "add", "--", name, NULL }; return io_run_bg(add_argv); } if (!status_update_prepare(&io, type)) return FALSE; result = status_update_write(&io, status, type); return io_done(&io) && result; } bool status_update_files(struct view *view, struct line *line) { char buf[sizeof(view->ref)]; struct io io; bool result = TRUE; struct line *pos; int files = 0; int file, done; int cursor_y = -1, cursor_x = -1; if (!status_update_prepare(&io, line->type)) return FALSE; for (pos = line; view_has_line(view, pos) && pos->data; pos++) files++; string_copy(buf, view->ref); getsyx(cursor_y, cursor_x); for (file = 0, done = 5; result && file < files; line++, file++) { int almost_done = file * 100 / files; if (almost_done > done) { done = almost_done; string_format(view->ref, "updating file %u of %u (%d%% done)", file, files, done); update_view_title(view); setsyx(cursor_y, cursor_x); doupdate(); } result = status_update_write(&io, line->data, line->type); } string_copy(view->ref, buf); return io_done(&io) && result; } static bool status_update(struct view *view) { struct line *line = &view->line[view->pos.lineno]; assert(view->lines); if (!line->data) { if (status_has_none(view, line)) { report("Nothing to update"); return FALSE; } if (!status_update_files(view, line + 1)) { report("Failed to update file status"); return FALSE; } } else if (!status_update_file(line->data, line->type)) { report("Failed to update file status"); return FALSE; } return TRUE; } bool status_revert(struct status *status, enum line_type type, bool has_none) { if (!status || type != LINE_STAT_UNSTAGED) { if (type == LINE_STAT_STAGED) { report("Cannot revert changes to staged files"); } else if (type == LINE_STAT_UNTRACKED) { report("Cannot revert changes to untracked files"); } else if (has_none) { report("Nothing to revert"); } else { report("Cannot revert changes to multiple files"); } } else if (prompt_yesno("Are you sure you want to revert changes?")) { char mode[10] = "100644"; const char *reset_argv[] = { "git", "update-index", "--cacheinfo", mode, status->old.rev, status->old.name, NULL }; const char *checkout_argv[] = { "git", "checkout", "--", status->old.name, NULL }; if (status->status == 'U') { string_format(mode, "%5o", status->old.mode); if (status->old.mode == 0 && status->new.mode == 0) { reset_argv[2] = "--force-remove"; reset_argv[3] = status->old.name; reset_argv[4] = NULL; } if (!io_run_fg(reset_argv, repo.cdup)) return FALSE; if (status->old.mode == 0 && status->new.mode == 0) return TRUE; } return io_run_fg(checkout_argv, repo.cdup); } return FALSE; } static void open_mergetool(const char *file) { const char *mergetool_argv[] = { "git", "mergetool", file, NULL }; open_external_viewer(mergetool_argv, repo.cdup, TRUE, TRUE, ""); } static enum request status_request(struct view *view, enum request request, struct line *line) { struct status *status = line->data; switch (request) { case REQ_STATUS_UPDATE: if (!status_update(view)) return REQ_NONE; break; case REQ_STATUS_REVERT: if (!status_revert(status, line->type, status_has_none(view, line))) return REQ_NONE; break; case REQ_STATUS_MERGE: if (!status || status->status != 'U') { report("Merging only possible for files with unmerged status ('U')."); return REQ_NONE; } open_mergetool(status->new.name); break; case REQ_EDIT: if (!status) return request; if (status->status == 'D') { report("File has been deleted."); return REQ_NONE; } open_editor(status->new.name, 0); break; case REQ_VIEW_BLAME: if (line->type == LINE_STAT_UNTRACKED || !status) { report("Nothing to blame here"); return REQ_NONE; } if (status) view->env->ref[0] = 0; return request; case REQ_ENTER: /* After returning the status view has been split to * show the stage view. No further reloading is * necessary. */ return status_enter(view, line); case REQ_REFRESH: /* Load the current branch information and then the view. */ load_refs(TRUE); break; default: return request; } refresh_view(view); return REQ_NONE; } bool status_stage_info_(char *buf, size_t bufsize, enum line_type type, struct status *status) { const char *file = status ? status->new.name : ""; const char *info; switch (type) { case LINE_STAT_STAGED: if (status && status->status) info = "Staged changes to %s"; else info = "Staged changes"; break; case LINE_STAT_UNSTAGED: if (status && status->status) info = "Unstaged changes to %s"; else info = "Unstaged changes"; break; case LINE_STAT_UNTRACKED: info = "Untracked file %s"; break; case LINE_HEADER: default: info = ""; } return string_nformat(buf, bufsize, NULL, info, file); } static void status_select(struct view *view, struct line *line) { struct status *status = line->data; char file[SIZEOF_STR] = "all files"; const char *text; const char *key; if (status && !string_format(file, "'%s'", status->new.name)) return; if (!status && line[1].type == LINE_STAT_NONE) line++; switch (line->type) { case LINE_STAT_STAGED: text = "Press %s to unstage %s for commit"; break; case LINE_STAT_UNSTAGED: text = "Press %s to stage %s for commit"; break; case LINE_STAT_UNTRACKED: text = "Press %s to stage %s for addition"; break; default: text = "Nothing to update"; } if (status && status->status == 'U') { text = "Press %s to resolve conflict in %s"; key = get_view_key(view, REQ_STATUS_MERGE); } else { key = get_view_key(view, REQ_STATUS_UPDATE); } string_format(view->ref, text, key, file); status_stage_info(view->env->status, line->type, status); if (status) string_copy(view->env->file, status->new.name); } static struct view_ops status_ops = { "file", "", VIEW_CUSTOM_STATUS | VIEW_SEND_CHILD_ENTER | VIEW_STATUS_LIKE | VIEW_REFRESH, 0, status_open, NULL, view_column_draw, status_request, view_column_grep, status_select, NULL, view_column_bit(FILE_NAME) | view_column_bit(LINE_NUMBER) | view_column_bit(STATUS), status_get_column_data, }; DEFINE_VIEW(status); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/string.c000066400000000000000000000207601233303337700145500ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/string.h" /* * Strings. */ bool string_isnumber(const char *str) { int pos; for (pos = 0; str[pos]; pos++) { if (!isdigit(str[pos])) return FALSE; } return pos > 0; } bool iscommit(const char *str) { int pos; for (pos = 0; str[pos]; pos++) { if (!isxdigit(str[pos])) return FALSE; } return 7 <= pos && pos < SIZEOF_REV; } int suffixcmp(const char *str, int slen, const char *suffix) { size_t len = slen >= 0 ? slen : strlen(str); size_t suffixlen = strlen(suffix); return suffixlen < len ? strcmp(str + len - suffixlen, suffix) : -1; } void string_ncopy_do(char *dst, size_t dstlen, const char *src, size_t srclen) { if (srclen > dstlen - 1) srclen = dstlen - 1; strncpy(dst, src, srclen); dst[srclen] = 0; } void string_copy_rev(char *dst, const char *src) { size_t srclen; if (!*src) return; for (srclen = 0; srclen < SIZEOF_REV; srclen++) if (isspace(src[srclen])) break; string_ncopy_do(dst, SIZEOF_REV, src, srclen); } void string_copy_rev_from_commit_line(char *dst, const char *src) { string_copy_rev(dst, src + STRING_SIZE("commit ")); } size_t string_expanded_length(const char *src, size_t srclen, size_t tabsize, size_t max_size) { size_t size, pos; for (size = pos = 0; pos < srclen && size < max_size; pos++) { if (src[pos] == '\t') { size_t expanded = tabsize - (size % tabsize); size += expanded; } else { size++; } } return pos; } size_t string_expand(char *dst, size_t dstlen, const char *src, int tabsize) { size_t size, pos; for (size = pos = 0; size < dstlen - 1 && src[pos]; pos++) { if (src[pos] == '\t') { size_t expanded = tabsize - (size % tabsize); if (expanded + size >= dstlen - 1) expanded = dstlen - size - 1; memcpy(dst + size, " ", expanded); size += expanded; } else { dst[size++] = src[pos]; } } dst[size] = 0; return pos; } char * chomp_string(char *name) { int namelen; while (isspace(*name)) name++; namelen = strlen(name) - 1; while (namelen > 0 && isspace(name[namelen])) name[namelen--] = 0; return name; } bool PRINTF_LIKE(4, 5) string_nformat(char *buf, size_t bufsize, size_t *bufpos, const char *fmt, ...) { size_t pos = bufpos ? *bufpos : 0; int retval; FORMAT_BUFFER(buf + pos, bufsize - pos, fmt, retval, FALSE); if (bufpos && retval > 0) *bufpos = pos + retval; return pos >= bufsize ? FALSE : TRUE; } int strcmp_null(const char *s1, const char *s2) { if (!s1 || !s2) { return (!!s1) - (!!s2); } return strcmp(s1, s2); } int strcmp_numeric(const char *s1, const char *s2) { int number = 0; int num1, num2; for (; *s1 && *s2 && *s1 == *s2; s1++, s2++) { int c = *s1; if (isdigit(c)) { number = 10 * number + (c - '0'); } else { number = 0; } } num1 = number * 10 + atoi(s1); num2 = number * 10 + atoi(s2); if (num1 != num2) return num2 - num1; if (!!*s1 != !!*s2) return !!*s2 - !!*s1; return *s1 - *s2; } /* * Unicode / UTF-8 handling * * 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. */ 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 == '\t') return tab_size; return 1; } /* Number of bytes used for encoding a UTF-8 character indexed by first byte. * Illegal bytes are set one. */ static const unsigned char utf8_bytes[256] = { 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4, 5,5,5,5,6,6,1,1, }; unsigned char utf8_char_length(const char *string) { int c = *(unsigned char *) string; return utf8_bytes[c]; } /* Decode UTF-8 multi-byte representation into a Unicode character. */ unsigned long utf8_to_unicode(const char *string, size_t length) { unsigned long unicode; switch (length) { case 1: unicode = string[0]; break; case 2: unicode = (string[0] & 0x1f) << 6; unicode += (string[1] & 0x3f); break; case 3: unicode = (string[0] & 0x0f) << 12; unicode += ((string[1] & 0x3f) << 6); unicode += (string[2] & 0x3f); break; case 4: unicode = (string[0] & 0x0f) << 18; unicode += ((string[1] & 0x3f) << 12); unicode += ((string[2] & 0x3f) << 6); unicode += (string[3] & 0x3f); break; case 5: unicode = (string[0] & 0x0f) << 24; unicode += ((string[1] & 0x3f) << 18); unicode += ((string[2] & 0x3f) << 12); unicode += ((string[3] & 0x3f) << 6); unicode += (string[4] & 0x3f); break; case 6: unicode = (string[0] & 0x01) << 30; unicode += ((string[1] & 0x3f) << 24); unicode += ((string[2] & 0x3f) << 18); unicode += ((string[3] & 0x3f) << 12); unicode += ((string[4] & 0x3f) << 6); unicode += (string[5] & 0x3f); break; default: return 0; } /* Invalid characters could return the special 0xfffd value but NUL * should be just as good. */ return unicode > 0xffff ? 0 : unicode; } /* Calculates how much of string can be shown within the given maximum width * and sets trimmed parameter to non-zero value if all of string could not be * shown. If the reserve flag is TRUE, it will reserve at least one * trailing character, which can be useful when drawing a delimiter. * * Returns the number of bytes to output from string to satisfy max_width. */ size_t utf8_length(const char **start, size_t skip, int *width, size_t max_width, int *trimmed, bool reserve, int tab_size) { const char *string = *start; const char *end = strchr(string, '\0'); unsigned char last_bytes = 0; size_t last_ucwidth = 0; *width = 0; *trimmed = 0; while (string < end) { unsigned char bytes = utf8_char_length(string); size_t ucwidth; unsigned long unicode; if (string + bytes > end) break; /* Change representation to figure out whether * it is a single- or double-width character. */ unicode = utf8_to_unicode(string, bytes); /* FIXME: Graceful handling of invalid Unicode character. */ if (!unicode) break; ucwidth = unicode_width(unicode, tab_size); if (skip > 0) { skip -= ucwidth <= skip ? ucwidth : skip; *start += bytes; } *width += ucwidth; if (max_width > 0 && *width > max_width) { *trimmed = 1; *width -= ucwidth; if (reserve && *width == max_width) { string -= last_bytes; *width -= last_ucwidth; } break; } string += bytes; if (ucwidth) { last_bytes = bytes; last_ucwidth = ucwidth; } else { last_bytes += bytes; } } return string - *start; } int utf8_width_max(const char *text, int max) { int text_width = 0; const char *tmp = text; int trimmed = FALSE; utf8_length(&tmp, 0, &text_width, max, &trimmed, FALSE, 1); return text_width; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/tig.c000066400000000000000000000402301233303337700140170ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #define WARN_MISSING_CURSES_CONFIGURATION #include "tig/tig.h" #include "tig/types.h" #include "tig/util.h" #include "tig/parse.h" #include "tig/io.h" #include "tig/argv.h" #include "tig/refdb.h" #include "tig/watch.h" #include "tig/graph.h" #include "tig/git.h" #include "tig/request.h" #include "tig/line.h" #include "tig/keys.h" #include "tig/view.h" #include "tig/repo.h" #include "tig/options.h" #include "tig/draw.h" #include "tig/display.h" #include "tig/prompt.h" /* Views. */ #include "tig/blame.h" #include "tig/blob.h" #include "tig/diff.h" #include "tig/grep.h" #include "tig/help.h" #include "tig/log.h" #include "tig/main.h" #include "tig/pager.h" #include "tig/refs.h" #include "tig/stage.h" #include "tig/stash.h" #include "tig/status.h" #include "tig/tree.h" static bool forward_request_to_child(struct view *child, enum request request) { return displayed_views() == 2 && view_is_displayed(child) && !strcmp(child->vid, child->ops->id); } static enum request view_request(struct view *view, enum request request) { if (!view || !view->lines) return request; if (request == REQ_ENTER && !opt_focus_child && view_has_flags(view, VIEW_SEND_CHILD_ENTER)) { struct view *child = display[1]; if (forward_request_to_child(child, request)) { view_request(child, request); return REQ_NONE; } } if (request == REQ_REFRESH && !view_can_refresh(view)) { report("This view can not be refreshed"); return REQ_NONE; } return view->ops->request(view, request, &view->line[view->pos.lineno]); } /* * Option management */ #define TOGGLE_MENU_INFO(_) \ _('.', "line numbers", "line-number"), \ _('D', "dates", "date"), \ _('A', "author", "author"), \ _('~', "graphics", "line-graphics"), \ _('g', "revision graph", "commit-title-graph"), \ _('#', "file names", "file-name"), \ _('*', "file sizes", "file-size"), \ _('W', "space changes", "ignore-space"), \ _('l', "commit order", "commit-order"), \ _('F', "reference display", "commit-title-refs"), \ _('C', "local change display", "show-changes"), \ _('X', "commit ID display", "id"), \ _('%', "file filtering", "file-filter"), \ _('$', "commit title overflow display", "commit-title-overflow"), \ _('d', "untracked directory info", "status-untracked-dirs"), \ _('|', "view split", "vertical-split"), \ static void toggle_option(struct view *view) { const struct menu_item menu[] = { #define DEFINE_TOGGLE_MENU(key, help, name) { key, help, name } TOGGLE_MENU_INFO(DEFINE_TOGGLE_MENU) { 0 } }; const char *toggle_argv[] = { "toggle", NULL, NULL }; int i = 0; if (!prompt_menu("Toggle option", menu, &i)) return; toggle_argv[1] = menu[i].data; run_prompt_command(view, toggle_argv); } /* * View opening */ static enum request open_run_request(struct view *view, enum request request) { struct run_request *req = get_run_request(request); const char **argv = NULL; bool confirmed = FALSE; request = REQ_NONE; if (!req) { report("Unknown run request"); return request; } if (!argv_format(view->env, &argv, req->argv, FALSE, TRUE)) { report("Failed to format arguments"); return REQ_NONE; } if (req->flags.internal) { request = run_prompt_command(view, argv); } else { confirmed = !req->flags.confirm; if (req->flags.confirm) { char cmd[SIZEOF_STR], prompt[SIZEOF_STR]; const char *and_exit = req->flags.exit ? " and exit" : ""; if (argv_to_string(argv, cmd, sizeof(cmd), " ") && string_format(prompt, "Run `%s`%s?", cmd, and_exit) && prompt_yesno(prompt)) { confirmed = TRUE; } } if (confirmed && argv_remove_quotes(argv)) { if (req->flags.silent) io_run_bg(argv); else open_external_viewer(argv, NULL, !req->flags.exit, FALSE, ""); } } if (argv) argv_free(argv); free(argv); if (request == REQ_NONE) { if (req->flags.confirm && !confirmed) request = REQ_NONE; else if (req->flags.exit) request = REQ_QUIT; else if (!req->flags.internal && watch_dirty(&view->watch)) request = REQ_REFRESH; } return request; } /* * User request switch noodle */ static int view_driver(struct view *view, enum request request) { int i; if (request == REQ_NONE) return TRUE; if (request >= REQ_RUN_REQUESTS) { request = open_run_request(view, request); // exit quickly rather than going through view_request and back if (request == REQ_QUIT) return FALSE; } request = view_request(view, request); if (request == REQ_NONE) return TRUE; switch (request) { case REQ_MOVE_UP: case REQ_MOVE_DOWN: case REQ_MOVE_PAGE_UP: case REQ_MOVE_PAGE_DOWN: case REQ_MOVE_FIRST_LINE: case REQ_MOVE_LAST_LINE: move_view(view, request); break; case REQ_SCROLL_FIRST_COL: case REQ_SCROLL_LEFT: case REQ_SCROLL_RIGHT: case REQ_SCROLL_LINE_DOWN: case REQ_SCROLL_LINE_UP: case REQ_SCROLL_PAGE_DOWN: case REQ_SCROLL_PAGE_UP: case REQ_SCROLL_WHEEL_DOWN: case REQ_SCROLL_WHEEL_UP: scroll_view(view, request); break; case REQ_VIEW_GREP: open_grep_view(view); break; case REQ_VIEW_MAIN: open_main_view(view, OPEN_DEFAULT); break; case REQ_VIEW_DIFF: open_diff_view(view, OPEN_DEFAULT); break; case REQ_VIEW_LOG: open_log_view(view, OPEN_DEFAULT); break; case REQ_VIEW_TREE: open_tree_view(view, OPEN_DEFAULT); break; case REQ_VIEW_HELP: open_help_view(view, OPEN_DEFAULT); break; case REQ_VIEW_REFS: open_refs_view(view, OPEN_DEFAULT); break; case REQ_VIEW_BLAME: open_blame_view(view, OPEN_DEFAULT); break; case REQ_VIEW_BLOB: open_blob_view(view, OPEN_DEFAULT); break; case REQ_VIEW_STATUS: open_status_view(view, OPEN_DEFAULT); break; case REQ_VIEW_STAGE: open_stage_view(view, NULL, 0, OPEN_DEFAULT); break; case REQ_VIEW_PAGER: open_pager_view(view, OPEN_DEFAULT); break; case REQ_VIEW_STASH: open_stash_view(view, OPEN_DEFAULT); break; case REQ_NEXT: case REQ_PREVIOUS: if (view->parent) { int line; view = view->parent; line = view->pos.lineno; view_request(view, request); move_view(view, request); if (view_is_displayed(view)) update_view_title(view); if (line != view->pos.lineno) view_request(view, REQ_ENTER); } else { move_view(view, request); } break; case REQ_VIEW_NEXT: { int nviews = displayed_views(); int next_view = (current_view + 1) % nviews; if (next_view == current_view) { report("Only one view is displayed"); break; } current_view = next_view; /* Blur out the title of the previous view. */ update_view_title(view); report_clear(); break; } case REQ_REFRESH: report("Refreshing is not supported by the %s view", view->name); break; case REQ_PARENT: report("Moving to parent is not supported by the the %s view", view->name); break; case REQ_BACK: report("Going back is not supported for by %s view", view->name); break; case REQ_MAXIMIZE: if (displayed_views() == 2) maximize_view(view, TRUE); break; case REQ_OPTIONS: toggle_option(view); break; case REQ_SEARCH: case REQ_SEARCH_BACK: search_view(view, request); break; case REQ_FIND_NEXT: case REQ_FIND_PREV: find_next(view, request); break; case REQ_STOP_LOADING: foreach_view(view, i) { if (view->pipe) report("Stopped loading the %s view", view->name), end_update(view, TRUE); } break; case REQ_SHOW_VERSION: report("tig-%s (built %s)", TIG_VERSION, __DATE__); return TRUE; case REQ_SCREEN_REDRAW: redraw_display(TRUE); break; case REQ_EDIT: report("Nothing to edit"); break; case REQ_ENTER: report("Nothing to enter"); break; case REQ_VIEW_CLOSE: /* XXX: Mark closed views by letting view->prev point to the * view itself. Parents to closed view should never be * followed. */ if (view->prev && view->prev != view) { maximize_view(view->prev, TRUE); view->prev = view; watch_unregister(&view->watch); break; } /* Fall-through */ case REQ_QUIT: return FALSE; default: report("Unknown key, press %s for help", get_view_key(view, REQ_VIEW_HELP)); return TRUE; } return TRUE; } /* * Main */ static const char usage_string[] = "tig " TIG_VERSION " (" __DATE__ ")\n" "\n" "Usage: tig [options] [revs] [--] [paths]\n" " or: tig log [options] [revs] [--] [paths]\n" " or: tig show [options] [revs] [--] [paths]\n" " or: tig blame [options] [rev] [--] path\n" " or: tig grep [options] [pattern]\n" " or: tig stash\n" " or: tig status\n" " or: tig < [git command output]\n" "\n" "Options:\n" " + Select line in the first view\n" " -v, --version Show version and exit\n" " -h, --help Show help message and exit"; void usage(const char *message) { die("%s\n\n%s", message, usage_string); } static int read_filter_args(char *name, size_t namelen, char *value, size_t valuelen, void *data) { const char ***filter_args = data; return argv_append(filter_args, name) ? OK : ERR; } static void filter_rev_parse(const char ***args, const char *arg1, const char *arg2, const char *argv[]) { const char *rev_parse_argv[SIZEOF_ARG] = { "git", "rev-parse", arg1, arg2 }; const char **all_argv = NULL; if (!argv_append_array(&all_argv, rev_parse_argv) || !argv_append_array(&all_argv, argv) || io_run_load(all_argv, "\n", read_filter_args, args) == ERR) die("Failed to split arguments"); argv_free(all_argv); free(all_argv); } static void filter_options(const char *argv[], bool rev_parse) { const char **flags = NULL; int next, flags_pos; update_options_from_argv(argv); if (!rev_parse) { opt_cmdline_argv = argv; return; } filter_rev_parse(&opt_file_argv, "--no-revs", "--no-flags", argv); filter_rev_parse(&flags, "--flags", "--no-revs", argv); if (flags) { for (next = flags_pos = 0; flags && flags[next]; next++) { const char *flag = flags[next]; if (argv_parse_rev_flag(flag, NULL)) argv_append(&opt_rev_argv, flag); else flags[flags_pos++] = flag; } flags[flags_pos] = NULL; opt_cmdline_argv = flags; } filter_rev_parse(&opt_rev_argv, "--symbolic", "--revs-only", argv); } static enum request parse_options(int argc, const char *argv[], bool pager_mode) { enum request request; const char *subcommand; bool seen_dashdash = FALSE; bool rev_parse = TRUE; const char **filter_argv = NULL; int i; request = pager_mode ? REQ_VIEW_PAGER : REQ_VIEW_MAIN; if (argc <= 1) return request; subcommand = argv[1]; if (!strcmp(subcommand, "status")) { request = REQ_VIEW_STATUS; } else if (!strcmp(subcommand, "blame")) { request = REQ_VIEW_BLAME; } else if (!strcmp(subcommand, "grep")) { request = REQ_VIEW_GREP; rev_parse = FALSE; } else if (!strcmp(subcommand, "show")) { request = REQ_VIEW_DIFF; } else if (!strcmp(subcommand, "log")) { request = REQ_VIEW_LOG; } else if (!strcmp(subcommand, "stash")) { request = REQ_VIEW_STASH; } else { subcommand = NULL; } for (i = 1 + !!subcommand; i < argc; i++) { const char *opt = argv[i]; // stop parsing our options after -- and let rev-parse handle the rest if (!seen_dashdash) { if (!strcmp(opt, "--")) { seen_dashdash = TRUE; continue; } else if (!strcmp(opt, "-v") || !strcmp(opt, "--version")) { printf("tig version %s\n", TIG_VERSION); exit(EXIT_SUCCESS); } else if (!strcmp(opt, "-h") || !strcmp(opt, "--help")) { printf("%s\n", usage_string); exit(EXIT_SUCCESS); } else if (strlen(opt) >= 2 && *opt == '+' && string_isnumber(opt + 1)) { int lineno = atoi(opt + 1); argv_env.lineno = lineno > 0 ? lineno - 1 : 0; continue; } } if (!argv_append(&filter_argv, opt)) die("command too long"); } if (filter_argv) filter_options(filter_argv, rev_parse); return request; } static enum request open_pager_mode(enum request request) { if (request == REQ_VIEW_PAGER) { /* Detect if the user requested the main view. */ if (argv_contains(opt_rev_argv, "--stdin")) { open_main_view(NULL, OPEN_FORWARD_STDIN); } else if (argv_contains(opt_cmdline_argv, "--pretty=raw")) { open_main_view(NULL, OPEN_STDIN); } else { open_pager_view(NULL, OPEN_STDIN); } } else if (request == REQ_VIEW_DIFF) { if (argv_contains(opt_rev_argv, "--stdin")) open_diff_view(NULL, OPEN_FORWARD_STDIN); else open_diff_view(NULL, OPEN_STDIN); } else { close(STDIN_FILENO); report("Ignoring stdin."); return request; } return REQ_NONE; } #ifdef NCURSES_MOUSE_VERSION static struct view * find_clicked_view(MEVENT *event) { struct view *view; int i; foreach_displayed_view (view, i) { int beg_y = 0, beg_x = 0; getbegyx(view->win, beg_y, beg_x); if (beg_y <= event->y && event->y < beg_y + view->height && beg_x <= event->x && event->x < beg_x + view->width) { if (i != current_view) { current_view = i; } return view; } } return NULL; } static enum request handle_mouse_event(void) { MEVENT event; struct view *view; if (getmouse(&event) != OK) return REQ_NONE; view = find_clicked_view(&event); if (!view) return REQ_NONE; if (event.bstate & BUTTON2_PRESSED) return REQ_SCROLL_WHEEL_DOWN; if (event.bstate & BUTTON4_PRESSED) return REQ_SCROLL_WHEEL_UP; if (event.bstate & BUTTON1_PRESSED) { if (event.y == view->pos.lineno - view->pos.offset) { /* Click is on the same line, perform an "ENTER" */ return REQ_ENTER; } else { int y = getbegy(view->win); unsigned long lineno = (event.y - y) + view->pos.offset; select_view_line(view, lineno); update_view_title(view); report_clear(); } } return REQ_NONE; } #endif int main(int argc, const char *argv[]) { const char *codeset = ENCODING_UTF8; bool pager_mode = !isatty(STDIN_FILENO); 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"); if (setlocale(LC_ALL, "")) { codeset = nl_langinfo(CODESET); } if (load_repo_info() == ERR) die("Failed to load repo info."); if (load_options() == ERR) die("Failed to load user config."); if (load_git_config() == ERR) die("Failed to load repo config."); /* Require a git repository unless when running in pager mode. */ if (!repo.git_dir[0] && request != REQ_VIEW_PAGER) die("Not a git repository"); if (codeset && strcmp(codeset, ENCODING_UTF8)) { char translit[SIZEOF_STR]; if (string_format(translit, "%s%s", codeset, ICONV_TRANSLIT)) opt_iconv_out = iconv_open(translit, ENCODING_UTF8); else opt_iconv_out = iconv_open(codeset, ENCODING_UTF8); if (opt_iconv_out == ICONV_NONE) die("Failed to initialize character set conversion"); } if (load_refs(FALSE) == ERR) die("Failed to load refs."); init_display(); if (pager_mode) request = open_pager_mode(request); while (view_driver(display[current_view], request)) { struct key key; int key_value = get_input(0, &key, TRUE); #ifdef NCURSES_MOUSE_VERSION if (key_value == KEY_MOUSE) { request = handle_mouse_event(); continue; } #endif view = display[current_view]; request = get_keybinding(view->keymap, &key, 1); /* Some low-level request handling. This keeps access to * status_win restricted. */ switch (request) { case REQ_NONE: report("Unknown key, press %s for help", get_view_key(view, REQ_VIEW_HELP)); break; case REQ_PROMPT: request = open_prompt(view); break; case REQ_SEARCH: case REQ_SEARCH_BACK: { const char *prompt = request == REQ_SEARCH ? "/" : "?"; char *search = read_prompt(prompt); if (search) string_ncopy(argv_env.search, search, strlen(search)); else if (*argv_env.search) request = request == REQ_SEARCH ? REQ_FIND_NEXT : REQ_FIND_PREV; else request = REQ_NONE; break; } default: break; } } exit(EXIT_SUCCESS); return 0; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/tree.c000066400000000000000000000267671233303337700142160ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/util.h" #include "tig/repo.h" #include "tig/io.h" #include "tig/parse.h" #include "tig/options.h" #include "tig/display.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/blob.h" /* The top of the path stack. */ static struct view_history tree_view_history = { sizeof(char *) }; static void pop_tree_stack_entry(struct position *position) { char *path_position = NULL; pop_view_history_state(&tree_view_history, position, &path_position); path_position[0] = 0; } static void push_tree_stack_entry(struct view *view, const char *name, struct position *position) { size_t pathlen = strlen(view->env->directory); char *path_position = view->env->directory + pathlen; struct view_state *state = push_view_history_state(&tree_view_history, position, &path_position); if (!state) return; if (!string_format_from(view->env->directory, &pathlen, "%s/", name)) { pop_tree_stack_entry(NULL); return; } clear_position(position); } /* Parse output from git-ls-tree(1): * * 100644 blob 95925677ca47beb0b8cce7c0e0011bcc3f61470f 213045 tig.c */ #define SIZEOF_TREE_ATTR \ STRING_SIZE("100644 blob f931e1d229c3e185caad4449bf5b66ed72462657\t") #define SIZEOF_TREE_MODE \ STRING_SIZE("100644 ") #define TREE_ID_OFFSET \ STRING_SIZE("100644 blob ") #define tree_path_is_parent(path) (!strcmp("..", (path))) struct tree_entry { char id[SIZEOF_REV]; char commit[SIZEOF_REV]; mode_t mode; struct time time; /* Date from the author ident. */ const struct ident *author; /* Author of the commit. */ unsigned long size; char name[1]; }; struct tree_state { char commit[SIZEOF_REV]; const struct ident *author; struct time author_time; bool read_date; }; static const char * tree_path(const struct line *line) { return ((struct tree_entry *) line->data)->name; } static int tree_compare_entry(const struct line *line1, const struct line *line2) { if (line1->type != line2->type) return line1->type == LINE_DIRECTORY ? -1 : 1; return strcmp(tree_path(line1), tree_path(line2)); } static bool tree_get_column_data(struct view *view, const struct line *line, struct view_column_data *column_data) { const struct tree_entry *entry = line->data; if (line->type == LINE_HEADER) return FALSE; column_data->author = entry->author; column_data->date = &entry->time; if (line->type != LINE_DIRECTORY) column_data->file_size = &entry->size; column_data->id = entry->commit; column_data->mode = &entry->mode; column_data->file_name = entry->name; return TRUE; } static struct line * tree_entry(struct view *view, enum line_type type, const char *path, const char *mode, const char *id, unsigned long size) { bool custom = type == LINE_HEADER || tree_path_is_parent(path); struct tree_entry *entry; struct line *line = add_line_alloc(view, &entry, type, strlen(path), custom); if (!line) return NULL; strncpy(entry->name, path, strlen(path)); if (mode) entry->mode = strtoul(mode, NULL, 8); if (id) string_copy_rev(entry->id, id); entry->size = size; return line; } static bool tree_read_date(struct view *view, struct buffer *buf, struct tree_state *state) { char *text = buf ? buf->data : NULL; if (!text && state->read_date) { state->read_date = FALSE; return TRUE; } else if (!text) { /* Find next entry to process */ const char *log_file[] = { "git", "log", encoding_arg, "--no-color", "--pretty=raw", "--cc", "--raw", view->ops->id, "--", "%(directory)", NULL }; if (!view->lines) { tree_entry(view, LINE_HEADER, view->env->directory, NULL, NULL, 0); tree_entry(view, LINE_DIRECTORY, "..", "040000", view->ref, 0); report("Tree is empty"); return TRUE; } if (!begin_update(view, repo.cdup, log_file, OPEN_EXTRA)) { report("Failed to load tree data"); return TRUE; } state->read_date = TRUE; return FALSE; } else if (*text == 'c' && get_line_type(text) == LINE_COMMIT) { string_copy_rev_from_commit_line(state->commit, text); } else if (*text == 'a' && get_line_type(text) == LINE_AUTHOR) { parse_author_line(text + STRING_SIZE("author "), &state->author, &state->author_time); } else if (*text == ':') { char *pos; size_t annotated = 1; size_t i; pos = strrchr(text, '\t'); if (!pos) return TRUE; text = pos + 1; if (*view->env->directory && !strncmp(text, view->env->directory, strlen(view->env->directory))) text += strlen(view->env->directory); pos = strchr(text, '/'); if (pos) *pos = 0; for (i = 1; i < view->lines; i++) { struct line *line = &view->line[i]; struct tree_entry *entry = line->data; annotated += !!entry->author; if (entry->author || strcmp(entry->name, text)) continue; string_copy_rev(entry->commit, state->commit); entry->author = state->author; entry->time = state->author_time; line->dirty = 1; view_column_info_update(view, line); break; } if (annotated == view->lines) io_kill(view->pipe); } return TRUE; } static bool tree_read(struct view *view, struct buffer *buf) { struct tree_state *state = view->private; struct tree_entry *data; struct line *entry, *line; enum line_type type; char *path; size_t size; if (state->read_date || !buf) return tree_read_date(view, buf, state); if (buf->size <= SIZEOF_TREE_ATTR) return FALSE; if (view->lines == 0 && !tree_entry(view, LINE_HEADER, view->env->directory, NULL, NULL, 0)) return FALSE; size = parse_size(buf->data + SIZEOF_TREE_ATTR); path = strchr(buf->data + SIZEOF_TREE_ATTR, '\t'); if (!path) return FALSE; path++; /* Strip the path part ... */ if (*view->env->directory) { size_t pathlen = strlen(path); size_t striplen = strlen(view->env->directory); if (pathlen > striplen) memmove(path, path + striplen, pathlen - striplen + 1); /* Insert "link" to parent directory. */ if (view->lines == 1 && !tree_entry(view, LINE_DIRECTORY, "..", "040000", view->ref, 0)) return FALSE; } type = buf->data[SIZEOF_TREE_MODE] == 't' ? LINE_DIRECTORY : LINE_FILE; entry = tree_entry(view, type, path, buf->data, buf->data + TREE_ID_OFFSET, size); if (!entry) return FALSE; data = entry->data; view_column_info_update(view, entry); /* Skip "Directory ..." and ".." line. */ for (line = &view->line[1 + !!*view->env->directory]; line < entry; line++) { if (tree_compare_entry(line, entry) <= 0) continue; memmove(line + 1, line, (entry - line) * sizeof(*entry)); line->data = data; line->type = type; line->dirty = line->cleareol = 1; for (line++; line <= entry; line++) { line->dirty = line->cleareol = 1; line->lineno++; } return TRUE; } /* Move the current line to the first tree entry. */ if (!check_position(&view->prev_pos) && !check_position(&view->pos)) goto_view_line(view, 0, 1); return TRUE; } static bool tree_draw(struct view *view, struct line *line, unsigned int lineno) { struct tree_entry *entry = line->data; if (line->type == LINE_HEADER) { draw_formatted(view, line->type, "Directory path /%s", entry->name); return TRUE; } return view_column_draw(view, line, lineno); } void open_blob_editor(const char *id, const char *name, unsigned int lineno) { const char *blob_argv[] = { "git", "cat-file", "blob", id, NULL }; char file[SIZEOF_STR]; int fd; if (!name) name = "unknown"; if (!string_format(file, "%s/tigblob.XXXXXX.%s", get_temp_dir(), name)) { report("Temporary file name is too long"); return; } fd = mkstemps(file, strlen(name) + 1); if (fd == -1) report("Failed to create temporary file"); else if (!io_run_append(blob_argv, fd)) report("Failed to save blob data to file"); else open_editor(file, lineno); if (fd != -1) unlink(file); } static enum request tree_request(struct view *view, enum request request, struct line *line) { enum open_flags flags; struct tree_entry *entry = line->data; switch (request) { case REQ_VIEW_BLAME: if (line->type != LINE_FILE) { report("Blame only supported for files"); return REQ_NONE; } string_copy(view->env->ref, view->vid); return request; case REQ_EDIT: if (line->type != LINE_FILE) { report("Edit only supported for files"); } else if (!is_head_commit(view->vid)) { open_blob_editor(entry->id, entry->name, 0); } else { open_editor(view->env->file, 0); } return REQ_NONE; case REQ_PARENT: case REQ_BACK: if (!*view->env->directory) { /* quit view if at top of tree */ return REQ_VIEW_CLOSE; } /* fake 'cd ..' */ pop_tree_stack_entry(&view->pos); reload_view(view); break; case REQ_ENTER: break; default: return request; } /* Cleanup the stack if the tree view is at a different tree. */ if (!*view->env->directory) reset_view_history(&tree_view_history); switch (line->type) { case LINE_DIRECTORY: /* Depending on whether it is a subdirectory or parent link * mangle the path buffer. */ if (tree_path_is_parent(entry->name) && *view->env->directory) { pop_tree_stack_entry(&view->pos); } else { const char *basename = tree_path(line); push_tree_stack_entry(view, basename, &view->pos); } /* Trees and subtrees share the same ID, so they are not not * unique like blobs. */ reload_view(view); break; case LINE_FILE: flags = view_is_displayed(view) ? OPEN_SPLIT : OPEN_DEFAULT; open_blob_view(view, flags); break; default: return REQ_NONE; } return REQ_NONE; } static void tree_select(struct view *view, struct line *line) { struct tree_entry *entry = line->data; if (line->type == LINE_HEADER) { string_format(view->ref, "Files in /%s", view->env->directory); return; } if (line->type == LINE_DIRECTORY && tree_path_is_parent(entry->name)) { string_copy(view->ref, "Open parent directory"); view->env->blob[0] = 0; return; } if (line->type == LINE_FILE) { string_copy_rev(view->env->blob, entry->id); string_format(view->env->file, "%s%s", view->env->directory, tree_path(line)); } string_copy_rev(view->ref, entry->id); } static bool tree_open(struct view *view, enum open_flags flags) { static const char *tree_argv[] = { "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 (view->lines == 0 && repo.prefix[0]) { char *pos = repo.prefix; while (pos && *pos) { char *end = strchr(pos, '/'); if (end) *end = 0; push_tree_stack_entry(view, pos, &view->pos); pos = end; if (end) { *end = '/'; pos++; } } } else if (strcmp(view->vid, view->ops->id)) { view->env->directory[0] = 0; } return begin_update(view, repo.cdup, tree_argv, flags); } static struct view_ops tree_ops = { "file", argv_env.commit, VIEW_SEND_CHILD_ENTER | VIEW_SORTABLE, sizeof(struct tree_state), tree_open, tree_read, tree_draw, tree_request, view_column_grep, tree_select, NULL, view_column_bit(AUTHOR) | view_column_bit(DATE) | view_column_bit(FILE_NAME) | view_column_bit(FILE_SIZE) | view_column_bit(ID) | view_column_bit(LINE_NUMBER) | view_column_bit(MODE), tree_get_column_data, }; DEFINE_VIEW(tree); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/types.c000066400000000000000000000047661233303337700144160ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/types.h" /* * Enumerations */ int string_enum_compare(const char *str1, const char *str2, int len) { size_t i; #define string_enum_sep(x) ((x) == '-' || (x) == '_') /* Diff-Header == DIFF_HEADER */ for (i = 0; i < len; i++) { if (ascii_toupper(str1[i]) == ascii_toupper(str2[i])) continue; if (string_enum_sep(str1[i]) && string_enum_sep(str2[i])) continue; return str1[i] - str2[i]; } return 0; } bool enum_name_copy(char *buf, size_t bufsize, const char *name) { int bufpos; for (bufpos = 0; name[bufpos] && bufpos < bufsize - 1; bufpos++) { buf[bufpos] = ascii_tolower(name[bufpos]); if (buf[bufpos] == '_') buf[bufpos] = '-'; } buf[bufpos] = 0; return bufpos < bufsize; } const char * enum_name(const char *name) { static char buf[SIZEOF_STR]; return enum_name_copy(buf, sizeof(buf), name) ? buf : name; } bool enum_name_prefixed(char buf[], size_t bufsize, const char *prefix, const char *name) { char prefixed[SIZEOF_STR]; if (*prefix) { if (!string_format(prefixed, "%s-%s", prefix, name)) return FALSE; name = prefixed; } return enum_name_copy(buf, bufsize, name); } const struct enum_map * find_enum_map(const char *type) { static struct { const char *type; const struct enum_map *map; } mappings[] = { #define DEFINE_ENUM_MAPPING(name, macro) { #name, name##_map }, ENUM_INFO(DEFINE_ENUM_MAPPING) }; int i; for (i = 0; i < ARRAY_SIZE(mappings); i++) if (!strcmp(type, mappings[i].type)) return mappings[i].map; return NULL; } bool map_enum_do(const struct enum_map_entry *map, size_t map_size, int *value, const char *name) { size_t namelen = strlen(name); int i; for (i = 0; i < map_size; i++) if (enum_equals(map[i], name, namelen)) { *value = map[i].value; return TRUE; } return FALSE; } #define DEFINE_ENUM_MAPS(name, macro) DEFINE_ENUM_MAP(name, macro); ENUM_INFO(DEFINE_ENUM_MAPS); /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/util.c000066400000000000000000000156321233303337700142210ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/util.h" /* * Error handling. */ static const char *status_messages[] = { "Success", #define STATUS_CODE_MESSAGE(name, msg) msg STATUS_CODE_INFO(STATUS_CODE_MESSAGE) }; static char status_custom_message[SIZEOF_STR]; static bool status_success_message = FALSE; const char * get_status_message(enum status_code code) { if (code == SUCCESS) { const char *message = status_success_message ? status_custom_message : ""; status_success_message = FALSE; return message; } if (code == ERROR_CUSTOM_MESSAGE) return status_custom_message; return status_messages[code]; } enum status_code error(const char *msg, ...) { int retval; FORMAT_BUFFER(status_custom_message, sizeof(status_custom_message), msg, retval, TRUE); status_success_message = FALSE; return ERROR_CUSTOM_MESSAGE; } enum status_code success(const char *msg, ...) { int retval; FORMAT_BUFFER(status_custom_message, sizeof(status_custom_message), msg, retval, TRUE); status_success_message = TRUE; return SUCCESS; } void warn(const char *msg, ...) { va_list args; va_start(args, msg); fputs("tig warning: ", stderr); vfprintf(stderr, msg, args); fputs("\n", stderr); va_end(args); } die_fn die_callback = NULL; void TIG_NORETURN die(const char *err, ...) { va_list args; if (die_callback) die_callback(); va_start(args, err); fputs("tig: ", stderr); vfprintf(stderr, err, args); fputs("\n", stderr); va_end(args); exit(1); } /* * Git data formatters and parsers. */ int timecmp(const struct time *t1, const struct time *t2) { return t1->sec - t2->sec; } const char * mkdate(const struct time *time, enum date date) { static char buf[STRING_SIZE("2006-04-29 14:21") + 1]; static const struct enum_map_entry reldate[] = { { "second", 1, 60 * 2 }, { "minute", 60, 60 * 60 * 2 }, { "hour", 60 * 60, 60 * 60 * 24 * 2 }, { "day", 60 * 60 * 24, 60 * 60 * 24 * 7 * 2 }, { "week", 60 * 60 * 24 * 7, 60 * 60 * 24 * 7 * 5 }, { "month", 60 * 60 * 24 * 30, 60 * 60 * 24 * 365 }, { "year", 60 * 60 * 24 * 365, 0 }, }; struct tm tm; const char *format; if (!date || !time || !time->sec) return ""; if (date == DATE_RELATIVE) { struct timeval now; time_t date = time->sec + time->tz; time_t seconds; int i; gettimeofday(&now, NULL); seconds = now.tv_sec < date ? date - now.tv_sec : now.tv_sec - date; for (i = 0; i < ARRAY_SIZE(reldate); i++) { if (seconds >= reldate[i].value && reldate[i].value) continue; seconds /= reldate[i].namelen; if (!string_format(buf, "%ld %s%s %s", seconds, reldate[i].name, seconds > 1 ? "s" : "", now.tv_sec >= date ? "ago" : "ahead")) break; return buf; } } if (date == DATE_LOCAL) { time_t date = time->sec + time->tz; localtime_r(&date, &tm); } else { gmtime_r(&time->sec, &tm); } format = date == DATE_SHORT ? "%Y-%m-%d" : "%Y-%m-%d %H:%M"; return strftime(buf, sizeof(buf), format, &tm) ? buf : NULL; } const char * mkfilesize(unsigned long size, enum file_size format) { static char buf[64 + 1]; static const char relsize[] = { 'B', 'K', 'M', 'G', 'T', 'P' }; if (!format) return ""; if (format == FILE_SIZE_UNITS) { const char *fmt = "%.0f%c"; double rsize = size; int i; for (i = 0; i < ARRAY_SIZE(relsize); i++) { if (rsize > 1024.0 && i + 1 < ARRAY_SIZE(relsize)) { rsize /= 1024; continue; } size = rsize * 10; if (size % 10 > 0) fmt = "%.1f%c"; return string_format(buf, fmt, rsize, relsize[i]) ? buf : NULL; } } return string_format(buf, "%ld", size) ? buf : NULL; } const struct ident unknown_ident = { "Unknown", "unknown@localhost" }; int ident_compare(const struct ident *i1, const struct ident *i2) { if (!i1 || !i2) return (!!i1) - (!!i2); if (!i1->name || !i2->name) return (!!i1->name) - (!!i2->name); return strcmp(i1->name, i2->name); } static const char * get_author_initials(const char *author) { static char initials[256]; size_t pos = 0; const char *end = strchr(author, '\0'); #define is_initial_sep(c) (isspace(c) || ispunct(c) || (c) == '@' || (c) == '-') memset(initials, 0, sizeof(initials)); while (author < end) { unsigned char bytes; size_t i; while (author < end && is_initial_sep(*author)) author++; bytes = utf8_char_length(author); if (bytes >= sizeof(initials) - 1 - pos) break; while (bytes--) { initials[pos++] = *author++; } i = pos; while (author < end && !is_initial_sep(*author)) { bytes = utf8_char_length(author); if (bytes >= sizeof(initials) - 1 - i) { while (author < end && !is_initial_sep(*author)) author++; break; } while (bytes--) { initials[i++] = *author++; } } initials[i++] = 0; } return initials; } static const char * get_email_user(const char *email) { static char user[SIZEOF_STR + 1]; const char *end = strchr(email, '@'); int length = end ? end - email : strlen(email); string_format(user, "%.*s%c", length, email, 0); return user; } const char * mkauthor(const struct ident *ident, int cols, enum author author) { bool trim = author_trim(cols); bool abbreviate = author == AUTHOR_ABBREVIATED || !trim; if (author == AUTHOR_NO || !ident) return ""; if (author == AUTHOR_EMAIL && ident->email) return ident->email; if (author == AUTHOR_EMAIL_USER && ident->email) return get_email_user(ident->email); if (abbreviate && ident->name) return get_author_initials(ident->name); return ident->name; } const char * mkmode(mode_t mode) { if (S_ISDIR(mode)) return "drwxr-xr-x"; else if (S_ISLNK(mode)) return "lrwxrwxrwx"; else if (S_ISGITLINK(mode)) return "m---------"; else if (S_ISREG(mode) && mode & S_IXUSR) return "-rwxr-xr-x"; else if (S_ISREG(mode)) return "-rw-r--r--"; else return "----------"; } const char * mkstatus(const char status, enum status_label label) { static char default_label[] = { '?', 0 }; static const char *labels[][2] = { { "!", "ignored" }, { "?", "untracked" }, { "A", "added" }, { "C", "copied" }, { "D", "deleted" }, { "M", "modified" }, { "R", "renamed" }, { "U", "unmerged" }, }; int i; if (label == STATUS_LABEL_NO) return ""; for (i = 0; i < ARRAY_SIZE(labels); i++) { if (status == *labels[i][0]) { if (label == STATUS_LABEL_LONG) return labels[i][1]; else return labels[i][0]; } } default_label[0] = status; return default_label; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/view.c000066400000000000000000001034241233303337700142130ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/argv.h" #include "tig/repo.h" #include "tig/watch.h" #include "tig/options.h" #include "tig/view.h" #include "tig/draw.h" #include "tig/display.h" /* * Navigation */ bool goto_view_line(struct view *view, unsigned long offset, unsigned long lineno) { if (lineno >= view->lines) lineno = view->lines > 0 ? view->lines - 1 : 0; if (offset > lineno || offset + view->height <= lineno) { unsigned long half = view->height / 2; if (lineno > half) offset = lineno - half; else offset = 0; } if (offset != view->pos.offset || lineno != view->pos.lineno) { view->pos.offset = offset; view->pos.lineno = lineno; return TRUE; } return FALSE; } /* Scrolling backend */ void do_scroll_view(struct view *view, int lines) { bool redraw_current_line = FALSE; /* The rendering expects the new offset. */ view->pos.offset += lines; assert(0 <= view->pos.offset && view->pos.offset < view->lines); assert(lines); /* Move current line into the view. */ if (view->pos.lineno < view->pos.offset) { view->pos.lineno = view->pos.offset; redraw_current_line = TRUE; } else if (view->pos.lineno >= view->pos.offset + view->height) { view->pos.lineno = view->pos.offset + view->height - 1; redraw_current_line = TRUE; } assert(view->pos.offset <= view->pos.lineno && view->pos.lineno < view->lines); /* Redraw the whole screen if scrolling is pointless. */ if (view->height < ABS(lines)) { redraw_view(view); } else { int line = lines > 0 ? view->height - lines : 0; int end = line + ABS(lines); scrollok(view->win, TRUE); wscrl(view->win, lines); scrollok(view->win, FALSE); while (line < end && draw_view_line(view, line)) line++; if (redraw_current_line) draw_view_line(view, view->pos.lineno - view->pos.offset); wnoutrefresh(view->win); } view->has_scrolled = TRUE; report_clear(); } /* Scroll frontend */ void scroll_view(struct view *view, enum request request) { int lines = 1; assert(view_is_displayed(view)); if (request == REQ_SCROLL_WHEEL_DOWN || request == REQ_SCROLL_WHEEL_UP) lines = opt_mouse_scroll; switch (request) { case REQ_SCROLL_FIRST_COL: view->pos.col = 0; redraw_view_from(view, 0); report_clear(); return; case REQ_SCROLL_LEFT: if (view->pos.col == 0) { report("Cannot scroll beyond the first column"); return; } if (view->pos.col <= apply_step(opt_horizontal_scroll, view->width)) view->pos.col = 0; else view->pos.col -= apply_step(opt_horizontal_scroll, view->width); redraw_view_from(view, 0); report_clear(); return; case REQ_SCROLL_RIGHT: view->pos.col += apply_step(opt_horizontal_scroll, view->width); redraw_view(view); report_clear(); return; case REQ_SCROLL_PAGE_DOWN: lines = view->height; case REQ_SCROLL_WHEEL_DOWN: case REQ_SCROLL_LINE_DOWN: if (view->pos.offset + lines > view->lines) lines = view->lines - view->pos.offset; if (lines == 0 || view->pos.offset + view->height >= view->lines) { report("Cannot scroll beyond the last line"); return; } break; case REQ_SCROLL_PAGE_UP: lines = view->height; case REQ_SCROLL_LINE_UP: case REQ_SCROLL_WHEEL_UP: if (lines > view->pos.offset) lines = view->pos.offset; if (lines == 0) { report("Cannot scroll beyond the first line"); return; } lines = -lines; break; default: die("request %d not handled in switch", request); } do_scroll_view(view, lines); } /* Cursor moving */ void move_view(struct view *view, enum request request) { int scroll_steps = 0; int steps; switch (request) { case REQ_MOVE_FIRST_LINE: steps = -view->pos.lineno; break; case REQ_MOVE_LAST_LINE: steps = view->lines - view->pos.lineno - 1; break; case REQ_MOVE_PAGE_UP: steps = view->height > view->pos.lineno ? -view->pos.lineno : -view->height; break; case REQ_MOVE_PAGE_DOWN: steps = view->pos.lineno + view->height >= view->lines ? view->lines - view->pos.lineno - 1 : view->height; break; case REQ_MOVE_UP: case REQ_PREVIOUS: steps = -1; break; case REQ_MOVE_DOWN: case REQ_NEXT: steps = 1; break; default: die("request %d not handled in switch", request); } if (steps <= 0 && view->pos.lineno == 0) { report("Cannot move beyond the first line"); return; } else if (steps >= 0 && view->pos.lineno + 1 >= view->lines) { report("Cannot move beyond the last line"); return; } /* Move the current line */ view->pos.lineno += steps; assert(0 <= view->pos.lineno && view->pos.lineno < view->lines); /* Check whether the view needs to be scrolled */ if (view->pos.lineno < view->pos.offset || view->pos.lineno >= view->pos.offset + view->height) { scroll_steps = steps; if (steps < 0 && -steps > view->pos.offset) { scroll_steps = -view->pos.offset; } else if (steps > 0) { if (view->pos.lineno == view->lines - 1 && view->lines > view->height) { scroll_steps = view->lines - view->pos.offset - 1; if (scroll_steps >= view->height) scroll_steps -= view->height - 1; } } } if (!view_is_displayed(view)) { view->pos.offset += scroll_steps; assert(0 <= view->pos.offset && view->pos.offset < view->lines); view->ops->select(view, &view->line[view->pos.lineno]); return; } /* Repaint the old "current" line if we be scrolling */ if (ABS(steps) < view->height) draw_view_line(view, view->pos.lineno - steps - view->pos.offset); if (scroll_steps) { do_scroll_view(view, scroll_steps); return; } /* Draw the current line */ draw_view_line(view, view->pos.lineno - view->pos.offset); wnoutrefresh(view->win); report_clear(); } /* * Searching */ DEFINE_ALLOCATOR(realloc_unsigned_ints, unsigned int, 32) bool grep_text(struct view *view, const char *text[]) { regmatch_t pmatch; size_t i; for (i = 0; text[i]; i++) if (*text[i] && !regexec(view->regex, text[i], 1, &pmatch, 0)) return TRUE; return FALSE; } void select_view_line(struct view *view, unsigned long lineno) { struct position old = view->pos; if (goto_view_line(view, view->pos.offset, lineno)) { if (view_is_displayed(view)) { if (old.offset != view->pos.offset) { redraw_view(view); } else { draw_view_line(view, old.lineno - view->pos.offset); draw_view_line(view, view->pos.lineno - view->pos.offset); wnoutrefresh(view->win); } } else { view->ops->select(view, &view->line[view->pos.lineno]); } } } static bool find_matches(struct view *view) { size_t lineno; /* Note, lineno is unsigned long so will wrap around in which case it * will become bigger than view->lines. */ for (lineno = 0; lineno < view->lines; lineno++) { if (!view->ops->grep(view, &view->line[lineno])) continue; if (!realloc_unsigned_ints(&view->matched_line, view->matched_lines, 1)) return FALSE; view->matched_line[view->matched_lines++] = lineno; } return TRUE; } void find_next(struct view *view, enum request request) { int direction; size_t i; if (!*view->grep) { if (!*view->env->search) report("No previous search"); else search_view(view, request); return; } switch (request) { case REQ_SEARCH: case REQ_FIND_NEXT: direction = 1; break; case REQ_SEARCH_BACK: case REQ_FIND_PREV: direction = -1; break; default: return; } if (!view->matched_lines && !find_matches(view)) { report("Allocation failure"); return; } /* Note, `i` is unsigned and will wrap around in which case it * will become bigger than view->matched_lines. */ i = direction > 0 ? 0 : view->matched_lines - 1; for (; i < view->matched_lines; i += direction) { size_t lineno = view->matched_line[i]; if (direction > 0 && lineno <= view->pos.lineno) continue; if (direction < 0 && lineno >= view->pos.lineno) continue; select_view_line(view, lineno); report("Line %zu matches '%s' (%zu of %zu)", lineno + 1, view->grep, i + 1, view->matched_lines); return; } report("No match found for '%s'", view->grep); } static void reset_matches(struct view *view) { free(view->matched_line); view->matched_line = NULL; view->matched_lines = 0; } void search_view(struct view *view, enum request request) { int regex_err; int regex_flags = opt_ignore_case ? REG_ICASE : 0; if (view->regex) { regfree(view->regex); *view->grep = 0; } else { view->regex = calloc(1, sizeof(*view->regex)); if (!view->regex) return; } regex_err = regcomp(view->regex, view->env->search, REG_EXTENDED | regex_flags); if (regex_err != 0) { char buf[SIZEOF_STR] = "unknown error"; regerror(regex_err, view->regex, buf, sizeof(buf)); report("Search failed: %s", buf); return; } string_copy(view->grep, view->env->search); reset_matches(view); find_next(view, request); } /* * View history */ static bool view_history_is_empty(struct view_history *history) { return !history->stack; } struct view_state * push_view_history_state(struct view_history *history, struct position *position, void *data) { struct view_state *state = history->stack; if (state && data && history->state_alloc && !memcmp(state->data, data, history->state_alloc)) return NULL; state = calloc(1, sizeof(*state) + history->state_alloc); if (!state) return NULL; state->prev = history->stack; history->stack = state; clear_position(&history->position); state->position = *position; state->data = &state[1]; if (data && history->state_alloc) memcpy(state->data, data, history->state_alloc); return state; } bool pop_view_history_state(struct view_history *history, struct position *position, void *data) { struct view_state *state = history->stack; if (view_history_is_empty(history)) return FALSE; history->position = state->position; history->stack = state->prev; if (data && history->state_alloc) memcpy(data, state->data, history->state_alloc); if (position) *position = state->position; free(state); return TRUE; } void reset_view_history(struct view_history *history) { while (pop_view_history_state(history, NULL, NULL)) ; } /* * Incremental updating */ void reset_view(struct view *view) { int i; for (i = 0; i < view->lines; i++) free(view->line[i].data); free(view->line); reset_matches(view); view->prev_pos = view->pos; clear_position(&view->pos); if (view->columns) view_column_reset(view); view->line = NULL; view->lines = 0; view->vid[0] = 0; view->custom_lines = 0; view->update_secs = 0; } static bool restore_view_position(struct view *view) { /* A view without a previous view is the first view */ if (!view->prev && view->env->lineno && view->env->lineno <= view->lines) { select_view_line(view, view->env->lineno); view->env->lineno = 0; } /* Ensure that the view position is in a valid state. */ if (!check_position(&view->prev_pos) || (view->pipe && view->lines <= view->prev_pos.lineno)) return goto_view_line(view, view->pos.offset, view->pos.lineno); /* Changing the view position cancels the restoring. */ /* FIXME: Changing back to the first line is not detected. */ if (check_position(&view->pos)) { clear_position(&view->prev_pos); return FALSE; } if (goto_view_line(view, view->prev_pos.offset, view->prev_pos.lineno) && view_is_displayed(view)) werase(view->win); view->pos.col = view->prev_pos.col; clear_position(&view->prev_pos); return TRUE; } void end_update(struct view *view, bool force) { if (!view->pipe) return; while (!view->ops->read(view, NULL)) if (!force) return; if (force) io_kill(view->pipe); io_done(view->pipe); view->pipe = NULL; } static void setup_update(struct view *view, const char *vid) { reset_view(view); /* XXX: Do not use string_copy_rev(), it copies until first space. */ string_ncopy(view->vid, vid, strlen(vid)); view->pipe = &view->io; view->start_time = time(NULL); } static bool view_no_refresh(struct view *view, enum open_flags flags) { bool reload = !!(flags & OPEN_ALWAYS_LOAD) || !view->lines; return (!reload && !strcmp(view->vid, view->ops->id)) || ((flags & OPEN_REFRESH) && !view_can_refresh(view)); } bool 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); int forward_stdin = (flags & OPEN_FORWARD_STDIN) ? IO_RD_FORWARD_STDIN : 0; int with_stderr = (flags & OPEN_WITH_STDERR) ? IO_RD_WITH_STDERR : 0; int io_flags = forward_stdin | with_stderr; if (view_no_refresh(view, flags)) return TRUE; if (view->pipe) { if (extra) io_done(view->pipe); else end_update(view, TRUE); } view->unrefreshable = open_in_pager_mode(flags); if (!refresh && argv) { 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; } /* Put the current view ref value to the view title ref * member. This is needed by the blob view. Most other * views sets it automatically after loading because the * first line is a commit line. */ string_copy_rev(view->ref, view->ops->id); } if (view->argv && view->argv[0] && !io_exec(&view->io, IO_RD, view->dir, opt_env, view->argv, io_flags)) { report("Failed to open %s view", view->name); return FALSE; } if (open_from_stdin(flags)) { if (!io_open(&view->io, "%s", "")) die("Failed to open stdin"); } if (!extra) setup_update(view, view->ops->id); return TRUE; } bool update_view(struct view *view) { /* Clear the view and redraw everything since the tree sorting * might have rearranged things. */ bool redraw = view->lines == 0; bool can_read = TRUE; struct encoding *encoding = view->encoding ? view->encoding : default_encoding; struct buffer line; if (!view->pipe) return TRUE; if (!io_can_read(view->pipe, FALSE)) { if (view->lines == 0 && view_is_displayed(view)) { time_t secs = time(NULL) - view->start_time; if (secs > 1 && secs > view->update_secs) { if (view->update_secs == 0) redraw_view(view); update_view_title(view); view->update_secs = secs; } } return TRUE; } for (; io_get(view->pipe, &line, '\n', can_read); can_read = FALSE) { if (encoding && !encoding_convert(encoding, &line)) { report("Encoding failure"); end_update(view, TRUE); return FALSE; } if (!view->ops->read(view, &line)) { report("Allocation failure"); end_update(view, TRUE); return FALSE; } } if (io_error(view->pipe)) { report("Failed to read: %s", io_strerror(view->pipe)); end_update(view, TRUE); } else if (io_eof(view->pipe)) { end_update(view, FALSE); } if (restore_view_position(view)) redraw = TRUE; if (!view_is_displayed(view)) return TRUE; if (redraw || view->force_redraw) redraw_view_from(view, 0); else redraw_view_dirty(view); view->force_redraw = FALSE; /* Update the title _after_ the redraw so that if the redraw picks up a * commit reference in view->ref it'll be available here. */ update_view_title(view); return TRUE; } void update_view_title(struct view *view) { WINDOW *window = view->title; struct line *line = &view->line[view->pos.lineno]; unsigned int view_lines, lines; assert(view_is_displayed(view)); if (view == display[current_view]) wbkgdset(window, get_view_attr(view, LINE_TITLE_FOCUS)); else wbkgdset(window, get_view_attr(view, LINE_TITLE_BLUR)); werase(window); mvwprintw(window, 0, 0, "[%s]", view->name); if (*view->ref) { wprintw(window, " %s", view->ref); } if (!view_has_flags(view, VIEW_CUSTOM_STATUS) && view_has_line(view, line) && line->lineno) { wprintw(window, " - %s %d of %zd", view->ops->type, line->lineno, view->lines - view->custom_lines); } if (view->pipe) { time_t secs = time(NULL) - view->start_time; /* Three git seconds are a long time ... */ if (secs > 2) wprintw(window, " loading %lds", secs); } view_lines = view->pos.offset + view->height; lines = view->lines ? MIN(view_lines, view->lines) * 100 / view->lines : 0; mvwprintw(window, 0, view->width - count_digits(lines) - 1, "%d%%", lines); wnoutrefresh(window); } /* * View opening */ void split_view(struct view *prev, struct view *view) { display[1] = view; current_view = opt_focus_child ? 1 : 0; view->parent = prev; resize_display(); if (prev->pos.lineno - prev->pos.offset >= prev->height) { /* Take the title line into account. */ int lines = prev->pos.lineno - prev->pos.offset - prev->height + 1; /* Scroll the view that was split if the current line is * outside the new limited view. */ do_scroll_view(prev, lines); } if (view != prev && view_is_displayed(prev)) { /* "Blur" the previous view. */ update_view_title(prev); } } void maximize_view(struct view *view, bool redraw) { memset(display, 0, sizeof(display)); current_view = 0; display[current_view] = view; resize_display(); if (redraw) { redraw_display(FALSE); report_clear(); } } void load_view(struct view *view, struct view *prev, enum open_flags flags) { bool refresh = !view_no_refresh(view, flags); /* When prev == view it means this is the first loaded view. */ if (prev && view != prev) { view->prev = prev; } if (!refresh && view_can_refresh(view) && watch_update_single(&view->watch, WATCH_EVENT_SWITCH_VIEW)) { refresh = watch_dirty(&view->watch); if (refresh) flags |= OPEN_REFRESH; } if (refresh) { if (view->pipe) end_update(view, TRUE); if (view->ops->private_size) { if (!view->private) { view->private = calloc(1, view->ops->private_size); } else { if (view->ops->done) view->ops->done(view); memset(view->private, 0, view->ops->private_size); } } if (!view->ops->open(view, flags)) return; } if (prev) { bool split = !!(flags & OPEN_SPLIT); if (split) { split_view(prev, view); } else { maximize_view(view, FALSE); } } restore_view_position(view); if (view->pipe && view->lines == 0) { /* Clear the old view and let the incremental updating refill * the screen. */ werase(view->win); if (!(flags & (OPEN_RELOAD | OPEN_REFRESH))) clear_position(&view->prev_pos); report_clear(); } else if (view_is_displayed(view)) { redraw_view(view); report_clear(); } } #define refresh_view(view) load_view(view, NULL, OPEN_REFRESH) #define reload_view(view) load_view(view, NULL, OPEN_RELOAD) void open_view(struct view *prev, struct view *view, enum open_flags flags) { bool reload = !!(flags & (OPEN_RELOAD | OPEN_PREPARED)); int nviews = displayed_views(); assert(flags ^ OPEN_REFRESH); if (view == prev && nviews == 1 && !reload) { report("Already in %s view", view->name); return; } if (!view_has_flags(view, VIEW_NO_GIT_DIR) && !repo.git_dir[0]) { report("The %s view is disabled in pager mode", view->name); return; } if (!view->keymap) view->keymap = get_keymap(view->name, strlen(view->name)); load_view(view, prev ? prev : view, flags); } void open_argv(struct view *prev, struct view *view, const char *argv[], const char *dir, enum open_flags flags) { if (view->pipe) end_update(view, TRUE); view->dir = dir; if (!argv_copy(&view->argv, argv)) { report("Failed to open %s view: %s", view->name, io_strerror(&view->io)); } else { open_view(prev, view, flags | OPEN_PREPARED); } } /* * Various utilities. */ static struct view *sorting_view; #define sort_order_reverse(state, result) \ ((state)->reverse ? -(result) : (result)) #define sort_order(state, cmp, o1, o2) \ sort_order_reverse(state, (!(o1) || !(o2)) ? !!(o2) - !!(o1) : cmp(o1, o2)) #define number_compare(size1, size2) (*(size1) - *(size2)) #define mode_is_dir(mode) ((mode) && S_ISDIR(*(mode))) static int sort_view_compare(const void *l1, const void *l2) { const struct line *line1 = l1; const struct line *line2 = l2; struct view_column_data column_data1 = {}; struct view_column_data column_data2 = {}; struct sort_state *sort = &sorting_view->sort; if (!sorting_view->ops->get_column_data(sorting_view, line1, &column_data1)) return -1; else if (!sorting_view->ops->get_column_data(sorting_view, line2, &column_data2)) return 1; switch (get_sort_field(sorting_view)) { case VIEW_COLUMN_AUTHOR: return sort_order(sort, ident_compare, column_data1.author, column_data2.author); case VIEW_COLUMN_DATE: return sort_order(sort, timecmp, column_data1.date, column_data2.date); case VIEW_COLUMN_ID: if (column_data1.reflog && column_data2.reflog) return sort_order(sort, strcmp, column_data1.reflog, column_data2.reflog); return sort_order(sort, strcmp, column_data1.id, column_data2.id); case VIEW_COLUMN_FILE_NAME: if (mode_is_dir(column_data1.mode) != mode_is_dir(column_data2.mode)) return sort_order_reverse(sort, mode_is_dir(column_data1.mode) ? -1 : 1); return sort_order(sort, strcmp, column_data1.file_name, column_data2.file_name); case VIEW_COLUMN_FILE_SIZE: return sort_order(sort, number_compare, column_data1.file_size, column_data2.file_size); case VIEW_COLUMN_LINE_NUMBER: return sort_order_reverse(sort, line1->lineno - line2->lineno); case VIEW_COLUMN_MODE: return sort_order(sort, number_compare, column_data1.mode, column_data2.mode); case VIEW_COLUMN_REF: return sort_order(sort, ref_compare, column_data1.ref, column_data2.ref); case VIEW_COLUMN_COMMIT_TITLE: return sort_order(sort, strcmp, column_data1.commit_title, column_data2.commit_title); case VIEW_COLUMN_SECTION: return sort_order(sort, strcmp, column_data1.section->opt.section.text, column_data2.section->opt.section.text); case VIEW_COLUMN_STATUS: return sort_order(sort, number_compare, column_data1.status, column_data2.status); case VIEW_COLUMN_TEXT: return sort_order(sort, strcmp, column_data1.text, column_data2.text); } return 0; } void sort_view(struct view *view, bool change_field) { struct sort_state *state = &view->sort; if (change_field) { while (TRUE) { state->current = state->current->next ? state->current->next : view->columns; if (get_sort_field(view) == VIEW_COLUMN_ID && !state->current->opt.id.display) continue; break; } } else { state->reverse = !state->reverse; } sorting_view = view; qsort(view->line, view->lines, sizeof(*view->line), sort_view_compare); } static const char * view_column_text(struct view *view, struct view_column_data *column_data, struct view_column *column) { const char *text = ""; switch (column->type) { case VIEW_COLUMN_AUTHOR: if (column_data->author) text = mkauthor(column_data->author, column->opt.author.width, column->opt.author.display); break; case VIEW_COLUMN_COMMIT_TITLE: text = column_data->commit_title; break; case VIEW_COLUMN_DATE: if (column_data->date) text = mkdate(column_data->date, column->opt.date.display); break; case VIEW_COLUMN_REF: if (column_data->ref) text = column_data->ref->name; break; case VIEW_COLUMN_FILE_NAME: if (column_data->file_name) text = column_data->file_name; break; case VIEW_COLUMN_FILE_SIZE: if (column_data->file_size) text = mkfilesize(*column_data->file_size, column->opt.file_size.display); break; case VIEW_COLUMN_ID: if (column->opt.id.display) text = column_data->reflog ? column_data->reflog : column_data->id; break; case VIEW_COLUMN_LINE_NUMBER: break; case VIEW_COLUMN_MODE: if (column_data->mode) text = mkmode(*column_data->mode); break; case VIEW_COLUMN_STATUS: if (column_data->status) text = mkstatus(*column_data->status, column->opt.status.display); break; case VIEW_COLUMN_SECTION: text = column_data->section->opt.section.text; break; case VIEW_COLUMN_TEXT: text = column_data->text; break; } return text ? text : ""; } static bool grep_refs(struct view *view, struct view_column *column, const struct ref_list *list) { regmatch_t pmatch; size_t i; if (!list) return FALSE; for (i = 0; i < list->size; i++) { if (!regexec(view->regex, list->refs[i]->name, 1, &pmatch, 0)) return TRUE; } return FALSE; } bool view_column_grep(struct view *view, struct line *line) { struct view_column_data column_data = {}; bool ok = view->ops->get_column_data(view, line, &column_data); struct view_column *column; if (!ok) return FALSE; for (column = view->columns; column; column = column->next) { const char *text[] = { view_column_text(view, &column_data, column), NULL }; if (grep_text(view, text)) return TRUE; if (column->type == VIEW_COLUMN_COMMIT_TITLE && column->opt.commit_title.refs && grep_refs(view, column, column_data.refs)) return TRUE; } return FALSE; } bool view_column_info_changed(struct view *view, bool update) { struct view_column *column; bool changed = FALSE; for (column = view->columns; column; column = column->next) { if (memcmp(&column->prev_opt, &column->opt, sizeof(column->opt))) { if (!update) return TRUE; column->prev_opt = column->opt; changed = TRUE; } } return changed; } void view_column_reset(struct view *view) { struct view_column *column; view_column_info_changed(view, TRUE); for (column = view->columns; column; column = column->next) column->width = 0; } static enum status_code parse_view_column_config(char **pos, const char **name, const char **value, bool first) { size_t len = strcspn(*pos, ","); size_t optlen; if (strlen(*pos) > len) (*pos)[len] = 0; optlen = strcspn(*pos, ":="); if (first) { *name = "display"; if (optlen == len) { *value = len ? *pos : "yes"; *pos += len + 1; return SUCCESS; } /* Fake boolean enum value. */ *value = "yes"; return SUCCESS; } *name = *pos; if (optlen == len) *value = "yes"; else *value = *pos + optlen + 1; (*pos)[optlen] = 0; *pos += len + 1; return SUCCESS; } static enum status_code parse_view_column_option(struct view_column *column, const char *opt_name, const char *opt_value) { #define DEFINE_COLUMN_OPTION_INFO(name, type, flags) \ { #name, STRING_SIZE(#name), #type, &opt->name }, #define DEFINE_COLUMN_OPTIONS_PARSE(name, id, options) \ if (column->type == VIEW_COLUMN_##id) { \ struct name##_options *opt = &column->opt.name; \ struct option_info info[] = { \ options(DEFINE_COLUMN_OPTION_INFO) \ }; \ struct option_info *option = find_option_info(info, ARRAY_SIZE(info), opt_name); \ if (!option) \ return error("Unknown option `%s' for column %s", opt_name, \ view_column_name(VIEW_COLUMN_##id)); \ return parse_option(option, #name, opt_value); \ } COLUMN_OPTIONS(DEFINE_COLUMN_OPTIONS_PARSE); return error("Unknown view column option: %s", opt_name); } static enum status_code parse_view_column_type(struct view_column *column, const char **arg) { enum view_column_type type; size_t typelen = strcspn(*arg, ":,"); for (type = 0; type < view_column_type_map->size; type++) if (enum_equals(view_column_type_map->entries[type], *arg, typelen)) { *arg += typelen + !!(*arg)[typelen]; column->type = type; return SUCCESS; } return error("Failed to parse view column type: %.*s", (int) typelen, *arg); } static struct view * find_view(const char *view_name) { struct view *view; int i; foreach_view(view, i) if (!strncmp(view_name, view->name, strlen(view->name))) return view; return NULL; } enum status_code parse_view_config(const char *view_name, const char *argv[]) { enum status_code code = SUCCESS; size_t size = argv_size(argv); struct view_column *columns; struct view_column *column; struct view *view = find_view(view_name); int i; if (!view) return error("Unknown view: %s", view_name); columns = calloc(size, sizeof(*columns)); if (!columns) return ERROR_OUT_OF_MEMORY; for (i = 0, column = NULL; code == SUCCESS && i < size; i++) { const char *arg = argv[i]; char buf[SIZEOF_STR] = ""; char *pos, *end; bool first = TRUE; if (column) column->next = &columns[i]; column = &columns[i]; code = parse_view_column_type(column, &arg); if (code != SUCCESS) break; if (!(view->ops->column_bits & (1 << column->type))) return error("The %s view does not support %s column", view->name, view_column_name(column->type)); if ((column->type == VIEW_COLUMN_TEXT || column->type == VIEW_COLUMN_COMMIT_TITLE) && i + 1 < size) return error("The %s column must always be last", view_column_name(column->type)); string_ncopy(buf, arg, strlen(arg)); for (pos = buf, end = pos + strlen(pos); code == SUCCESS && pos <= end; first = FALSE) { const char *name = NULL; const char *value = NULL; code = parse_view_column_config(&pos, &name, &value, first); if (code == SUCCESS) code = parse_view_column_option(column, name, value); } column->prev_opt = column->opt; } if (code == SUCCESS) { free(view->columns); view->columns = columns; view->sort.current = view->columns; } else { free(columns); } return code; } struct view_column * get_view_column(struct view *view, enum view_column_type type) { struct view_column *column; for (column = view->columns; column; column = column->next) if (column->type == type) return column; return NULL; } bool view_column_info_update(struct view *view, struct line *line) { struct view_column_data column_data = {}; struct view_column *column; bool changed = FALSE; if (!view->ops->get_column_data(view, line, &column_data)) return FALSE; for (column = view->columns; column; column = column->next) { const char *text = view_column_text(view, &column_data, column); int width = 0; switch (column->type) { case VIEW_COLUMN_AUTHOR: width = column->opt.author.width; break; case VIEW_COLUMN_COMMIT_TITLE: width = column->opt.commit_title.width; break; case VIEW_COLUMN_DATE: width = column->opt.date.width; break; case VIEW_COLUMN_FILE_NAME: width = column->opt.file_name.width; break; case VIEW_COLUMN_FILE_SIZE: width = column->opt.file_size.width; break; case VIEW_COLUMN_ID: width = column->opt.id.width; if (!width) width = opt_id_width; if (!column_data.reflog && !width) width = 7; break; case VIEW_COLUMN_LINE_NUMBER: if (column_data.line_number) width = count_digits(*column_data.line_number); else width = count_digits(view->lines); if (width < 3) width = 3; break; case VIEW_COLUMN_MODE: width = column->opt.mode.width; break; case VIEW_COLUMN_REF: width = column->opt.ref.width; break; case VIEW_COLUMN_SECTION: break; case VIEW_COLUMN_STATUS: width = column->opt.status.width; break; case VIEW_COLUMN_TEXT: width = column->opt.text.width; break; } if (*text && !width) width = utf8_width(text); if (width > column->width) { column->width = width; changed = TRUE; } } if (changed) view->force_redraw = TRUE; return changed; } struct line * find_line_by_type(struct view *view, struct line *line, enum line_type type, int direction) { for (; view_has_line(view, line); line += direction) if (line->type == type) return line; return NULL; } /* * Line utilities. */ DEFINE_ALLOCATOR(realloc_lines, struct line, 256) struct line * add_line_at(struct view *view, unsigned long pos, const void *data, enum line_type type, size_t data_size, bool custom) { struct line *line; unsigned long lineno; if (!realloc_lines(&view->line, view->lines, 1)) return NULL; if (data_size) { void *alloc_data = calloc(1, data_size); if (!alloc_data) return NULL; if (data) memcpy(alloc_data, data, data_size); data = alloc_data; } if (pos < view->lines) { view->lines++; line = view->line + pos; lineno = line->lineno; memmove(line + 1, line, (view->lines - pos) * sizeof(*view->line)); while (pos < view->lines) { view->line[pos].lineno++; view->line[pos++].dirty = 1; } } else { line = &view->line[view->lines++]; lineno = view->lines - view->custom_lines; } memset(line, 0, sizeof(*line)); line->type = type; line->data = (void *) data; line->dirty = 1; if (custom) view->custom_lines++; else line->lineno = lineno; return line; } struct line * add_line(struct view *view, const void *data, enum line_type type, size_t data_size, bool custom) { return add_line_at(view, view->lines, data, type, data_size, custom); } struct line * add_line_alloc_(struct view *view, void **ptr, enum line_type type, size_t data_size, bool custom) { struct line *line = add_line(view, NULL, type, data_size, custom); if (line) *ptr = line->data; return line; } struct line * add_line_nodata(struct view *view, enum line_type type) { return add_line(view, NULL, type, 0, FALSE); } struct line * add_line_text(struct view *view, const char *text, enum line_type type) { struct line *line = add_line(view, text, type, strlen(text) + 1, FALSE); if (line && view->ops->column_bits) view_column_info_update(view, line); return line; } struct line * PRINTF_LIKE(3, 4) add_line_format(struct view *view, enum line_type type, const char *fmt, ...) { char buf[SIZEOF_STR]; int retval; FORMAT_BUFFER(buf, sizeof(buf), fmt, retval, FALSE); return retval >= 0 ? add_line_text(view, buf, type) : NULL; } /* * Global view state. */ /* Included last to not pollute the rest of the file. */ #include "tig/main.h" #include "tig/diff.h" #include "tig/log.h" #include "tig/tree.h" #include "tig/blob.h" #include "tig/blame.h" #include "tig/refs.h" #include "tig/status.h" #include "tig/stage.h" #include "tig/stash.h" #include "tig/grep.h" #include "tig/pager.h" #include "tig/help.h" static struct view *views[] = { #define VIEW_DATA(id, name) &name##_view VIEW_INFO(VIEW_DATA) }; struct view * get_view(int i) { return 0 <= i && i < ARRAY_SIZE(views) ? views[i] : NULL; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/src/watch.c000066400000000000000000000151321233303337700143450ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/repo.h" #include "tig/refdb.h" #include "tig/io.h" #include "tig/options.h" #include "tig/watch.h" static struct watch *watches; void watch_register(struct watch *watch, enum watch_trigger triggers) { watch_unregister(watch); watch->next = watches; watches = watch; watch->triggers = triggers; watch->changed = WATCH_NONE; watch->state = WATCH_NONE; } void watch_unregister(struct watch *watch) { struct watch *pos, *prev = NULL; for (pos = watches; pos; prev = pos, pos = pos->next) { if (watch != pos) continue; if (!prev) watches = watch->next; else prev->next = watch->next; break; } memset(watch, 0, sizeof(*watch)); } struct watch_handler { enum watch_trigger (*check)(struct watch_handler *handler, enum watch_event event, enum watch_trigger check); enum watch_trigger triggers; time_t last_modified; }; static bool check_file_mtime(time_t *last_modified, const char *path_fmt, ...) { char path[SIZEOF_STR]; struct stat stat; int retval; FORMAT_BUFFER(path, sizeof(path), path_fmt, retval, FALSE); if (retval < 0 || lstat(path, &stat) < 0 || stat.st_mtime <= *last_modified) return FALSE; *last_modified = stat.st_mtime; return TRUE; } static enum watch_trigger watch_head_handler(struct watch_handler *handler, enum watch_event event, enum watch_trigger check) { struct ref *head; if (check_file_mtime(&handler->last_modified, "%s/HEAD", repo.git_dir)) return WATCH_HEAD; // FIXME: check branch if ((head = get_ref_head()) && check_file_mtime(&handler->last_modified, "%s/refs/head/%s", repo.git_dir, head->name)) return WATCH_HEAD; return WATCH_NONE; } static enum watch_trigger watch_stash_handler(struct watch_handler *handler, enum watch_event event, enum watch_trigger check) { if (check_file_mtime(&handler->last_modified, "%s/refs/stash", repo.git_dir)) return WATCH_STASH; return WATCH_NONE; } static enum watch_trigger watch_index_handler(struct watch_handler *handler, enum watch_event event, enum watch_trigger check) { enum watch_trigger changed = WATCH_NONE; struct index_diff diff; if (event == WATCH_EVENT_AFTER_EXTERNAL) return check_file_mtime(&handler->last_modified, "%s/index", repo.git_dir) ? check : WATCH_NONE; if (!check_file_mtime(&handler->last_modified, "%s/index", repo.git_dir) || event == WATCH_EVENT_SWITCH_VIEW || !index_diff(&diff, FALSE, FALSE)) return WATCH_NONE; if (check & WATCH_INDEX_STAGED) { if (diff.staged) changed |= WATCH_INDEX_STAGED_YES; else changed |= WATCH_INDEX_STAGED_NO; } if (check & WATCH_INDEX_UNSTAGED) { if (diff.unstaged) changed |= WATCH_INDEX_UNSTAGED_YES; else changed |= WATCH_INDEX_UNSTAGED_NO; } if (changed) handler->last_modified = time(NULL); return changed; } static enum watch_trigger watch_refs_handler(struct watch_handler *handler, enum watch_event event, enum watch_trigger check) { if (event == WATCH_EVENT_AFTER_EXTERNAL) load_refs(TRUE); return WATCH_NONE; } static struct watch_handler watch_handlers[] = { { watch_index_handler, WATCH_INDEX }, { watch_head_handler, WATCH_HEAD }, { watch_stash_handler, WATCH_STASH }, { watch_refs_handler, WATCH_HEAD | WATCH_REFS }, }; static bool watch_no_refresh(enum watch_event event) { return opt_refresh_mode == REFRESH_MODE_MANUAL || (opt_refresh_mode == REFRESH_MODE_AFTER_COMMAND && event != WATCH_EVENT_AFTER_EXTERNAL); } static void watch_apply_changes(struct watch *source, enum watch_event event, enum watch_trigger changed) { struct watch *watch; if (watch_no_refresh(event)) return; for (watch = watches; watch; watch = watch->next) { enum watch_trigger triggers = changed & watch->triggers; if (source == watch) source->state |= triggers; else if (triggers) watch->changed |= triggers; } } void watch_apply(struct watch *source, enum watch_trigger changed) { return watch_apply_changes(source, WATCH_EVENT_LOAD, changed); } static enum watch_trigger watch_update_event(enum watch_event event, enum watch_trigger trigger, enum watch_trigger changed) { int i; if (watch_no_refresh(event)) return WATCH_NONE; for (i = 0; trigger && i < ARRAY_SIZE(watch_handlers); i++) { struct watch_handler *handler = &watch_handlers[i]; if (*repo.git_dir && (trigger & handler->triggers) && (changed | handler->triggers) != changed) changed |= handler->check(handler, event, trigger); } if (changed) watch_apply_changes(NULL, event, changed); return changed; } #define watch_trigger_unmask(triggers, set) ((triggers) & ~(set)) static inline enum watch_trigger watch_unchanged_triggers(struct watch *watch) { return watch_trigger_unmask(watch->triggers, watch->changed); } enum watch_trigger watch_update_single(struct watch *watch, enum watch_event event) { enum watch_trigger trigger = watch_unchanged_triggers(watch); return watch_update_event(event, trigger, watch->changed); } enum watch_trigger watch_update(enum watch_event event) { enum watch_trigger trigger = WATCH_NONE; struct watch *watch; /* Collect triggers to check. Skkipping watches that are already * marked dirty to avoid unnecessary checks. */ for (watch = watches; watch; watch = watch->next) trigger |= watch_unchanged_triggers(watch); return watch_update_event(event, trigger, WATCH_NONE); } int watch_periodic(int interval) { static time_t last_update; int delay = -1; if (watches && interval > 0) { time_t now = time(NULL); if (!last_update) last_update = now; if (last_update + interval <= now) { watch_update(WATCH_EVENT_PERIODIC); last_update = now; } delay = (now - last_update + interval) * 1000; } return delay; } bool watch_dirty(struct watch *watch) { enum watch_trigger old_index = watch->state & WATCH_INDEX; enum watch_trigger new_index = watch->changed & WATCH_INDEX; enum watch_trigger index = watch_trigger_unmask(new_index, old_index); enum watch_trigger other = watch_trigger_unmask(watch->changed, WATCH_INDEX); bool dirty = !!(index | other); watch->changed = WATCH_NONE; return dirty; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/test/000077500000000000000000000000001233303337700132615ustar00rootroot00000000000000tig-2.0.2/test/builtin-config.sh000077500000000000000000000004601233303337700165310ustar00rootroot00000000000000#!/bin/bash result=0 export GIT_DIR=./does-not-exist export TIGRC_SYSTEM= export TIGRC_USER= src/tig 2>&1 | grep -q "tig: Error in built-in config" if [ $? == 0 ] then echo "not ok - Errors reported in built-in config" result=$(($result+1)) else echo "ok - Built-in config loaded" fi exit $result tig-2.0.2/test/test-graph-samples/000077500000000000000000000000001233303337700170015ustar00rootroot00000000000000tig-2.0.2/test/test-graph-samples/10_shorter_merge_than_branch.in000066400000000000000000000006141233303337700250260ustar00rootroot00000000000000commit A H B C D J E Commit A - merge H, B, C, D, and E commit B K Commit B - after K commit C H Commit C - after H commit J I Commit J - after I commit D K Commit D - after K commit E F Commit E - after F commit K F Commit K - after F commit F G H Commit F - merge G and H commit G I Commit G - after I commit H I Commit H - after I commit I Commit I tig-2.0.2/test/test-graph-samples/10_shorter_merge_than_branch.out000066400000000000000000000007771233303337700252410ustar00rootroot00000000000000â—─┬─┬─┬─┬─╮ Commit A - merge H, B, C, D, and E │ ◠│ │ │ │ Commit B - after K │ │ ◠│ │ │ Commit C - after H │ │ │ │ ◠│ Commit J - after I │ │ │ ◠│ │ Commit D - after K │ │ │ │ │ â— Commit E - after F │ â—─│─╯ │ │ Commit K - after F │ â—─│─╭─╯─╯ Commit F - merge G and H │ ◠│ │ ╭─╯ Commit G - after I â—─│─┴─│─╯ Commit H - after I ◎─┴───╯ Commit I tig-2.0.2/test/test-graph-samples/11_new_branch_in_middle.in000066400000000000000000000005041233303337700237430ustar00rootroot00000000000000commit A B C E Commit A - merge B, C, and E commit B F Commit B - after F commit C F Commit C - after F commit E Z Commit E - after Z commit F G I Commit F - merge G and I commit G H I Commit F - merge H and I commit H I Commit H - after I commit I Z Commit I - after Z commit Z Commit Z tig-2.0.2/test/test-graph-samples/11_new_branch_in_middle.out000066400000000000000000000005051233303337700241450ustar00rootroot00000000000000â—─┬─╮ Commit A - merge B, C, and E ◠│ │ Commit B - after F │ ◠│ Commit C - after F │ │ â— Commit E - after Z â—─╯ │ Commit F - merge G and I â—─│─│─╮ Commit F - merge H and I ◠│ │ │ Commit H - after I â—─┴─│─╯ Commit I - after Z ◎───╯ Commit Z tig-2.0.2/test/test-graph-samples/12_cross_over_collapse.in000066400000000000000000000004741233303337700237060ustar00rootroot00000000000000commit A B D E Commit A - merge B, D, and E commit B F Commit B - after F commit D F Commit D - after F commit E Z Commit E - after Z commit F G Commit F - after I commit G H I Commit F - merge H and I commit H I Commit H - after I commit I Z Commit I - after Z commit Z Commit Z tig-2.0.2/test/test-graph-samples/12_cross_over_collapse.out000066400000000000000000000004651233303337700241070ustar00rootroot00000000000000â—─┬─╮ Commit A - merge B, D, and E ◠│ │ Commit B - after F │ ◠│ Commit D - after F │ │ â— Commit E - after Z â—─╯ │ Commit F - after I â—─╭─╯─╮ Commit F - merge H and I ◠│ ╭─╯ Commit H - after I â—─│─╯ Commit I - after Z ◎─╯ Commit Z tig-2.0.2/test/test-graph-samples/13_collapse_parallel_branches_with_different_middle_branch.in000066400000000000000000000005401233303337700330720ustar00rootroot00000000000000commit A B C D E F Commit A - merge B, C, D, E, and F commit D I Commit D - after I commit E J Commit E - after J commit F I Commit F - after I commit B C Commit B - after C commit C G Commit C - after G commit G H Commit G - after H commit H I Commit H - after I commit I J Commit I - after J commit J Commit J tig-2.0.2/test/test-graph-samples/13_collapse_parallel_branches_with_different_middle_branch.out000066400000000000000000000006361233303337700333010ustar00rootroot00000000000000â—─┬─┬─┬─╮ Commit A - merge B, C, D, E, and F │ │ ◠│ │ Commit D - after I │ │ │ ◠│ Commit E - after J │ │ │ │ â— Commit F - after I ◠│ │ │ │ Commit B - after C â—─╯ │ │ │ Commit C - after G ◠╭─╯ │ │ Commit G - after H ◠│ ╭─╯ │ Commit H - after I â—─┴─│───╯ Commit I - after J ◎───╯ Commit J tig-2.0.2/test/test-graph-samples/14_long_collapse_line.in000066400000000000000000000013461233303337700234710ustar00rootroot00000000000000commit A B C D E F G Commit A - merge B, C, D, E, F, and G commit C B Commit C - after B commit D B Commit D - after B commit E B Commit E - after B commit F B Commit F - after B commit B H Commit B - after H commit H I G Commit H - merge I and G commit I J Commit I - after J commit G J Commit G - after J commit J K Commit J - after K commit K L M N O P Q Commit K - merge L, M, N, O, P, and Q commit M L Commit M - after L commit N L Commit N - after L commit O L Commit O - after L commit P L Commit P - after L commit L R Commit L - after R commit R S T Commit R - merge S and T commit S Q Commit S - after Q commit T Q Commit T - after Q commit Q Commit Q tig-2.0.2/test/test-graph-samples/14_long_collapse_line.out000066400000000000000000000016641233303337700236750ustar00rootroot00000000000000â—─┬─┬─┬─┬─╮ Commit A - merge B, C, D, E, F, and G │ ◠│ │ │ │ Commit C - after B │ │ ◠│ │ │ Commit D - after B │ │ │ ◠│ │ Commit E - after B │ │ │ │ ◠│ Commit F - after B â—─┴─┴─┴─╯ │ Commit B - after H â—─╭───────╯─╮ Commit H - merge I and G ◠│ ╭───────╯ Commit I - after J │ â—─╯ Commit G - after J â—─╯ Commit J - after K â—─┬─┬─┬─┬─╮ Commit K - merge L, M, N, O, P, and Q │ ◠│ │ │ │ Commit M - after L │ │ ◠│ │ │ Commit N - after L │ │ │ ◠│ │ Commit O - after L │ │ │ │ ◠│ Commit P - after L â—─┴─┴─┴─╯ │ Commit L - after R â—─╭───────╯─╮ Commit R - merge S and T ◠│ ╭───────╯ Commit S - after Q │ │ â— Commit T - after Q ◎─┴─╯ Commit Q tig-2.0.2/test/test-graph-samples/16_changes.in000066400000000000000000000006041233303337700212470ustar00rootroot00000000000000commit 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 Staged changes commit 0000000000000000000000000000000000000000 007ae1f1c611254aaf67b71d42d2326be7ab4047 Unstaged changes commit 007ae1f1c611254aaf67b71d42d2326be7ab4047 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX First commit commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Last commit tig-2.0.2/test/test-graph-samples/16_changes.out000066400000000000000000000001111233303337700214410ustar00rootroot00000000000000â— Staged changes â— Unstaged changes â— First commit â—Ž Last commit tig-2.0.2/test/test-graph-samples/1_merge_from_left.in000066400000000000000000000002541233303337700227060ustar00rootroot00000000000000commit A B C Commit A - Merge C into B commit C B D Commit C - Merge D into B commit B E Commit B after E commit E D Commit E after D commit D Commit D tig-2.0.2/test/test-graph-samples/1_merge_from_left.out000066400000000000000000000002351233303337700231060ustar00rootroot00000000000000â—─╮ Commit A - Merge C into B │ â—─╮ Commit C - Merge D into B â—─╯ │ Commit B after E ◠╭─╯ Commit E after D ◎─╯ Commit D tig-2.0.2/test/test-graph-samples/2_duplicate_parent.in000066400000000000000000000005021233303337700230720ustar00rootroot00000000000000commit A B C Commit A - Merge C into B commit B C E Commit B - Merge E into C commit C D Commit C after D commit E D Commit E after D commit D F Commit D after F commit F G H Commit F - Merge H into G commit G H I Commit G - Merge I into H commit I H Commit I after H commit H Commit H tig-2.0.2/test/test-graph-samples/2_duplicate_parent.out000066400000000000000000000004531233303337700233000ustar00rootroot00000000000000â—─╮ Commit A - Merge C into B â—─│─╮ Commit B - Merge E into C â—─╯ │ Commit C after D │ â—─╯ Commit E after D â—─╯ Commit D after F â—─╮ Commit F - Merge H into G â—─│─╮ Commit G - Merge I into H │ │ â— Commit I after H ◎─┴─╯ Commit H tig-2.0.2/test/test-graph-samples/3_octo_merge.in000066400000000000000000000002621233303337700216760ustar00rootroot00000000000000commit A B C D Commit A - Merges B, C, and D commit C E Commit C after E commit E D B Commit E - Merges D and B commit B D Commit B after D commit D Commit D tig-2.0.2/test/test-graph-samples/3_octo_merge.out000066400000000000000000000002711233303337700220770ustar00rootroot00000000000000â—─┬─╮ Commit A - Merges B, C, and D │ ◠│ Commit C after E │ â—─│─╮ Commit E - Merges D and B â—─│─│─╯ Commit B after D ◎─┴─╯ Commit D tig-2.0.2/test/test-graph-samples/4_missing_bar.in000066400000000000000000000003641233303337700220540ustar00rootroot00000000000000commit A B C Commit A - Merge B and C commit B D E Commit B - Merge D and E commit C F Commit C after F commit F G D Commit F - Merge G and D commit D G Commit D after G commit G E Commit G after E commit E Commit E tig-2.0.2/test/test-graph-samples/4_missing_bar.out000066400000000000000000000003651233303337700222560ustar00rootroot00000000000000â—─╮ Commit A - Merge B and C â—─│─╮ Commit B - Merge D and E │ ◠│ Commit C after F │ â—─│─╮ Commit F - Merge G and D â—─│─│─╯ Commit D after G â—─╯ │ Commit G after E ◎───╯ Commit E tig-2.0.2/test/test-graph-samples/5_extra_pipe.in000066400000000000000000000003001233303337700217060ustar00rootroot00000000000000commit A B C Commit A - merge B and C commit C D Commit C after D commit B E D Commit B - merge E and D commit D F Commit D after F commit E Commit E commit F Commit F tig-2.0.2/test/test-graph-samples/5_extra_pipe.out000066400000000000000000000002501233303337700221130ustar00rootroot00000000000000â—─╮ Commit A - merge B and C │ â— Commit C after D â—─│─╮ Commit B - merge E and D │ â—─╯ Commit D after F â—Ž │ Commit E ◎─╯ Commit F tig-2.0.2/test/test-graph-samples/6_extra_bars.in000066400000000000000000000037331233303337700217160ustar00rootroot00000000000000commit A B C Commit A - merge B and C commit C B Commit C - after B commit D B Commit D - after B commit E F Commit E - after F commit F G Commit F - after G commit G H Commit G - after H commit H I Commit H - after I commit I J Commit I - after J commit J K Commit J - after K commit K L Commit K - after L commit L M Commit L - after M commit M N Commit M - after N commit N O Commit N - after O commit O P Commit O - after P commit B Q R Commit B - merge Q and R commit R Q Commit R - after Q commit Q S T Commit Q - merge S and T commit T S Commit T - after S commit P U Commit P - after U commit U V Commit U - after V commit V W Commit V - after W commit S X Y Commit S - merge X and Y commit Z 1 Commit Z - after 1 commit Y X Commit Y - after X commit X 2 3 Commit X - merge 2 and 3 commit 3 2 Commit 3 - after 2 commit 4 5 Commit 4 - after 5 commit 5 6 Commit 5 - after 6 commit W 7 Commit W - after 7 commit 6 8 Commit 6 - after 8 commit 7 9 Commit 7 - after 9 commit 2 0 a Commit 2 - merge 0 and a commit a b Commit a - after b commit b c Commit b - after c commit c d 0 Commit c - merge d and 0 commit 8 e Commit 8 - after e commit e f Commit e - after f commit f g Commit f - after g commit 0 h i Commit 0 - merge h and i commit g j Commit g - after j commit j k Commit j - after k commit k l Commit k - after l commit l m Commit l - after m commit m n Commit m - after n commit n o Commit n - after o commit o p Commit o - after p commit p 1 Commit p - after 1 commit 9 q Commit 9 - after q commit 1 r Commit 1 - after r commit i h Commit i - after h commit d h Commit d - after h commit r s Commit r - after s commit h t u Commit h - merge t and u commit s v Commit s - after v commit u t Commit u - after t commit w x Commit w - after x commit x y Commit x - after y tig-2.0.2/test/test-graph-samples/6_extra_bars.out000066400000000000000000000042671233303337700221220ustar00rootroot00000000000000â—─╮ Commit A - merge B and C │ â— Commit C - after B │ │ â— Commit D - after B │ │ │ â— Commit E - after F │ │ │ â— Commit F - after G │ │ │ â— Commit G - after H │ │ │ â— Commit H - after I │ │ │ â— Commit I - after J │ │ │ â— Commit J - after K │ │ │ â— Commit K - after L │ │ │ â— Commit L - after M │ │ │ â— Commit M - after N │ │ │ â— Commit N - after O │ │ │ â— Commit O - after P â—─┴─╯ │ Commit B - merge Q and R │ ◠╭─╯ Commit R - after Q â—─╯ │ Commit Q - merge S and T │ ◠│ Commit T - after S │ │ â— Commit P - after U │ │ â— Commit U - after V │ │ â— Commit V - after W â—─╯ │ Commit S - merge X and Y │ │ │ â— Commit Z - after 1 │ ◠│ │ Commit Y - after X â—─╯ │ │ Commit X - merge 2 and 3 │ ◠│ │ Commit 3 - after 2 │ │ │ │ â— Commit 4 - after 5 │ │ │ │ â— Commit 5 - after 6 │ │ ◠│ │ Commit W - after 7 │ │ │ │ â— Commit 6 - after 8 │ │ ◠│ │ Commit 7 - after 9 â—─╯ │ │ │ Commit 2 - merge 0 and a │ ◠│ │ │ Commit a - after b │ ◠│ │ │ Commit b - after c │ â—─│─│─│─╮ Commit c - merge d and 0 │ │ │ │ ◠│ Commit 8 - after e │ │ │ │ ◠│ Commit e - after f │ │ │ │ ◠│ Commit f - after g â—─│─│─│─│─╯ Commit 0 - merge h and i │ │ │ │ ◠│ Commit g - after j │ │ │ │ ◠│ Commit j - after k │ │ │ │ ◠│ Commit k - after l │ │ │ │ ◠│ Commit l - after m │ │ │ │ ◠│ Commit m - after n │ │ │ │ ◠│ Commit n - after o │ │ │ │ ◠│ Commit o - after p │ │ │ │ ◠│ Commit p - after 1 │ │ ◠│ │ │ Commit 9 - after q │ │ │ â—─╯ │ Commit 1 - after r │ │ │ │ â—─╯ Commit i - after h │ ◠│ │ │ Commit d - after h │ │ │ ◠│ Commit r - after s â—─┴─│─│─╯ Commit h - merge t and u │ │ │ â— Commit s - after v │ ◠│ │ Commit u - after t │ │ │ │ â— Commit w - after x │ │ │ │ â— Commit x - after y tig-2.0.2/test/test-graph-samples/7_multi_collapse.in000066400000000000000000000004341233303337700225740ustar00rootroot00000000000000commit A B C D E F Commit A - merge B, C, D, E, and F commit C B Commit C - after B commit B H Commit B - after H commit F G Commit F - after G commit H D Commit H - after D commit D E Commit D - after E commit E G Commit E - after G commit G Commit G tig-2.0.2/test/test-graph-samples/7_multi_collapse.out000066400000000000000000000005221233303337700227730ustar00rootroot00000000000000â—─┬─┬─┬─╮ Commit A - merge B, C, D, E, and F │ ◠│ │ │ Commit C - after B â—─╯ │ │ │ Commit B - after H │ ╭─╯ │ â— Commit F - after G ◠│ ╭─╯ │ Commit H - after D â—─╯ │ ╭─╯ Commit D - after E â—───╯ │ Commit E - after G ◎─────╯ Commit G tig-2.0.2/test/test-graph-samples/8_multi_collapse_2.in000066400000000000000000000005031233303337700230130ustar00rootroot00000000000000commit A Z B C D E F Commit A - merge Z, B, C, D, E, and F commit C B Commit C - after B commit B H Commit B - after H commit F G Commit F - after G commit H D Commit H - after D commit D E Commit D - after E commit E G Commit E - after G commit G Z Commit G - after Z commit Z Commit Z tig-2.0.2/test/test-graph-samples/8_multi_collapse_2.out000066400000000000000000000006241233303337700232200ustar00rootroot00000000000000â—─┬─┬─┬─┬─╮ Commit A - merge Z, B, C, D, E, and F │ │ ◠│ │ │ Commit C - after B │ â—─╯ │ │ │ Commit B - after H │ │ ╭─╯ │ â— Commit F - after G │ ◠│ ╭─╯ │ Commit H - after D │ â—─╯ │ ╭─╯ Commit D - after E │ â—───╯ │ Commit E - after G │ â—─────╯ Commit G - after Z ◎─╯ Commit Z tig-2.0.2/test/test-graph-samples/9_parallel_siblings.in000066400000000000000000000005041233303337700232460ustar00rootroot00000000000000commit A Z B C Commit A - merge Z, B, and C commit B D C Commit B - merge D and C commit D E C Commit D - merge C and E commit E Z Commit E - after Z commit Z Y Commit Z - after Y commit Y X Commit Y - after X commit X W Commit X - after W commit W C Commit W - after C commit C Commit C tig-2.0.2/test/test-graph-samples/9_parallel_siblings.out000066400000000000000000000005671233303337700234600ustar00rootroot00000000000000â—─┬─╮ Commit A - merge Z, B, and C │ â—─│─╮ Commit B - merge D and C │ â—─│─│─╮ Commit D - merge C and E │ ◠│ │ │ Commit E - after Z â—─╯ │ │ │ Commit Z - after Y ◠╭─╯ │ │ Commit Y - after X ◠│ ╭─╯ │ Commit X - after W ◠│ │ ╭─╯ Commit W - after C ◎─┴─┴─╯ Commit C tig-2.0.2/test/test-graph-samples/many_merges.in000066400000000000000000000045761233303337700216530ustar00rootroot00000000000000commit P N O Commit P - Merge O into N commit O M Commit O after M commit N L M Commit N - Merge M into L commit M K Commit M after K commit L J K Commit L - Merge K into J commit K E J Commit K - Merge J into E commit J I F Commit J - Merge F into I commit I C H Commit I - Merge H into C commit H G Commit H after G commit F C Commit F after C commit E D Commit E after D commit C A B Commit C - Merge B into A commit D Q Commit D after Q commit B R Commit B after R commit R A Commit R after A commit Q X Commit Q after X commit A S T Commit A - Merge T into S commit T U Commit T after U commit U V Commit U after V commit V W Commit V after W * b132970 (HEAD) Merge pull request #22 in COM/compliance_checks from feature/6963/fireeye to master |\ | * a300155 (origin/feature/6963/fireeye, feature/6963/fireeye) When no lines found for info report, say so * | acdad90 Merge pull request #21 in COM/compliance_checks from feature/6963/fireeye to master |\ \ | |/ | * 27ea95d Reduce output lines on failure and improve status messages * | 1c4f527 Merge pull request #10 in COM/compliance_checks from feature/6963/fireeye to master |\ \ | |/ | * bcad23b Merge branch 'master' into feature/6963/fireeye | |\ | |/ |/| * | 4d124b1 Merge pull request #19 in COM/compliance_checks from pa_typo to master |\ \ | * | 6648aeb fix typo * | | 8bba33d Merge pull request #20 in COM/compliance_checks from 2012typo to master |\ \ \ | |/ / |/| | | * | 0b7d81c fixed typo * | | 04d6735 Merge pull request #18 in COM/compliance_checks from procurve_naid to master |\ \ \ | * | | d6c83d9 Cleaned up the reference field indentation. tig-2.0.2/test/test-graph-samples/many_merges.out000066400000000000000000000013301233303337700220350ustar00rootroot00000000000000â—─╮ Commit P - Merge O into N │ â— Commit O after M â—─│─╮ Commit N - Merge M into L │ â—─╯ Commit M after K â—─│─╮ Commit L - Merge K into J │ â—─╯ Commit K - Merge J into E â—─│─╯ Commit J - Merge F into I â—─│─│─╮ Commit I - Merge H into C │ │ │ â— Commit H after G │ │ ◠│ Commit F after C │ ◠│ │ Commit E after D â—─│─╯ │ Commit C - Merge B into A │ ◠│ │ Commit D after Q │ │ ◠│ Commit B after R │ │ ◠│ Commit R after A │ ◠│ │ Commit Q after X â—─│─╯ │ Commit A - Merge T into S │ │ ◠│ Commit T after U │ │ ◠│ Commit U after V │ │ ◠│ Commit V after W tig-2.0.2/test/test-graph-samples/more.in000066400000000000000000000024241233303337700202750ustar00rootroot00000000000000commit A B C D E Commit A - merge B, C, D, and E commit D B Commit D - after B commit C F Commit C - after F commit E H Commit E - after H commit B H F Commit B - merge H and F commit F G Commit F - after G commit G H Commit G - after H commit H I Commit H - after I commit I J K L M P O Commit I - merge J, K, L, M, P, and O commit K J Commit K - after J commit J N Commit J - after N commit N O Commit N - after O commit O Q Commit O - after Q commit Q R S Commit Q - merge R and S commit R T U Commit R - merge T and U commit T V W Commit T - merge V and W commit V X W Commit V - merge X and W commit X Y Z Commit X - merge Y and Z commit W Commit W commit M Y 1 2 Commit M - merge Y, 1, and 2 commit P Y Commit P - after Y commit Z Y Commit Z - after Y commit Y 1 Commit Y - after 1 commit 1 2 Commit 1 - after 2 commit 2 S Commit 2 - after S commit S U Commit S - after U commit U 3 Commit U - after 3 commit 3 4 5 8 Commit 3 - merge 4, 5, and 8 commit 4 6 5 Commit 4 - merge 6 and 5 commit 5 7 9 Commit 5 - merge 7 and 9 commit 6 A 9 Commit 6 - merge A and 9 commit A Commit A commit L Commit L commit 7 Commit 7 commit 8 Commit 8 commit 9 Commit 9 tig-2.0.2/test/test-graph-samples/more.out000066400000000000000000000035401233303337700204760ustar00rootroot00000000000000â—─┬─┬─╮ Commit A - merge B, C, D, and E │ │ ◠│ Commit D - after B │ ◠│ │ Commit C - after F │ │ │ â— Commit E - after H â—─│─╯ │ Commit B - merge H and F │ â—─╯ │ Commit F - after G │ ◠╭─╯ Commit G - after H â—─┴─╯ Commit H - after I â—─┬─┬─┬─┬─╮ Commit I - merge J, K, L, M, P, and O │ ◠│ │ │ │ Commit K - after J â—─╯ │ │ │ │ Commit J - after N ◠╭─╯ │ │ │ Commit N - after O â—─│─╭─╯─│─╯ Commit O - after Q â—─│─│─╭─╯─╮ Commit Q - merge R and S â—─│─│─│─╭─╯─╮ Commit R - merge T and U â—─│─│─│─│─╭─╯─╮ Commit T - merge V and W â—─│─│─│─│─│─╭─╯─╮ Commit V - merge X and W â—─│─│─│─│─│─│─╭─╯─╮ Commit X - merge Y and Z │ │ │ │ │ │ ◎─╯ ╭─╯ Commit W │ │ â—─│─│─│─╭───╯─┬─╮ Commit M - merge Y, 1, and 2 │ │ │ ◠│ │ │ ╭───╯ │ Commit P - after Y │ │ │ │ │ │ ◠│ ╭───╯ Commit Z - after Y â—─│─┴─┴─│─│─╯ │ │ Commit Y - after 1 â—─│─╭───╯─│───╯ │ Commit 1 - after 2 â—─│─│─╭───╯─────╯ Commit 2 - after S â—─│─╯ │ Commit S - after U â—─│───╯ Commit U - after 3 â—─│─┬─╮ Commit 3 - merge 4, 5, and 8 â—─│─│─│─╮ Commit 4 - merge 6 and 5 │ │ â—─│─╯ Commit 5 - merge 7 and 9 â—─│─│─│─│─╮ Commit 6 - merge A and 9 â—Ž │ │ │ │ │ Commit A ◎─╯ │ │ │ │ Commit L ◎───╯ │ │ │ Commit 7 ◎─────╯ │ │ Commit 8 ◎───────┴─╯ Commit 9 tig-2.0.2/test/test-graph-samples/simple.in000066400000000000000000000012241233303337700206210ustar00rootroot00000000000000commit f e d Merge branch 'branch3' commit e b c Merge branch 'branch2' commit d a branch3 commit c a branch2 commit b a 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 tig-2.0.2/test/test-graph-samples/simple.out000066400000000000000000000002311233303337700210170ustar00rootroot00000000000000â—─╮ Merge branch 'branch3' â—─│─╮ Merge branch 'branch2' │ ◠│ branch3 │ │ â— branch2 ◠│ │ branch1 ◎─┴─╯ init tig-2.0.2/test/test-graph-samples/tig-all-long.in000066400000000000000000023766741233303337700216500ustar00rootroot00000000000000commit f5160e1ce06445f9b7323e91dc8c1470b06a3d4b 85e82d060ce75a840f84cd53259413461633aaa5 tree e1d76f53a0cd49ff0cd5cb53a831e46db7f1d787 parent 85e82d060ce75a840f84cd53259413461633aaa5 author Benjamin Bergman 1388778057 -0600 committer Benjamin Bergman 1388778294 -0600 Fix stupid bug I introduced commit 91079e51c53f310dc4981ad87ea752ade7553041 ff10e741a1a81d7dff97adb855c3304cd2af6586 1401c715df28c5efdfccbb6e84b1f05677c04bb0 tree d698196abdde3f637409427ca5f3dfea1bfdf209 parent ff10e741a1a81d7dff97adb855c3304cd2af6586 parent 1401c715df28c5efdfccbb6e84b1f05677c04bb0 author Benjamin Bergman 1387563174 -0600 committer Benjamin Bergman 1387563174 -0600 On redo-next-row: segfault stuff commit 1401c715df28c5efdfccbb6e84b1f05677c04bb0 ff10e741a1a81d7dff97adb855c3304cd2af6586 tree b2ca5715befcc80f05e200984351bb44bca1e2a8 parent ff10e741a1a81d7dff97adb855c3304cd2af6586 author Benjamin Bergman 1387563174 -0600 committer Benjamin Bergman 1387563174 -0600 index on redo-next-row: ff10e74 Change some memory management stuff commit ff10e741a1a81d7dff97adb855c3304cd2af6586 48a6ca25bd8c018117f9cd752cd8acf962d90060 tree b2ca5715befcc80f05e200984351bb44bca1e2a8 parent 48a6ca25bd8c018117f9cd752cd8acf962d90060 author Benjamin Bergman 1383945891 -0600 committer Benjamin Bergman 1383945891 -0600 Change some memory management stuff commit 85e82d060ce75a840f84cd53259413461633aaa5 3c5321af10963dedb71361173e17fea5fddbcd09 tree 0751a22a3cfde6d0c3fad0910c77664b0e9dfd1c parent 3c5321af10963dedb71361173e17fea5fddbcd09 author Benjamin Bergman 1382970000 -0500 committer Benjamin Bergman 1382970000 -0500 One more fix commit 3c5321af10963dedb71361173e17fea5fddbcd09 fa53fb34d6bed0444dfc65254dfccf5ec27fb5a8 tree 91c965c280d9b6faa89ce6fe648d8676e8233b2a parent fa53fb34d6bed0444dfc65254dfccf5ec27fb5a8 author Benjamin Bergman 1382968508 -0500 committer Benjamin Bergman 1382968508 -0500 Another fix commit fa53fb34d6bed0444dfc65254dfccf5ec27fb5a8 48a6ca25bd8c018117f9cd752cd8acf962d90060 tree badae0344d4e7e59357a2905442aa2ed04505dbf parent 48a6ca25bd8c018117f9cd752cd8acf962d90060 author Benjamin Bergman 1382935317 -0500 committer Benjamin Bergman 1382935317 -0500 Use pre-generated next row commit 48a6ca25bd8c018117f9cd752cd8acf962d90060 5a0a8ed21bcf5be036fe66479f2be89d32e4c214 tree 0579c24b661ed3863bbcc1c6cddafd0a13b9d7fd parent 5a0a8ed21bcf5be036fe66479f2be89d32e4c214 author Benjamin Bergman 1382933509 -0500 committer Benjamin Bergman 1382933509 -0500 Add function to pre-generate next row commit 5a0a8ed21bcf5be036fe66479f2be89d32e4c214 2696d90c257f97226447bac12dfa9ec266b1221d tree 01d6e82f68c014dd7bf9f3539b7738531ee005cb parent 2696d90c257f97226447bac12dfa9ec266b1221d author Benjamin Bergman 1382906024 -0500 committer Benjamin Bergman 1382906024 -0500 A little more broken to make it better commit 2696d90c257f97226447bac12dfa9ec266b1221d c445378c6aef243a63c805bb1da7afba9821dd07 tree 3e8dc50a65b9e3a95a128aa65b6a804e2b479e57 parent c445378c6aef243a63c805bb1da7afba9821dd07 author Benjamin Bergman 1382852608 -0500 committer Benjamin Bergman 1382852608 -0500 Always insert extra columns at the end commit c445378c6aef243a63c805bb1da7afba9821dd07 02cb3450c52aff5f9daafd479e97a52d01edaf2f tree ac394f2b65aee9be50ce61eab2c9db6865640777 parent 02cb3450c52aff5f9daafd479e97a52d01edaf2f author Benjamin Bergman 1382772930 -0500 committer Benjamin Bergman 1382772930 -0500 Works for first test case commit 02cb3450c52aff5f9daafd479e97a52d01edaf2f 05927494e74b8ddcebfe9163338bf1e6ddb899d5 tree 0f0513ed6df99f7db29b7b821660636af9f5410b parent 05927494e74b8ddcebfe9163338bf1e6ddb899d5 author Benjamin Bergman 1382768031 -0500 committer Benjamin Bergman 1382768031 -0500 Better, but missing some lines still commit 05927494e74b8ddcebfe9163338bf1e6ddb899d5 bc911786d75680d0fa28ac81c846775f6a7c894f tree e83f2f19de9422f1a4ba24e406e7daf43b3781bd parent bc911786d75680d0fa28ac81c846775f6a7c894f author Benjamin Bergman 1382764756 -0500 committer Benjamin Bergman 1382764756 -0500 A little better at the top, a little worse at the bottom commit bc911786d75680d0fa28ac81c846775f6a7c894f 7088a1081ba353bd0bb8f3d38426d24861c694c2 tree 10db6fa2507bd3fa59b3cb6f9701fa48a453d968 parent 7088a1081ba353bd0bb8f3d38426d24861c694c2 author Jonas Fonseca 1382580247 -0700 committer Jonas Fonseca 1382580247 -0700 Fix reloading diffs of staged and unstaged changes commit 7088a1081ba353bd0bb8f3d38426d24861c694c2 7c949baaf493b812702ec78b087d2540e8827bf3 tree 19bbb16e4b01bcc7de1412563ca3bf3f5b1c819d parent 7c949baaf493b812702ec78b087d2540e8827bf3 author Jonas Fonseca 1382578049 -0700 committer Jonas Fonseca 1382578049 -0700 Fix map size assertion in parse_enum commit fc602a04798a0f1fcb6aa71e9613b0c0acbb7e2f 2be80ae3bc7f056ad88ba71acc47ab99e9dd0166 tree 82e24ccb2d2cc98fe9e6ebd3464a9ebc31af9863 parent 2be80ae3bc7f056ad88ba71acc47ab99e9dd0166 author Jonas Fonseca 1377865223 -0400 committer Jonas Fonseca 1382248987 -0400 Move view draw methods to draw module commit 2be80ae3bc7f056ad88ba71acc47ab99e9dd0166 2a45940e80b5326a5fc1b7bbb7d8e1719cf5634d tree f2a5888a534af6e521dfd1f9d4820d7a363b08ed parent 2a45940e80b5326a5fc1b7bbb7d8e1719cf5634d author Jonas Fonseca 1377825820 -0400 committer Jonas Fonseca 1382248987 -0400 Move option handling code to options.c commit 2a45940e80b5326a5fc1b7bbb7d8e1719cf5634d 5fc7c50410bcc61bc0dc89a8e2c354444e0e3fad tree deafe0b382f3cfb977dc659366648ab5fde465f4 parent 5fc7c50410bcc61bc0dc89a8e2c354444e0e3fad author Jonas Fonseca 1377823028 -0400 committer Jonas Fonseca 1382248987 -0400 Move option declarations to separate files commit 5fc7c50410bcc61bc0dc89a8e2c354444e0e3fad 7ecc9fb460c833fa6f669ef2e81b804441b00b95 tree 1e2eaf1d68d0663d9018c38b960f8b55fd7b6399 parent 7ecc9fb460c833fa6f669ef2e81b804441b00b95 author Jonas Fonseca 1377822278 -0400 committer Jonas Fonseca 1382248987 -0400 Use symbols to track diff and log argument formatting commit 7ecc9fb460c833fa6f669ef2e81b804441b00b95 aa2eabbb7879cabe87b2fa22d186848ebf51497d tree d83e96ffc715863c88b2906b1256040fcd74c206 parent aa2eabbb7879cabe87b2fa22d186848ebf51497d author Jonas Fonseca 1377821969 -0400 committer Jonas Fonseca 1382248986 -0400 Group environment-based options commit aa2eabbb7879cabe87b2fa22d186848ebf51497d 951666702f8705388fc3b980ce09ad4be069fe30 tree b9bae82e2fcacff2c65a6d8ca0ac18abf2d4b1b5 parent 951666702f8705388fc3b980ce09ad4be069fe30 author Jonas Fonseca 1378434482 -0400 committer Jonas Fonseca 1382248986 -0400 Move refs helpers to refs module commit 951666702f8705388fc3b980ce09ad4be069fe30 d9c8a7473f3c81957316998910305b8bc346ee89 tree 2390627cd8caf71626ef73c602338479ad33db00 parent d9c8a7473f3c81957316998910305b8bc346ee89 author Jonas Fonseca 1377821898 -0400 committer Jonas Fonseca 1382248986 -0400 Move repository information to repo.[ch] commit d9c8a7473f3c81957316998910305b8bc346ee89 c531bcde787601952c018551f27f27a4d07afb24 tree 5de054e17653f35c549d3d0f422c928f63a82264 parent c531bcde787601952c018551f27f27a4d07afb24 author Jonas Fonseca 1377735198 -0400 committer Jonas Fonseca 1382248986 -0400 Add tool to generate doc from data structures commit c531bcde787601952c018551f27f27a4d07afb24 f0161de385a0f3240d0a7d11c7ff582a83759942 tree 92b1bbcf2eb25fd558d5cad43f22c2090e9d455a parent f0161de385a0f3240d0a7d11c7ff582a83759942 author Jonas Fonseca 1377609285 -0400 committer Jonas Fonseca 1382248986 -0400 Move view declarations to view.h commit f0161de385a0f3240d0a7d11c7ff582a83759942 9abb2ac9aa375f0794ee84a5d258128f1258dd0b tree 5e0f47015f82a8f48db7c88dffd587c93b5fb239 parent 9abb2ac9aa375f0794ee84a5d258128f1258dd0b author Jonas Fonseca 1377609022 -0400 committer Jonas Fonseca 1382248986 -0400 Move keybinding and run requests to keys.[ch] commit 9abb2ac9aa375f0794ee84a5d258128f1258dd0b 31331173eadd9efaba2f7044e4e141127ad98ee9 tree e6c0d0f4b379efa1ffc8bc0aabcef7308ba4521c parent 31331173eadd9efaba2f7044e4e141127ad98ee9 author Jonas Fonseca 1379026390 -0400 committer Jonas Fonseca 1382248985 -0400 Move line and color code to line.c commit 31331173eadd9efaba2f7044e4e141127ad98ee9 d1cc009c134f143befffcff148ff33e12f3fc06b tree a596ed1293fc493f8005f42e2a4db7ab13b69900 parent d1cc009c134f143befffcff148ff33e12f3fc06b author Jonas Fonseca 1349143875 -0400 committer Jonas Fonseca 1382248985 -0400 Move line definitions to line.h commit d1cc009c134f143befffcff148ff33e12f3fc06b 1569d15bf38d0a15683b5a73c51763871225e9b9 tree af32e5ba3a47a44893a8eb631cb033174e632089 parent 1569d15bf38d0a15683b5a73c51763871225e9b9 author Jonas Fonseca 1377607388 -0400 committer Jonas Fonseca 1382248985 -0400 Move request handling code to request.c commit 1569d15bf38d0a15683b5a73c51763871225e9b9 a48b0f5dd687202110498d1775edcc6a3bdf6c72 tree 14afa84fea795fac6beec02db5b1953c8ea98269 parent a48b0f5dd687202110498d1775edcc6a3bdf6c72 author Jonas Fonseca 1377607333 -0400 committer Jonas Fonseca 1382248985 -0400 Move request definitions to request.h commit a48b0f5dd687202110498d1775edcc6a3bdf6c72 0db5d56c7a0c1e74a481387dd22e0da603be902f tree 929ddd7ba53bb299fe99ef9ce5ee43c9650ab42e parent 0db5d56c7a0c1e74a481387dd22e0da603be902f author Jonas Fonseca 1349143750 -0400 committer Jonas Fonseca 1382248985 -0400 Move view macro to tig.h commit 0db5d56c7a0c1e74a481387dd22e0da603be902f 7c949baaf493b812702ec78b087d2540e8827bf3 tree 29917131dafd0d1041c80141b7396e28e28a648f parent 7c949baaf493b812702ec78b087d2540e8827bf3 author Jonas Fonseca 1377864465 -0400 committer Jonas Fonseca 1382248985 -0400 Move enums and various utility methods to util module commit 7c949baaf493b812702ec78b087d2540e8827bf3 536d565fcd789a2ea9dda43b3ae989e9d651af55 tree 93d3104b94f044a1c7772ca60a63ef4b5ee83b66 parent 536d565fcd789a2ea9dda43b3ae989e9d651af55 author Jonas Fonseca 1382226054 -0400 committer Jonas Fonseca 1382248932 -0400 Refactor defined enum maps to contain size information The existing struct enum_map is renamed to enum_map_entry. commit 536d565fcd789a2ea9dda43b3ae989e9d651af55 57787a3668d28808764dd1525a1157e3564d9b46 tree a679b29f2740f740b826d89f82c049b04bc99cb0 parent 57787a3668d28808764dd1525a1157e3564d9b46 author Jonas Fonseca 1382229219 -0400 committer Jonas Fonseca 1382248932 -0400 Detect renames when generating the announcement commit 57787a3668d28808764dd1525a1157e3564d9b46 0d68e41d80c642af766fe5adb320a9cc204f56dc tree be39dfa48d4c43f7a0667700b230d8fe312e0c96 parent 0d68e41d80c642af766fe5adb320a9cc204f56dc author Jonas Fonseca 1382225913 -0400 committer Jonas Fonseca 1382225929 -0400 Fix warning about uninitialized lineno variable commit 0d68e41d80c642af766fe5adb320a9cc204f56dc c14792afc41efcb1126ca0ab896eac6d1a12e580 tree 5879870a174f110d6ee8facae1e92ff032ccd048 parent c14792afc41efcb1126ca0ab896eac6d1a12e580 author Jonas Fonseca 1382133286 -0400 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. commit c14792afc41efcb1126ca0ab896eac6d1a12e580 bf740aa9b7afc29a05f2bc6a8b44035e639fda0e tree 838f1135838567884b2c6c02a428542c6e3c1995 parent bf740aa9b7afc29a05f2bc6a8b44035e639fda0e author Jonas Fonseca 1381192201 -0400 committer Jonas Fonseca 1381192201 -0400 Fix clean rule to remove DocBook XML files in doc/ commit bf740aa9b7afc29a05f2bc6a8b44035e639fda0e f9399028a8ecdd7342bc977b7334fc76a902d3a7 tree 7d2442e3ecdba05ef9746ded3d8e38ff299bb89e parent f9399028a8ecdd7342bc977b7334fc76a902d3a7 author Jonas Fonseca 1381189194 -0400 committer Jonas Fonseca 1381189194 -0400 Fix and improve inter-document linking commit f9399028a8ecdd7342bc977b7334fc76a902d3a7 09650badce7f2a04d2e631c9eb5f11d6239578a1 tree 76711240c3e663fb5acbe47a2b5da3692359d2c9 parent 09650badce7f2a04d2e631c9eb5f11d6239578a1 author Jonas Fonseca 1381117713 -0400 committer Jonas Fonseca 1381117763 -0400 Rename README, INSTALL, and NEWS to end in .adoc Add inter-document links to work on Github. commit 09650badce7f2a04d2e631c9eb5f11d6239578a1 0a90614f363cd67b10c60384fc49ee785562837e tree 9fae47a935057273161c70e1e12b33d2fcf2c029 parent 0a90614f363cd67b10c60384fc49ee785562837e author Jonas Fonseca 1381115377 -0400 committer Jonas Fonseca 1381115377 -0400 Use .adoc as the extension for AsciiDoc files in doc/ commit 0a90614f363cd67b10c60384fc49ee785562837e 71831b3aab7063c3a13a381250109c0d372e269d tree 0b246f4b7ba98fd4a421910ccbd3764f82ae0b70 parent 71831b3aab7063c3a13a381250109c0d372e269d author Jonas Fonseca 1381114957 -0400 committer Jonas Fonseca 1381115359 -0400 Merge the content of BUGS into the README file commit 71831b3aab7063c3a13a381250109c0d372e269d b7e9bd7f8e265667cf3b2285cebf96d8f7782438 tree c6be71d001150fff612915b3fbcc44ff6cd5aa21 parent b7e9bd7f8e265667cf3b2285cebf96d8f7782438 author Jonas Fonseca 1381094177 -0400 committer Jonas Fonseca 1381094177 -0400 Fix regression in add_line_at making line numbers start atf 0 instead of 1 This in turn caused the stash view to segfault when displaying IDs. commit b7e9bd7f8e265667cf3b2285cebf96d8f7782438 9dece48933671e3601e0c2ed1451ab16bfa840f3 tree 325b2b86a74e5aec04b80c925b41656919822215 parent 9dece48933671e3601e0c2ed1451ab16bfa840f3 author Jonas Fonseca 1381093281 -0400 committer Jonas Fonseca 1381093281 -0400 Fix regression in diff_get_lineno commit 9dece48933671e3601e0c2ed1451ab16bfa840f3 b812b89e8f0aaf3a9df1a1a10b840e9926475c8c tree c89d89c11c1dac75ebffce4bb0271cfdcecc019d parent b812b89e8f0aaf3a9df1a1a10b840e9926475c8c author Jonas Fonseca 1381071596 -0400 committer Jonas Fonseca 1381079191 -0400 Fix regression making diff parsing fail when opening the blame view commit b812b89e8f0aaf3a9df1a1a10b840e9926475c8c 65c4435b97ceac0e19439b85207496bb5955dbfa tree cab14c2a8c655366743ff2bf4445917b097f9b4c parent 65c4435b97ceac0e19439b85207496bb5955dbfa author Jonas Fonseca 1381024345 -0400 committer Jonas Fonseca 1381024345 -0400 Make blame_draw check if the filename is NULL instead of empty Fix null pointer exception^W^W^Wsegfault. commit 65c4435b97ceac0e19439b85207496bb5955dbfa b87297b44a7dd0cdab86d79a2843a4f7ef63d11e tree c5b6aeabd02d285360264fb53fd8098bef78e613 parent b87297b44a7dd0cdab86d79a2843a4f7ef63d11e author Jonas Fonseca 1381023248 -0400 committer Jonas Fonseca 1381023248 -0400 Handle diffs with no newline at end of file Also simplify the finalization logic. commit b87297b44a7dd0cdab86d79a2843a4f7ef63d11e 47a9ef0b2d35b116cc226d400d6dd2ed2a7ea995 tree 7c8b74df2c10d9c59e966ec50ac0528c744339b3 parent 47a9ef0b2d35b116cc226d400d6dd2ed2a7ea995 author Jonas Fonseca 1381018546 -0400 committer Jonas Fonseca 1381018615 -0400 Add support for splitting chunks in the stage view Fixes #107 commit 47a9ef0b2d35b116cc226d400d6dd2ed2a7ea995 09bc77844192ecd8f0fc905382f3d5056083b565 tree 143b8802eba238bc20fefb23bfc094d81c185fc1 parent 09bc77844192ecd8f0fc905382f3d5056083b565 author Jonas Fonseca 1381018360 -0400 committer Jonas Fonseca 1381018360 -0400 Add common utility for parsing chunk headers commit 09bc77844192ecd8f0fc905382f3d5056083b565 03fc819789b980a1765a5fbf5d969f6e45810f32 tree c5d7f611da49342ff06b3e338ac236886632fda3 parent 03fc819789b980a1765a5fbf5d969f6e45810f32 author Jonas Fonseca 1380999708 -0400 committer Jonas Fonseca 1381000623 -0400 Introduce a path cache and use it for the blame view This reduces the file path limit of 128 characters, which is not enough for Java enterprise projects. commit 03fc819789b980a1765a5fbf5d969f6e45810f32 b50824be0837c135b8a2f15c77f7c5496ba8197f tree f151964eaa03c7d33201cb9c270b2ddaf2440266 parent b50824be0837c135b8a2f15c77f7c5496ba8197f author Jonas Fonseca 1380999676 -0400 committer Jonas Fonseca 1380999676 -0400 Fix blame_go_back to copy the whole file path commit b50824be0837c135b8a2f15c77f7c5496ba8197f ff90858faf95d71b799c15d5d419c66731753fa3 tree 1084f2f6a355a96ba337115f094a47d1f29e2f2d parent ff90858faf95d71b799c15d5d419c66731753fa3 author Andreas Schlick 1378927737 +0200 committer Jonas Fonseca 1380998806 -0400 Fix handling of combining characters in utf8_length() when reserve==TRUE. Commit 550e3283 did not change utf8_length() to handle the new return value it introduced in unicode_width(). This patch is based on a similar patch I proposed earlier. Signed-off-by: Jonas Fonseca commit ff90858faf95d71b799c15d5d419c66731753fa3 9855b4a676e606d46d1bcca307805e96f9b6b08e tree 2897e2e08238883732952f4b8721a65ebb31705a parent 9855b4a676e606d46d1bcca307805e96f9b6b08e author Jonas Fonseca 1380996978 -0400 committer Jonas Fonseca 1380997403 -0400 Implement navigating back to previous view state in the blame view Use the new view history API to track the previous blamed revisions when navigating to the blame information for the current file. Data for the current blame view is stored inside the view state and pushed onto the stack when reloading another blamed revision from inside the blame view. This also improves error messages when trying to reloading the blamed revision currently displayed as well as navigating back in views that does not support it. Note, that the back action (REQ_BACK) acts similar to REQ_PARENT in the tree view. Fixes #124 Fixes #139 commit 9855b4a676e606d46d1bcca307805e96f9b6b08e bbca0b0c19666b096359080d5d64884ccf912b87 tree f4d07b2738ed646385ce007d86d7e253a8f93507 parent bbca0b0c19666b096359080d5d64884ccf912b87 author Jonas Fonseca 1380985422 -0400 committer Jonas Fonseca 1380996418 -0400 Create a commit view history API based on the tree view stack commit bbca0b0c19666b096359080d5d64884ccf912b87 f09462e682724f49dff3cce4b0be907effb6e2a7 tree 450cdad0009b4c493798b6da72cd2acff5a03a5f parent f09462e682724f49dff3cce4b0be907effb6e2a7 author Jonas Fonseca 1380982832 -0400 committer Jonas Fonseca 1380983399 -0400 Free all cached list of reference when reloading the references This fixes a bug where stale reference lists where used after a new branch was created via the branch view. Fixes #196 commit f09462e682724f49dff3cce4b0be907effb6e2a7 4e1dfad4f961f3cc2daa60e563033557f00f5455 tree 444bf045bbf6b1b9bdf9f13fb9e50bf057350a16 parent 4e1dfad4f961f3cc2daa60e563033557f00f5455 author Jonas Fonseca 1378947856 -0400 committer Jonas Fonseca 1380947378 -0400 Move warn and die to the util module commit 4e1dfad4f961f3cc2daa60e563033557f00f5455 0048b0832b3644b4829b37114926d04d130560bb tree 0d1295aa04a8359091c48f842ec5dda5d58ce7f1 parent 0048b0832b3644b4829b37114926d04d130560bb author Jonas Fonseca 1378947312 -0400 committer Jonas Fonseca 1380947378 -0400 Move error messages to new util module commit 0048b0832b3644b4829b37114926d04d130560bb 8448c2a4df28fd365fbf49ac3ac6205704f26803 tree ff863beada48c887a2a97865936dfecbfdd80b30 parent 8448c2a4df28fd365fbf49ac3ac6205704f26803 author Jonas Fonseca 1379025678 -0400 committer Jonas Fonseca 1380947378 -0400 Move get_temp_dir to io module commit 8448c2a4df28fd365fbf49ac3ac6205704f26803 24c3c77a310b60a980638b9f204ff5301b9a8806 tree 27c1ae87b3fce16f275f112248ad2d38d9277fab parent 24c3c77a310b60a980638b9f204ff5301b9a8806 author Jonas Fonseca 1377864403 -0400 committer Jonas Fonseca 1380947378 -0400 Move encoding utilities to the io module commit 24c3c77a310b60a980638b9f204ff5301b9a8806 77cdf5faf47ccd09dd2da04251d1269f57891b15 tree 0a5874910b0acbe533b8e1b3a57dc416ee2b79e8 parent 77cdf5faf47ccd09dd2da04251d1269f57891b15 author Jonas Fonseca 1380946350 -0400 committer Jonas Fonseca 1380947025 -0400 Fix regression making the status view inaccessible for new repositories Commit a11bf779be32ba139e9c0839c50d12475581058c (Load HEAD ID and symbolic name as part of the repo info) introduced the regression by passing "HEAD" to git-rev-parse. In new repositories, HEAD does not resolve to anything and thus caused an error message and no additional output. Work-around this issue by moving all reference arguments to the end of the command. commit 77cdf5faf47ccd09dd2da04251d1269f57891b15 cda9ed30f7467c39c543382846a641d9611b202b tree 2650eef7e3ce802e95520bb6d6b8bde891a0ade4 parent cda9ed30f7467c39c543382846a641d9611b202b author Jonas Fonseca 1379467100 -0400 committer Jonas Fonseca 1379467756 -0400 Fix `make dist` to support versions with more than 2 digit groups The recent 1.2.1 release ended up having VERSION set to 1.2.1.1 in the Makefile. With this patch the rebuilt tarball has the correct VERSION value. Reported by Sedat Dilek. commit cda9ed30f7467c39c543382846a641d9611b202b 0101f8507fa627ae59086902e76f33e7acc6f79a tree ae71e9ee4cbdfe7d034d44bf054b478cd85ff786 parent 0101f8507fa627ae59086902e76f33e7acc6f79a author Jonas Fonseca 1378337341 -0400 committer Jonas Fonseca 1378352109 -0400 tig(1): document the Git commands supported by the pager mode Also add some general improvements to the manpage description, add the stash subcommand and more. Fixes #1 commit 0101f8507fa627ae59086902e76f33e7acc6f79a 328ecea246928661045cec741503df695b2dd81a tree 0431d3d2eeeca08d62b370c38ed229a4b29ce149 parent 328ecea246928661045cec741503df695b2dd81a author Jonas Fonseca 1378342697 -0400 committer Jonas Fonseca 1378351172 -0400 Load main view from any --pretty=raw output given on stdin This allows you to run: git log --pretty=raw | tig --pretty=raw git reflog --pretty=raw | tig --pretty=raw git stash list --pretty=raw | tig --pretty=raw git rev-list jonas/code-split --pretty=raw | tig --pretty=raw git whatchanged --pretty=raw | tig --pretty=raw Idea and commit message by Vivien Didelot. commit 328ecea246928661045cec741503df695b2dd81a 88c739b19c8da02554ecb5dbb046abd8ac8bea3c tree 1ad0f36b433e9aaa867e6918d76faca0921ddcd9 parent 88c739b19c8da02554ecb5dbb046abd8ac8bea3c author Jonas Fonseca 1378337009 -0400 committer Jonas Fonseca 1378349450 -0400 Refactor the pager mode handling Remove the global opt_stdin variable and the VIEW_STDIN flag and move checking of pager mode options and opening logic into open_pager_mode(). Two new flags (OPEN_PAGER_MODE and OPEN_FORWARD_STDIN) is added to deal with how the IO for the view needs to be initialized. Also fixes a bug, where stdin was not closed when pager mode is not supported. This means that the process writing to stdin would hang until Tig closes. commit 88c739b19c8da02554ecb5dbb046abd8ac8bea3c e32cad84bc199ec3113fa9448082eb8b9b9b080f tree 1f3f1684e5b1748a7aed6f6ea65fe30bca9ccb1b parent e32cad84bc199ec3113fa9448082eb8b9b9b080f author Jonas Fonseca 1378256413 -0400 committer Jonas Fonseca 1378337401 -0400 Simplify checking of --stdin argument commit e32cad84bc199ec3113fa9448082eb8b9b9b080f 547c40275d0dd5d9340627f349854f49a20bca81 tree 65821290eab36c4ee27a40bf737cec6f9bac48b9 parent 547c40275d0dd5d9340627f349854f49a20bca81 author Jonas Fonseca 1378255937 -0400 committer Jonas Fonseca 1378337401 -0400 Generalize and move parsing of reflog info into main_read commit 547c40275d0dd5d9340627f349854f49a20bca81 5b9918f61d2607f252e1b86ac7dace4f6553aba8 tree 46cb90ecaaa577159eefe41e7c16deb5c2394578 parent 5b9918f61d2607f252e1b86ac7dace4f6553aba8 author Jonas Fonseca 1377820721 -0400 committer Jonas Fonseca 1377820721 -0400 Use memset to clear the format buffer commit 5b9918f61d2607f252e1b86ac7dace4f6553aba8 bda0c6ab5b7a29e1381e0f314221d6dd3b89e3d5 tree 5c2a0779486f7c2ee2422ef25d091bcc38e8e3ab parent bda0c6ab5b7a29e1381e0f314221d6dd3b89e3d5 author Jonas Fonseca 1377820397 -0400 committer Jonas Fonseca 1377820397 -0400 Add toggling for display of files in untracked directories commit bda0c6ab5b7a29e1381e0f314221d6dd3b89e3d5 dad8bc5f1987e27b1692812d290817b1bdd0386a tree a56ea8425570a02d41502aa87f3b7b1fc683ac07 parent dad8bc5f1987e27b1692812d290817b1bdd0386a author Jonas Fonseca 1377819315 -0400 committer Jonas Fonseca 1377820315 -0400 Improve option toggling to update all displayed view Use view flags to query which views need to be reloaded. This avoids custom logic inside toggle_option. commit dad8bc5f1987e27b1692812d290817b1bdd0386a 90bb9eabe005b67f866bffe85abff8b3b166812c tree 688c36a75003bc9d26847cfa047138afae4ef576 parent 90bb9eabe005b67f866bffe85abff8b3b166812c author hasufell 1377743527 -0400 committer Jonas Fonseca 1377743616 -0400 Pass CFLAGS to linker It happens that people use flags in CFLAGS that do affect the linking stage. There is not always a clear distinction which do and which don't so it's safer to have CFLAGS in linking commands as well. [ Reworked to make it use generic make rule ] Signed-off-by: Jonas Fonseca commit 90bb9eabe005b67f866bffe85abff8b3b166812c 8eaf1eeae119ecb29a5570e78459563efcfbdc0a tree 5ec617db8542aee8c469ecdfe793f14d947be90e parent 8eaf1eeae119ecb29a5570e78459563efcfbdc0a author Jonas Fonseca 1377739873 -0400 committer Jonas Fonseca 1377742930 -0400 Move release scripts, test programs and maintainer files to new tools directory commit 8eaf1eeae119ecb29a5570e78459563efcfbdc0a 5c4fe5df9972803acbcb435e00b10ff3a31f7666 tree 9f437371afacaba1c8ad716e08305fdd0b0623db parent 5c4fe5df9972803acbcb435e00b10ff3a31f7666 author Jonas Fonseca 1377739260 -0400 committer Jonas Fonseca 1377742861 -0400 Switch to automatically generate dependencies Can be disabled by (un)setting DEPS_CFLAGS: make DEPS_CFLAGS= commit 5c4fe5df9972803acbcb435e00b10ff3a31f7666 ac0aeb9f31bedd751033c55c8fe5598693ee6c4f tree 43d28025b25ee1f740660832b0c9c8ec8be209f8 parent ac0aeb9f31bedd751033c55c8fe5598693ee6c4f author Jonas Fonseca 1377571719 -0400 committer Jonas Fonseca 1377571849 -0400 Disabled colors last when passing user supplied arguments to Git This fixes situations where colors are enabled by for example TIG_DIFF_OPTS: TIG_DIFF_OPTS="--word-diff=color" tig Fixes #191 commit ac0aeb9f31bedd751033c55c8fe5598693ee6c4f a11bf779be32ba139e9c0839c50d12475581058c tree 9afa0cba80e9f672c31c07277e62f32473e0e5aa parent a11bf779be32ba139e9c0839c50d12475581058c author Jonas Fonseca 1377568930 -0400 committer Jonas Fonseca 1377571127 -0400 Optionally load HEAD when loading references This avoids one fork+exec and improves the start-up time on Cygwin. References #92 commit a11bf779be32ba139e9c0839c50d12475581058c ba61243e21e56ae0a74b7fefe7a6a04fa000206a tree 9cd2be58293c6e8bf4855d37835a1008a28fc51d parent ba61243e21e56ae0a74b7fefe7a6a04fa000206a author Jonas Fonseca 1377568309 -0400 committer Jonas Fonseca 1377571111 -0400 Load HEAD ID and symbolic name as part of the repo info This ensures that opt_remote is populated before the git config is loaded so that tracking information for the current branch can be used when highlighting remote references. commit ba61243e21e56ae0a74b7fefe7a6a04fa000206a 2b13047c16e4ca60d3f477c01c7fbc4e5d76c57d tree 27be857263bc235207911b45cd227ddb85c52883 parent 2b13047c16e4ca60d3f477c01c7fbc4e5d76c57d author Jonas Fonseca 1377565950 -0400 committer Jonas Fonseca 1377565950 -0400 Add auto-configuration for Cygwin It is automatically enabled when the OS name is reported as CYGWIN_NT-6.1 and will detect and inform the user whether the ncurses and iconv packages need to be installed. Tested on Windows 7 with the currently available 64-bit Cygwin version. commit 2b13047c16e4ca60d3f477c01c7fbc4e5d76c57d 6bf4d33f732b5984fba258df5eef0b710277293d tree 40e0bee6042192ea9e9a0fd53eebb32e6aa506e5 parent 6bf4d33f732b5984fba258df5eef0b710277293d author Jonas Fonseca 1377451005 -0400 committer Jonas Fonseca 1377451005 -0400 Rewrite the toggle menu setup macro code to fix compile error Compiling tig version 1.2.1 on OS/2 using GCC version 4.5.4 fails with: tig.c: In function 'toggle_option': tig.c:2696:3: error: subscripted value is neither array nor pointer tig.c:2696:3: error: subscripted value is neither array nor pointer tig.c:2696:3: error: subscripted value is neither array nor pointer tig.c:2696:3: error: subscripted value is neither array nor pointer tig.c:2696:3: error: subscripted value is neither array nor pointer tig.c:2696:3: error: subscripted value is neither array nor pointer tig.c:2696:3: error: subscripted value is neither array nor pointer Change the macro to not have logic in the macro responsible for initializing the toggle menu in an attempt to fix the compile error. commit 6bf4d33f732b5984fba258df5eef0b710277293d 700a4c96e2d6894fc4d7fed8cefbaf17b7109b2b tree 5dbbbe4533453fb71f3f7f5612e29c26bf023c39 parent 700a4c96e2d6894fc4d7fed8cefbaf17b7109b2b author Jonas Fonseca 1377412860 -0400 committer Jonas Fonseca 1377447047 -0400 Fix stash diff display after deleting a stash Refer to stashes internally by their commit ID instead of their symbolic name (i.e. stash@{%d}) so that the stash diff updates correctly after calling `git stash drop $stash`. The issue can be reproduced by deleting one of the first N-1 stash and pressing Enter after the reload. The bug is caused by the commit->id, which are used in determining whether to refresh the diff view or not, does not change when the modified stash list is reloaded. commit 700a4c96e2d6894fc4d7fed8cefbaf17b7109b2b 59b34cce323911d7a3854c5d985576c8087b6293 tree 94b93b57a6fcc5552473400407976ff7900d6cac parent 59b34cce323911d7a3854c5d985576c8087b6293 author Jonas Fonseca 1377412764 -0400 committer Jonas Fonseca 1377446984 -0400 Make digit counting reusable commit 59b34cce323911d7a3854c5d985576c8087b6293 99d8d008fb36b22e87685b6c95390b330beb1b4b tree e93871e096b13488981488c4ee43ad27f1be02c3 parent 99d8d008fb36b22e87685b6c95390b330beb1b4b author Jonas Fonseca 1377408841 -0400 committer Jonas Fonseca 1377446984 -0400 Make the prompt for user-defined commands tell when Tig will exit commit 99d8d008fb36b22e87685b6c95390b330beb1b4b e686bc095312a26008d5e853cd4bef4f9586a753 tree 29d8c43384ce5e3132f5a81ec7e73bbdca5a490d parent e686bc095312a26008d5e853cd4bef4f9586a753 author Jonas Fonseca 1377408727 -0400 committer Jonas Fonseca 1377446984 -0400 User-defined commands no longer need to be prefixed with '!' The exclamation point is implied when '@', '?', or '<' are specified. commit e686bc095312a26008d5e853cd4bef4f9586a753 03766e27b038dfc06f0b4ecb58d1154f9c080a30 tree 9d206b8ebf6702819bcbfdbbefbdcfe23c633f63 parent 03766e27b038dfc06f0b4ecb58d1154f9c080a30 author Jonas Fonseca 1377407214 -0400 committer Jonas Fonseca 1377446983 -0400 tigrc(5): rework the keybinding section Rearranges the subsections for the bind command, adds the stash view and documents the internal commands. commit 03766e27b038dfc06f0b4ecb58d1154f9c080a30 c91ba8ff6e5e2e4783cc2e708a70afb938a2f59b tree 7f831e1bbeb0e60d72bf37c36c3e6a6601540fda parent c91ba8ff6e5e2e4783cc2e708a70afb938a2f59b author Jonas Fonseca 1377355336 -0400 committer Jonas Fonseca 1377355336 -0400 tig-1.2.1 commit c91ba8ff6e5e2e4783cc2e708a70afb938a2f59b bf1b9fcd15ee9a38fd1d6a19b8801a552fb90089 tree 1884093e024eceee188fa414286111333f78704c parent bf1b9fcd15ee9a38fd1d6a19b8801a552fb90089 author Jonas Fonseca 1377283290 -0400 committer Jonas Fonseca 1377283367 -0400 Use capitalized Git and Tig when talking about the systems in general commit bf1b9fcd15ee9a38fd1d6a19b8801a552fb90089 7a5183f78a00d3c9553d60786333f595befd9ad5 tree 6e9e26653ab3f13f6aedb398c023976c6cd27078 parent 7a5183f78a00d3c9553d60786333f595befd9ad5 author Jonas Fonseca 1377235893 -0400 committer Jonas Fonseca 1377236003 -0400 Simplify the install goal and rename $(PROGS) to $(EXE) commit 7a5183f78a00d3c9553d60786333f595befd9ad5 251b64d5244c591f108c3f40ebb3d3c9cffc8da5 tree 98d226fd6e8e0e91a0832e1c2793530b2dfaa88a parent 251b64d5244c591f108c3f40ebb3d3c9cffc8da5 author Jonas Fonseca 1377235420 -0400 committer Jonas Fonseca 1377235420 -0400 Fix regression that skipped commits with no messages The changes to dynamically allocate the commit title changed to order in which commits are created to only add the commit once a commit message title has been found. When a commit does not have any commit message the commit need to be flushed before the next commit is parsed or when the log ends. The regression was found in Git's repository, where commit 296fdc53bdd75147121aa290b4de0eeb3b4e7074 has no commit message. commit 251b64d5244c591f108c3f40ebb3d3c9cffc8da5 4999eb00285e7c2a8d8d8d300f3a0eb95ca3f08b tree a686e103ed8bc1947ab62456d131526ccf0da2ba parent 4999eb00285e7c2a8d8d8d300f3a0eb95ca3f08b author Jonas Fonseca 1377226094 -0400 committer Jonas Fonseca 1377226453 -0400 Remove the dont_free line struct flag in favor of custom help_done commit 4999eb00285e7c2a8d8d8d300f3a0eb95ca3f08b 4ebcd59fbbea796b735cea361d2277c3c02c1528 tree 4cb65cf813203e404e9204c73b7d7a53c609af83 parent 4ebcd59fbbea796b735cea361d2277c3c02c1528 author Jonas Fonseca 1377226038 -0400 committer Jonas Fonseca 1377226453 -0400 Free graph symbols when reloading the main view References #160 commit 4ebcd59fbbea796b735cea361d2277c3c02c1528 d2c458156502de8cdc9a38dfd56f0d8ae5a3af5e tree 0484132a1908f3423247e127fa5ed118a8402aa6 parent d2c458156502de8cdc9a38dfd56f0d8ae5a3af5e author Jonas Fonseca 1377224986 -0400 committer Jonas Fonseca 1377226179 -0400 Bypass all graph calls and memory allocations when the graph is disabled This reduces memory usage considerably by no longer allocating graph data and improves the startup time as well. References #160 commit d2c458156502de8cdc9a38dfd56f0d8ae5a3af5e 8ddd4c1f430573e910fd1a1def2f891bb4ee18ef tree 026a7022cac317614505541c8f3f9d5fb79a2b68 parent 8ddd4c1f430573e910fd1a1def2f891bb4ee18ef author Jonas Fonseca 1377223058 -0400 committer Jonas Fonseca 1377223058 -0400 Postpone ref list lookup to the draw phase Remove ref_list from the commit struct and look them up when drawing. This improves the start-up time by ~15% in tests on the Git repository and also reduces the memory usage a bit. References #160 commit 8ddd4c1f430573e910fd1a1def2f891bb4ee18ef 5a072dfb06203518e1b020742bafc371a19e4fc0 tree 2dd8ab9f05826e94cb5c29ffe735f69467d8bf4a parent 5a072dfb06203518e1b020742bafc371a19e4fc0 author Jonas Fonseca 1371873501 -0400 committer Jonas Fonseca 1377138051 -0400 Dynamically allocate commit titles to reduce memory usage References #160 commit 5a072dfb06203518e1b020742bafc371a19e4fc0 b9486539335f9999bb8e7fb642a8dc56ae6db6e1 tree a3d778e532108e4303462fe783666e3eb3b8d202 parent b9486539335f9999bb8e7fb642a8dc56ae6db6e1 author Jonas Fonseca 1376966327 -0400 committer Jonas Fonseca 1376966327 -0400 Ignore generated HTML files in the whole tree commit b9486539335f9999bb8e7fb642a8dc56ae6db6e1 f789bcd88a97e597e06ae0c0462deb8dfa29770f tree b9f1bf1bebf444fd44fedfba063623bffff74e33 parent f789bcd88a97e597e06ae0c0462deb8dfa29770f author Jonas Fonseca 1376966185 -0400 committer Jonas Fonseca 1376966185 -0400 Show blob sizes in the tree view Fixes #163 commit f789bcd88a97e597e06ae0c0462deb8dfa29770f 154053e6c8e2da7875f2aa71091b83bfec160a84 tree 71ca19458e97a94fbd162fdceef24765076b314b parent 154053e6c8e2da7875f2aa71091b83bfec160a84 author Jonas Fonseca 1376865106 -0400 committer Jonas Fonseca 1376865328 -0400 Improve the installation instructions ... and add example config.make in contrib/. commit 154053e6c8e2da7875f2aa71091b83bfec160a84 e8f6397895028706b161c274c69a6b1283ce482d tree d74da71ee1183abece8595da30c5290380365053 parent e8f6397895028706b161c274c69a6b1283ce482d author Jonas Fonseca 1376865055 -0400 committer Jonas Fonseca 1376865055 -0400 Add work-around for building manpages with Homebrew-based xmlto commit e8f6397895028706b161c274c69a6b1283ce482d 68f531e8365281ae8559340bf32e2a7f5cc9b947 tree 8e297142b89af6b997a5b8af74898841de0e1330 parent 68f531e8365281ae8559340bf32e2a7f5cc9b947 author Jonas Fonseca 1376864920 -0400 committer Jonas Fonseca 1376865014 -0400 Ignore *.swp files and restrict to only ignore top-level config.make commit 68f531e8365281ae8559340bf32e2a7f5cc9b947 9b7d1741862acf97e80c65abc4f9fdaf7aa01988 tree db355887030aa9649ee452a9598203727777cee9 parent 9b7d1741862acf97e80c65abc4f9fdaf7aa01988 author Jonas Fonseca 1376841954 -0400 committer Jonas Fonseca 1376841954 -0400 Fix HTML doc installation Similar to Dan Church's fix in b7de063c07b0f4d5879459f84403d14b8a86a011 also ensure that files are installed using the basename of each file. commit 9b7d1741862acf97e80c65abc4f9fdaf7aa01988 d1ff0511477a0e5a887e0d42dfd9b8d85ae84989 tree d7c8f1958b986382b68e92a360988bc11cdaac8c parent d1ff0511477a0e5a887e0d42dfd9b8d85ae84989 author Jonas Fonseca 1376841793 -0400 committer Jonas Fonseca 1376841793 -0400 Fix path to sysconfdir-based gitconfig in tig(1) The ending '/etc' is supposed to be part of {sysconfdir}. commit d1ff0511477a0e5a887e0d42dfd9b8d85ae84989 11877b63597503cfdf24897874728a7fa7ae81f6 tree c78515c9e7e2fd136f107d8feec849f19f10b226 parent 11877b63597503cfdf24897874728a7fa7ae81f6 author Jonas Fonseca 1376835016 -0400 committer Jonas Fonseca 1376836380 -0400 Fix submodule-related setup to properly check setenv return value Commit 7fdd95a switched from using internal putenv-based setenv work-around to setenv from libiberty. The internal work-around returned non-zero on success whereas setenv returns zero on success, which means that tig exits with the following error when started inside a submodule: tig: Failed to set GIT_WORK_TREE to ... Fix calls to setenv to check for non-zero return value and correctly catch errors. Fixes #188 commit 11877b63597503cfdf24897874728a7fa7ae81f6 b7de063c07b0f4d5879459f84403d14b8a86a011 tree 6c61a6960b92068d392d0617a5a5f245c1a64bd6 parent b7de063c07b0f4d5879459f84403d14b8a86a011 author Jonas Fonseca 1376192172 -0400 committer Jonas Fonseca 1376192172 -0400 Rework README to include the list of online resources Merges doc/SITES into the README file and moves the installation instructions to their own file. commit b7de063c07b0f4d5879459f84403d14b8a86a011 f37c4d896a70a0824e6dda6b84dbab3003eb8376 tree 8b58ad69c67f94ee9d89b64924a5590df2c558f0 parent f37c4d896a70a0824e6dda6b84dbab3003eb8376 author Dan Church 1376163088 -0500 committer Dan Church 1376163088 -0500 Fix man page install It was trying to install to `usr/man/man1/doc/tig.1` for example. commit f37c4d896a70a0824e6dda6b84dbab3003eb8376 ba5c39f1b174245215cdb6bd4f95cbb0e6f68e20 tree 8577a2349a158cfff06be8482b849d4a59618eb3 parent ba5c39f1b174245215cdb6bd4f95cbb0e6f68e20 author Jonas Fonseca 1349110154 -0400 committer Jonas Fonseca 1376155072 -0400 Move documentation to doc directory Rename AsciiDoc files to have the extension .asciidoc so that GitHub will display them. commit b207fde5e005df29916e3b8d6c264e4c7dc9f0b5 acd48496ddec00f575227c3a3f6ab4b62f577f72 tree 4ab76848bc3995efc79334985339b1096d630bbb parent acd48496ddec00f575227c3a3f6ab4b62f577f72 author Jonas Fonseca 1376144830 -0400 committer Jonas Fonseca 1376144830 -0400 Update for version tig-1.2 commit acd48496ddec00f575227c3a3f6ab4b62f577f72 494b8c83eab99657aae9fce302dd8166913ff377 ba5c39f1b174245215cdb6bd4f95cbb0e6f68e20 tree 9056e1f662e899d7351e0f984711b7b1f8518961 parent 494b8c83eab99657aae9fce302dd8166913ff377 parent ba5c39f1b174245215cdb6bd4f95cbb0e6f68e20 author Jonas Fonseca 1376144807 -0400 committer Jonas Fonseca 1376144807 -0400 Merge branch 'master' into release commit ba5c39f1b174245215cdb6bd4f95cbb0e6f68e20 079360acdf5672de7980c4eeef724b7e81eb7154 tree 11389efb72c5eb36f0e178460ebc9849b6b413d3 parent 079360acdf5672de7980c4eeef724b7e81eb7154 author Jonas Fonseca 1376144794 -0400 committer Jonas Fonseca 1376144794 -0400 tig-1.2 commit 079360acdf5672de7980c4eeef724b7e81eb7154 f9a943afe0236167fc7a7e32c7fcaac4226763c0 tree 7830023b83878fdad146a0db0c9064964ac9443c parent f9a943afe0236167fc7a7e32c7fcaac4226763c0 author Jonas Fonseca 1376144478 -0400 committer Jonas Fonseca 1376144478 -0400 Remove release-docs/ during distclean ... and remove obsolte SOURCE variable. commit f9a943afe0236167fc7a7e32c7fcaac4226763c0 307e792c38a81f744f9c4307fdb304c90a095d50 tree 5e82443562440ddcc7c6fa689dc72283367658a9 parent 307e792c38a81f744f9c4307fdb304c90a095d50 author Jonas Fonseca 1376144239 -0400 committer Jonas Fonseca 1376144239 -0400 Only warn about missing curses configuration once Reported by Drew Northup. commit 307e792c38a81f744f9c4307fdb304c90a095d50 095254953cc2c68a74c4de6a18a802669f9e4fc6 tree 930cd6b720332dccdc1748e35614bdea91eb7d29 parent 095254953cc2c68a74c4de6a18a802669f9e4fc6 author Vivien Didelot 1373048205 -0400 committer Jonas Fonseca 1376140319 -0400 remove useless call to strdup() in get_temp_dir() Since env variables and "/tmp" (literal string) are present for the execution of the program, there's no need to call strdup(). Also constify the tmp variable. Closes #182 Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 095254953cc2c68a74c4de6a18a802669f9e4fc6 52af123233e2b73aee1d1421f9e2ce90a64616a5 tree 8484de15733b0d64c1e3d0655085599761ec901a parent 52af123233e2b73aee1d1421f9e2ce90a64616a5 author Jonas Fonseca 1376108555 -0400 committer Jonas Fonseca 1376109414 -0400 Move all checks for the log view commit context to log_select Track the last line in log_state, so checks for whether to recalculate the commit context can be moved inside log_select. This ensure that the correct commit is shown when using jump-to-line and refreshing the log view. Fixes #183 Closes #186 commit 52af123233e2b73aee1d1421f9e2ce90a64616a5 c08bc85cda9d7243201be06da7df4a5c8f6fa600 tree 9125d88d739536a186a4491794059f10ff140e94 parent c08bc85cda9d7243201be06da7df4a5c8f6fa600 author Vivien Didelot 1376063070 -0400 committer Jonas Fonseca 1376090345 -0400 Fix %(prompt) variable formatting Without this patch, "%(prompt" (with a missing ending parenthesis) is formatted and causes a segmentation fault. Closes #181 Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit c08bc85cda9d7243201be06da7df4a5c8f6fa600 f7306fd57bbb5f182afebdec853122fe8e406e4c tree 2b1dc2ed72b4256aa11711c91fcfacff3cc04699 parent f7306fd57bbb5f182afebdec853122fe8e406e4c author Kumar Appaiah 1375488528 -0400 committer Jonas Fonseca 1376090120 -0400 Revert "Scroll diff with arrow keys in log view" This reverts commit 888611dd5d407775245d574a3dc5c01b5963a5ba. This is because, in the re-engineered log view, scrolling the log with the arrows now updates the diff in the diff view when the screen is split. This resembles the earlier behaviour, and is also what users of software like Mutt (which uses the pager view concept) would expect. Signed-Off-By: Kumar Appaiah commit f7306fd57bbb5f182afebdec853122fe8e406e4c c71d4894a154926f4830be6fe454141a6e102800 tree 2504bdf8e09ab7e5b3a44ff727e4880fcf73a593 parent c71d4894a154926f4830be6fe454141a6e102800 author Kumar Appaiah 1375411507 -0400 committer Jonas Fonseca 1376090120 -0400 Display correct diff the context in split log view In the log view, when scrolling across a commit, the diff view should automatically switch to the commit whose context the cursor is on in the log view. This commit changes things to catch the REQ_ENTER in the log view and handle recalculation of the commit and diff display from log_request, rather than delegating it to pager_request. In addition, it also gets rid of unexpected upward scrolling of the log view. Fixes GH #155 Signed-Off-By: Kumar Appaiah commit c71d4894a154926f4830be6fe454141a6e102800 7fdd95a5b0ec609e4acc8cffe125445b3470f4ef tree a9b6ff32bd05a1f7a134a2f94ddd759731d832e6 parent 7fdd95a5b0ec609e4acc8cffe125445b3470f4ef author Kumar Appaiah 1375411874 -0400 committer Jonas Fonseca 1376089759 -0400 Add log_select function to find commit from context in log view This commit introduces and uses the log_select function to find the correct commit in the unsplit log view. In the log view, if one scrolls down across a commit line, the current commit (as displayed in the status bar) gets updated, but not so when scrolling upward across a commit. The log_select function handles this scenario to do the ``right thing''. In addition, it introduces the log_state structure as the private entry of the log view to hold a flag that decides whether to re-evaluate the current commit based on scrolling. Signed-off-by: Kumar Appaiah commit 7fdd95a5b0ec609e4acc8cffe125445b3470f4ef 64b9d570792cbe799afbf3c094e5643512915098 tree 387ca9a2baf06acc3639d12a3093564f1989fe3f parent 64b9d570792cbe799afbf3c094e5643512915098 author Vivien Didelot 1375972983 -0400 committer Jonas Fonseca 1376089505 -0400 Provide proper work-around for missing setenv() This patch removes the set_environment_variable() function that was introduced by 46ef80d for compatibility reason, for platforms lacking the setenv() function. It borrows the setenv.c code from the libiberty. The work-around can be enabled via configure (and config.make.in), via the config.make file by adding the line 'NO_SETENV=y' or when calling make by adding 'NO_SETENV=y' to its parameter list. Based on Drew's work for compat and mkstemps.c. References: GH #156 #152 Closes #180 Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 64b9d570792cbe799afbf3c094e5643512915098 8e1324ddc5c137bc242161da5f6abac941b2c3b6 tree ee6d9bdb8a97a7ed6da14201f1dbb95388e76ede parent 8e1324ddc5c137bc242161da5f6abac941b2c3b6 author Drew Northup 1375632845 -0400 committer Jonas Fonseca 1376089464 -0400 Provide mkstemps() work-around for platforms lacking it The function mkstemps() isn't available in all libc implementations. In glibc it first became available in 2.11. This is likely true of many non-LINUX platforms as well. The work-around is based on mkstemps() implementation from libiberty and is kept inside its own source file under a new compat/ subdirectory. The work-around can be enabled via configure (and config.make.in), via the config.make file by adding the line 'NO_MKSTEMPS=y' or when calling make by adding 'NO_MKSTEMPS=y' to its parameter list. This fixes breakage that was introduced with a0fdac29 "Create temporary file with name as suffix." Fixes #152 Closes #175 Signed-off-by: Drew Northup Original patch by Drew reworked to make it easier to enable the work-around when not using configure. Also, switched mkstemps() implementation to that of libiberty instead of the adapted version from Git. Signed-off-by: Jonas Fonseca commit 8e1324ddc5c137bc242161da5f6abac941b2c3b6 4ee558a38e815b924c5736abc8969f3d12f049df tree e32fc4b15824e340bde37ddc3acc9044c361a423 parent 4ee558a38e815b924c5736abc8969f3d12f049df author Jonas Fonseca 1376010056 -0400 committer Jonas Fonseca 1376089464 -0400 Add example showing how to show display submodule log in diffs Proposed by Ingo Oeser. Fixes #171 commit 4ee558a38e815b924c5736abc8969f3d12f049df 9439272f32a9a4936d81f8dfcfff9b3c503cde25 tree ed5118fefda5c9c60880a725cf68e925286c0ec3 parent 9439272f32a9a4936d81f8dfcfff9b3c503cde25 author Vivien Didelot 1375919551 -0400 committer Jonas Fonseca 1376089399 -0400 Fix %(commit) assignment in the diff view Since commit 0c278556e52b9b78fde9f089cab755a6366d9ce6, the %(commit) variable is badly overwritten with part of the commit title when we highlight this line. For instance, browsing a commit message like this: linux: add support for [...] This text explains the patch [...] will result in the %(commit) variable to be "ux:". (the offset corresponds to strlen("commit ") which is LINE_COMMIT). This patch reworks commit 0c278556e52b9b78fde9f089cab755a6366d9ce6: "Fix regression causing incorect coloring of the commit title", to set the line type to LINE_DEFAULT instead of LINE_COMMIT. Closes #179 Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 9439272f32a9a4936d81f8dfcfff9b3c503cde25 ddc45bb74149d911bfe06a7cf3f9219c606e30b5 tree e55a281e308ed000e94c45168cf23674990c305f parent ddc45bb74149d911bfe06a7cf3f9219c606e30b5 author Jonas Fonseca 1375841573 -0400 committer Jonas Fonseca 1375841753 -0400 Add utility method to help copy commit ID to revision buffer commit ddc45bb74149d911bfe06a7cf3f9219c606e30b5 3e270ee3b561ddf9de97520341e52fcad40e4953 tree 0266e5b702cf469f954a31ac9e8afd92f2ae4867 parent 3e270ee3b561ddf9de97520341e52fcad40e4953 author Jonas Fonseca 1375755161 -0400 committer Jonas Fonseca 1375755161 -0400 stash: Highlight the diffstat of combined diffs Fixes #169 commit 3e270ee3b561ddf9de97520341e52fcad40e4953 b518dfcf348349459dcaa5994554f770f32c2cfd tree 15d35e80b472a6d3160853dc6497218ce1165016 parent b518dfcf348349459dcaa5994554f770f32c2cfd author Jonas Fonseca 1375744716 -0400 committer Jonas Fonseca 1375745006 -0400 stash: Ensure that the whole stash@{_} text is shown Fixes #169 commit b518dfcf348349459dcaa5994554f770f32c2cfd 068f4194fb915a056b247427aac9c3db1ba393c5 tree a1b7e227283df822b67f5beab312c30ad51bcbb9 parent 068f4194fb915a056b247427aac9c3db1ba393c5 author Jonas Fonseca 1375743731 -0400 committer Jonas Fonseca 1375744945 -0400 stash: Refactor ID drawing method Simpify the main method (draw_id) and add custom method for more advanced requirements. commit 068f4194fb915a056b247427aac9c3db1ba393c5 40f67216a06826176dd2d66e21fa99b04bc216f9 tree 68dfb2d04c5838d25361d22d5ac66c3fa276aa70 parent 40f67216a06826176dd2d66e21fa99b04bc216f9 author Jonas Fonseca 1375558994 -0400 committer Jonas Fonseca 1375744940 -0400 stash: Use main view infrastructure for the stash view Change the output to use "--pretty=raw", which is compatible with the main view. This simplifies the parsing of the 'stash{X}' ID by using the emitted 'Reflog' line and displays the stash date for free. The reference to the stash is stored as the commit->id for easy access when updating the status line (view->ref). Fixes #169 commit 40f67216a06826176dd2d66e21fa99b04bc216f9 933447cbd6649bb78ac45f8eb6de7bd94a389173 tree 596d6e19f88ba2914e663f7441c637683985083f parent 933447cbd6649bb78ac45f8eb6de7bd94a389173 author Jonas Fonseca 1375741280 -0400 committer Jonas Fonseca 1375741861 -0400 iconv: Consolidate convert methods into one single backend commit 933447cbd6649bb78ac45f8eb6de7bd94a389173 742ad988cfa1abf92c086575450dbd97cf2b6018 tree 3381c262b932930eebe4cb560fa6d2fc57dcad3b parent 742ad988cfa1abf92c086575450dbd97cf2b6018 author Jonas Fonseca 1375674727 -0400 committer Jonas Fonseca 1375741765 -0400 iconv: Remove unnecessary length argument to encoding_iconv commit 742ad988cfa1abf92c086575450dbd97cf2b6018 c913a6824627866135a63ade233c5e156fa74f0e tree 8715fa0bdaaac53ad76800ad506185098808d512 parent c913a6824627866135a63ade233c5e156fa74f0e author Jonas Fonseca 1375674727 -0400 committer Jonas Fonseca 1375741765 -0400 iconv: Convert characters before trimming text before rendering By first trimming and then transliterating, characters which need two characters to represent would cause the rendered text to get out of alignment. An example can be seen by running: $ LANG=C ./tig 2324d6120c5de58f63b32b876bd33e99d7375dbb Fix the misalignment by reversing the operations so that text is trimmed after it has been transliterated. Fixes #86 commit c913a6824627866135a63ade233c5e156fa74f0e 61f3f64c69320e47adf8a67e9069e546fe0c5f7a tree 48a09c1b8f4e5e43bacdca7a217457d04636bcf6 parent 61f3f64c69320e47adf8a67e9069e546fe0c5f7a author Jonas Fonseca 1375671192 -0400 committer Jonas Fonseca 1375741760 -0400 iconv: Move draw_chars encoding code to IO module commit 61f3f64c69320e47adf8a67e9069e546fe0c5f7a 1eaf34b03d2ed8b38cbb3a76086e4b79511554f1 tree a80ddd36f4a00eabc9b18d3524c48134508029a0 parent 1eaf34b03d2ed8b38cbb3a76086e4b79511554f1 author Jonas Fonseca 1375673818 -0400 committer Jonas Fonseca 1375741741 -0400 iconv: Ignore unrepresentable characters when transliterating Certain characters where causing iconv() to fail, which resulted in buggy rendering. By adding "//IGNORE" to the already existing "//TRANSLIT" flag unrepresentable characters are automatically removed from the resulting output. > echo "Nguyá»…n Thái Ngá»c Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT Nguy iconv: (stdin):1:4: cannot convert > echo "Nguyá»…n Thái Ngá»c Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT//IGNORE Nguyn Th'ai Ngc Duy commit 1eaf34b03d2ed8b38cbb3a76086e4b79511554f1 b5f566dd5f60287721e052f866966884915e05b4 tree 86e5729e30b0381e0d7fbbd0387a9e91067fe76d parent b5f566dd5f60287721e052f866966884915e05b4 author Jonas Fonseca 1375644113 -0400 committer Jonas Fonseca 1375644113 -0400 Only set LINES and COLUMNS environment variables for external commands Setting the LINES/COLUMNS environment variables to a constant number breaks ncurses' getmaxyx() logic, so dynamic resizing doesn't work as pointed out by Marcel Partap in a comment to the fix for issue #151 (https://github.com/jonas/tig/commit/f0ad1f74#commitcomment-3528715). As a work-around, only set LINES/COLUMNS when forking Git processes. This way diff stats will still use the whole terminal width and resizing works as intended. Fixes #109 commit b5f566dd5f60287721e052f866966884915e05b4 888611dd5d407775245d574a3dc5c01b5963a5ba tree 0d15ae11d18d9e803a054bd57d5479055045f84f parent 888611dd5d407775245d574a3dc5c01b5963a5ba author Jonas Fonseca 1375639426 -0400 committer Jonas Fonseca 1375639989 -0400 Crop text when title-overflow is enabled Limit the length of the title text if less columns are available when drawing the title. This fixes a glitch introduced with the original title-overflow patch, where the title text would wrap to the next line when rendered. Improve the rendering when only part of the "non-overflowing" title text is displayed by showing the '~' character to indicate that the text was cropped. Fixes #166 commit 888611dd5d407775245d574a3dc5c01b5963a5ba 5e33b18c68f630d58e415de7d26c1dea3f8152de tree 3615887606ba522c82b79bfbe18211bccbaa88fe parent 5e33b18c68f630d58e415de7d26c1dea3f8152de author Kumar Appaiah 1375326710 -0400 committer Jonas Fonseca 1375408508 -0400 Scroll diff with arrow keys in log view This commit introduces the VIEW_NO_PARENT_NAV flag and adds it to the log view. This allows the scrolling commands to fall through from the pager to the diff when the diff is viewed in the log mode. Signed-Off-By: Kumar Appaiah Signed-off-by: Jonas Fonseca commit 5e33b18c68f630d58e415de7d26c1dea3f8152de e2a0134d17e2096fa1467ad27bdf79b6fb6026e3 tree 794073c2525cfebddf7ad76666cc5090073af609 parent e2a0134d17e2096fa1467ad27bdf79b6fb6026e3 author Jonas Fonseca 1375320757 -0400 committer Jonas Fonseca 1375320757 -0400 Prepend the path to the repository root when editing a diff file Fixes #165 commit e2a0134d17e2096fa1467ad27bdf79b6fb6026e3 b2c279db873f10ee4724909eb561cb7be01c2328 tree fc3869dcd9dad077606d3cbd629c836ef97956c0 parent b2c279db873f10ee4724909eb561cb7be01c2328 author Vivien Didelot 1373353189 -0400 committer Jonas Fonseca 1375319300 -0400 Introduce the stash view This patch adds a new "stash" view, bound to the 'y' key. This view displays the list of stashes. Pressing Enter on one of them displays the corresponding change in a split view. Running 'tig stash' opens directly the stash view. A new %(stash) variable is added for bindings and commands. A built-in command to pop the current stash is bound to 'P' in this view. Other bindings may be added in the ~/.tigrc file, for instance: bind stash D !?git stash drop %(stash) bind stash A !?git stash apply %(stash) bind status S !?git stash save --keep-index %(prompt) Fixes #169 Closes #174 Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit b2c279db873f10ee4724909eb561cb7be01c2328 2d61ff12a8e04d4e5b0902c233f53fb27c0420fc tree e6ed0498463ac3d012859ef8cf2660fde188703e parent 2d61ff12a8e04d4e5b0902c233f53fb27c0420fc author Jonas Fonseca 1375072389 -0400 committer Jonas Fonseca 1375072389 -0400 Open editor at selected line also for multi-file diffs in the stage view Refactor out diff_common_edit(), which extracts the diffed file path and line numbers so it can be used for the case in stage_request() where there's not a single file. commit 2d61ff12a8e04d4e5b0902c233f53fb27c0420fc 550e32836b5190ad0d206dbe6ae42150f0136cbd tree 2b0afb27faee2fa6278d641cdfc454d44f1c85b2 parent 550e32836b5190ad0d206dbe6ae42150f0136cbd author Drew Northup 1374670227 -0400 committer Jonas Fonseca 1375060477 -0400 Fix regression when running tig with no arguments and custom encoding Since c7d67ab running "tig" with no options has failed with the error "tig: No revisions match the given arguments." This was due to a change in how the arguments for the back-end git call was being constructed. This change caused the blank field left in place of "%(encoding_arg)" when it is empty to not overwrite "buf" which then caused the value in "buf" to be copied into dst_argv twice. The resulting git command failed if there was no available revision named "log" as shown in the trace. From the TIG_TRACE log: git log log --no-color --pretty=raw --parents --parents -- fatal: bad revision 'log' This fix works by properly and fully initializing "buf" before each use. Fixes #167 Signed-off-by: Drew Northup Minor edits of commit message and change patch to use sizeof(buf). Signed-off-by: Jonas Fonseca commit 550e32836b5190ad0d206dbe6ae42150f0136cbd 4cd3ce8c022a252287364e1137a60517ea40b784 tree 1d0bcefdf4b8ef9bfb0b95b97488026fbd2c2175 parent 4cd3ce8c022a252287364e1137a60517ea40b784 author Michael Grünewald 1373905170 +0200 committer Jonas Fonseca 1375058892 -0400 Fix unicode_width for combining characters Combining characters have an effective width of zero because they just modify an adjacent character. The commit fixes tree indentation issues when using those kinds of characters. Fixes #170 Signed-off-by: Jonas Fonseca commit 4cd3ce8c022a252287364e1137a60517ea40b784 24b47349ced57657162f6eaac2211e7db0a9795b tree 1e34ca72218788c811ca7cb42fb3ddc229c55c99 parent 24b47349ced57657162f6eaac2211e7db0a9795b author Jonas Fonseca 1375057887 -0400 committer Jonas Fonseca 1375057887 -0400 Enable tilde expansion in ~/.tigrc "source" commands ... as used in the examples of the 'SOURCE COMMAND' section of tigrc(5). Thanks to Johann Visagie for reporting this and providing an initial patch. Fixes #168 commit 24b47349ced57657162f6eaac2211e7db0a9795b d2058bfbd8fd20b9063a3e6d3453ae9b9b8d15f3 tree 59654553d019d6ccea3150f86e564ef87519aba3 parent d2058bfbd8fd20b9063a3e6d3453ae9b9b8d15f3 author Jonas Fonseca 1375054604 -0400 committer Jonas Fonseca 1375055538 -0400 Fix blame and status to work from within directories starting with a dot When running `tig blame ../io.h' or `tig status' inside the directory `.dir', the command: git rev-parse --git-dir --is-inside-work-tree --show-cdup --show-prefix will print: /tig/.git true ../ .dir/ This cause read_repo_info() to confuse the show-prefix option output was the output of the show-cdup option. Fixes #172 reported by Azat Khuzhin. commit d2058bfbd8fd20b9063a3e6d3453ae9b9b8d15f3 01173e200ee2f477e26e8cf9da91440cf191fa91 tree 807f42248b95b604f9aa1bbeac36328a666b3aa0 parent 01173e200ee2f477e26e8cf9da91440cf191fa91 author IWASAKI Yudai 1362151543 +0900 committer Jonas Fonseca 1369703570 -0400 Reenable the log view from the command line Like `git log`, `tig log` shows the log view by default. Closes GH-146. Signed-off-by: Jonas Fonseca commit 01173e200ee2f477e26e8cf9da91440cf191fa91 7fb8d07a4734f1d9be5f960129ce3494f6ecab23 tree 2c8f11be3b5396fef07de2e1c96c60bce6558643 parent 7fb8d07a4734f1d9be5f960129ce3494f6ecab23 author Jonas Fonseca 1369700574 -0400 committer Jonas Fonseca 1369700574 -0400 Do not apply diff styling to untracked files in the stage view Fixes GH-153. commit 7fb8d07a4734f1d9be5f960129ce3494f6ecab23 f0ad1f7456ad1200d23eaa02e6409854cc47b9ad tree 2ca0704159a3965e9f4c082a8be064f57cdfcddf parent f0ad1f7456ad1200d23eaa02e6409854cc47b9ad author Menghan Zheng 1350901156 +0800 committer Jonas Fonseca 1369275476 -0400 Fix regexec() error checking in grep_text() and grep_refs() regexec() returns 0 for success and the non-zero code REG_NOMATCH for failure, so it should be '!result' instead of 'result != REG_NOMATCH'. Signed-off-by: Jonas Fonseca commit f0ad1f7456ad1200d23eaa02e6409854cc47b9ad 4dd65a94a9b2d6918eb6af6ad2c8236bb6a2a9a7 tree a6c52e450bdbd11dbd7b276ae909b84b61e9b0a5 parent 4dd65a94a9b2d6918eb6af6ad2c8236bb6a2a9a7 author Jonas Fonseca 1369077118 -0400 committer Jonas Fonseca 1369077902 -0400 Pass terminal dimensions to git by setting COLUMNS and LINES This partially reverts "Show diff stats as wide as the terminal" (commit a7eb3057ec70d4948ca5f2de98fcf29d844085b4) which passed the terminal width to git-diff using `--stat=%(width)`. This feature was introduced in Git version 1.7.10 released 2013-04-06 and causes problems for older versions of Git. It turns out that Git will automatically read $COLUMNS when showing diff stats, so the same effect can be achieved by passing the terminal dimensions using environment variables. Fixes GH-151, "Broken commit rendering on Ubuntu 10.04" since incompatibilitis with older versions of Git is no longer an issue. Tested using `tig 1f384f3f5b9f0ea5a78504200eb577fcb8ba600a`. commit 4dd65a94a9b2d6918eb6af6ad2c8236bb6a2a9a7 ac9dd6e71c9ccda15c2db6782c270b97f2788ea3 tree bc352016eb8d7fd44a8911054b9bdb633c35793f parent ac9dd6e71c9ccda15c2db6782c270b97f2788ea3 author Jonas Fonseca 1369025158 -0400 committer Jonas Fonseca 1369025519 -0400 Do not expand the graph for merges already aligned to the left Fixes regression introduced in de7cb8abe84337fd5b628648dfda1b472e0a6c53 as part of GH-143. commit ac9dd6e71c9ccda15c2db6782c270b97f2788ea3 a0fdac2975ce8cf2de07435c7a3c6ccc1415393c tree 0b7c2f21ba7babd1a0e09381557606e1ad505298 parent a0fdac2975ce8cf2de07435c7a3c6ccc1415393c author Sven Wegener 1368693353 +0200 committer Jonas Fonseca 1369022685 -0400 Use TMPDIR for temporary files Signed-off-by: Sven Wegener Fall back to /tmp if copying fails for the environment variable. Signed-off-by: Jonas Fonseca commit a0fdac2975ce8cf2de07435c7a3c6ccc1415393c ae5904771796e34037f07f27b49a8bf5529ad3bc tree 2a48e704699393f7549d12c87b965449d19d8e81 parent ae5904771796e34037f07f27b49a8bf5529ad3bc author Sven Wegener 1368693364 +0200 committer Jonas Fonseca 1369022369 -0400 Create temporary file with name as suffix This helps editors guess the filetype to properly set up their syntax highlighting. Signed-off-by: Sven Wegener Signed-off-by: Jonas Fonseca commit ae5904771796e34037f07f27b49a8bf5529ad3bc 9846fae52bd0666c0e314618ad936ed76f365240 tree d867ef866b95c88fe18940e906833ab75fd4f8a4 parent 9846fae52bd0666c0e314618ad936ed76f365240 author Jonas Fonseca 1369021168 -0400 committer Jonas Fonseca 1369021277 -0400 Improve invalidation during reload of references Add valid field and only clear the reference ID after the reload so that decoration of replaced commits will work correctly. commit 9846fae52bd0666c0e314618ad936ed76f365240 88cc2d2b8d972dadb8c7e53e2c323524ac1ae391 tree b697eda6ae840432bfa2d1c5d23bf1a112aca8a6 parent 88cc2d2b8d972dadb8c7e53e2c323524ac1ae391 author Jonas Fonseca 1369020716 -0400 committer Jonas Fonseca 1369021023 -0400 Set the reference list ID during creation Because the reference list could not be found again, this caused the branches and tags in the list to disappear in the main view when the references were reloaded, such as after an external command. Fixes GH-148. commit 88cc2d2b8d972dadb8c7e53e2c323524ac1ae391 3503de6d37bb5f893faed05e1a872ed20707a568 tree c61c1c298109463981f5db19556085341e563dc4 parent 3503de6d37bb5f893faed05e1a872ed20707a568 author Jonas Fonseca 1368846980 -0400 committer Jonas Fonseca 1368846980 -0400 Fix rendering glitch for branch names Parts of the author name would randomly be shown after the branch's commit title if the title was shorter than the author name. commit 3503de6d37bb5f893faed05e1a872ed20707a568 7596edb1ffb3c9f0186536ec9ab336bdfe609e24 tree 5153bf5f89ed603cb7ba00ff2ff89f727351d22d parent 7596edb1ffb3c9f0186536ec9ab336bdfe609e24 author Jonas Fonseca 1368842825 -0400 committer Jonas Fonseca 1368842973 -0400 Fix display of all branches labels in repos with short branch names In a fresh repository with only the master branch the "All branches" label would be truncated to "All br". commit 7596edb1ffb3c9f0186536ec9ab336bdfe609e24 49ff09473805698941d4177cd84815c32921326c de7cb8abe84337fd5b628648dfda1b472e0a6c53 tree 2310b53acfd46b4a09776351491a02d00e1834cb parent 49ff09473805698941d4177cd84815c32921326c parent de7cb8abe84337fd5b628648dfda1b472e0a6c53 author Jonas Fonseca 1368407107 -0700 committer Jonas Fonseca 1368407107 -0700 Merge pull request #143 from bbolli/clang-warning Eliminate a constant expression commit de7cb8abe84337fd5b628648dfda1b472e0a6c53 e730ceee45c4312f7d5921d1c8890a506816caf2 tree f3fbffc3f07bd2466288b48e250aa5ed5757b021 parent e730ceee45c4312f7d5921d1c8890a506816caf2 author Beat Bolli 1368040861 +0200 committer Beat Bolli 1368192516 +0200 Eliminate a constant expression Clang warns that the expression graph->position < 0 is always false because ->position is unsigned. commit 49ff09473805698941d4177cd84815c32921326c e730ceee45c4312f7d5921d1c8890a506816caf2 tree 9d590acf115537caeea7cd848ff92e65a8b92075 parent e730ceee45c4312f7d5921d1c8890a506816caf2 author Aaron Franks 1367963398 -0700 committer Jonas Fonseca 1368061815 -0400 tigrc(5): document how to use Ctrl in key bindings Fixes GH-131 by providing an explanation in the man pages. Closes GH-141. [ jf: reworked the commit message ] commit e730ceee45c4312f7d5921d1c8890a506816caf2 c7d9e977a57c61977410edf03ff0d3cfc1f9090c tree 553f8a82ecab16a26c93b0e127765d3a2afc8130 parent c7d9e977a57c61977410edf03ff0d3cfc1f9090c author Jonas Fonseca 1367374676 -0400 committer Jonas Fonseca 1367374772 -0400 Show line numbers in the branch view Closes GH-135. commit c7d9e977a57c61977410edf03ff0d3cfc1f9090c 224470e7cd0963f130f97ff64af8bf7958f0f05c tree 4772ac7ed1e97a4321426f73d4930d5e11c260d8 parent 224470e7cd0963f130f97ff64af8bf7958f0f05c author Jonas Fonseca 1367323021 -0400 committer Jonas Fonseca 1367323021 -0400 Fix formatting of revargs Regression introduced in 9c2a94b8e845c1838ebeb2842dba423c2987690e. commit 224470e7cd0963f130f97ff64af8bf7958f0f05c 7ff7651bd61c6dd96caa256c9faf6c17dca285a0 tree 62657d121ea660e7e2ff4ea844c42c6e07f44fa3 parent 7ff7651bd61c6dd96caa256c9faf6c17dca285a0 author Jonas Fonseca 1367322440 -0400 committer Jonas Fonseca 1367322440 -0400 Fix half cooked patch tweaks commit 7ff7651bd61c6dd96caa256c9faf6c17dca285a0 0c278556e52b9b78fde9f089cab755a6366d9ce6 tree 02dd919f55152633e13d3cd1948d6533fb27daa5 parent 0c278556e52b9b78fde9f089cab755a6366d9ce6 author IWASAKI Yudai 1362230113 +0900 committer Jonas Fonseca 1367289351 -0400 Cancel quitting after answering no to a prompt [ jf: Fix coding style ] Signed-off-by: Jonas Fonseca Closes GH-128. commit 0c278556e52b9b78fde9f089cab755a6366d9ce6 a7eb3057ec70d4948ca5f2de98fcf29d844085b4 tree 77962540fb7e1d75d48891ac253728a04bab2fee parent a7eb3057ec70d4948ca5f2de98fcf29d844085b4 author Jonas Fonseca 1367288341 -0400 committer Jonas Fonseca 1367288439 -0400 Fix regression causing incorect coloring of the commit title The regression was introduced in fe27b370d2937a37ed8a1be2a8d3b7d8d7edf5be. Closes GH-136. commit a7eb3057ec70d4948ca5f2de98fcf29d844085b4 ee3c148e0dace3ec59f743df214db56959ecd144 tree 28ee9e88e87f7ecfe3cfd4141c7a221c93a2d8c3 parent ee3c148e0dace3ec59f743df214db56959ecd144 author Jonas Fonseca 1367287036 -0400 committer Jonas Fonseca 1367287058 -0400 Show diff stats as wide as the terminal Closes GH-109. commit ee3c148e0dace3ec59f743df214db56959ecd144 c7d67ab1c70ba9e50138c8a3e19ca430daaff385 tree 75b254b628716346faa2664831410fd7a3662253 parent c7d67ab1c70ba9e50138c8a3e19ca430daaff385 author Jonas Fonseca 1367285888 -0400 committer Jonas Fonseca 1367286812 -0400 Introduce format_context struct to simplify argument passing commit c7d67ab1c70ba9e50138c8a3e19ca430daaff385 2e7f23cdab250e8d67b70c03e6b9a2b12f902896 tree a859d32003c3add181de24bd202868e6e86ae4ad parent 2e7f23cdab250e8d67b70c03e6b9a2b12f902896 author Jonas Fonseca 1367285346 -0400 committer Jonas Fonseca 1367286772 -0400 Append the argument in format_expand_arg commit 2e7f23cdab250e8d67b70c03e6b9a2b12f902896 9c2a94b8e845c1838ebeb2842dba423c2987690e tree d1bda105b815d7424acba734e0b4890c3d9995ae parent 9c2a94b8e845c1838ebeb2842dba423c2987690e author Jonas Fonseca 1367284008 -0400 committer Jonas Fonseca 1367286771 -0400 Rename format_arg => format_expand_arg commit 9c2a94b8e845c1838ebeb2842dba423c2987690e edd845846accf1ba2888ca2dfed949a77e81acf2 tree d76d51340e37f0d6481f421e9c226f154f89e771 parent edd845846accf1ba2888ca2dfed949a77e81acf2 author Jonas Fonseca 1367283878 -0400 committer Jonas Fonseca 1367286765 -0400 Format diff and blame arguments commit edd845846accf1ba2888ca2dfed949a77e81acf2 77ff1abfe0d8a47b8f88ed95630ceeb71f672890 tree c14d12f6c7093ccdf1e799f918402f9efe0466b7 parent 77ff1abfe0d8a47b8f88ed95630ceeb71f672890 author Jonas Fonseca 1367283013 -0400 committer Jonas Fonseca 1367283545 -0400 Move argument formatting to separate function commit 77ff1abfe0d8a47b8f88ed95630ceeb71f672890 6d45bfbd02b43f2275aa8a4a06b91945f5f0d351 tree 132f469365cfce025062864a3258a50951d1f751 parent 6d45bfbd02b43f2275aa8a4a06b91945f5f0d351 author Dominik Vogt 1365668122 +0200 committer Jonas Fonseca 1365736966 -0400 Add a ".." entry if tig is used on an empty path in tree view. Without this change it was impossible to leave an empty directory in tree view if you started tig inside an empty directory in the working tree. Signed-off-by: Jonas Fonseca commit 6d45bfbd02b43f2275aa8a4a06b91945f5f0d351 d0444d5acb5a037481dd309bd13acc60cf887fc6 tree 48ab823f7260e3d84ee0273b4c955aca64567212 parent d0444d5acb5a037481dd309bd13acc60cf887fc6 author Jonas Fonseca 1365306790 -0400 committer Jonas Fonseca 1365306790 -0400 Build with curses.h when using the default Mac OS X make configuration commit d0444d5acb5a037481dd309bd13acc60cf887fc6 fe27b370d2937a37ed8a1be2a8d3b7d8d7edf5be tree b67c579d205f583aefb009d65f7001714a5f711e parent fe27b370d2937a37ed8a1be2a8d3b7d8d7edf5be author Rafael Laboissiere 1364914682 +0200 committer Jonas Fonseca 1365121074 -0400 Update documentation as regards color specification using bare numbers The change in the set_color function that allows colors to be specified by numbers (like in Git) was done in commit 54e8c4d2, but the documentation has not been updated accordingly. Fixes GH #129 [ jf: minor rewording ] Signed-off-by: Jonas Fonseca commit fe27b370d2937a37ed8a1be2a8d3b7d8d7edf5be 56e167af5ff10671a6e09d3011b2a8cbbf450753 tree 7790fbfe4f9136d0f0f80b4273ad6abc7a4935bf parent 56e167af5ff10671a6e09d3011b2a8cbbf450753 author Jonas Fonseca 1364618920 -0400 committer Jonas Fonseca 1364618920 -0400 Fix diff title overflow rendering to use view specific flag commit 56e167af5ff10671a6e09d3011b2a8cbbf450753 8ecf51caf9b2dcbd684d053f47edf524fa48f5bf tree fe3846ad85af01ebe29d7afaa7222879c16a7fb2 parent 8ecf51caf9b2dcbd684d053f47edf524fa48f5bf author Jonas Fonseca 1364613901 -0400 committer Jonas Fonseca 1364614060 -0400 [#102] Revert 40868f7 which breaks blame and pickaxe support for follow The commit breaks `tig blame --follow tig.c` and `tig -Sfoo --follow`. commit 8ecf51caf9b2dcbd684d053f47edf524fa48f5bf 3d9a8c5393777e04c0ecff55c59e660d4de77360 tree 3e9b468963e0c0544ddf297debecabb9c1f95a1b parent 3d9a8c5393777e04c0ecff55c59e660d4de77360 author IWASAKI Yudai 1362147913 +0900 committer Jonas Fonseca 1364612906 -0400 Add +ESC key binding Example: bind generic ^[v move-page-up Signed-off-by: Jonas Fonseca commit 3d9a8c5393777e04c0ecff55c59e660d4de77360 5ada4726801fa9884dd2dd4a9bab157c3d1517c9 tree aac9f5fdc7478bb50e1a1c95b8356656f484a09b parent 5ada4726801fa9884dd2dd4a9bab157c3d1517c9 author Jonas Fonseca 1364612346 -0400 committer Jonas Fonseca 1364612906 -0400 Highlight commit title overflow in the diff view commit 5ada4726801fa9884dd2dd4a9bab157c3d1517c9 9948512164e55f35197dd3d5eca175c9f022762b tree 3d210cd7caf680ebd9b8a09a07a690f74c540d30 parent 9948512164e55f35197dd3d5eca175c9f022762b author Jonas Fonseca 1364612315 -0400 committer Jonas Fonseca 1364612906 -0400 Rename the title-overflow color to overflow commit 9948512164e55f35197dd3d5eca175c9f022762b 240e3aaf86f619892d4038dcce5af793c85eae70 tree 8b7c97a277bef49bcdc0636f6540dc1dbf529515 parent 240e3aaf86f619892d4038dcce5af793c85eae70 author Jonas Fonseca 1364612258 -0400 committer Jonas Fonseca 1364612905 -0400 Refactor commit title drawing to expand text and make it reusable commit 240e3aaf86f619892d4038dcce5af793c85eae70 374d9dc1f98b881f224de80aa0704edbacc3055d tree bdaafd4be4c2cf68799f83c2ce5e5e3826ce207b parent 374d9dc1f98b881f224de80aa0704edbacc3055d author Vivien Didelot 1363111444 -0400 committer Jonas Fonseca 1364612900 -0400 main: add toggle for commit title overflow Many developers and tools use the Git convention for commit titles, as discussed in the git-commit(1) man page: Though not required, it's a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change This patch adds the ability to highlight text exceeding a specified width in commit titles, through a "title-overflow" option. As a boolean, it enables/disables the highlighting, with a default value of 50. As a int, it enables and uses the value as the maximum width for a title to be considered short. Signed-off-by: Vivien Didelot Minor improvement of the option description. Signed-off-by: Jonas Fonseca commit 374d9dc1f98b881f224de80aa0704edbacc3055d 571bc1d2b695a09100be649b26267b3abdc771d9 tree 367435537e161a646abb3823b8aa7541c839a0dd parent 571bc1d2b695a09100be649b26267b3abdc771d9 author Jonas Fonseca 1363899891 -0400 committer Jonas Fonseca 1364255649 -0400 Link to stackoverflow.com/questions/tagged/tig for Q and A Thanks to Vincent Scheib for arranging and Paul Kinlan for donating his Stack Overflow karma to create the tag. commit 571bc1d2b695a09100be649b26267b3abdc771d9 a51cb56682ec0c89250154f6d352b8ee95742aac tree da528a71fd88ce76f24c2515ab0dc8f3bb0a9db1 parent a51cb56682ec0c89250154f6d352b8ee95742aac author Vivien Didelot 1363892369 -0400 committer Jonas Fonseca 1363899726 -0400 Catch SIGQUIT and gracefully exit tig Ctrl+4 sends a SIGQUIT to tig, which results in printing a "Quit (core dumped)" message and leaving the console dirty. This patch catches the signal in order to correctly end the session. Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit a51cb56682ec0c89250154f6d352b8ee95742aac 22bd244771f64b020fa6d3f4d548b319a8702e75 tree fc1d92b81ebe3b7bb167ac1cc25555696f7fe78a parent 22bd244771f64b020fa6d3f4d548b319a8702e75 author Tristan Matthews 1363891568 -0400 committer Jonas Fonseca 1363899561 -0400 Restore default signal handlers This guarantees that the OS can handle further signals if, for example, endwin() did not return. Signed-off-by: Tristan Matthews Signed-off-by: Jonas Fonseca commit 22bd244771f64b020fa6d3f4d548b319a8702e75 91fc97d2ea3bb3f20dc876acc8315b667e05ae39 tree 56bb05adcd106f1e9f99a5c18ea0aa0aa2804295 parent 91fc97d2ea3bb3f20dc876acc8315b667e05ae39 author Jonas Fonseca 1363052649 -0400 committer Jonas Fonseca 1363052649 -0400 Add toggle-files to disable file filtering for the diff and main views Requested by Vincent Scheib. commit 91fc97d2ea3bb3f20dc876acc8315b667e05ae39 5627d59c8c86f6d0f0ed83b0563d9df112a8e46b tree 1fdab102da17782512cbd2af365ce89afb9c37fd parent 5627d59c8c86f6d0f0ed83b0563d9df112a8e46b author Jonas Fonseca 1362327679 -0500 committer Jonas Fonseca 1362327679 -0500 Add example user-defined commands to the manual Inspired by GH #121, GH #65 and GH #74. commit 5627d59c8c86f6d0f0ed83b0563d9df112a8e46b 20204dc02520f508a024ba6d9e0f6d82f483c500 tree cb360264cacc56ea3d2be9f120f00e6b42251a5b parent 20204dc02520f508a024ba6d9e0f6d82f483c500 author Jonas Fonseca 1361754864 -0500 committer Jonas Fonseca 1361756240 -0500 tigrc(5): document show-line-numbers commit 20204dc02520f508a024ba6d9e0f6d82f483c500 123da8482336c6da44166d1b739752f582ae84e3 tree 512eb1aac281b9a5d228385e481842beb36a6351 parent 123da8482336c6da44166d1b739752f582ae84e3 author Jonas Fonseca 1361754797 -0500 committer Jonas Fonseca 1361756240 -0500 Detect errors and allow editor line number to be disabled First of all a big warning is shown when the editor reports an error. Secondly, the line line number feature is disabled. commit 123da8482336c6da44166d1b739752f582ae84e3 a14ad94dbde5bee0eef66047dfc3d3f02a59bf3a tree b3a448f4321a5249fd3ab1e8952e0f4dd96ce457 parent a14ad94dbde5bee0eef66047dfc3d3f02a59bf3a author Jonas Fonseca 1361756205 -0500 committer Jonas Fonseca 1361756240 -0500 Stage view: open untracked file at selected line commit a14ad94dbde5bee0eef66047dfc3d3f02a59bf3a 89bdcf775240748c052b25dbf776aaa729026a63 tree 21e7e77a8f938aa180452eab21834e15a0c2de73 parent 89bdcf775240748c052b25dbf776aaa729026a63 author Jonas Fonseca 1361754741 -0500 committer Jonas Fonseca 1361754741 -0500 Blob view: open editor at selected line commit 89bdcf775240748c052b25dbf776aaa729026a63 0609a8c15b0f05ae8a1b21c6218cba6cc685595c tree 39ec17ba181c714f1e5e32fba781a748feb8d77b parent 0609a8c15b0f05ae8a1b21c6218cba6cc685595c author Vivien Didelot 1361737678 -0500 committer Jonas Fonseca 1361753248 -0500 Add a line number argument to open_editor This patch allows opening the editor from the diff or stage view, at the actual line number. Signed-off-by: Vivien Didelot Increase the editor argument array size. Signed-off-by: Jonas Fonseca commit 0609a8c15b0f05ae8a1b21c6218cba6cc685595c ff63893e8091cf54a1c447bc9c0bebe977d1d278 tree 6a507e526057555b053de0464e429f2794229eee parent ff63893e8091cf54a1c447bc9c0bebe977d1d278 author Jonas Fonseca 1361416281 -0500 committer Jonas Fonseca 1361505758 -0500 [#116] Add vim mode lines and machinery for updating C file headers This was originally suggested by Thomas Sibley to ease contributions. Use the update mechanism to add Copyright notice for 2013. commit ff63893e8091cf54a1c447bc9c0bebe977d1d278 1f384f3f5b9f0ea5a78504200eb577fcb8ba600a tree f663b0e4dbec0ec6777cae8e3664db20064b03b1 parent 1f384f3f5b9f0ea5a78504200eb577fcb8ba600a author Jonas Fonseca 1361505710 -0500 committer Jonas Fonseca 1361505749 -0500 test-graph: show usage string when no input is given on stdin commit 1f384f3f5b9f0ea5a78504200eb577fcb8ba600a 1027bc1bd6877223a3cb537d63a25e91248dd26c tree e55700fa5f9d554e557a364251c9dce56ccc0fbc parent 1027bc1bd6877223a3cb537d63a25e91248dd26c author Jonas Fonseca 1361328035 -0500 committer Jonas Fonseca 1361328035 -0500 [#115] Add toggles for showing author email or email user names The initial patch and idea was contributed by Anders F Björklund. Reimplemented to use a 'single object' cache of authors. commit 1027bc1bd6877223a3cb537d63a25e91248dd26c 2c403f4b210c17d6d4a9f0c0186522ba6a062ee2 tree 5a0619d17a0f51a6caff3a9b3790f1668a21149d parent 2c403f4b210c17d6d4a9f0c0186522ba6a062ee2 author Jonas Fonseca 1361169715 -0500 committer Jonas Fonseca 1361169715 -0500 Fix manual keybinging for stage-single-line commit 2c403f4b210c17d6d4a9f0c0186522ba6a062ee2 d4dc96cd92f8333378cc35394ed5653157c6c9d1 tree bb4023b8342a27890478be9136d0d5ce9b088bc4 parent d4dc96cd92f8333378cc35394ed5653157c6c9d1 author Jonas Fonseca 1361169695 -0500 committer Jonas Fonseca 1361169695 -0500 Update NEWS commit d4dc96cd92f8333378cc35394ed5653157c6c9d1 0d9ef8c05032ce8cc1519be89b57ab44e436d5cc tree 513cbaf3adb2c1ce029f5b185b5edeac65a7faf9 parent 0d9ef8c05032ce8cc1519be89b57ab44e436d5cc author Thomas Sibley 1360744950 -0800 committer Jonas Fonseca 1361167519 -0500 Document the ability to bind internal commands Signed-off-by: Jonas Fonseca commit 0d9ef8c05032ce8cc1519be89b57ab44e436d5cc b023bf6181c68c71c0af3cb764d2dfa26361fe92 tree 96cbc48d2cac2022585c8c8aeb5ebf7afb6cdaf0 parent b023bf6181c68c71c0af3cb764d2dfa26361fe92 author Thomas Sibley 1360739925 -0800 committer Jonas Fonseca 1361167519 -0500 Key bindings which execute tig prompt commands "Internal" run requests now provide a way to add keybindings for tigrc and tig prompt commands. For example: bind diff F :set diff-options = --full-diff Much of the change to open_run_request() is increased indentation; viewing the diff with whitespace ignored (git show -w or pressing W in tig) reveals the simplicity of the functional changes. Signed-off-by: Jonas Fonseca commit b023bf6181c68c71c0af3cb764d2dfa26361fe92 057579a6b703ddf7e0496fd84f20015acadb7a10 tree 38e841ca7a809a5fa7174ea9e6ed07cc5053daa6 parent 057579a6b703ddf7e0496fd84f20015acadb7a10 author Thomas Sibley 1360738866 -0800 committer Jonas Fonseca 1361167507 -0500 Return a request from open_run_request() A boolean return value limits the ability of open_run_request() to handle more complex run requests in the future. The "quit, refresh, or do nothing" logic in view_driver(), based on the boolean return value, is easily represented by returning REQ_QUIT, REQ_REFRESH, or REQ_NONE from open_run_request() itself. Returning a request also seems more in line with workings of other functions which process requests. The current view is passed to open_run_request(), which enables it to return REQ_REFRESH as appropriate. For the future, this also opens the door for other queries and actions on the view. Signed-off-by: Jonas Fonseca commit 057579a6b703ddf7e0496fd84f20015acadb7a10 ebf5058f59dacbdcda7921ecd3d15b881c70026e tree 26615c0885ae0940086d727d2c306b319a507f07 parent ebf5058f59dacbdcda7921ecd3d15b881c70026e author Thomas Sibley 1360739478 -0800 committer Jonas Fonseca 1361167459 -0500 After setting an option, refresh the view if possible Redrawing is not always enough but is still used as a fallback if the view is unrefreshable. Signed-off-by: Jonas Fonseca commit ebf5058f59dacbdcda7921ecd3d15b881c70026e 33a60e4fbf947301329072c9470276b9727aaf0c tree b13559e7708ed2bd2c24e0c9724acc1fd3181513 parent 33a60e4fbf947301329072c9470276b9727aaf0c author Thomas Sibley 1360695172 -0800 committer Jonas Fonseca 1361167454 -0500 Support refreshing the diff view by reloading the data This allows new diff-options to take effect. The diff view is still unrefreshable when reading data from STDIN. Signed-off-by: Jonas Fonseca commit 33a60e4fbf947301329072c9470276b9727aaf0c a2887de61e8a06ed640d4da2c9469136b208409d tree d1b886e27c72bff96f63dcdcf7f0a8b22c2a1ec3 parent a2887de61e8a06ed640d4da2c9469136b208409d author Thomas Sibley 1360724523 -0800 committer Jonas Fonseca 1361167449 -0500 Refactor the prompt command handling into a separate function Preparation for running prompt commands from keybindings. Signed-off-by: Jonas Fonseca commit a2887de61e8a06ed640d4da2c9469136b208409d 3567c4e158f50e8ca6813d97195fbbc6697cd09b tree 924c1a9f39baeee0b8b82c344af754694c9c71ea parent 3567c4e158f50e8ca6813d97195fbbc6697cd09b author Thomas Sibley 1360604513 -0800 committer Jonas Fonseca 1361167446 -0500 Allow overwriting of a previously set "argv" option parse_args() is only used by option_set_command() for the two "argv" style options: blame-options and diff-options. Allowing parse_args() to overwrite the destination enables ":set diff-options = ..." to work more than once from within the tig prompt (or at all if first set via tigrc). This is safe since argv_copy() handles the necessary freeing, added as part of 7dfa0b2. Signed-off-by: Jonas Fonseca commit 3567c4e158f50e8ca6813d97195fbbc6697cd09b f996cef478b09ccd0bb49e3742185dbab402b062 tree 1f2913deae7f1331fdbd41ddc1d8ef4c40ee9763 parent f996cef478b09ccd0bb49e3742185dbab402b062 author Thomas Sibley 1360452876 -0800 committer Jonas Fonseca 1361167439 -0500 Add a diff-options config, similar to blame-options This is useful for persistent arguments to the diff view instead of setting TIG_DIFF_OPTS or always passing them on the command line invocation. Signed-off-by: Jonas Fonseca commit f996cef478b09ccd0bb49e3742185dbab402b062 a49bafa275cb2ac1bcf51848bbadc33eb0324d28 tree 6cdc01a055332f133d2acccfd4e429ccf8b939c1 parent a49bafa275cb2ac1bcf51848bbadc33eb0324d28 author Julian Langschaedel 1358279099 +0100 committer Jonas Fonseca 1361164336 -0500 Main view: fix diff view display for staged/unstaged changes Shows actual diff of stage/unstaged state instead of just a blank diff with "[diff] 0000000000000000000000000000000000000000" in the status bar. [ Set flags depending on whether the diff view is requested ] Signed-off-by: Jonas Fonseca commit a49bafa275cb2ac1bcf51848bbadc33eb0324d28 faf98a39c02c09d782633cccfdd644c6aaa8be8e tree 517e1f42bdf8b24d45282b01b27ee37ce3666fc2 parent faf98a39c02c09d782633cccfdd644c6aaa8be8e author Joakim Sernbrant 1357639937 +0100 committer Jonas Fonseca 1361163729 -0500 Added configure Signed-off-by: Jonas Fonseca commit faf98a39c02c09d782633cccfdd644c6aaa8be8e c622b9e71d9aedab055597d3156e65b8f720da8c tree 0c7823c775ee351646c920de568dff826a41e37e parent c622b9e71d9aedab055597d3156e65b8f720da8c author Thomas Sibley 1357200879 -0800 committer Jonas Fonseca 1361163451 -0500 Report toggled option *after* refreshing/reloading the view This ensures that the report is remains visible in all cases, rather than immediately being cleared in some cases. In particular, toggling the diff whitespace behaviour (with W) no longer leaves you unsure of the current state. [ Changed to keep redraw logic in view_driver() ] Signed-off-by: Jonas Fonseca commit c622b9e71d9aedab055597d3156e65b8f720da8c de0258e58fa5b71134beadc075962fab069b5227 tree 319e0999f953244dcccd599d059adece45f9e01f parent de0258e58fa5b71134beadc075962fab069b5227 author Thomas Sibley 1357201429 -0800 committer Jonas Fonseca 1361160443 -0500 Don't clear the status/report line when finishing a piped update This appears to be no longer necessary, and a hold over from when updates were more verbose at the start of and during processing and needed to be cleared when finished (refer to f97f401). More importantly, the call to report_clear() when the view is done updating can hide status messages from the beginning of the update which should remain visible past the end (until some other action clears the status line). Signed-off-by: Jonas Fonseca commit de0258e58fa5b71134beadc075962fab069b5227 cd9815d1a594d483a1efc6135e3badc996603b7f tree 4ca35871e2b0a1d6ba831190f3e357c71be3c3f6 parent cd9815d1a594d483a1efc6135e3badc996603b7f author lvzhandong 1353575781 +0800 committer Jonas Fonseca 1361160334 -0500 Reload current branch name when reloading the stage view. Signed-off-by: Jonas Fonseca commit cd9815d1a594d483a1efc6135e3badc996603b7f c575a602087c6e4d94051f8cafdd5a7d98ade600 tree e5d19ff7475c3f7f076934148bb57298c4462a24 parent c575a602087c6e4d94051f8cafdd5a7d98ade600 author Romain Francoise 1351419148 +0100 committer Jonas Fonseca 1361159935 -0500 Don't call string_copy_rev() on empty string graph_expand() calls graph_insert_column() with the empty string as id, which in turns leads to string_copy_rev() reading outside the allowed memory area looking for whitespace. To avoid this, don't call string_copy_rev() if we know the string is empty anyway. Signed-off-by: Romain Francoise Moved the check to string_copy_rev(). Signed-off-by: Jonas Fonseca commit c575a602087c6e4d94051f8cafdd5a7d98ade600 9ba6219ac69a38eeb59f466fca22813fff1ed953 tree 6d639c1489659c58976e4ee24681f7ab03c66a0d parent 9ba6219ac69a38eeb59f466fca22813fff1ed953 author Jonas Fonseca 1356769443 -0500 committer Jonas Fonseca 1361159625 -0500 autogen.sh: Set WARNINGS in a more portable fashion commit 9ba6219ac69a38eeb59f466fca22813fff1ed953 7290971278944a701276e9bc4a88a216858f4e39 tree ed08f3524fca49ba5380a70125d5acc692abb79b parent 7290971278944a701276e9bc4a88a216858f4e39 author Jonas Fonseca 1350931180 -0400 committer Jonas Fonseca 1350931270 -0400 [GH #93] Fix compile errors reported on old Solaris systems - tig.h:81:1: warning: "__NORETURN" redefined - tig.c:2468: error: subscripted value is neither array nor pointer commit 7290971278944a701276e9bc4a88a216858f4e39 40868f705ff8b4a1c4dc44ae07c64a47e0f090dc tree 82f261673425e957b6f91338218dc668f187b155 parent 40868f705ff8b4a1c4dc44ae07c64a47e0f090dc author Jonas Fonseca 1350406297 -0400 committer Jonas Fonseca 1350406297 -0400 [GH #93] Reload the current branch name when reloading the status view commit 40868f705ff8b4a1c4dc44ae07c64a47e0f090dc 3acf9cfc26e52f261795a1c9bc7d7553f08d2002 tree 71f993c0a078ca98ec0749664ab78e21334291c7 parent 3acf9cfc26e52f261795a1c9bc7d7553f08d2002 author Jonas Fonseca 1350189074 -0400 committer Jonas Fonseca 1350189216 -0400 Fix diff display when using --follow by marking it as a rev flag commit 3acf9cfc26e52f261795a1c9bc7d7553f08d2002 121fda4dba9213a7b8200f7203f37ff00186b562 tree 74509bf5d702b8d0467cbcef890c5593c6a2bbd7 parent 121fda4dba9213a7b8200f7203f37ff00186b562 author Jonas Fonseca 1350098087 -0400 committer Jonas Fonseca 1350189153 -0400 Remove unneeded git update-index call ... detected with TIG_TRACE. commit 494b8c83eab99657aae9fce302dd8166913ff377 60e8ed5c4cac499e0223ccf0cce4fed71f5d380a tree 10d5eb9d510589fa7d56a2f58ef0ea2ddcbfe384 parent 60e8ed5c4cac499e0223ccf0cce4fed71f5d380a author Jonas Fonseca 1350046305 -0400 committer Jonas Fonseca 1350046305 -0400 Update for version tig-1.1 commit 60e8ed5c4cac499e0223ccf0cce4fed71f5d380a 185614f0f60fc686b2ab143308cba145cc5c74fb 121fda4dba9213a7b8200f7203f37ff00186b562 tree 180565cb7b201ababfa93cbd2e6a4bf202e8639d parent 185614f0f60fc686b2ab143308cba145cc5c74fb parent 121fda4dba9213a7b8200f7203f37ff00186b562 author Jonas Fonseca 1350046278 -0400 committer Jonas Fonseca 1350046278 -0400 Merge branch 'master' into release commit 121fda4dba9213a7b8200f7203f37ff00186b562 6ffb71c3ae8978066af22484d6cf08e7a3409da5 tree 98051905b8557349ff6052e80ba206690b0dcf09 parent 6ffb71c3ae8978066af22484d6cf08e7a3409da5 author Jonas Fonseca 1350046272 -0400 committer Jonas Fonseca 1350046272 -0400 tig-1.1 commit 6ffb71c3ae8978066af22484d6cf08e7a3409da5 690c03da4e0119029fd7402bfead149d73599b68 tree 3f43ddcf2f056619488face139d4acec5115a43e parent 690c03da4e0119029fd7402bfead149d73599b68 author Jonas Fonseca 1350013711 -0400 committer Jonas Fonseca 1350013711 -0400 [GH #91] Allow to open blob related with added content in a diff commit 29ea9b6c8aa3f673ca311fbda5685c2efe375092 690c03da4e0119029fd7402bfead149d73599b68 tree ef66ad36edacef0a7dd7464f6f3fab222def0993 parent 690c03da4e0119029fd7402bfead149d73599b68 author Jonas Fonseca 1344607073 -0400 committer Jonas Fonseca 1349188857 -0400 [GH #72] Convert output to ASCII//TRANSLIT unless using ncursesw commit 690c03da4e0119029fd7402bfead149d73599b68 2acb3ee55379c18985d55c62a324c65d8eccb34b tree f5eb97c1d72c8ef70cbcba3022ae87ffbddfd075 parent 2acb3ee55379c18985d55c62a324c65d8eccb34b author Jonas Fonseca 1349110191 -0400 committer Jonas Fonseca 1349110191 -0400 Fix status view to show section-level changes in non-lazy navigation mode commit 2acb3ee55379c18985d55c62a324c65d8eccb34b d102df05fb46f243bb2d913a4a4c32643e792f20 tree b14abeccbed225a58c3737463a5253d6c9cfc310 parent d102df05fb46f243bb2d913a4a4c32643e792f20 author Jonas Fonseca 1349098032 -0400 committer Jonas Fonseca 1349098032 -0400 Fix lazy navigation mode to allow opening the parent tree commit d102df05fb46f243bb2d913a4a4c32643e792f20 a2636d72a2c0b5700e13f54f46931d9d2dbb2fab tree f10687df4905447e0b9c755496bd497cbcb7c7f5 parent a2636d72a2c0b5700e13f54f46931d9d2dbb2fab author Jonas Fonseca 1349060095 -0400 committer Jonas Fonseca 1349060112 -0400 Do not show deleted branch when reloading the branch view Reported by Vivien. commit a2636d72a2c0b5700e13f54f46931d9d2dbb2fab 70c1014900d7f0e6ddaa4d8b4c588870f92bf130 tree 29344212075f88b7da875347f63a57d4dc4e263d parent 70c1014900d7f0e6ddaa4d8b4c588870f92bf130 author Jonas Fonseca 1349059634 -0400 committer Jonas Fonseca 1349059634 -0400 Enable lazy navigation mode for the status view commit 70c1014900d7f0e6ddaa4d8b4c588870f92bf130 c0cb28f11a6be7d5bc5f6c440a07ceb6ca17e99f tree 08a3e3ecb04d469516ba3a74ba26cea3923fd926 parent c0cb28f11a6be7d5bc5f6c440a07ceb6ca17e99f author Jonas Fonseca 1349059382 -0400 committer Jonas Fonseca 1349059382 -0400 Refactor stage view title formatting commit c0cb28f11a6be7d5bc5f6c440a07ceb6ca17e99f 7b90e269e2e11d53834c37a66eda68da24b8f6b9 tree 63c189a26ccd1fe9d8990ece2688b8652d0d290d parent 7b90e269e2e11d53834c37a66eda68da24b8f6b9 author Jonas Fonseca 1346338047 -0400 committer Jonas Fonseca 1349054302 -0400 [GH #83] WIP: main view lazy navigation mode prototype commit 7b90e269e2e11d53834c37a66eda68da24b8f6b9 4500f5b36a8071afde10a67b4d7397567a3e6073 tree 55d273f024903a76d76d30701b2923b21d4bf1b1 parent 4500f5b36a8071afde10a67b4d7397567a3e6073 author Jonas Fonseca 1347053292 -0400 committer Jonas Fonseca 1349050986 -0400 Read commit IDs from stdin when opened with --stdin Works for the main and diff view. Examples: $ tig --no-walk --stdin < cherry-picks.txt $ git rev-list --author=vivien HEAD | tig show --stdin Requested by Jean-Baptiste Quenot. commit 4500f5b36a8071afde10a67b4d7397567a3e6073 401d81cf7554859b3499881ed0a9355970ab1728 tree 15de634c5a0770751b43c3a5503013b25be5a651 parent 401d81cf7554859b3499881ed0a9355970ab1728 author Samuel Bronson 1346992881 -0400 committer Jonas Fonseca 1349049454 -0400 Try to automatically re-run configure script when appropriate But, of course, don't try to run it unless we are actually using it! [ jf: Update NEWS ] commit 401d81cf7554859b3499881ed0a9355970ab1728 1be65f315961561f4f786ed961b7a5551bcc8207 tree da300179494629f42c87fd5e550f63329b2c11b5 parent 1be65f315961561f4f786ed961b7a5551bcc8207 author Samuel Bronson 1346982760 -0400 committer Jonas Fonseca 1349047307 -0400 Work around a bug in autoreconf 2.61 commit 1be65f315961561f4f786ed961b7a5551bcc8207 ec5a412068364f63ea795bf273de3587b51abf5a tree 4a813e34ae0d31c57f17a550086445410c59d431 parent ec5a412068364f63ea795bf273de3587b51abf5a author Samuel Bronson 1346981526 -0400 committer Jonas Fonseca 1349047307 -0400 Use the right Emacs mode for config.make.in commit ec5a412068364f63ea795bf273de3587b51abf5a aeb24b36b270e2d82399d297782a00048870025a tree ec3196852cbe9aea3e7fce95af16e93e21c77d3a parent aeb24b36b270e2d82399d297782a00048870025a author Samuel Bronson 1346981412 -0400 committer Jonas Fonseca 1349047279 -0400 Add "show-deps" make target; rearrange existing dependencies to match output The hard-coded dependencies in Makefile were already exactly correct; they just weren't alphabetized as gcc -MM alphabetizes them. commit aeb24b36b270e2d82399d297782a00048870025a 762421e2267ff5e8581a2d8d536f88cc47bee4cc tree 47971b8f04b2652166f784bfa4641c1f22173565 parent 762421e2267ff5e8581a2d8d536f88cc47bee4cc author Samuel Bronson 1346980590 -0400 committer Jonas Fonseca 1349047279 -0400 When using autoconf, *all* of our .o files depend on config.h commit 762421e2267ff5e8581a2d8d536f88cc47bee4cc 2b6e49fe893c5432330fea62fda8b1b491afc2cf tree d9a540d2edbebb0f8968d856e265ef1881059d43 parent 2b6e49fe893c5432330fea62fda8b1b491afc2cf author Samuel Bronson 1346970979 -0400 committer Jonas Fonseca 1349047279 -0400 Tweak Emacs' syntax highlighting of configure.ac commit 2b6e49fe893c5432330fea62fda8b1b491afc2cf c9c4571e414e2d1d67ff828261c6d7d853e7728b tree 3e1ae8de8f7520ce3611fc378ea1099e8cffec0f parent c9c4571e414e2d1d67ff828261c6d7d853e7728b author Samuel Bronson 1346970916 -0400 committer Jonas Fonseca 1349047261 -0400 Make sure that our .m4 file gets included That is, make autoconf abort if it's missing. commit c9c4571e414e2d1d67ff828261c6d7d853e7728b a3079e26a34ee79ed3dce05dcdbe6f0bfdc4cd59 tree 8f125a7684374fbf80d2a9ddfe2a32e9a9ef3bbb parent a3079e26a34ee79ed3dce05dcdbe6f0bfdc4cd59 author Samuel Bronson 1346970767 -0400 committer Jonas Fonseca 1349047258 -0400 Run autoupdate(1) on to get rid of autoconf warnings commit a3079e26a34ee79ed3dce05dcdbe6f0bfdc4cd59 756724aa045742ec89551c826266e0b45490ba00 tree 19081032d2a17559eca2f2a07324bcd871ea417e parent 756724aa045742ec89551c826266e0b45490ba00 author Jonas Fonseca 1346882636 -0400 committer Jonas Fonseca 1346882636 -0400 Replace strndup(3) usage with malloc + strncpy strndup(3) wasn't standardized until POSIX.1-2008, and (more concretely) isn't available in OS X 10.5 Leopard. Reported by Samuel Bronson. commit 756724aa045742ec89551c826266e0b45490ba00 cb5eb1d549e32d0d7b014c96c7d999fab19783ac tree 2122d6d8f4f86f868783274b33f4d719faf37476 parent cb5eb1d549e32d0d7b014c96c7d999fab19783ac author Jonas Fonseca 1346874848 -0400 committer Jonas Fonseca 1346874848 -0400 Handle wrapping of the first line of a view commit cb5eb1d549e32d0d7b014c96c7d999fab19783ac 9e09e0242d968a656583fafc09fb481b6b9c5085 tree f7dc89475732f142cf8f3a3022e251c6ca788398 parent 9e09e0242d968a656583fafc09fb481b6b9c5085 author Jonas Fonseca 1346874304 -0400 committer Jonas Fonseca 1346874304 -0400 Fix invalid memory access bug in pager line wrapping A reference to the first allocated line was cached as the return value. If calls to add_line would force a reallocation of the view line array the cached line reference would become invalid and lead to a segfault. commit 9e09e0242d968a656583fafc09fb481b6b9c5085 f941be37fa446935d5544cad52280276620acc9e tree c5125f4f0b5c4a13572d52b1b78f47dfd3bbdf34 parent f941be37fa446935d5544cad52280276620acc9e author Jonas Fonseca 1345822649 -0400 committer Jonas Fonseca 1345822721 -0400 Properly initialize variable in diff_get_pathname Fixes compiler warning: ‘dst’ may be used uninitialized in this function. commit f941be37fa446935d5544cad52280276620acc9e c1c40ecc314542d6387c74ac2393065fda327f58 tree e7c073d52ee67fb1afe5bcbaa2a90d4657a202cd parent c1c40ecc314542d6387c74ac2393065fda327f58 author Jonas Fonseca 1345423588 -0400 committer Jonas Fonseca 1345822526 -0400 [GH #62] Make the use of encoding arguments optional Reworks changes in commit 6b195c0fd1474961e6f252900e25748794b5c3cf to not force git to reencode output to UTF-8, when i18n.commitencoding or gui.encoding is set. commit c1c40ecc314542d6387c74ac2393065fda327f58 03443da3639edc058239767769cf27993d95f8b7 tree a4747b6e1f1811d530b6b5da4287a5eb23cc33d8 parent 03443da3639edc058239767769cf27993d95f8b7 author Hugo Schmitt 1345814344 -0300 committer Jonas Fonseca 1345822156 -0400 Change diff-context setting to have a minimum value of 0 Currently the minimum value accepted from the config is 1, although in interactive usage (hitting [) the value goes to 0.  Signed-off-by: Jonas Fonseca commit 03443da3639edc058239767769cf27993d95f8b7 98760f2eb3779d5192cb84d3ba168b2e620340e7 tree c4dca0bc3b3c1e3deb3a3fd136cac89bc3dd6936 parent 98760f2eb3779d5192cb84d3ba168b2e620340e7 author Vivien Didelot 1345762214 -0400 committer Jonas Fonseca 1345762804 -0400 diff: get pathname of combined diff headers With combined diffs, the diff header line contains --cc or --combined, instead of a/ or b/ prefixes. This patch allows to get the pathname from combined diff headers as well. Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 98760f2eb3779d5192cb84d3ba168b2e620340e7 e35b50dadc1c29b474715b89eeb1508663710452 tree 1ca48d46aea8bab3152de3ccfc0b2cbc5b98a3f7 parent e35b50dadc1c29b474715b89eeb1508663710452 author Jonas Fonseca 1345725702 -0400 committer Jonas Fonseca 1345725702 -0400 [GH #65] Support binding more advanced external commands commit e35b50dadc1c29b474715b89eeb1508663710452 9df8039cd4154d68599aed6846f11c27d5616765 tree 2762e9b42ba84a6b0c7a19ed158c9f0ef6190a8a parent 9df8039cd4154d68599aed6846f11c27d5616765 author Jonas Fonseca 1345687985 -0400 committer Jonas Fonseca 1345687985 -0400 Correctly report allocation failure in argv_append commit 9df8039cd4154d68599aed6846f11c27d5616765 d10dcd871b62059f6526d2f61700d7e087a9e37d tree 605bc1b1dfd54ddea1584ad67ef18460f2266fa6 parent d10dcd871b62059f6526d2f61700d7e087a9e37d author Jonas Fonseca 1345423399 -0400 committer Jonas Fonseca 1345423399 -0400 tigrc(5): improve documentation of git configuration usage commit d10dcd871b62059f6526d2f61700d7e087a9e37d 7cdab0019beb781ec915038bac8bbc9c207a3e23 tree 3bdb3cc615774ced02c27cae402539ba6af93bb8 parent 7cdab0019beb781ec915038bac8bbc9c207a3e23 author Jonas Fonseca 1345307530 -0400 committer Jonas Fonseca 1345307530 -0400 Do not include merges in the announcement's change log commit 7cdab0019beb781ec915038bac8bbc9c207a3e23 7368b5b3c3163b2dc2f43ec82d843567bdd63ada 54e8c4d21f653c2fb0a13d9ea3b30b63b986b141 tree 7770cfdb72b2fe6008378beb174fd28d99ff61a5 parent 7368b5b3c3163b2dc2f43ec82d843567bdd63ada parent 54e8c4d21f653c2fb0a13d9ea3b30b63b986b141 author Jonas Fonseca 1345307355 -0700 committer Jonas Fonseca 1345307355 -0700 Merge pull request #81 from esc/fix/reading_git_colors_256 fix: reading git colors in rang 0 255 commit 7368b5b3c3163b2dc2f43ec82d843567bdd63ada 82458a4088bfd0f1364611428a580047a83ab932 0431cd20f62e222110168a7c6042ef301bb54ae0 tree 3cdb447b8e159dba9634388d4ad2b0bac791868d parent 82458a4088bfd0f1364611428a580047a83ab932 parent 0431cd20f62e222110168a7c6042ef301bb54ae0 author Jonas Fonseca 1345307257 -0700 committer Jonas Fonseca 1345307257 -0700 Merge pull request #80 from esc/fix/option_name_mismatch fix: the manpage says 'read-git-colors' commit 82458a4088bfd0f1364611428a580047a83ab932 6d276a6084cef6cab17b5752e123b090195186b7 tree 2d855194bde7407abe1970b828685a031964fb7c parent 6d276a6084cef6cab17b5752e123b090195186b7 author Jonas Fonseca 1345304828 -0400 committer Jonas Fonseca 1345304828 -0400 Reenable copy/rename detection in the status view Reverts parts of 6d276a6084cef6cab17b5752e123b090195186b7. commit 0431cd20f62e222110168a7c6042ef301bb54ae0 6d276a6084cef6cab17b5752e123b090195186b7 tree a24594c19a693be781d15a1a1653c2bab4cbbc0f parent 6d276a6084cef6cab17b5752e123b090195186b7 author Valentin Haenel 1345304088 +0200 committer Valentin Haenel 1345304090 +0200 fix: the manpage says 'read-git-colors' The manpage says the option is called 'read-git-colors', but the code looks for 'use-git-colors'. Fix the code to look for what is described in the manpage. commit 54e8c4d21f653c2fb0a13d9ea3b30b63b986b141 6d276a6084cef6cab17b5752e123b090195186b7 tree e1fea239e23555fdc2c9635e7aa6090660656ea1 parent 6d276a6084cef6cab17b5752e123b090195186b7 author Valentin Haenel 1345303610 +0200 committer Valentin Haenel 1345303613 +0200 fix: reading git colors in rang 0 255 In 'tig' a color from the 256 colors range is specified using the string 'colorN' where N is the integer. In 'git' you can used 256 colors too. However instead of 'colorN' they are specified using just N. This needs to be taken into account for using the option 'use-git-colors' which reads options from the git config for use in tig. commit 6d276a6084cef6cab17b5752e123b090195186b7 c5aaa84eeeb4715b2deaf7891f3df8e8112a10f6 tree a5085d8d950b5929e6311445d9cccf673c3f1643 parent c5aaa84eeeb4715b2deaf7891f3df8e8112a10f6 author Jiri Jaburek 1338925936 +0200 committer Jonas Fonseca 1345271686 -0400 Remove enforced diff move/copy detection Signed-off-by: Jiri Jaburek Signed-off-by: Jonas Fonseca commit c5aaa84eeeb4715b2deaf7891f3df8e8112a10f6 f6280b3ec4cc0539d6e0d693987b55074495ef58 tree f3c2ef3587d3e26c7beeada5f249b8bec70a9b40 parent f6280b3ec4cc0539d6e0d693987b55074495ef58 author Jonas Fonseca 1345270901 -0400 committer Jonas Fonseca 1345270901 -0400 Optionally show commit IDs for branches and tree entries commit f6280b3ec4cc0539d6e0d693987b55074495ef58 5e274d3e0cdef78a86259a933b1133ba9c282dcf tree 1bb51644c98d02fd0574f5bd57e085f1bcb71d01 parent 5e274d3e0cdef78a86259a933b1133ba9c282dcf author Valentin Haenel 1345269880 -0400 committer Jonas Fonseca 1345270292 -0400 [GH #77] Add options for displaying commit IDs in the main view 'show-id' will make the commit IDs visible, and 'id-width' configures how many characters to show. The latter is also applied to the blame view. Reviewed-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 5e274d3e0cdef78a86259a933b1133ba9c282dcf 29890a384e0a987edae932fb9667e7c63ca4bb88 tree f6b531a61f0ff432664c9d106f6e7959ca61550f parent 29890a384e0a987edae932fb9667e7c63ca4bb88 author Jonas Fonseca 1345268048 -0400 committer Jonas Fonseca 1345268048 -0400 Sanitize the width argument to draw_field to not include padding This breaks configurations for author-width and filename-width, which will now be one character wider than before. commit 29890a384e0a987edae932fb9667e7c63ca4bb88 88d65e662ac1f10a0543bc1ffbc499438b7a237a tree ea0d041f9e7d0aa70cf28fb15d0f1e7278c516f0 parent 88d65e662ac1f10a0543bc1ffbc499438b7a237a author Jonas Fonseca 1345267621 -0400 committer Jonas Fonseca 1345267621 -0400 Rename all column variables to end with _width commit 88d65e662ac1f10a0543bc1ffbc499438b7a237a c4acadeab0a5e0cdb2d4dab2d0a4c2a13dbc02a3 tree 23d363e67303d9c7f60c8edc46eb5a313acd04d1 parent c4acadeab0a5e0cdb2d4dab2d0a4c2a13dbc02a3 author Victor Foitzik 1345188929 +0200 committer Jonas Fonseca 1345214056 -0400 [GH #78] tig.spec: add man7 directory to RPM package Fixes failure when using the packaged tig.spec for building an RPM package of tig 1.0 due to unpackaged files: RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/man/man7/tigmanual.7.gz Signed-off-by: Jonas Fonseca commit c4acadeab0a5e0cdb2d4dab2d0a4c2a13dbc02a3 de9701cc82e084d1edd4032b280f9e209b3379fa tree 3dbd771062a196ab052a2db56d5d8232c90cd6b9 parent de9701cc82e084d1edd4032b280f9e209b3379fa author Jonas Fonseca 1344996204 -0400 committer Jonas Fonseca 1344996474 -0400 [GH #76] Add option to split views vertically Fixes issue 76. commit de9701cc82e084d1edd4032b280f9e209b3379fa 2630a906575cc3dd413d237a67af734336fe48d6 tree 93f42e72e3c0ffd56729a6cdabd84016c0840aeb parent 2630a906575cc3dd413d237a67af734336fe48d6 author Jonas Fonseca 1344995485 -0400 committer Jonas Fonseca 1344995485 -0400 Move horizontal split calculation to separate function commit 2630a906575cc3dd413d237a67af734336fe48d6 65a1e96ee179c8abced2a24d5a0477ef780e9a4f tree b4b1a0bb6993d5467d13baf318bb0f0046b70129 parent 65a1e96ee179c8abced2a24d5a0477ef780e9a4f author Jonas Fonseca 1336794735 -0400 committer Jonas Fonseca 1344608424 -0400 [GH #25] Allow to build on Mac OS 10.7 without the configure script commit 65a1e96ee179c8abced2a24d5a0477ef780e9a4f e85b985335fbbe8a987ac85539497ee8082ccde4 tree 190c4b10bb5ccabfd9aeda39833d96446567ff74 parent e85b985335fbbe8a987ac85539497ee8082ccde4 author Donald Chai 1342923216 -0700 committer Jonas Fonseca 1344572871 -0400 [GH #70] Fix parent blaming when tig is launched in subdirectory When running "tig blame" from within a subdirectory of a repository, the "B" and "," commands will fail with "No blame exist for...". The problem is that the current directory name gets prepended to the filename if view->prev == NULL, but it should not be in this case. Steps to reproduce: 1) checkout a copy of tig 2) cd contrib 3) run "tig blame tig-completion.bash" 4) press B 5) observe "tig: No blame exist for contrib/contrib/tig-completion.bash" Also fixes another minor bug in an expression. Signed-off-by: Jonas Fonseca commit e85b985335fbbe8a987ac85539497ee8082ccde4 493f07b9de622d94a0c5dd270d9865d1c8c505ff tree d3c5a815ad84bbdf659a22e09d3b7a88036e8f3a parent 493f07b9de622d94a0c5dd270d9865d1c8c505ff author Jonas Fonseca 1344570948 -0400 committer Jonas Fonseca 1344571785 -0400 [GH #66] Allow run requests to exit tig after execution Example: `bind main C ! 1344569325 -0400 committer Jonas Fonseca 1344569381 -0400 [GH #39] Add note for packagers to avoid building ncurses --with-shared Suggested by Roman D. Boiko. commit 755fba35ccfb42aaded82e37019a44d3ca587419 2324d6120c5de58f63b32b876bd33e99d7375dbb tree 10565c2c53e1b9d7c58fbd0736ae28f9ec55adc2 parent 2324d6120c5de58f63b32b876bd33e99d7375dbb author Jonas Fonseca 1344568340 -0400 committer Jonas Fonseca 1344568425 -0400 [DEB-682766] Improve tigrc(5) documentation commit 2324d6120c5de58f63b32b876bd33e99d7375dbb 0ad40a83315a4844e77e2c6feae79bf74128d806 tree 6b2e56caeba0ae9396bd8e0af4f7a551deef5b25 parent 0ad40a83315a4844e77e2c6feae79bf74128d806 author Å tÄ›pán NÄ›mec 1343341810 +0200 committer Jonas Fonseca 1344567699 -0400 Documentation typo and grammar fixes Signed-off-by: Jonas Fonseca commit 0ad40a83315a4844e77e2c6feae79bf74128d806 f26be2b3cd7b57dd61791db08bc4b94fad352b31 tree 39d392801a73985df358d01ccab788454dd6e413 parent f26be2b3cd7b57dd61791db08bc4b94fad352b31 author Jonas Fonseca 1344567014 -0400 committer Jonas Fonseca 1344567129 -0400 Allow people to still build without autotools ... assuming their curses installation is easily found. A big warning is emitted instead of an error encourage the use of autotools or minimal configuration of the curses location as documented in INSTALL. commit f26be2b3cd7b57dd61791db08bc4b94fad352b31 7f9372ab57e9539d7c97049632943943cee70936 tree 0fc46a143b9fee9b0679e71917cb715ca7d3cbab parent 7f9372ab57e9539d7c97049632943943cee70936 author Douglas Livingstone 1344191507 +0100 committer Jonas Fonseca 1344565630 -0400 Update AX_WITH_CURSES to build under Cygwin Serial 13 of AX_WITH_CURSES finds the Cygwin ncursesw package. This was fixed in: http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=61c0c244e11d22ed5dc9a03895771309a515e482 This also updates tig.h to use the headers suggested in the AX_WITH_CURSES documentation. Signed-off-by: Jonas Fonseca commit 7f9372ab57e9539d7c97049632943943cee70936 c01f8bb27893c404beb578feff0b6ca7de59d42d tree 2c44d18e36d8a8fbc19ffd9929e2336c5bbdfe7d parent c01f8bb27893c404beb578feff0b6ca7de59d42d author Vivien Didelot 1341636706 -0400 committer Jonas Fonseca 1344565218 -0400 diff: support editing changed files This allows editing a file corresponding to the displayed changes, if it still exists and is readable (it may have be renamed/deleted). JF: Fixed potential segfault when calling access(). Update NEWS. Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit c01f8bb27893c404beb578feff0b6ca7de59d42d 01630756f6458ee41555373510c7023f16ac306b tree bc92329efebe963d6b8badcbd05a33dd95ef3f8e parent 01630756f6458ee41555373510c7023f16ac306b author Vivien Didelot 1341636421 -0400 committer Jonas Fonseca 1344565212 -0400 diff: fix and improve detection of filename There were a few badly displayed filenames in the diff view: in case of adding a new empty file, deleting, or copying a file, the status line displays: Diff of '(null)' This is because there is no diff for a copy or a new empty file, and because the destination for a deletion is shown as /dev/null. The code used to get the filename corresponding to the displayed changes is extracted in its own function. It now retrieves the filename from the diff header line, which is always present and a more reliable data. This commit also adds the "deleted mode" line type for better coloring. Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 01630756f6458ee41555373510c7023f16ac306b 092517b8aeddd736ec3d8c984a02a0d9c29264c2 tree 4c013c4781d2ab1b1e07234cf1c02b77831f048d parent 092517b8aeddd736ec3d8c984a02a0d9c29264c2 author Ryan Schlesinger 1337814708 -0700 committer Jonas Fonseca 1337829429 -0400 Fixing documentation for maximize keybinding Signed-off-by: Jonas Fonseca commit 092517b8aeddd736ec3d8c984a02a0d9c29264c2 2146882f7479a0319af5952be0c2bdd0d4a79552 tree b09cf05b1dab4f8be3bf15ccb27084db6a44f122 parent 2146882f7479a0319af5952be0c2bdd0d4a79552 author Beat Bolli 1337587602 +0200 committer Jonas Fonseca 1337616311 -0400 Get rid of printf format warnings with size_t arguments I got these with GCC version 4.6.3 on Debian. Signed-off-by: Jonas Fonseca commit 2146882f7479a0319af5952be0c2bdd0d4a79552 3c5296cefa44554512e274bb600f1fafc896f545 tree 7c4f1744abe00cec70eb68247b81991f5575b8c4 parent 3c5296cefa44554512e274bb600f1fafc896f545 author Vivien Didelot 1337281489 -0400 committer Jonas Fonseca 1337402238 -0400 Reload colors when typed in prompt The colors should be reloaded to take effect once tig is running. This patch fixes that. Now commands such as the following work: :color default white black Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit 3c5296cefa44554512e274bb600f1fafc896f545 f252cfa033296f876c7950ec34f7d9a8aedd55a5 tree 79d419cbaf44bf58bf11cbb56d19c5fcaff193f4 parent f252cfa033296f876c7950ec34f7d9a8aedd55a5 author Vivien Didelot 1337272167 -0400 committer Jonas Fonseca 1337402237 -0400 Support tig config options in prompt This is a complement to the previous commit extending the prompt functionalities. Now, tig options (such as in ~/.tigrc) can be typed in the prompt. e.g. : :set ignore-case = yes :source alternate.tig Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit f252cfa033296f876c7950ec34f7d9a8aedd55a5 cc0465f4f321857c1713f83bad9feb1690f86d0e tree 689674fea2b43c119d16125e3b5a69385f7e82b5 parent cc0465f4f321857c1713f83bad9feb1690f86d0e author Vivien Didelot 1337104399 -0400 committer Jonas Fonseca 1337402231 -0400 Extend prompt functionalities This commit reworks one prompt functionality while adding two others: * `:foo` now executes the `foo` tig command; * `:!bar` will run the system command `bar` in an external pager; * `:x` will execute the corresponding key binding. Some now working examples: :q :edit :!git pull origin %(branch) Signed-off-by: Vivien Didelot Signed-off-by: Jonas Fonseca commit cc0465f4f321857c1713f83bad9feb1690f86d0e 590d170213a5ed1c05603262f88b5708eb10598c tree 9909c9f5485e32a59736639c94b23d001b233202 parent 590d170213a5ed1c05603262f88b5708eb10598c author Rich Healey 1337238309 +1000 committer Jonas Fonseca 1337276482 -0400 Remove trailing whitespace Signed-off-by: Jonas Fonseca commit 590d170213a5ed1c05603262f88b5708eb10598c bc9d72407236b7d874e6d5729091d9f500e879b5 tree 286c6363ee3737e81b48f9ae030f5f45d889d9f2 parent bc9d72407236b7d874e6d5729091d9f500e879b5 author Rich Healey 1337238302 +1000 committer Jonas Fonseca 1337276220 -0400 [GH #54] Reorder chdir checks for submodules When in a submodule, you first need to chdir into the git_dir, and then use the value of "core.worktree" as a relative path. In tig, it moves into the git_dir and then checks that cwd is still availble, thus breaking the relative path. Signed-off-by: Jonas Fonseca commit bc9d72407236b7d874e6d5729091d9f500e879b5 2f437e36b44a3708404a7840d2e14a75f0f585c3 tree 8aba47c60ca466bf77f439654172f0111defac63 parent 2f437e36b44a3708404a7840d2e14a75f0f585c3 author Jonas Fonseca 1337131782 -0400 committer Jonas Fonseca 1337131782 -0400 Annotate printf-like methods and fix warnings reported by GCC commit 2f437e36b44a3708404a7840d2e14a75f0f585c3 d0cf0fb4ed270850620bbff2c07e80c2f4a42abf tree 90eb2ff5120f47ef1dd670af19ac4d3713b5c69e parent d0cf0fb4ed270850620bbff2c07e80c2f4a42abf author Jonas Fonseca 1336941824 -0400 committer Jonas Fonseca 1336945802 -0400 [GH #2] Add basic support for wrapping pager-based views commit d0cf0fb4ed270850620bbff2c07e80c2f4a42abf c39ec07e7ce95fa62db9bb089751cb7257d5f716 tree 4fb5582edb3fad84db206f8481a27fac90af9452 parent c39ec07e7ce95fa62db9bb089751cb7257d5f716 author Jonas Fonseca 1336931020 -0400 committer Jonas Fonseca 1336931053 -0400 Only show changes commits for the current branch commit c39ec07e7ce95fa62db9bb089751cb7257d5f716 20b7a5d7c6767a9a2ba8ebca3d4413c72c84cd71 tree 1ce659368aafaa7b8e04852f3215337358cd9b7b parent 20b7a5d7c6767a9a2ba8ebca3d4413c72c84cd71 author Jonas Fonseca 1336930631 -0400 committer Jonas Fonseca 1336930854 -0400 Rework custom line tracking to allow custom lines at any place commit 20b7a5d7c6767a9a2ba8ebca3d4413c72c84cd71 7cabefb82f40b8ab8fb942139c03cca26f5a7db5 tree a2359675d712bd84a2fe67826d6b99f79c91f6b7 parent 7cabefb82f40b8ab8fb942139c03cca26f5a7db5 author Jonas Fonseca 1336928923 -0400 committer Jonas Fonseca 1336930476 -0400 Refactor line allocation to avoid memory leaks commit 7cabefb82f40b8ab8fb942139c03cca26f5a7db5 d003b47f479fe43cc662e21774b062adab61b7da tree 8c2a3a289f2a75fbb31b72fae0c1bad3f3ad79bd parent d003b47f479fe43cc662e21774b062adab61b7da author Jonas Fonseca 1336923275 -0400 committer Jonas Fonseca 1336923646 -0400 Introduce struct to store state during reading of the main view commit d003b47f479fe43cc662e21774b062adab61b7da 65022e7b2f736fcb08ba2c803355f993af90b29f tree 3d6403bf78d41c7c4e1faedac46fc0790a1f217d parent 65022e7b2f736fcb08ba2c803355f993af90b29f author Petr Uzel 1336918541 +0200 committer Jonas Fonseca 1336921831 -0400 Allow case-insensitive searches - implement ignore-case option. Signed-off-by: Petr Uzel Signed-off-by: Jonas Fonseca commit 65022e7b2f736fcb08ba2c803355f993af90b29f 5579a6ff047c0d1b319b5452a8443000921d7da1 tree bdd348bf9bdb54558fe7afc77d8d889ce93e74b1 parent 5579a6ff047c0d1b319b5452a8443000921d7da1 author Petr Uzel 1336918542 +0200 committer Jonas Fonseca 1336921831 -0400 Add files generated by cscope and ctags to .gitignore Signed-off-by: Petr Uzel Signed-off-by: Jonas Fonseca commit 5579a6ff047c0d1b319b5452a8443000921d7da1 0a302b92942613699e322462ad8665e378e22653 tree 9dcce5e0ee9d423b3349eb709888857a179dd6f0 parent 0a302b92942613699e322462ad8665e378e22653 author Jonas Fonseca 1336827094 -0400 committer Jonas Fonseca 1336827473 -0400 [GH #53] Revert 73bee5e which breaks the graph when path spec is specified Thanks to Guillaume Castagnino for reporting and identifying the commit causing the regression. commit 0a302b92942613699e322462ad8665e378e22653 f8451c2900d35e8dd268067c7da32b95fac06869 tree fe269f36eacdc22c8fc4e8a4880be4e8ea034337 parent f8451c2900d35e8dd268067c7da32b95fac06869 author Jonas Fonseca 1336768620 -0400 committer Jonas Fonseca 1336768620 -0400 Fix opening the pager view from the command prompt commit f8451c2900d35e8dd268067c7da32b95fac06869 85babe575bb9b31b962d42e4be8717015ed984d7 tree 9a2eda089e6e79258c6c0c2449f53edb47bc7e2f parent 85babe575bb9b31b962d42e4be8717015ed984d7 author Jonas Fonseca 1336739617 -0400 committer Jonas Fonseca 1336739617 -0400 Show formatted run request argv when prompting Fixes a bug in my refactoring of Vivien's patch. commit 85babe575bb9b31b962d42e4be8717015ed984d7 55929cd0ec4a5d477749d0b1f7b700b13ebad765 tree a6036f436b87cb9ab3fdfaa6c25b003f42d9fc48 parent 55929cd0ec4a5d477749d0b1f7b700b13ebad765 author Vivien Didelot 1336707603 -0400 committer Jonas Fonseca 1336712979 -0400 Add support to confirm the execution of a binding * User-defined commands prefix with a '?' will be prompted for confirmation before being executed. This can be useful for sensible commands such as `git revert`, etc. * By the way, the built-in 'G' binding for `git gc`, and 'C' binding for `git cherry-pick` now need confirmation. Examples of bindings: # Ask before rebasing bind main B !?git rebase -i %(commit) # Ask before cleaning but do not display output bind generic ! !@?git clean -fdx Signed-off-by: Vivien Didelot * Reworked patch to use refactored infrastructure. * Added `git checkout` to the list of built-in bindings needing confirmation. * Updated NEWS. Signed-off-by: Jonas Fonseca commit 55929cd0ec4a5d477749d0b1f7b700b13ebad765 3e338cc89c9394a1dd31581e02ad3138b4c2a8ef tree c566bc10aac8bcc0583c02e3fac32b54c8cdde0f parent 3e338cc89c9394a1dd31581e02ad3138b4c2a8ef author Jonas Fonseca 1336711724 -0400 committer Jonas Fonseca 1336711735 -0400 Change run request to use flags for passing silent and force options commit 3e338cc89c9394a1dd31581e02ad3138b4c2a8ef 23d7b5c2cf075584c8d29ad2c96fbc6b571d9d48 tree c0eb4d245c6580d96e0c36c98a904aad80608b8c parent 23d7b5c2cf075584c8d29ad2c96fbc6b571d9d48 author Jonas Fonseca 1336710179 -0400 committer Jonas Fonseca 1336710179 -0400 Introduce argv_to_string function in the IO library commit 23d7b5c2cf075584c8d29ad2c96fbc6b571d9d48 0e6304fc11a1d592b1a4382a16c4b3907df70431 tree b8306a71fba51696792cd9bd57681de62f922f8a parent 0e6304fc11a1d592b1a4382a16c4b3907df70431 author Jonas Fonseca 1336709094 -0400 committer Jonas Fonseca 1336709094 -0400 Simplify add_pager_refs interface to expect the commit ID commit 0e6304fc11a1d592b1a4382a16c4b3907df70431 5beeb74c980206cb5172f569340f9312bc9bf02d tree 709110285e319bd6e5fd619226151b56c6631dfd parent 5beeb74c980206cb5172f569340f9312bc9bf02d author Jonas Fonseca 1336709009 -0400 committer Jonas Fonseca 1336709056 -0400 Use const char pointers for common pager and diff read functions commit 5beeb74c980206cb5172f569340f9312bc9bf02d 2844b9cfe8650704c006a72af060e376d3fc4f5a tree b03f11bcced0ff84e0e4deb7409ba36331177d4b parent 2844b9cfe8650704c006a72af060e376d3fc4f5a author Jonas Fonseca 1336656277 -0400 committer Jonas Fonseca 1336656277 -0400 Add script to prepare documentation for http://jonas.nitro.dk/tig commit 185614f0f60fc686b2ab143308cba145cc5c74fb ee3c931835321808aec7af517046ae8a7c519876 tree 0fbc5552d4b7ece682f75df69c9ec511943f23a0 parent ee3c931835321808aec7af517046ae8a7c519876 author Jonas Fonseca 1336655143 -0400 committer Jonas Fonseca 1336655143 -0400 Update for version tig-1.0 commit ee3c931835321808aec7af517046ae8a7c519876 0aa82d416404c8f827c879ca055d088631694075 2844b9cfe8650704c006a72af060e376d3fc4f5a tree 9ba8253992a2bbc5eb77ea5b2e485c4f8d14035b parent 0aa82d416404c8f827c879ca055d088631694075 parent 2844b9cfe8650704c006a72af060e376d3fc4f5a author Jonas Fonseca 1336655123 -0400 committer Jonas Fonseca 1336655123 -0400 Merge branch 'master' into release commit 2844b9cfe8650704c006a72af060e376d3fc4f5a 4bfaaa2bc10912d91aef9a1db2a838eeb3f88de6 tree 13dd744b1e1975f3178b43c561b0356c6a3cb2a4 parent 4bfaaa2bc10912d91aef9a1db2a838eeb3f88de6 author Jonas Fonseca 1336655107 -0400 committer Jonas Fonseca 1336655107 -0400 tig-1.0 commit 0aa82d416404c8f827c879ca055d088631694075 cd1059e895bca6e2f87690ed26509dfb4c3bcecb tree dfd371e9e1b67c812cd34b6ce540b2952d6bf465 parent cd1059e895bca6e2f87690ed26509dfb4c3bcecb author Jonas Fonseca 1336654594 -0400 committer Jonas Fonseca 1336654594 -0400 Update for version tig-0.18-138-g4bfaaa2 commit cd1059e895bca6e2f87690ed26509dfb4c3bcecb 7dcb22b080ee42335faf825701c88356447ed790 4bfaaa2bc10912d91aef9a1db2a838eeb3f88de6 tree 2ca561ec9540f435b34d61277b445803c5008a81 parent 7dcb22b080ee42335faf825701c88356447ed790 parent 4bfaaa2bc10912d91aef9a1db2a838eeb3f88de6 author Jonas Fonseca 1336654572 -0400 committer Jonas Fonseca 1336654572 -0400 Merge branch 'master' into release commit 4bfaaa2bc10912d91aef9a1db2a838eeb3f88de6 66a168d5aeb6add3aec14700c79090a553ea25dc tree 7dc4bd6575cbac7d57bc3062cf4389eb7753225f parent 66a168d5aeb6add3aec14700c79090a553ea25dc author Jonas Fonseca 1336653779 -0400 committer Jonas Fonseca 1336654470 -0400 Rework the VERSION mangling in the make dist rule commit 66a168d5aeb6add3aec14700c79090a553ea25dc 5a938dab139853f8e296fdfc02ad2f1403f2224b tree 2c74b088ca76945ae1a0555e8c0f9924df6159fc parent 5a938dab139853f8e296fdfc02ad2f1403f2224b author Jonas Fonseca 1336617775 -0400 committer Jonas Fonseca 1336617775 -0400 [GH #49] Increase the author auto-abbreviation threshold to 10 commit 5a938dab139853f8e296fdfc02ad2f1403f2224b 67993dd0c50b72f9a182ab6d5623d0bac0d166bd tree a0b3b71fc88e4562ac0e062631684f981defe78b parent 67993dd0c50b72f9a182ab6d5623d0bac0d166bd author Jonas Fonseca 1336616669 -0400 committer Jonas Fonseca 1336616669 -0400 [GH #50] Make relative dates show number of years ago for old commits The previous behavior was to fall back and show the timestamp. commit 67993dd0c50b72f9a182ab6d5623d0bac0d166bd 3422d8211cfb2e002f9801ac285cd06fbf1ff169 tree 08da7ba39c86c02eacbf42015ccaefb9da3f7da2 parent 3422d8211cfb2e002f9801ac285cd06fbf1ff169 author Jonas Fonseca 1336615019 -0400 committer Jonas Fonseca 1336615019 -0400 Update the index before showing staged/unstaged changes in the main view commit 3422d8211cfb2e002f9801ac285cd06fbf1ff169 9d5433e0fa942c4790271eed93f9ed44a115fab0 tree 92f52f7f84aa5866eba7b8fa44417a6dd4753425 parent 9d5433e0fa942c4790271eed93f9ed44a115fab0 author Jonas Fonseca 1336614973 -0400 committer Jonas Fonseca 1336614973 -0400 Do not count the first line and parent accessor lines in the tree view commit 9d5433e0fa942c4790271eed93f9ed44a115fab0 b21b13c291563f5354f839efbd5c9df76b4e289d tree 5d6b735d107cd306fe93a44a62c6d826dc768514 parent b21b13c291563f5354f839efbd5c9df76b4e289d author Jonas Fonseca 1336476211 -0400 committer Jonas Fonseca 1336476211 -0400 Do not count the All branches line in the branch view commit b21b13c291563f5354f839efbd5c9df76b4e289d 529136490ccb5a9a6925480361ad661176f8001d tree 190ef9322d689450783332c9c958e624edfc5e10 parent 529136490ccb5a9a6925480361ad661176f8001d author Jonas Fonseca 1336476093 -0400 committer Jonas Fonseca 1336476093 -0400 Do not count the unstaged/staged commit lines in the main view commit 529136490ccb5a9a6925480361ad661176f8001d 73bee5e48a534ff8ab76346992188f0a229837f9 tree f611383b94c739e6d3aa2f74bad7e28e029543e7 parent 73bee5e48a534ff8ab76346992188f0a229837f9 author Jonas Fonseca 1336171071 -0400 committer Jonas Fonseca 1336171071 -0400 Fix diff stat for files where the path separator is not shown commit 73bee5e48a534ff8ab76346992188f0a229837f9 da0b192645e4075f66503f632edd882eb50c29b6 tree 6c1358ccc4a6263572c22879ea5f66093952bb14 parent da0b192645e4075f66503f632edd882eb50c29b6 author Jonas Fonseca 1336076394 -0400 committer Jonas Fonseca 1336076899 -0400 Use git log format to simplify commit title parsing Also unifies the git-log(1) command arguments used by the main and branch views. commit da0b192645e4075f66503f632edd882eb50c29b6 32e979800c8fde9e7b7980d53a383121af6c14e3 tree ad96f90a25be0f12ebc9f80d38661e1ff2dffed1 parent 32e979800c8fde9e7b7980d53a383121af6c14e3 author Jonas Fonseca 1336076797 -0400 committer Jonas Fonseca 1336076899 -0400 Show the file name of the current position in the diff status commit 32e979800c8fde9e7b7980d53a383121af6c14e3 9fd859c338d8a22e823e1bf21733bb093174e7f7 tree 0fb09a7030814e494bc0cb8a0d1ce14490506c97 parent 9fd859c338d8a22e823e1bf21733bb093174e7f7 author Jonas Fonseca 1336051746 -0400 committer Jonas Fonseca 1336051746 -0400 Show the title of the last commit in the branch view commit 9fd859c338d8a22e823e1bf21733bb093174e7f7 3741b846584898902aedba40d77c5d7a71990717 tree 2ef03de58c1c149a1475d6cfb9b5c58025b69ccc parent 3741b846584898902aedba40d77c5d7a71990717 author Jonas Fonseca 1335875179 -0400 committer Jonas Fonseca 1335875179 -0400 Fix regression to not handle non-symbolic-ref during rebase action commit 3741b846584898902aedba40d77c5d7a71990717 c3a9da991c1501f09df061a0859de0e1d5e518a1 tree c4e4df17afca5e73e0f6a444d105d9a02f88a9ea parent c3a9da991c1501f09df061a0859de0e1d5e518a1 author Jonas Fonseca 1335757596 -0400 committer Jonas Fonseca 1335757596 -0400 Enable diff stat navigation for the staged changes views commit c3a9da991c1501f09df061a0859de0e1d5e518a1 6827bf08919ffcfc325bcc1bad4edbccf9cc9b6f tree 3f15ff6b4f29a95ce5313b0f92560248096aac9c parent 6827bf08919ffcfc325bcc1bad4edbccf9cc9b6f author Jonas Fonseca 1335755270 -0400 committer Jonas Fonseca 1335756718 -0400 Fix jumping when the diff stat contains a file with no changes commit 6827bf08919ffcfc325bcc1bad4edbccf9cc9b6f 4530ec31c4efb4970fea6f6b51b5febabfa1c4b5 tree 41271b3b4f0e7be8337087b0ddc470ab6e0e84e9 parent 4530ec31c4efb4970fea6f6b51b5febabfa1c4b5 author Jonas Fonseca 1335752807 -0400 committer Jonas Fonseca 1335755488 -0400 Add macro to check if a view line is in range commit 4530ec31c4efb4970fea6f6b51b5febabfa1c4b5 3da8d3b2d0954699a72bf45de67263fdebdf273a tree 9a3ee4c051871189a4b6670e31e34aca27cdbd90 parent 3da8d3b2d0954699a72bf45de67263fdebdf273a author Jonas Fonseca 1335746480 -0400 committer Jonas Fonseca 1335749874 -0400 Do not show empty trees for staged and unstaged commit entries commit 3da8d3b2d0954699a72bf45de67263fdebdf273a 2362e0b60a43a475e82a16c2e04b75f75c53166a tree e7266dba0493b0fc8ae99534d495bac675c44194 parent 2362e0b60a43a475e82a16c2e04b75f75c53166a author Jonas Fonseca 1335733329 -0400 committer Jonas Fonseca 1335749874 -0400 Update copyright notices to include 2012 commit 2362e0b60a43a475e82a16c2e04b75f75c53166a 0a0f618899a3af66b85ff2a5d8f36116f2f08365 tree 5b2243ee2da98c3ed65a52c0b9759d6bb8294ae1 parent 0a0f618899a3af66b85ff2a5d8f36116f2f08365 author Jonas Fonseca 1335729527 -0400 committer Jonas Fonseca 1335749874 -0400 Define manpage:[] AsciiDoc macro to fix manpage links commit 0a0f618899a3af66b85ff2a5d8f36116f2f08365 e6cf79e96956d155db020a5c2cb10ddbd84ca307 tree 714c65a7670748beb752ba7d3f3777e104a403e7 parent e6cf79e96956d155db020a5c2cb10ddbd84ca307 author Jonas Fonseca 1335726644 -0400 committer Jonas Fonseca 1335749874 -0400 Move fall-back version string to Makefile commit e6cf79e96956d155db020a5c2cb10ddbd84ca307 be7fbb4ad2dcb45f2cb7955998e12852f24fec96 tree 782a68271e1cb92876f05780feeaf844638c6f76 parent be7fbb4ad2dcb45f2cb7955998e12852f24fec96 author Jonas Fonseca 1335725685 -0400 committer Jonas Fonseca 1335725685 -0400 Move TODO items to the github issue tracker Dropped bug regarding proper locale support due to recent changes in commit handling. commit be7fbb4ad2dcb45f2cb7955998e12852f24fec96 5bfbc6b96440e185cad11d4d910dce2a60a9d453 tree 54c2fbafb4c6dec7245eed3c10bb574f7fae780a parent 5bfbc6b96440e185cad11d4d910dce2a60a9d453 author Jonas Fonseca 1335724421 -0400 committer Jonas Fonseca 1335724421 -0400 Fix diff stat navigation for unmodified renamed files Reported-by: Vivien Didelot commit 5bfbc6b96440e185cad11d4d910dce2a60a9d453 e108e281260480f8cafbf762669f07921d630ed7 088d7d16488dc9163ca86d640e6e81f90bc6360b tree f1d25f11c8adcaaeaae0d153d6ae610ebd9d51c0 parent e108e281260480f8cafbf762669f07921d630ed7 parent 088d7d16488dc9163ca86d640e6e81f90bc6360b author Jonas Fonseca 1335363604 -0700 committer Jonas Fonseca 1335363604 -0700 Merge pull request #43 from Oblomov/master Minor patches to clear some Clang warnings commit 088d7d16488dc9163ca86d640e6e81f90bc6360b 5464bbea4a197c8d7e9bda02be4df4403bf3903e tree f1d25f11c8adcaaeaae0d153d6ae610ebd9d51c0 parent 5464bbea4a197c8d7e9bda02be4df4403bf3903e author Giuseppe Bilotta 1335335971 +0200 committer Giuseppe Bilotta 1335336301 +0200 prompt_menu: protect against programming error If prompt_menu is passed an empty menu list, you can get negative values for selected in the KEY_{LEFT,UP} case, and a modulo by zero in the KEY_{RIGHT,DOWN} cases. This currently can't happen, because the only user of prompt_menu is toggle_option that does fill up the menu. However, let's future-proof the call: since an empty menu would indicate a programming error, assert that size must be positive. Signed-off-by: Giuseppe Bilotta commit 5464bbea4a197c8d7e9bda02be4df4403bf3903e bed4eee68cfbaa2b14abec8e67555cabbb678b45 tree 20035a1a70c54b8eb8fbbb54e2da516a86404919 parent bed4eee68cfbaa2b14abec8e67555cabbb678b45 author Giuseppe Bilotta 1335335775 +0200 committer Giuseppe Bilotta 1335335848 +0200 Suppress clang warning Initialization of pos is never used. Signed-off-by: Giuseppe Bilotta commit bed4eee68cfbaa2b14abec8e67555cabbb678b45 e108e281260480f8cafbf762669f07921d630ed7 tree 8587025c450e1319d50269f2d54a66cc44dd526e parent e108e281260480f8cafbf762669f07921d630ed7 author Giuseppe Bilotta 1335334601 +0200 committer Giuseppe Bilotta 1335335842 +0200 read_ref: use string_ncopy_do directly A minor optimization: we already know the length of the id, so we can skip the counting loop done by string_copy_rev. As a side-effect, this also clears the warning about idlen being unused. Signed-off-by: Giuseppe Bilotta commit e108e281260480f8cafbf762669f07921d630ed7 3525ca9d30357820e0c0949e627fdc7bbad3aa62 tree 2f4557fb186e3aa27b3d1cef8cd06b86f3b8e907 parent 3525ca9d30357820e0c0949e627fdc7bbad3aa62 author Jonas Fonseca 1335327657 -0400 committer Jonas Fonseca 1335327657 -0400 Fix compile warnings for an unused variable and return values commit 3525ca9d30357820e0c0949e627fdc7bbad3aa62 cffbf3307f33e43143e4764da56438330e042cfa tree afc76999c22e1f0c48d20b03c4bb5c358f2c9b78 parent cffbf3307f33e43143e4764da56438330e042cfa author Giuseppe Bilotta 1335190358 +0200 committer Jonas Fonseca 1335321100 -0400 [GH #41] Clear newly allocated memory in allocators Fixes malloc assertion when using command-line options. [ Refactor to use variables ] Signed-off-by: Jonas Fonseca commit cffbf3307f33e43143e4764da56438330e042cfa c92dd55837a5e1113258dbf161279a12788c66cd tree c3d308cab2c850f0b72866006c06b611996310c2 parent c92dd55837a5e1113258dbf161279a12788c66cd author Jonas Fonseca 1335319143 -0400 committer Jonas Fonseca 1335319143 -0400 Fix status view position restoration regression from recent refactorings commit c92dd55837a5e1113258dbf161279a12788c66cd ea2d76772d7d795451154322c5b13b5e4b5c4314 tree f6b7d457ec589b330258a6800cf376ca8776837e parent ea2d76772d7d795451154322c5b13b5e4b5c4314 author Jonas Fonseca 1335151174 -0400 committer Jonas Fonseca 1335185303 -0400 Move error logic to the respective view open handlers commit ea2d76772d7d795451154322c5b13b5e4b5c4314 ac2467ef94510aa357b4fbb780148dd0d6170872 tree c54a32a32a78edcc71737fa9eecbaf8f6f2dcec6 parent ac2467ef94510aa357b4fbb780148dd0d6170872 author Jonas Fonseca 1335150959 -0400 committer Jonas Fonseca 1335185303 -0400 Refactor view loading to allow open methods to abort commit ac2467ef94510aa357b4fbb780148dd0d6170872 38f24bf6fb0ecfe2c6898f287164de32dccef841 tree 8725fd3689e1e4d40662a955ad3f6fb05b81c6a7 parent 38f24bf6fb0ecfe2c6898f287164de32dccef841 author Jonas Fonseca 1335134449 -0400 committer Jonas Fonseca 1335185303 -0400 Move open view error reporting down into the view handlers commit 38f24bf6fb0ecfe2c6898f287164de32dccef841 b57f99552a5e5f8f13a5aefed7aca07cc688f472 tree ff1a663128221cb92896ed60f49ad106489454eb parent b57f99552a5e5f8f13a5aefed7aca07cc688f472 author Jonas Fonseca 1335134088 -0400 committer Jonas Fonseca 1335185303 -0400 Simplify code in status_open commit b57f99552a5e5f8f13a5aefed7aca07cc688f472 1196ce1536247ee535b9bd7b8483dbb76cf1a55d tree e9b1042f8424f24ab8b441ba8e4eeedc2391a728 parent 1196ce1536247ee535b9bd7b8483dbb76cf1a55d author Jonas Fonseca 1335131420 -0400 committer Jonas Fonseca 1335185303 -0400 Move split_view and maximize_view to the open view section commit 1196ce1536247ee535b9bd7b8483dbb76cf1a55d 89d4a31b4d36a2a94c77d4a6bcb186f0fcf0f9fb tree 2fe07f3a24c763b737632aa2fe94bc32ee335bb6 parent 89d4a31b4d36a2a94c77d4a6bcb186f0fcf0f9fb author Jonas Fonseca 1334506340 -0400 committer Jonas Fonseca 1335185303 -0400 Move refs code to separate file commit 89d4a31b4d36a2a94c77d4a6bcb186f0fcf0f9fb bc14b03c280cbb4fb51a23197ad510311a77dc70 tree d3c2d47306a843e4b7d4bc0994b738e7107225af parent bc14b03c280cbb4fb51a23197ad510311a77dc70 author Jonas Fonseca 1333812341 -0400 committer Jonas Fonseca 1335185303 -0400 Move keymap to view ops and change to use a struct commit bc14b03c280cbb4fb51a23197ad510311a77dc70 7cc034bf5320d105383c192fad766e11791a38ac tree 6f943ea8c9d5b1d7214c4add4f5c0ccb8edba891 parent 7cc034bf5320d105383c192fad766e11791a38ac author Jonas Fonseca 1322949533 -0500 committer Jonas Fonseca 1335185303 -0400 Rework the help view to not use line->other commit 7cc034bf5320d105383c192fad766e11791a38ac 174bf51e10589672aec92beb6f137207545f7965 tree 045a10a84606aa83bcecc960b83f598abed68e41 parent 174bf51e10589672aec92beb6f137207545f7965 author Jonas Fonseca 1322714400 -0500 committer Jonas Fonseca 1335185303 -0400 Refactor setup of built-in run requests commit 174bf51e10589672aec92beb6f137207545f7965 3e58bb6e82ea39d8f7d4bf3221ff6b8ef53008c7 tree d2d37fc6f9c2a9c0e8ae5aac4c8ea512045ff435 parent 3e58bb6e82ea39d8f7d4bf3221ff6b8ef53008c7 author Jonas Fonseca 1335150892 -0400 committer Jonas Fonseca 1335185303 -0400 Minor improvement of status view restoration commit 3e58bb6e82ea39d8f7d4bf3221ff6b8ef53008c7 07635e29d75f442910126fc7a3c2973ff007e3d2 tree 8eb12b9fce33ca3d23ad0887321032152e4b81f8 parent 07635e29d75f442910126fc7a3c2973ff007e3d2 author Jonas Fonseca 1324226780 -0500 committer Jonas Fonseca 1335184147 -0400 Store all restore information in view.prev_pos commit 07635e29d75f442910126fc7a3c2973ff007e3d2 7ce27a4cf2e17a7b4ae21af7552c455c32bf3f82 tree a2260f2d9afe2208162c65f4f1535b3b048061d5 parent 7ce27a4cf2e17a7b4ae21af7552c455c32bf3f82 author Jonas Fonseca 1323089859 -0500 committer Jonas Fonseca 1335184147 -0400 Move navigation state to struct position commit 7ce27a4cf2e17a7b4ae21af7552c455c32bf3f82 17dfd4d819aedd186d21c501a96fd58a5616a31f tree 2126a42f81dc1bd7f7fdaec82bed4f0a3b1eb9dc parent 17dfd4d819aedd186d21c501a96fd58a5616a31f author Jonas Fonseca 1335184000 -0400 committer Jonas Fonseca 1335184000 -0400 Fix refs reloading by not assuming that they are alphabetically sorted The references are sorted for display and thus the binary search used for finding existing references caused every reference to be duplicated. commit 17dfd4d819aedd186d21c501a96fd58a5616a31f fd5ae5f4afe4bd4e7375773b9e5d2990a4cddfe5 tree a2a25d43c5a21c813f7e1935e726ec177ea729c2 parent fd5ae5f4afe4bd4e7375773b9e5d2990a4cddfe5 author Jonas Fonseca 1334892888 -0400 committer Jonas Fonseca 1334892888 -0400 Add small tracing utility for monitoring executed commands commit fd5ae5f4afe4bd4e7375773b9e5d2990a4cddfe5 cc7006ee40b368719b0edad4102467a7bbeb51c9 tree b4515a0f8758b7cd9448f0c44bc9c0de5868c505 parent cc7006ee40b368719b0edad4102467a7bbeb51c9 author Jonas Fonseca 1334837711 -0400 committer Jonas Fonseca 1334837711 -0400 Force load the branch view log data Fixes an issue where the view would not be reset and the content would of the branch view would duplicated, since the view loading depends on begin_update to reset the view. commit cc7006ee40b368719b0edad4102467a7bbeb51c9 336d13d5e2dc8979b90bdc0390fc15438a54945f tree 453163ee38c59faf85bad7341a587df9fb5dbb22 parent 336d13d5e2dc8979b90bdc0390fc15438a54945f author Jonas Fonseca 1334807853 -0400 committer Jonas Fonseca 1334807853 -0400 Fix default commit order to be that of git-log(1) commit 336d13d5e2dc8979b90bdc0390fc15438a54945f 6b0eb6508e46dfb0c1c8c0882aa8974ea6dee55d tree 334d773e76c41fd82f63ba5412ae78e9875c9e43 parent 6b0eb6508e46dfb0c1c8c0882aa8974ea6dee55d author Jonas Fonseca 1334807598 -0400 committer Jonas Fonseca 1334807598 -0400 Switch to use git-log(s) default commit ordering This cuts the startup time considerably for large projects (e.g. the linux kernel). The order is toggleable and can also be set in ~/.tigrc. commit 6b0eb6508e46dfb0c1c8c0882aa8974ea6dee55d fd07d6eab6ab4ac67b46e50cbc6f4c8352cdb394 tree 6e944aff1182d044456d5dbb77a5a50bbd7e3dc5 parent fd07d6eab6ab4ac67b46e50cbc6f4c8352cdb394 author Jonas Fonseca 1334733531 -0400 committer Jonas Fonseca 1334733531 -0400 [GH #23] Add %(prompt) variable commit fd07d6eab6ab4ac67b46e50cbc6f4c8352cdb394 b3542024a739bb055a78ea43de26d5eebccbcc8b tree c8cfd9290c228feebbfd20958c974f6ddb8f2139 parent b3542024a739bb055a78ea43de26d5eebccbcc8b author Jonas Fonseca 1334731344 -0400 committer Jonas Fonseca 1334731787 -0400 [GH #30] Enable notes by default Switch to use --show-notes instead of --notes to support git versions prior to 1.7.6. The meaning is slightly different wrt. when a reference is configured with the show-notes setting, but backwards compatibility wins. commit b3542024a739bb055a78ea43de26d5eebccbcc8b 5e615149ec75737592f0c49be16a9432d315f11c tree 59c3a24c935dd324a34fd78ffbb7224db8ceb1b2 parent 5e615149ec75737592f0c49be16a9432d315f11c author Jonas Fonseca 1334727588 -0400 committer Jonas Fonseca 1334727684 -0400 [GH #38] Do not pass navigation requests to the branch view when the main view is maximized commit 5e615149ec75737592f0c49be16a9432d315f11c 1798b8728c163a02fe982199a478018163d25d44 tree 9b17ce360536b18f03c9db870e9d716a48ee1e75 parent 1798b8728c163a02fe982199a478018163d25d44 author Jonas Fonseca 1334506267 -0400 committer Jonas Fonseca 1334514008 -0400 Fix build dependencies commit 1798b8728c163a02fe982199a478018163d25d44 b1db8a6bac652bac6b0e33052a79279f532eaf1d tree 5cce5f4459c24c3f2d323257557e47a675b060b7 parent b1db8a6bac652bac6b0e33052a79279f532eaf1d author Jonas Fonseca 1334509457 -0400 committer Jonas Fonseca 1334513873 -0400 Limit the number of allocated color pairs It had grown to 72 and ncurses reports the COLOR_PAIRS max number as 64. commit b1db8a6bac652bac6b0e33052a79279f532eaf1d e5ca95fdc3f5fcd1af7c05874f06e83a0eeb3595 tree 677a0ffb14d647bfc149fcbcfa5dbdd4608dbf93 parent e5ca95fdc3f5fcd1af7c05874f06e83a0eeb3595 author Romain Francoise 1334165292 +0200 committer Jonas Fonseca 1334168025 -0400 Parse commit title correctly in presence of mergetag object When merging a signed tag, recent versions of Git store the original tag in the merge commit as a "mergetag object". This additional content can confuse tig's parsing of the commit title for the main view if the tag description contains a line which happens to start with four spaces. (Recent examples of such commits in linux.git: 94fb175c04, 9479f0f801, 1ddca05743.) Git helpfully separates with a blank line the commit header (which contains the mergetag object) from the description itself, so keep track of which lines belong to the header and only look for the title in the description. Signed-off-by: Romain Francoise Signed-off-by: Jonas Fonseca commit e5ca95fdc3f5fcd1af7c05874f06e83a0eeb3595 c758ad04a266612f04bcd3712c27a53af7e4fdb6 tree 56a6f0b683ffc641e8fb7ddaf5ce4d014104306a parent c758ad04a266612f04bcd3712c27a53af7e4fdb6 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 [GH #8] Read git's color settings commit c758ad04a266612f04bcd3712c27a53af7e4fdb6 999e3b555764c3d76f4e06e947655db52978cd08 tree dec3e92426c0569e3b108f9e4f6550e9b9694633 parent 999e3b555764c3d76f4e06e947655db52978cd08 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Show uncommitted changes in the main view as virtual staged and unstaged commits Requested by Antje Miederhöfer. Inspired by gitk. commit 999e3b555764c3d76f4e06e947655db52978cd08 abdcbddc3a055637e2f16d0a266d11300ce18f92 tree 79a0e58379a54c3ef38d5c55c94984191b50a44d parent abdcbddc3a055637e2f16d0a266d11300ce18f92 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Refactor main_add_commit from main_read commit abdcbddc3a055637e2f16d0a266d11300ce18f92 27346be239405d4420ef542e87d3c6e51e85f215 tree 8b67b7f21017ff01e9e0ac09603c2094ced832ff parent 27346be239405d4420ef542e87d3c6e51e85f215 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Add status staged and unstaged commands to git.h commit 27346be239405d4420ef542e87d3c6e51e85f215 be63cd81414e94b54ad9c5bddc2f70e1d6ef3289 tree 050ddfa6717944db57b5f4b2adacd1c20da25ea2 parent be63cd81414e94b54ad9c5bddc2f70e1d6ef3289 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Add blame diff commands to git.h commit be63cd81414e94b54ad9c5bddc2f70e1d6ef3289 de5e7b3f95427072aca5208ad1d185fd3410e242 tree 46ef3bc0669e88dc9b81f833e60e6e8aada1001c parent de5e7b3f95427072aca5208ad1d185fd3410e242 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Move git diff command argv arrays to git.h commit de5e7b3f95427072aca5208ad1d185fd3410e242 277d9138f5234c76e1325d988b8fb7e19b4921f9 tree c41a7d609f108df21a5175b44925ece5eb261ab6 parent 277d9138f5234c76e1325d988b8fb7e19b4921f9 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Allow the command status to be accessed after io_done commit 277d9138f5234c76e1325d988b8fb7e19b4921f9 6bd47560eb0b3ac7d633b463e2a61f6ef8e6cd38 tree 4dc5c5512457285fb42e98d6c63e1ac315531ab6 parent 6bd47560eb0b3ac7d633b463e2a61f6ef8e6cd38 author Jonas Fonseca 1334077308 -0400 committer Jonas Fonseca 1334077308 -0400 Fix diff command for staged files before initial commit commit 6bd47560eb0b3ac7d633b463e2a61f6ef8e6cd38 aeba14a0812018a1cfccf3b7f15431fb6bfca760 tree 5b852abb775f3e1f769d3284754dcc4e8ca352fa parent aeba14a0812018a1cfccf3b7f15431fb6bfca760 author Jonas Fonseca 1333857551 -0400 committer Jonas Fonseca 1333857620 -0400 Only show the external group title once in the help view commit aeba14a0812018a1cfccf3b7f15431fb6bfca760 c8cfcd1bbf1c1a993c003e1caf7accc1eba6e5f8 tree 70d95a23b15a6aac5604d3de4df4eb584ccae6cb parent c8cfcd1bbf1c1a993c003e1caf7accc1eba6e5f8 author Jonas Fonseca 1333110906 -0400 committer Jonas Fonseca 1333110986 -0400 User-defined commands prefixed with '@' are run with no console output commit c8cfcd1bbf1c1a993c003e1caf7accc1eba6e5f8 b6724d4a3fffd87923cde332db590de93ee6bbf0 tree 173723e13bf9fa3225eafabede3ee796f914f79b parent b6724d4a3fffd87923cde332db590de93ee6bbf0 author Robert Clausecker 1332236995 +0100 committer Jonas Fonseca 1332247150 -0400 Fix mistake in tigrc: line-graphic expects utf8, not utf-8 Signed-off-by: Jonas Fonseca commit b6724d4a3fffd87923cde332db590de93ee6bbf0 bf17412da03b2442453eafe6bb6dcf1f3bb008b9 44dd7132baa4d0bfc4341da3756dda5161ed7a48 tree e7e871f6773a60eb45152a30494869bc54a6af18 parent bf17412da03b2442453eafe6bb6dcf1f3bb008b9 parent 44dd7132baa4d0bfc4341da3756dda5161ed7a48 author Jonas Fonseca 1331238681 -0800 committer Jonas Fonseca 1331238681 -0800 Merge pull request #37 from v0n/abbrev_commit_hash string_copy_rev: chop rev on first space (if any) commit 44dd7132baa4d0bfc4341da3756dda5161ed7a48 bf17412da03b2442453eafe6bb6dcf1f3bb008b9 tree e7e871f6773a60eb45152a30494869bc54a6af18 parent bf17412da03b2442453eafe6bb6dcf1f3bb008b9 author Vivien Didelot 1331224006 -0500 committer Vivien Didelot 1331228073 -0500 string_copy_rev: chop rev on first space (if any) This allows tig to work with abbreviated commit hashes like: git log --format="commit %h %s" | tig commit bf17412da03b2442453eafe6bb6dcf1f3bb008b9 ea4fb57aab0700924a61db7870f41af77dd1db26 aa539eafbc2c1a18b41f9aca284410e4b3a7a70d tree c3de5fd006d3814ac96b97d0c739fedf9c87d1f1 parent ea4fb57aab0700924a61db7870f41af77dd1db26 parent aa539eafbc2c1a18b41f9aca284410e4b3a7a70d author Jonas Fonseca 1330807763 -0800 committer Jonas Fonseca 1330807763 -0800 Merge pull request #36 from tsibley/reload-diff-view-on-toggle Bug fix: reload diff view when toggling ignore space commit aa539eafbc2c1a18b41f9aca284410e4b3a7a70d 5e5e326fbaf2974989c36b320925d870a562cbe5 tree c3de5fd006d3814ac96b97d0c739fedf9c87d1f1 parent 5e5e326fbaf2974989c36b320925d870a562cbe5 author Thomas Sibley 1330791653 -0500 committer Thomas Sibley 1330791653 -0500 Reload the view on a diff-like option change view->argv needs to be updated for the diff view, so refreshing with the same argv isn't enough. Refactoring in dbb3663c introduced the bug. Toggling whitespace still worked for the stage view since stage_open calls argv_copy before begin_update; diff_open instead relies on begin_update calling format_argv when appropriate. commit 5e5e326fbaf2974989c36b320925d870a562cbe5 ea4fb57aab0700924a61db7870f41af77dd1db26 tree 61f6b193df583858ef1ee054b1eca18724a3a3c4 parent ea4fb57aab0700924a61db7870f41af77dd1db26 author Thomas Sibley 1330791583 -0500 committer Thomas Sibley 1330791592 -0500 Doc typo commit ea4fb57aab0700924a61db7870f41af77dd1db26 dbb3663c47b59fcca040fbac14fd6e20b734232d 4942e28ff99618dcfa972f732b9db0ace80ffb5a tree bb1a244354bcbaf9ddb9756840030f83da991502 parent dbb3663c47b59fcca040fbac14fd6e20b734232d parent 4942e28ff99618dcfa972f732b9db0ace80ffb5a author Jonas Fonseca 1329757878 -0800 committer Jonas Fonseca 1329757878 -0800 Merge pull request #34 from tsibley/combined-diff-coloring [GH #32] Only color +/- in the second column when in a combined diff commit 4942e28ff99618dcfa972f732b9db0ace80ffb5a dbb3663c47b59fcca040fbac14fd6e20b734232d tree bb1a244354bcbaf9ddb9756840030f83da991502 parent dbb3663c47b59fcca040fbac14fd6e20b734232d author Thomas Sibley 1329613935 -0500 committer Thomas Sibley 1329614667 -0500 [GH #32] Only color +/- in the second column when in a combined diff If the diff type is not combined, force the mistakenly identified lines to the default line type. Combined diffs are used by git when showing changes on a merge commit. Refer to the section COMBINED DIFF FORMAT in man git-diff. This resolves [GH #32] for the diff and stage views. The general pager view still exhibits the issue when used like so `git show -p | tig`, but this seems to be a less common use case that needs additional state to fix. commit dbb3663c47b59fcca040fbac14fd6e20b734232d 59f7fc4edc278c7be0f1d9f902ee0df10a3ad9c5 tree ed53533bf9eb2f3f3a419020c78046cf6a5881be parent 59f7fc4edc278c7be0f1d9f902ee0df10a3ad9c5 author Jonas Fonseca 1328480378 -0500 committer Jonas Fonseca 1328487715 -0500 Only reload the view after changing diff options for diff-like views ... as originally intended. commit 59f7fc4edc278c7be0f1d9f902ee0df10a3ad9c5 197a0be83cb21fe93d4be80db4f3daaafddaa1b1 tree 61b0301120cc88f84b950dcab0efb88365721652 parent 197a0be83cb21fe93d4be80db4f3daaafddaa1b1 author Jonas Fonseca 1328481088 -0500 committer Jonas Fonseca 1328483833 -0500 Document how to submit bugs commit 197a0be83cb21fe93d4be80db4f3daaafddaa1b1 1d8d5cde197db98edcd42ba11e6ce13493ddb8c6 tree 2bab0fc8dea37d2089d658fa0e60d4b73ef902c0 parent 1d8d5cde197db98edcd42ba11e6ce13493ddb8c6 author Jonas Fonseca 1327129292 -0500 committer Jonas Fonseca 1328480574 -0500 Move checking for line number display to draw_lineno commit 1d8d5cde197db98edcd42ba11e6ce13493ddb8c6 6b195c0fd1474961e6f252900e25748794b5c3cf tree 49cbdee99aeeb17d8bff1ca1dec89472780c38e9 parent 6b195c0fd1474961e6f252900e25748794b5c3cf author Jonathan Neuschäfer 1327061450 +0100 committer Jonas Fonseca 1327127149 -0500 tigrc.5.txt: fix a typo ("changes are ignore") Signed-off-by: Jonas Fonseca commit 6b195c0fd1474961e6f252900e25748794b5c3cf 933c4447babf5aac6bde3ae596af0d42b7dbf225 tree 1d8ca5aec5a8c8f924de71f263a2bcab5876addf parent 933c4447babf5aac6bde3ae596af0d42b7dbf225 author Jonas Fonseca 1326346289 -0500 committer Jonas Fonseca 1327127092 -0500 Offload commit encoding entirely to git Commits can be encoding with different character sets, which means that relying on a repository wide setting is wrong. To fix this pass --encoding=UTF-8 to all git commands, which use the revision machinery. This will override the user's i18n.logOutputEncoding option and ensure that the output provided by git is encoding as UTF-8. The --encoding option has been available in git for a couple of years--since 2006 for the log and diff related tools and since 2008 for git-blame--so they should not pose any problems. This patch is based on work by Heiko Schlichting. Signed-off-by: Jonas Fonseca commit 933c4447babf5aac6bde3ae596af0d42b7dbf225 d793c09f4c8fc466c234cadb171f5e59ab52a038 tree 574599982a9d108e71f54f474fd00e3ed89e8bf1 parent d793c09f4c8fc466c234cadb171f5e59ab52a038 author Jonas Fonseca 1326945834 -0500 committer Jonas Fonseca 1327126892 -0500 Add support for using path encoding from git attributes commit d793c09f4c8fc466c234cadb171f5e59ab52a038 ae649b7763a0f6fc88aeea84a18406994f2095b9 tree a77f2bc42117b98494fd6afe359fdf79e387ae1c parent ae649b7763a0f6fc88aeea84a18406994f2095b9 author Jonas Fonseca 1327126481 -0500 committer Jonas Fonseca 1327126892 -0500 Extract encoding conversion to encoding_convert commit ae649b7763a0f6fc88aeea84a18406994f2095b9 61ee4e8de65f60fcfc82bf91a40ec179d77e1e52 tree 964bbca9bd3395d0d888ee63a9d3b8a8c3f7ed9d parent 61ee4e8de65f60fcfc82bf91a40ec179d77e1e52 author Jonas Fonseca 1327122762 -0500 committer Jonas Fonseca 1327126788 -0500 Add interface for managing encodings commit 61ee4e8de65f60fcfc82bf91a40ec179d77e1e52 c2c8be3c25b864c8f43d15aed23dde1c9041f6c5 tree a32360dbe04a3dea40b88b6516ef3d19c39b65bf parent c2c8be3c25b864c8f43d15aed23dde1c9041f6c5 author Jonas Fonseca 1327125416 -0500 committer Jonas Fonseca 1327126771 -0500 Refactor parsing of encoding options commit c2c8be3c25b864c8f43d15aed23dde1c9041f6c5 f58588b877cc4a4d09f0469fd8767495eaf6f681 tree 469e57535ce5507d383fa6e5558a8e99f6b03d8b parent f58588b877cc4a4d09f0469fd8767495eaf6f681 author Jonas Fonseca 1327026823 -0500 committer Jonas Fonseca 1327027052 -0500 Enable toggling of all diff ignore space options commit f58588b877cc4a4d09f0469fd8767495eaf6f681 c1929f7f9c14715133acfd33aaf66b1b47bdb0aa tree 759fa88ced424c0febadf59572a7e68828ff0d8c parent c1929f7f9c14715133acfd33aaf66b1b47bdb0aa author Jonas Fonseca 1326768139 -0500 committer Jonas Fonseca 1326769896 -0500 Allow space to be ignored in the stage view and blame diffs commit c1929f7f9c14715133acfd33aaf66b1b47bdb0aa 2dd172efe8c491fef2492c2b7773c1823dca8bb8 tree 47044e2fad18789be75336345697b3858dce16c4 parent 2dd172efe8c491fef2492c2b7773c1823dca8bb8 author Jonas Fonseca 1326767871 -0500 committer Jonas Fonseca 1326769825 -0500 Use toggle_option infrastructure to change the ignore space option commit 2dd172efe8c491fef2492c2b7773c1823dca8bb8 029f2a7bc616594aea4c089249087e2783b3e86e tree 4d15fb2de3797f894adfcdb32912cadd62c5d208 parent 029f2a7bc616594aea4c089249087e2783b3e86e author Thomas Sibley 1326507994 -0500 committer Jonas Fonseca 1326766412 -0500 Toggle to ignore all whitespace changes in diffs; bound to W This is equivalent to passing "-w" or "--ignore-all-space" to `git diff` or `git show`. Signed-off-by: Jonas Fonseca commit 029f2a7bc616594aea4c089249087e2783b3e86e d22ce5859e4a2bb498dc4bfaa0a71bdbc384e14b tree a19d0e92dbb6915ccba22121fd00b7cd2c1adee7 parent d22ce5859e4a2bb498dc4bfaa0a71bdbc384e14b author Jonas Fonseca 1326682169 -0500 committer Jonas Fonseca 1326682607 -0500 Add completion for the different .git/*_HEAD files ... as done by git's bash completion. commit d22ce5859e4a2bb498dc4bfaa0a71bdbc384e14b f199752e6ca23ae75bb1dd55c804fa00b5f78c6f tree 5b33d9c23f366724a4b023f146de08a594169dbc parent f199752e6ca23ae75bb1dd55c804fa00b5f78c6f author Jonas Fonseca 1326578324 -0500 committer Jonas Fonseca 1326578381 -0500 [GH #29] Change references section title to 'see also' Apparently it has a special meaning in that it creates a bibliography style section whereby generated docbook no longer validated. commit f199752e6ca23ae75bb1dd55c804fa00b5f78c6f e3cda794b4026ab3f89b5a3d01eff3415e70f91b tree eac223cc44eec05e9a68f59dfa8c2886b3133259 parent e3cda794b4026ab3f89b5a3d01eff3415e70f91b author Jonas Fonseca 1322711573 -0500 committer Jonas Fonseca 1326495055 -0500 Minor simplification in add_keybinding commit e3cda794b4026ab3f89b5a3d01eff3415e70f91b 5dfcac3f8b0dcf80eb58ad0d28f590895e69c653 tree 0317b5f73b7782b9acaed31bbefda1085d5fe990 parent 5dfcac3f8b0dcf80eb58ad0d28f590895e69c653 author Jonas Fonseca 1322711494 -0500 committer Jonas Fonseca 1326495055 -0500 Rename get_key to get_view_key commit 5dfcac3f8b0dcf80eb58ad0d28f590895e69c653 21c8ee070f6ea7c61b9e73ba148a2afc7b2fa2e7 tree b67a61b08df99da3c2e3fb6d405c46cb67e01f54 parent 21c8ee070f6ea7c61b9e73ba148a2afc7b2fa2e7 author Jonas Fonseca 1322319902 -0500 committer Jonas Fonseca 1326495055 -0500 Simplify view request declaration commit 21c8ee070f6ea7c61b9e73ba148a2afc7b2fa2e7 3a8e724fee1e55e4e57dd724821a9eb45b16e630 tree 502897726ac5485436417bec674d389ddf0b04fc parent 3a8e724fee1e55e4e57dd724821a9eb45b16e630 author Jonas Fonseca 1322319755 -0500 committer Jonas Fonseca 1326495055 -0500 Simplify view_ops pre-declaration commit 3a8e724fee1e55e4e57dd724821a9eb45b16e630 f2838ef12c17705abc22fc6b640c5e42a782bbd8 tree d557b8b5799dc53d117db7a1beef7e181e273f85 parent f2838ef12c17705abc22fc6b640c5e42a782bbd8 author Jonas Fonseca 1322319722 -0500 committer Jonas Fonseca 1326495055 -0500 Simplify view declaration commit f2838ef12c17705abc22fc6b640c5e42a782bbd8 1bbcd2838a20f04d36ee6ac7481c2d5c7ee934e4 tree 848d1d5d596b00526eee28e798be27210b756c27 parent 1bbcd2838a20f04d36ee6ac7481c2d5c7ee934e4 author Jonas Fonseca 1322715312 -0500 committer Jonas Fonseca 1326495055 -0500 Add draw_formatted commit 1bbcd2838a20f04d36ee6ac7481c2d5c7ee934e4 72617eef9aa4ae49524b56bb0653f2fbadd99327 tree f082b24571bac04c6e5e6fc0912db27b858d7c13 parent 72617eef9aa4ae49524b56bb0653f2fbadd99327 author Jonas Fonseca 1325956653 -0500 committer Jonas Fonseca 1326494964 -0500 Change git_dir boolean to become a view flag commit 72617eef9aa4ae49524b56bb0653f2fbadd99327 849ecff65c70f405b79d02a0a47baa2ee9f71d6f tree 67caf45aa4cdf6367df58a5d86f74ec0c5b0b6d2 parent 849ecff65c70f405b79d02a0a47baa2ee9f71d6f author Jonas Fonseca 1322319742 -0500 committer Jonas Fonseca 1326494963 -0500 Replace view type enum with a view flag enum commit 849ecff65c70f405b79d02a0a47baa2ee9f71d6f ea687a7ccfde1ae3554a8b414ec167c5ca3ff81c tree 08a9444e804ed207ae5f5501fa60e1c410b32019 parent ea687a7ccfde1ae3554a8b414ec167c5ca3ff81c author Jonas Fonseca 1323087301 -0500 committer Jonas Fonseca 1326494963 -0500 Add source command for loading separate config file from ~/.tigrc commit ea687a7ccfde1ae3554a8b414ec167c5ca3ff81c 23d42138c61931d870a5f549d0b5e999ecd66bd4 tree e9d2d374d646755dd1acea85ccb02315863b549f parent 23d42138c61931d870a5f549d0b5e999ecd66bd4 author Jonas Fonseca 1326400766 -0500 committer Jonas Fonseca 1326494963 -0500 [GH #21] Bind single line staging to '1' by default Ctrl-u was conflicting with page up. Suggested by Heiko. commit 23d42138c61931d870a5f549d0b5e999ecd66bd4 c7a55c133383ba74ccaabca81e3038a5130cd261 tree 11ec52b280be1a53b6ddb7b34244f1e4c981120f parent c7a55c133383ba74ccaabca81e3038a5130cd261 author Jonas Fonseca 1326494839 -0500 committer Jonas Fonseca 1326494963 -0500 Move truncation logic to FORMAT_BUFFER commit a2e1ea648153797f4185d6a95a7b56530ba83f90 tree 72fff06c6818c7dc465fc416a519f64190fe5498 author Jonas Fonseca 1326422791 -0800 committer Jonas Fonseca 1326423202 -0500 Created gh-pages branch via GitHub commit c7a55c133383ba74ccaabca81e3038a5130cd261 4002f49cd983d544e5a0e4473cf95942a8680886 tree 5c6da9628b0ee5515b20606f98c8ad7965819642 parent 4002f49cd983d544e5a0e4473cf95942a8680886 author Jonas Fonseca 1326422272 -0500 committer Jonas Fonseca 1326422299 -0500 manual: Fix the references section title commit 4002f49cd983d544e5a0e4473cf95942a8680886 1251dcf09337628d3e6111710270adda5195857f tree 0a39a578bcc5cf2f444028655e5cb34715d0b85c parent 1251dcf09337628d3e6111710270adda5195857f author Jonas Fonseca 1326201453 -0500 committer Jonas Fonseca 1326201453 -0500 Do not allow single line staging for new files (untracked or added) commit 1251dcf09337628d3e6111710270adda5195857f 8402e25b6e9b55e15a9f82cdab42de4d3cd7aadd tree ab343719590cb7807f1cfc705381a5b39b15d1fe parent 8402e25b6e9b55e15a9f82cdab42de4d3cd7aadd author Heiko Schlichting 1326198604 -0500 committer Jonas Fonseca 1326198698 -0500 Fix setup of the iconv input filter [ jf: patch extracted from email exchange ] Signed-off-by: Jonas Fonseca commit 8402e25b6e9b55e15a9f82cdab42de4d3cd7aadd 1304d8616672bb2dc44f0ac2b381cdaf8c8da7aa tree 77bd22432434d6ad55f8b281876b9f7260e10e36 parent 1304d8616672bb2dc44f0ac2b381cdaf8c8da7aa author Heiko Schlichting 1326039202 +0100 committer Jonas Fonseca 1326161426 -0500 Do not read configuration from stdin Ignore TIGRC_USER and TIGRC_SYSTEM if set to "" (empty string) instead reading configuration from standard input. Signed-off-by: Jonas Fonseca commit 1304d8616672bb2dc44f0ac2b381cdaf8c8da7aa 4ea1f10f682714013548594316b7ba16ae7e67ea tree deb7988443667e32aafeaa388f4f095714736570 parent 4ea1f10f682714013548594316b7ba16ae7e67ea author Heiko Schlichting 1326035150 +0100 committer Jonas Fonseca 1326161426 -0500 Correct typos in documentation * line numbering: default is every fifth line not every line * line numbering: enabled by "." not "n" * line numbering: there is no command line option "-n" * status-untracked-dirs: added missing right parenthesis Signed-off-by: Jonas Fonseca commit 4ea1f10f682714013548594316b7ba16ae7e67ea 6026fea31968f4e04c897ecb98a38366c238a09b tree 6c4f251c7b19d965cfc1887f0ce190b71b2fdca3 parent 6026fea31968f4e04c897ecb98a38366c238a09b author Heiko Schlichting 1325102093 +0100 committer Jonas Fonseca 1326161426 -0500 "make clean" should remove $(TESTS) targets Signed-off-by: Jonas Fonseca commit 6026fea31968f4e04c897ecb98a38366c238a09b 0b00b4de2bbb672d154dccef4a2b82e5d62fb93e tree 9acdc86cc8598d2b30ac79c1869c33db11d64936 parent 0b00b4de2bbb672d154dccef4a2b82e5d62fb93e author Heiko Schlichting 1311182776 +0200 committer Jonas Fonseca 1326161426 -0500 Ensure \0 terminated input for iconv() Signed-off-by: Jonas Fonseca commit 0b00b4de2bbb672d154dccef4a2b82e5d62fb93e 6084fcd13b730641d3738b0e634dfa2ec7d8669d tree 683127916f781c5cc7601c5ec72cc85008e0bc6c parent 6084fcd13b730641d3738b0e634dfa2ec7d8669d author Heiko Schlichting 1311186529 +0200 committer Jonas Fonseca 1326161425 -0500 Add "//TRANSLIT" for iconv encoding [ jf: changed to use stack allocated buffer ] Signed-off-by: Jonas Fonseca commit 6084fcd13b730641d3738b0e634dfa2ec7d8669d 8f765d36f87be5447670196aeefa5162ea3888fb tree 1cbe643e1eb7077d1242e77dc3ce0f3edb60b8f7 parent 8f765d36f87be5447670196aeefa5162ea3888fb author Jonas Fonseca 1326160081 -0500 committer Jonas Fonseca 1326161347 -0500 Introduce define for the UTF-8 encoding string commit 8f765d36f87be5447670196aeefa5162ea3888fb 34dc446686d786ae2144a34cc72807b7b8691064 tree 87c65eca7fce2354032ab012a07a4bcd2889c119 parent 34dc446686d786ae2144a34cc72807b7b8691064 author Jonas Fonseca 1326087700 -0500 committer Jonas Fonseca 1326087914 -0500 [GH #21] Fix single line updating to support unstaging Use git-apply(1)s --unidiff-zero option to simplify how changes are expressed. commit 34dc446686d786ae2144a34cc72807b7b8691064 f82498a53edd8e9262162c59b91cb9b5195fa40a tree b217fe465f22597d13c7086aa1cd4c95caa5f3c2 parent f82498a53edd8e9262162c59b91cb9b5195fa40a author Jonas Fonseca 1326065327 -0500 committer Jonas Fonseca 1326085929 -0500 [GH #21] Support staging of single lines Unstaging single lines from the index is not supported. commit f82498a53edd8e9262162c59b91cb9b5195fa40a f701a9c75c4a80671dafb83ce9a192fdca921391 tree bf49e6ac0c5d592bf7a9f1eb2580d239cce6e922 parent f701a9c75c4a80671dafb83ce9a192fdca921391 author Jonas Fonseca 1326004745 -0500 committer Jonas Fonseca 1326085920 -0500 Refactor diff chunk header parsing commit f701a9c75c4a80671dafb83ce9a192fdca921391 42485771bc80cd06d83fadd71af15055ad0e261a tree a1f59bfe29e793da3aaedf86668d005f21dccead parent 42485771bc80cd06d83fadd71af15055ad0e261a author Jonas Fonseca 1326067255 -0500 committer Jonas Fonseca 1326085885 -0500 Introduce io_printf function commit 42485771bc80cd06d83fadd71af15055ad0e261a a3d72d41d2fa2ded0763b59a2621191a74f9d2fe tree 77157c143e4979726f249f01b8499c3c3cf50497 parent a3d72d41d2fa2ded0763b59a2621191a74f9d2fe author Jonas Fonseca 1326066971 -0500 committer Jonas Fonseca 1326067755 -0500 Introduce macro for wrapping calls to vsnprintf commit a3d72d41d2fa2ded0763b59a2621191a74f9d2fe 320d8ebf696fd542c984d6d9e230a34dc06e225b tree f792d09ecd35e2979f4b9ea2057e1bb4cbfc9e87 parent 320d8ebf696fd542c984d6d9e230a34dc06e225b author Jonas Fonseca 1322509377 -0500 committer Jonas Fonseca 1325956161 -0500 [GH #22] Add + improvement to NEWS commit 320d8ebf696fd542c984d6d9e230a34dc06e225b 32bcee026998f8308a70d8563bf5e316b58995c5 tree 2b529be757a0f8ccf4fdfcccf296236c6e7327c6 parent 32bcee026998f8308a70d8563bf5e316b58995c5 author Jonathan Neuschäfer 1325028898 +0100 committer Jonas Fonseca 1325260696 -0500 tig.c: compare_refs: fix comparing by ref->ltag Signed-off-by: Jonas Fonseca commit 32bcee026998f8308a70d8563bf5e316b58995c5 e98ff9a9b52c71bb0688cfb97d06fbf7e7bfea4e tree 6a87f9a307dd9359c402fcaafd107692de740b3d parent e98ff9a9b52c71bb0688cfb97d06fbf7e7bfea4e author Jonas Fonseca 1325003923 -0500 committer Jonas Fonseca 1325004665 -0500 Make git://github.com/jonas/tig.git repo the master http://jonas.nitro.dk/tig/tig.git is no longer updated. commit e98ff9a9b52c71bb0688cfb97d06fbf7e7bfea4e d43c04c8992dbbb437cef6c3baac97c03e2bcfdc tree e646b1ae2ac65fa4c492629c7356237907590b85 parent d43c04c8992dbbb437cef6c3baac97c03e2bcfdc author zomfg 1323078261 +0100 committer Jonas Fonseca 1323135275 -0500 fixed compile issue: NCURSES_OPAQUE on OSX 10.6.8 commit d43c04c8992dbbb437cef6c3baac97c03e2bcfdc ce5c25c0fdfe1c4e1273f529ed81484db9b754ae tree d48c69feb7e9fc989cb4e62d03022bf93fb52e6a parent ce5c25c0fdfe1c4e1273f529ed81484db9b754ae author zomfg 1323075238 +0100 committer Jonas Fonseca 1323135272 -0500 fixed isnumber error (OSX 10.6.8) In file included from tig.c:14: ./tig.h:138:1: error: conflicting types for 'isnumber' isnumber(const char *str) ^ /usr/include/ctype.h:340:1: note: previous definition is here isnumber(int _c) commit ce5c25c0fdfe1c4e1273f529ed81484db9b754ae 22a09efc73acbf873e78c0706fc872bebb1e7c4e 2974424623ad111bd068950b81921b8ae257676e tree 5d4d48a885f7b3073d8a2e64240976c1777eedf7 parent 22a09efc73acbf873e78c0706fc872bebb1e7c4e parent 2974424623ad111bd068950b81921b8ae257676e author Jonas Fonseca 1322509107 -0800 committer Jonas Fonseca 1322509107 -0800 Merge pull request #22 from tsibley/open-at-line-number Support opening the initial view at an arbitrary line number commit 2974424623ad111bd068950b81921b8ae257676e 9267d2ab5bcfc3cd505ee631b903108433f0a9ff tree 5d4d48a885f7b3073d8a2e64240976c1777eedf7 parent 9267d2ab5bcfc3cd505ee631b903108433f0a9ff author Thomas Sibley 1322453254 -0500 committer Thomas Sibley 1322453666 -0500 Support opening the initial view at an arbitrary line number Specified on the command line as +. commit 9267d2ab5bcfc3cd505ee631b903108433f0a9ff 9c3a0a22055623dbf8182cc41cce94e5b1f87d4d tree 229a6782216c8740edb8f393b7c87a78e42b1ac8 parent 9c3a0a22055623dbf8182cc41cce94e5b1f87d4d author Thomas Sibley 1322452087 -0500 committer Thomas Sibley 1322453666 -0500 Unify the parsing of blame options and other view options This refactor lays the groundwork for further cross-view options. commit 9c3a0a22055623dbf8182cc41cce94e5b1f87d4d 22a09efc73acbf873e78c0706fc872bebb1e7c4e tree 60fce33d83aee59a0c3dcd56360adf8c539eac8d parent 22a09efc73acbf873e78c0706fc872bebb1e7c4e author Thomas Sibley 1322443924 -0500 committer Thomas Sibley 1322453665 -0500 Simplify parse_options by offloading more to filter_options filter_options hands off to git rev-parse, which handles filenames after a dashdash -- and already interprets --all as a rev. Still track whether we've seen a -- for the sake of stopping our own option parsing. commit 22a09efc73acbf873e78c0706fc872bebb1e7c4e 61841e1e807c4b8f688b6717faa13b7bf27b98bd tree f1f0efe667e1e29d43e1fb536de122a6326cd7d8 parent 61841e1e807c4b8f688b6717faa13b7bf27b98bd author Jonas Fonseca 1322094797 -0500 committer Jonas Fonseca 1322190399 -0500 [GH #19] Show filename column when blaming with copy detection enabled commit 61841e1e807c4b8f688b6717faa13b7bf27b98bd 4d80e9ae05c6361ba314c10ab5a436d57bcf4ca0 tree f7f0569d0b698ecaa61b3f62264b5760d890805a parent 4d80e9ae05c6361ba314c10ab5a436d57bcf4ca0 author Jonas Fonseca 1321969364 -0500 committer Jonas Fonseca 1321969364 -0500 Move stage chunk to private data commit 4d80e9ae05c6361ba314c10ab5a436d57bcf4ca0 eabf426f25e1c5752259fa97fbf079e38465b66e tree 9e45693ebe976a8c14dfa2af07560049bf9de2c6 parent eabf426f25e1c5752259fa97fbf079e38465b66e author Jonas Fonseca 1321969112 -0500 committer Jonas Fonseca 1321969112 -0500 Introduce private view data and use it for all reading state commit eabf426f25e1c5752259fa97fbf079e38465b66e 4023fe714395dc3fbf575d3ffc7622aaabaa622e tree 485461a86a52ea5eec067af0cc6d1ec39b7b87b8 parent 4023fe714395dc3fbf575d3ffc7622aaabaa622e author Jonas Fonseca 1321928164 -0500 committer Jonas Fonseca 1321928269 -0500 [GH #15] Fix diff-header colorization by ensuring color IDs are >= 1 commit 4023fe714395dc3fbf575d3ffc7622aaabaa622e 3bed4fa1a776a2ec286377e01a7f6f67091fd8de tree fe4669b10044d4b8dde765a28fa33ad93ff63241 parent 3bed4fa1a776a2ec286377e01a7f6f67091fd8de author Jonas Fonseca 1321926927 -0500 committer Jonas Fonseca 1321926927 -0500 Fix off-by-one error introduced in off-by-one error fix See b7bbb274f532d2cce6ce3c444230d0d22ec15968. commit 3bed4fa1a776a2ec286377e01a7f6f67091fd8de 842a463579cca7a82585c50604f685f4593eae1e tree ad23ffdb5fd259f6f869073f02a7c180616fe10f parent 842a463579cca7a82585c50604f685f4593eae1e author Jonas Fonseca 1321883115 -0500 committer Jonas Fonseca 1321883263 -0500 [GH #12] Support multi-arg editor strings For example, the following editor string will do the right thing: [core] editor = /usr/bin/vim -c ':normal gg' commit 842a463579cca7a82585c50604f685f4593eae1e 511006ce8f78c1824f7c932da80d8543d43d6954 tree bdd09987b1555c42a350da8846ae4a618a74283a parent 511006ce8f78c1824f7c932da80d8543d43d6954 author Jonas Fonseca 1321855637 -0500 committer Jonas Fonseca 1321855837 -0500 [GH #16] Support custom colorization of lines matching a string prefix This allows users to define custom color rules in their ~/.tigrc. commit 511006ce8f78c1824f7c932da80d8543d43d6954 87c27d4b39273da87712535ec8a3b4c74e62ff01 tree f56abe9e07ce2fbfe1c8dbaea071e998849a5bb3 parent 87c27d4b39273da87712535ec8a3b4c74e62ff01 author Jonas Fonseca 1321838820 -0500 committer Jonas Fonseca 1321839631 -0500 [GH #17] Properly color binary diffstat lines Reported-by: Michael Sullivan commit 87c27d4b39273da87712535ec8a3b4c74e62ff01 551bb79691d1bc7e67149c06aef437574da06aeb tree b4670ce51ac674cb64f80f6532fb32c2fdcf428d parent 551bb79691d1bc7e67149c06aef437574da06aeb author Jonas Fonseca 1321832410 -0500 committer Jonas Fonseca 1321832410 -0500 Show branches/refs which names are a substring of the current branch commit 551bb79691d1bc7e67149c06aef437574da06aeb b7bbb274f532d2cce6ce3c444230d0d22ec15968 tree e5cd6f0b76c25239522da9fc21ea9ff542a0766e parent b7bbb274f532d2cce6ce3c444230d0d22ec15968 author Jonas Fonseca 1321831365 -0500 committer Jonas Fonseca 1321831365 -0500 Update NEWS commit b7bbb274f532d2cce6ce3c444230d0d22ec15968 1663d66a25ee1672d554e3080284444cc8e5a2de tree 74ee1616ddc562a6e71bb6eb600a90796c677e39 parent 1663d66a25ee1672d554e3080284444cc8e5a2de author Jonas Fonseca 1321830582 -0500 committer Jonas Fonseca 1321831261 -0500 Fix off-by-one error in the diff stat jump feature commit 1663d66a25ee1672d554e3080284444cc8e5a2de 05a24989a8606ea004aa624c6965236658f4c975 tree edce74b331925fe48e175bb8711f6d8f61011aee parent 05a24989a8606ea004aa624c6965236658f4c975 author P. Sadik 1318486605 +0530 committer Jonas Fonseca 1321728051 -0500 Create and use dup() of STDIN_FILENO instead of STDIN_FILENO itself Otheriwse, issues can pop up, since we close io->pipe in io_done(); and in Pager mode io->pipe = STDIN_FILENO. Signed-off-by: Jonas Fonseca commit 05a24989a8606ea004aa624c6965236658f4c975 615741ca8a21699f157d94ee251f3507d788fcbd tree d29525874602d79910c50d1e0160c7067200f362 parent 615741ca8a21699f157d94ee251f3507d788fcbd author Pierre Habouzit 1316780907 +0200 committer Jonas Fonseca 1321726582 -0500 Add show-notes tigrc option This allow to have control to the --notes= option passed to git show in log view in log view Signed-off-by: Pierre Habouzit Signed-off-by: Jonas Fonseca commit 615741ca8a21699f157d94ee251f3507d788fcbd c01a4abab2380d80fdfbf16b6c5105805e3dd80b tree cbb00cdacff0da08450700112a29e3a6fb18e0a7 parent c01a4abab2380d80fdfbf16b6c5105805e3dd80b author Jonas Fonseca 1321726073 -0500 committer Jonas Fonseca 1321726195 -0500 Support jumping to commit in the branch view commit c01a4abab2380d80fdfbf16b6c5105805e3dd80b 7a5651eb0573d337d7233354c9d47fa6c4f2e371 tree a6aa16b54c0baec758c52b4bd45570fa4d5e21b6 parent 7a5651eb0573d337d7233354c9d47fa6c4f2e371 author Jonas Fonseca 1321725033 -0500 committer Jonas Fonseca 1321726194 -0500 Add internal JUMP_COMMIT request and view specific logic to main_request commit 7a5651eb0573d337d7233354c9d47fa6c4f2e371 9e79c66a6920f009222ba3fcbf74743fb2f64781 tree 4f3ba11cf533ea9a9b6c64fc4543f978810acfdc parent 9e79c66a6920f009222ba3fcbf74743fb2f64781 author Thomas Sibley 1321418735 -0500 committer Jonas Fonseca 1321726183 -0500 Find TOC sections based on 4 tildes or hyphens This ensures we don't miss sections with short titles like "Misc" (under "Default Keybindings"). Signed-off-by: Jonas Fonseca commit 9e79c66a6920f009222ba3fcbf74743fb2f64781 b674f3fafc2918128671cfb4946e42f936cd439c tree 0b8217abb10516a377f2a560fab5c016ca1d7042 parent b674f3fafc2918128671cfb4946e42f936cd439c author Thomas Sibley 1321417175 -0500 committer Jonas Fonseca 1321726173 -0500 Support jumping to specific SHAs in the main view This functions much like jumping to view lines, but expects a 7 to 40 character commit SHA. It is very useful when you want to jump to a specific commit and see surrounding context. [ jf: minor refactoring ] Signed-off-by: Jonas Fonseca commit b674f3fafc2918128671cfb4946e42f936cd439c d59840e3272e039d3aca33d74caa8de8c58b32e1 tree 55d64868f33a63b91f4a56903e8dfd77b5ca7eba parent d59840e3272e039d3aca33d74caa8de8c58b32e1 author Jonathan Neuschäfer 1321722322 -0500 committer Jonas Fonseca 1321722322 -0500 tree_compare: handle author == NULL gracefully when sorting [ jf: minor refactoring ] Signed-off-by: Jonas Fonseca commit d59840e3272e039d3aca33d74caa8de8c58b32e1 a98759a971d7ab9ad135199ec993028c4b0d6332 tree 6b6e031998b76ef1282388fb37c4fb94e0799cc9 parent a98759a971d7ab9ad135199ec993028c4b0d6332 author Michael J Gruber 1314608910 +0200 committer Jonas Fonseca 1315234858 -0400 Decorate replaced commits Decorate replaced commits by "replaced" analogous to git.git's 5267d29 (log: decorate "replaced" on to replaced commits, 2011-08-19). Signed-off-by: Jonas Fonseca commit a98759a971d7ab9ad135199ec993028c4b0d6332 b884e4625571e64cc413764874ffffed4bf56e14 tree cf06264fa9fa20db7d1f2dca2cfa0af0eb0763ce parent b884e4625571e64cc413764874ffffed4bf56e14 author Kumar Appaiah 1312506376 -0500 committer Jonas Fonseca 1314587734 -0400 Display line numbers in main view When line numbers are enabled, this enables the display of line numbers in the main view as well. This is useful for cases where one would want to quickly navigate to a particular commit by the ordering displayed in tig, using the `:' approach. commit 7dcb22b080ee42335faf825701c88356447ed790 3945c0b666ac117574ae13d3d2c5068bb6c22f97 tree 3b6c820fc2e6c2708e2ef1617cf27e2918cbeaba parent 3945c0b666ac117574ae13d3d2c5068bb6c22f97 author Jonas Fonseca 1314571359 -0400 committer Jonas Fonseca 1314571359 -0400 Update for version tig-0.18 commit 3945c0b666ac117574ae13d3d2c5068bb6c22f97 ee77e561fd5dc52870605f9c240ab349c86a28b4 b884e4625571e64cc413764874ffffed4bf56e14 tree 9f8181897dcf0de9fa47af37ae63c4282bc29075 parent ee77e561fd5dc52870605f9c240ab349c86a28b4 parent b884e4625571e64cc413764874ffffed4bf56e14 author Jonas Fonseca 1314571338 -0400 committer Jonas Fonseca 1314571338 -0400 Merge branch 'master' into release commit b884e4625571e64cc413764874ffffed4bf56e14 fb0f1c05e31c557b0daf5f31633e405369f00462 tree 2ee388c8f38da0a9c9a84ee977f1baafac0692ee parent fb0f1c05e31c557b0daf5f31633e405369f00462 author Jonas Fonseca 1314571333 -0400 committer Jonas Fonseca 1314571333 -0400 tig-0.18 commit fb0f1c05e31c557b0daf5f31633e405369f00462 325a37e09541472a1b5f32a5b268dce82718c900 tree f2dd15c09048389f9cf404e7ae971e6a8c869737 parent 325a37e09541472a1b5f32a5b268dce82718c900 author Jonas Fonseca 1311817911 -0400 committer Jonas Fonseca 1311817911 -0400 Update the view title status after jumping to file diff commit 325a37e09541472a1b5f32a5b268dce82718c900 c0a42b9dab69ec31e644f5648a257f8781171ad1 tree 5a83ad02194515c7dccb77fcc6e1a198e8bdcf94 parent c0a42b9dab69ec31e644f5648a257f8781171ad1 author Jonas Fonseca 1311816982 -0400 committer Jonas Fonseca 1311817348 -0400 [LP-694780][DEB-635546] Expand browsing state variables for prompt commands For example, :rev-parse %(commit) -> git rev-parse . commit c0a42b9dab69ec31e644f5648a257f8781171ad1 2e7069fdb0bc0f8649aaa432d9b2b43658d067ad tree 95d924d13def3e9948f30fa16467c7ec7ff63751 parent 2e7069fdb0bc0f8649aaa432d9b2b43658d067ad author Jonas Fonseca 1311816508 -0400 committer Jonas Fonseca 1311816508 -0400 Promote view_open to pager_open commit 2e7069fdb0bc0f8649aaa432d9b2b43658d067ad af03e0413e5b236ed45ab6e1ddc8d5eaec208f78 tree bc020ea626af07d3ddb50f9c6f12b9c3a94da3f6 parent af03e0413e5b236ed45ab6e1ddc8d5eaec208f78 author Von Fugal 1311565641 -0600 committer Von Fugal 1311565641 -0600 rename graph-line to palette used for revision graph to distinguished branches and now in git-blame to distinguish commits possible other places as well in the future commit af03e0413e5b236ed45ab6e1ddc8d5eaec208f78 82364a3b341fa59e2af4b9bf167bfafdc42577e9 tree 1b18c5d8ebc97e850319156a32c7f50c2e4231ae parent 82364a3b341fa59e2af4b9bf167bfafdc42577e9 author Jonas Fonseca 1311212825 -0400 committer Jonas Fonseca 1311212825 -0400 Jump to a file's diff when enter is pressed on a diff stat file line Also, color the different parts of the diff stat: file, +'s and -'s. commit 82364a3b341fa59e2af4b9bf167bfafdc42577e9 d2a1e1e3c02b3786f06694b79b08f5d155dc7e28 tree 7e0b9c40da1e1eda5f43dc959fe421bef5544486 parent d2a1e1e3c02b3786f06694b79b08f5d155dc7e28 author Tony Miller 1311031437 -0700 committer Jonas Fonseca 1311204426 -0400 Use erasechar() to check for the correct backspace character commit d2a1e1e3c02b3786f06694b79b08f5d155dc7e28 18ef063aeb74ebea583b81fd3fa5fb00bfb6d5b7 tree 8fc9d1595894787a31a6cdc9179498271c393f3e parent 18ef063aeb74ebea583b81fd3fa5fb00bfb6d5b7 author Jonas Fonseca 1309014202 -0400 committer Jonas Fonseca 1309014202 -0400 Minor cleanup in blame diff opening commit 18ef063aeb74ebea583b81fd3fa5fb00bfb6d5b7 87c56878d89b8ea16feea0673192b589aea1150e tree f6de171706170ed361ed3a8e6f87267481110f9f parent 87c56878d89b8ea16feea0673192b589aea1150e author Jonas Fonseca 1309013891 -0400 committer Jonas Fonseca 1309013891 -0400 Use view->parent to access status view from the stage view commit 87c56878d89b8ea16feea0673192b589aea1150e be7a3346156d140b9369ad8a61c9dcf14b34431e tree 3bedd6fa316f7570c49403b45cf1f99d6a85e4f9 parent be7a3346156d140b9369ad8a61c9dcf14b34431e author Jonas Fonseca 1309011795 -0400 committer Jonas Fonseca 1309011897 -0400 Naïvely color blame IDs to distinguish lines commit be7a3346156d140b9369ad8a61c9dcf14b34431e a8fdb9f4a9960dc8d3c5a28d3e16a8a625895c40 tree 4faea402ea7c8108054d0d9114708d10cfeb090f parent a8fdb9f4a9960dc8d3c5a28d3e16a8a625895c40 author Jonas Fonseca 1308798296 -0400 committer Jonas Fonseca 1308798337 -0400 Sort references so that remotes comes last in the branch view commit a8fdb9f4a9960dc8d3c5a28d3e16a8a625895c40 74b612205601f8aeca6a3f92d7097cf18f08287d tree 06329d05180cd68f437b7bb85f226aad74e8db57 parent 74b612205601f8aeca6a3f92d7097cf18f08287d author Jonas Fonseca 1308714440 -0400 committer Jonas Fonseca 1308714440 -0400 Restore the help view after collapsing/expanding a keybinding group commit 74b612205601f8aeca6a3f92d7097cf18f08287d 91278741544f5fbe20807d733405bfa320d5940b tree 7ce04849c88f88ccfae42f8fea5134c749440a4a parent 91278741544f5fbe20807d733405bfa320d5940b author Jonas Fonseca 1308714361 -0400 committer Jonas Fonseca 1308714406 -0400 Improve the selection of the line blamed from a diff commit 91278741544f5fbe20807d733405bfa320d5940b 7f75751712447cca7b4f6f9c50b6cfe29a0fa58a tree a5c202b6420e112ebe6fd9b5f5cd2cc5e7b8474a parent 7f75751712447cca7b4f6f9c50b6cfe29a0fa58a author Jonas Fonseca 1308455592 -0400 committer Jonas Fonseca 1308455592 -0400 Make it possible to change the diff context in the diff view commit 7f75751712447cca7b4f6f9c50b6cfe29a0fa58a 17d7b371e293b431deff7c2a790a78833f23ed4f tree a32a04db732f28a7b891a1c6d41da242b71b7905 parent 17d7b371e293b431deff7c2a790a78833f23ed4f author Jonas Fonseca 1308444637 -0400 committer Jonas Fonseca 1308452844 -0400 Add support for blaming diff lines commit 17d7b371e293b431deff7c2a790a78833f23ed4f 2d85491fbc8750a7d1dd26556575d0f9f4dd7ac4 tree 417502dee92eff5678ec3c873a7f176216f7bbe6 parent 2d85491fbc8750a7d1dd26556575d0f9f4dd7ac4 author Jonas Fonseca 1308444617 -0400 committer Jonas Fonseca 1308452809 -0400 Move blame parsing code to backend utility area commit 2d85491fbc8750a7d1dd26556575d0f9f4dd7ac4 1f1b239208a09149828f8fbaf41902ce259c6f05 tree f1c094316111e859a3276d5feac6c0a07631ff14 parent 1f1b239208a09149828f8fbaf41902ce259c6f05 author Jonas Fonseca 1308439467 -0400 committer Jonas Fonseca 1308452809 -0400 Refactor blame output parsing commit 1f1b239208a09149828f8fbaf41902ce259c6f05 d264b02aaafb14083c9ffaac67dcbcecda57e180 tree ee8252c27212a742fe106980a5d5166fc009db76 parent d264b02aaafb14083c9ffaac67dcbcecda57e180 author Jonas Fonseca 1308090458 -0400 committer Jonas Fonseca 1308452809 -0400 Rename stage_diff_find to find_prev_line_by_type_ commit d264b02aaafb14083c9ffaac67dcbcecda57e180 14563384277a4ba4ee5234e20a9526edb42023aa tree d050a5cc07d41cc60ba75519da5f0b73e8ad0b30 parent 14563384277a4ba4ee5234e20a9526edb42023aa author Jonas Fonseca 1307809997 -0400 committer Jonas Fonseca 1308451293 -0400 Add option to control the diff context commit 14563384277a4ba4ee5234e20a9526edb42023aa 3e11b846647210bd85adb6972b9a745dfe79579d tree 33633195c6606fc41e82e2ce9d686c65072ff66b parent 3e11b846647210bd85adb6972b9a745dfe79579d author Jonas Fonseca 1307906517 -0400 committer Jonas Fonseca 1308451290 -0400 Move stage open logic to stage_open commit 3e11b846647210bd85adb6972b9a745dfe79579d f0150fa6d3b9162520a2293d46e67294ecad9717 tree 213ebeaff358a785d9ecca2f9824ada4505dd3a9 parent f0150fa6d3b9162520a2293d46e67294ecad9717 author Jonas Fonseca 1308089606 -0400 committer Jonas Fonseca 1308089703 -0400 Regroup default keybindings commit f0150fa6d3b9162520a2293d46e67294ecad9717 0c49889f4e750f38baa410e400a1724a8186783d tree bd9897fa2bc79b1e8200262ea1b50c7ae9aead77 parent 0c49889f4e750f38baa410e400a1724a8186783d author Sven Wegener 1306004559 +0200 committer Jonas Fonseca 1307277272 -0400 Show remotes in branch view Signed-off-by: Sven Wegener Signed-off-by: Jonas Fonseca commit 0c49889f4e750f38baa410e400a1724a8186783d 6876ab86ff6b410fb3e068dbe6dd4985de6908e8 tree 20a7c3326c03f55845d2345d91b0170eb915e0b2 parent 6876ab86ff6b410fb3e068dbe6dd4985de6908e8 author Sven Wegener 1306004558 +0200 committer Jonas Fonseca 1307277271 -0400 Split out function to get line type from ref Signed-off-by: Sven Wegener Signed-off-by: Jonas Fonseca commit 6876ab86ff6b410fb3e068dbe6dd4985de6908e8 cc3ca7c749f943f00a3011f923df4d663a068ebf tree 00210426fb57a0690bd5924aa60d2fe493187036 parent cc3ca7c749f943f00a3011f923df4d663a068ebf author Sven Wegener 1306003964 +0200 committer Jonas Fonseca 1307277260 -0400 Sort "All branches" to the top and prevent segfault The "All branches" branch has a NULL author pointer and will cause a segfault when sorting the branches view by author. Also it should be always at the top. Signed-off-by: Sven Wegener Signed-off-by: Jonas Fonseca commit cc3ca7c749f943f00a3011f923df4d663a068ebf e60ef00ee281973dee588598e199b5913b837050 f2c52551bbfe859c05bfb86edc1274664a6bb052 tree 018c550a1d8dbc6e737ef7dcd402b333092824b0 parent e60ef00ee281973dee588598e199b5913b837050 parent f2c52551bbfe859c05bfb86edc1274664a6bb052 author Jonas Fonseca 1304932408 -0700 committer Jonas Fonseca 1304932408 -0700 Merge pull request #9 from tokkee/sh/next commit f2c52551bbfe859c05bfb86edc1274664a6bb052 2654e60d1ad213e9c8c1153593b7708233251a02 tree 018c550a1d8dbc6e737ef7dcd402b333092824b0 parent 2654e60d1ad213e9c8c1153593b7708233251a02 author Sebastian Harl 1304921823 +0200 committer Sebastian Harl 1304921823 +0200 Use error codes when checking parse_int() return value Usually, OPT_OK != OK, so we'd usually treat success as an error, leading e.g. to errors like "Unable to parse '42' as a line number". Reported by Christian Ohm in Debian bug #626124. Signed-off-by: Sebastian Harl commit 2654e60d1ad213e9c8c1153593b7708233251a02 e60ef00ee281973dee588598e199b5913b837050 tree b538f6043bb89682ad13f17b00c8efa0be38b5c3 parent e60ef00ee281973dee588598e199b5913b837050 author Sebastian Harl 1267222993 +0100 committer Sebastian Harl 1304921170 +0200 Colorize merge commit diffs as well Signed-off-by: Sebastian Harl commit e60ef00ee281973dee588598e199b5913b837050 ab7ff83bde6294f620a49bef3a8f8b617ef435ab tree 834e6a06dcb6e87517342c7f01386c9bc5146893 parent ab7ff83bde6294f620a49bef3a8f8b617ef435ab author Pierre Habouzit 1304334628 +0200 committer Jonas Fonseca 1304386730 -0400 get_author_initials: various fixes Do not pull partial multi-byte sequences. Signed-off-by: Pierre Habouzit Signed-off-by: Jonas Fonseca commit ab7ff83bde6294f620a49bef3a8f8b617ef435ab 0cd8f8485547a641873db71319da97ddc123b197 tree 11ca141215e475c32e2c3067a31a719b440414b9 parent 0cd8f8485547a641873db71319da97ddc123b197 author Ozan ÇaÄŸlayan 1303191520 +0300 committer Jonas Fonseca 1304386724 -0400 Use locale-unaware methods for case conversion Problem: On a tr_TR.UTF-8 locale, adding a key binding to tigrc can not be correctly parsed if the keymap contains 'i' like main, generic, etc. as they are wrongly converted to upper case. In languages like Turkish, 'i' is not converted to 'I' as they're different characters. So one should never use locale-aware conversion methods which will break things in some locales. See: http://www.mattryall.net/blog/2009/02/the-infamous-turkish-locale-bug Signed-off-by: Jonas Fonseca commit 0cd8f8485547a641873db71319da97ddc123b197 6b0f9d0419dfe7d93fe74d5c6f5ff3af105494a7 tree 9b4cf67c40c5538c9d72a83872cf30c55695871c parent 6b0f9d0419dfe7d93fe74d5c6f5ff3af105494a7 author Jonas Fonseca 1302748438 -0400 committer Jonas Fonseca 1302748438 -0400 Revert change to put %(ref):%(file) in the blame view title commit 6b0f9d0419dfe7d93fe74d5c6f5ff3af105494a7 83ef9f853312f7e4bbc5ef6ba3700f9282e6cb65 tree 38d2562932b6f6395b4547d1c073eeda7bbd49a4 parent 83ef9f853312f7e4bbc5ef6ba3700f9282e6cb65 author Jonas Fonseca 1302748242 -0400 committer Jonas Fonseca 1302748242 -0400 Simplify blame argv formatting commit 83ef9f853312f7e4bbc5ef6ba3700f9282e6cb65 b2ea386030e3bccd197c42e335d811ed2cbaf2fd tree 980cbf56f92e12901c561cfc51a8f018274a1fc4 parent b2ea386030e3bccd197c42e335d811ed2cbaf2fd author Jonas Fonseca 1302748187 -0400 committer Jonas Fonseca 1302748187 -0400 Reload the blame view when changing the ref and file variables Fixes regression introduced in recent refactorings. commit b2ea386030e3bccd197c42e335d811ed2cbaf2fd 6c924db8677d5231b2ffb7ac89bac25f9f7a6695 tree 7a5e5d2cb1f594768e1a0182159a3294e61692ee parent 6c924db8677d5231b2ffb7ac89bac25f9f7a6695 author Jonas Fonseca 1302741379 -0400 committer Jonas Fonseca 1302741379 -0400 Use mkauthor in grep functions commit 6c924db8677d5231b2ffb7ac89bac25f9f7a6695 ec002272b4e4ff0d336b332af615681fe14a4f9f tree 858d3421564caa208723d073247407c047efc2dd parent ec002272b4e4ff0d336b332af615681fe14a4f9f author Jonas Fonseca 1302741340 -0400 committer Jonas Fonseca 1302741340 -0400 Fix problem with empty space when the author field is disabled commit ec002272b4e4ff0d336b332af615681fe14a4f9f c8af48119c23e9cc90bbc02b84cf6dca7400cdfc tree 0190515191b7f3c926abc0e6a73d5cf2d06bc945 parent c8af48119c23e9cc90bbc02b84cf6dca7400cdfc author Jonas Fonseca 1302477599 -0400 committer Jonas Fonseca 1302477599 -0400 Unify enum map declarations through a common utility commit c8af48119c23e9cc90bbc02b84cf6dca7400cdfc 9cfde756a1a73f275dff97827d35ac27c5eb30eb tree 81dc2077637e9e5db6918b92d333d11a4331080f parent 9cfde756a1a73f275dff97827d35ac27c5eb30eb author Jonas Fonseca 1302452350 -0400 committer Jonas Fonseca 1302452369 -0400 Accept 'utf-8' for the line-graphics option as indicated in the docs Reported by Bernhard Walle. commit 9cfde756a1a73f275dff97827d35ac27c5eb30eb e4a8d2c0d050d3c53e1aa3846f2ffc2a981ffa65 tree cd07ae86204ce1b9f3dd9d7c5e3d9197a28344e0 parent e4a8d2c0d050d3c53e1aa3846f2ffc2a981ffa65 author Jonas Fonseca 1302406810 -0400 committer Jonas Fonseca 1302406810 -0400 Fix regression where new content in the stage view does not reset the position commit e4a8d2c0d050d3c53e1aa3846f2ffc2a981ffa65 bc334f1ecc401b2753927a808fd36ef76ee00691 tree 3682d41da46c5a539264d66351ec982f78149d1d parent bc334f1ecc401b2753927a808fd36ef76ee00691 author Jonas Fonseca 1302406789 -0400 committer Jonas Fonseca 1302406789 -0400 Refactor mkmode from draw_mode commit bc334f1ecc401b2753927a808fd36ef76ee00691 d4d5d590bab0ae4297adcdbfbece1f07d44d4c25 tree 2342215554abf01a24d89411db02bfb441e2feb8 parent d4d5d590bab0ae4297adcdbfbece1f07d44d4c25 author Jonas Fonseca 1302406741 -0400 committer Jonas Fonseca 1302406741 -0400 Refactor mkauthor from draw_author commit d4d5d590bab0ae4297adcdbfbece1f07d44d4c25 745649df49e55942b95ee2aacd619bb1cf6359b0 tree 3fac2f165370b8904def2701bb2611f09888e8f7 parent 745649df49e55942b95ee2aacd619bb1cf6359b0 author Jonas Fonseca 1302405520 -0400 committer Jonas Fonseca 1302405520 -0400 Refactor draw_refs out from main_draw commit 745649df49e55942b95ee2aacd619bb1cf6359b0 cea805b9dfaf077c3b799bbc38c5792c7fee49dd tree cf3e6e3de691a0203ff92c950821c88858c23f2e parent cea805b9dfaf077c3b799bbc38c5792c7fee49dd author Jonas Fonseca 1302373580 -0400 committer Jonas Fonseca 1302373580 -0400 Merge prepare_update into open_argv; make open_file call open_argv commit cea805b9dfaf077c3b799bbc38c5792c7fee49dd 4bac5372c9b08d6ced9eab474d97df311cdf0887 tree bffea516c62dd39eee6d9b4ec4352d20d9d8871c parent 4bac5372c9b08d6ced9eab474d97df311cdf0887 author Jonas Fonseca 1302373196 -0400 committer Jonas Fonseca 1302373240 -0400 Use begin_update to load data in the tree and branch views Deletes the now unused start_update. commit 4bac5372c9b08d6ced9eab474d97df311cdf0887 c77942d3d053415bcf1a09f79e8b05a7b76f6de2 tree 3b0ca6567349b3581a5be1868e01089b5f577fae parent c77942d3d053415bcf1a09f79e8b05a7b76f6de2 author Jonas Fonseca 1302373115 -0400 committer Jonas Fonseca 1302373146 -0400 Fix blame view regression Makes it possible to use begin_update to load extra view data, which allows the argv argument to be properly formatted. commit c77942d3d053415bcf1a09f79e8b05a7b76f6de2 2fa792e814f533b95124fef2eac6b556a8db392a tree 9dc45ec03c1b1aa79ef1e27e35ca60f1d487eb23 parent 2fa792e814f533b95124fef2eac6b556a8db392a author Jonas Fonseca 1302372838 -0400 committer Jonas Fonseca 1302372838 -0400 io_run: make it possible to open file commit 2fa792e814f533b95124fef2eac6b556a8db392a 730ae86ffae42b854e023e5d91d05551d9824c6e tree dd3e13fd7116036b40747307cd408f726cae9ab8 parent 730ae86ffae42b854e023e5d91d05551d9824c6e author Jonas Fonseca 1300451541 -0400 committer Jonas Fonseca 1300451541 -0400 Simplify format_argv to always replace commit 730ae86ffae42b854e023e5d91d05551d9824c6e 16f9664dc3626f0f30f6a680913e93b104cccca1 tree 486aa42d1aaca6295045594485b91d25d914da03 parent 16f9664dc3626f0f30f6a680913e93b104cccca1 author Jonas Fonseca 1300326328 -0400 committer Jonas Fonseca 1300451155 -0400 Rename prepare_io to prepare_update and make it more specialized commit 16f9664dc3626f0f30f6a680913e93b104cccca1 8f2046c514645767395d2ee735a99ab2358d42b9 tree d5b30ae48916ad1ce25b2c8571df875f3f6739c2 parent 8f2046c514645767395d2ee735a99ab2358d42b9 author Jonas Fonseca 1299818045 -0500 committer Jonas Fonseca 1300324861 -0400 Move view splitting code to separate split_view commit 8f2046c514645767395d2ee735a99ab2358d42b9 f8185f0d77c7be98989bb13beba8be5a82cda40c tree 87ff09bf9a53ddc3fce98b6a7dc73f8fdf721db0 parent f8185f0d77c7be98989bb13beba8be5a82cda40c author Jonas Fonseca 1299817835 -0500 committer Jonas Fonseca 1300324861 -0400 open_view: Use maximize_view to prepare non-split displays commit f8185f0d77c7be98989bb13beba8be5a82cda40c fab628258e3b69e35265c20634ff821ebc40b754 tree 31a74284482c86e3e60c222dbb8693984c8fdb58 parent fab628258e3b69e35265c20634ff821ebc40b754 author Jonas Fonseca 1299817642 -0500 committer Jonas Fonseca 1300324861 -0400 open_view: gather split view code in the same branch commit fab628258e3b69e35265c20634ff821ebc40b754 85980cd0ed05bd2ffc18765f70c3c9b50fb50a71 tree c5203094a97e38595aed43316e48055ad640d88e parent 85980cd0ed05bd2ffc18765f70c3c9b50fb50a71 author Jonas Fonseca 1300240010 -0400 committer Jonas Fonseca 1300324861 -0400 Introduce refresh_view based on load_view commit 85980cd0ed05bd2ffc18765f70c3c9b50fb50a71 831f6e48c51076d8f714978f6709a4491bee4a19 tree e72a8c826fd6b825db360a5f9a0df0254ccdfb10 parent 831f6e48c51076d8f714978f6709a4491bee4a19 author Jonas Fonseca 1300238926 -0400 committer Jonas Fonseca 1300324793 -0400 Refactor view loading from open_view into load_view commit 831f6e48c51076d8f714978f6709a4491bee4a19 7dfa0b29496911af61a3d761979db0b1093fec6a tree 1893e6f997b7a4ab826f01f8fad7067875f94b5f parent 7dfa0b29496911af61a3d761979db0b1093fec6a author Jonas Fonseca 1299849880 -0500 committer Jonas Fonseca 1300324735 -0400 Add open_argv and open_file to wrap update preparation and open_view call commit 7dfa0b29496911af61a3d761979db0b1093fec6a fc7fd6f2aae126dc1bcb9dcd2a5762d3a9903c7c tree 082ad1bc68fc91170659649dca7b4d5817a5b0b4 parent fc7fd6f2aae126dc1bcb9dcd2a5762d3a9903c7c author Jonas Fonseca 1299815094 -0500 committer Jonas Fonseca 1300324735 -0400 Enhance prepare_update_file to add support for refreshable file IO commit fc7fd6f2aae126dc1bcb9dcd2a5762d3a9903c7c 28e376e2624f6dd5fa20caacec996e3468d7f45d tree 05c451383f6f45bb082187879c65a543dba16f58 parent 28e376e2624f6dd5fa20caacec996e3468d7f45d author Jonas Fonseca 1276383623 -0400 committer Jonas Fonseca 1300324735 -0400 Simplify draw_author and draw_date logic commit 28e376e2624f6dd5fa20caacec996e3468d7f45d 43fec2264a6cdffc083123ef412d79c95ec44371 tree a10a93fcccf5e0b0ae0f1dd72eda8969026f983b parent 43fec2264a6cdffc083123ef412d79c95ec44371 author Jonas Fonseca 1299889476 -0500 committer Jonas Fonseca 1300324734 -0400 Make the low-level drawing functions update the view column commit 43fec2264a6cdffc083123ef412d79c95ec44371 f55675eed5d53451a8c8231f120d13fd1b5b921e tree bde34e3abcd5a5982fa8a8044640b2982b445382 parent f55675eed5d53451a8c8231f120d13fd1b5b921e author Jonas Fonseca 1300152953 -0400 committer Jonas Fonseca 1300237340 -0400 Add specialized open methods for each view ... which provide the argv to begin_update commit f55675eed5d53451a8c8231f120d13fd1b5b921e f6a2df0af88073c1c67dd1b4f17e78559e9c7151 tree 4224b37a6112373b6f8faf23835ac7b43d0f99f1 parent f6a2df0af88073c1c67dd1b4f17e78559e9c7151 author Jonas Fonseca 1300151188 -0400 committer Jonas Fonseca 1300237339 -0400 Convert tree_prepare to tree_open commit f6a2df0af88073c1c67dd1b4f17e78559e9c7151 aba2a4d67800ccf267dd7e80c008674beb1258b9 tree 91728e5bd6d2ee29dc4a9f6b06ea5108bcda44bb parent aba2a4d67800ccf267dd7e80c008674beb1258b9 author Jonas Fonseca 1300150540 -0400 committer Jonas Fonseca 1300237339 -0400 Convert begin_update to act as a view_ops open function commit aba2a4d67800ccf267dd7e80c008674beb1258b9 550fbc7127b3eac2481cb10dc6449545ff8de588 tree e4b5f730eca24c87ce0e1cc250c05ab358ab2a35 parent 550fbc7127b3eac2481cb10dc6449545ff8de588 author Jonas Fonseca 1300149904 -0400 committer Jonas Fonseca 1300237319 -0400 Extend open() view ops to accept the open flags as an argument commit 550fbc7127b3eac2481cb10dc6449545ff8de588 cbc5ebaaf7f082f334d06d770efddd37dea91e7f tree 92f7db68eeb5fe717ededc4cde541dcb2363d7c4 parent cbc5ebaaf7f082f334d06d770efddd37dea91e7f author Jonas Fonseca 1276352823 -0400 committer Jonas Fonseca 1299725250 -0500 Add VIEW_MAX_LEN macro to aid when drawing commit cbc5ebaaf7f082f334d06d770efddd37dea91e7f 4bf02e653c03d0b1213319aa881cbb38b25ff15f tree 1d99a193862cead53ca289e561231fbc303517a8 parent 4bf02e653c03d0b1213319aa881cbb38b25ff15f author Jonas Fonseca 1276360664 -0400 committer Jonas Fonseca 1299725082 -0500 Remove support for the deprecated TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD env vars commit 4bf02e653c03d0b1213319aa881cbb38b25ff15f e198a629b454a90a6f4c721d29393d579edf4895 tree 6c9062143d2b21d4a971de7c46f0439ef814377d parent e198a629b454a90a6f4c721d29393d579edf4895 author Jonas Fonseca 1299723249 -0500 committer Jonas Fonseca 1299723249 -0500 Do not install test-graph commit e198a629b454a90a6f4c721d29393d579edf4895 ff39685956079dcdf1b8a2a7ca59c540cfbe91c8 tree b1dca976d1ee4e5f634652fe09fff5ee03c6ec07 parent ff39685956079dcdf1b8a2a7ca59c540cfbe91c8 author Jonas Fonseca 1299723104 -0500 committer Jonas Fonseca 1299723150 -0500 Improve parsing of the set command and variable arguments options commit ff39685956079dcdf1b8a2a7ca59c540cfbe91c8 21afe1d8fec56dec24297124594cb8abc3621169 tree 1b4950f4cd02847dc27fc95671874c2121cab2d3 parent 21afe1d8fec56dec24297124594cb8abc3621169 author Jonas Fonseca 1299712549 -0500 committer Jonas Fonseca 1299713913 -0500 [GH-6] Make blame configurable via options from ~/.tigrc and the command line commit 21afe1d8fec56dec24297124594cb8abc3621169 c69ec01132ceb9379e407087ba50f710b509e880 tree 6669f8503a4ffb4ce417d36e8b62e99d2b5a2125 parent c69ec01132ceb9379e407087ba50f710b509e880 author Jonas Fonseca 1299711879 -0500 committer Jonas Fonseca 1299711916 -0500 tigrc(5): sort options alphabetically commit c69ec01132ceb9379e407087ba50f710b509e880 edc58e70a1988fa0aa1b56c500419b7886bae6dc tree a5c106304bb990019c4f31609cdabb2e05ed0446 parent edc58e70a1988fa0aa1b56c500419b7886bae6dc author Jonas Fonseca 1299632768 -0500 committer Jonas Fonseca 1299632768 -0500 Update and fix a few NEWS entries commit edc58e70a1988fa0aa1b56c500419b7886bae6dc c2e1c3fc6576afe962ebaa82a8578210563be99d tree a44b5d245a937eddfea96a30eea09370f4053585 parent c2e1c3fc6576afe962ebaa82a8578210563be99d author Jonas Fonseca 1299632582 -0500 committer Jonas Fonseca 1299632582 -0500 [GH-3] Expand %(directory) to . for the root directory commit ee77e561fd5dc52870605f9c240ab349c86a28b4 8d99dce35f9792ec97e3c21036d1e035581bfe94 tree aeadd46b0f169bd95aa2d8c1b40cba7af041d192 parent 8d99dce35f9792ec97e3c21036d1e035581bfe94 author Jonas Fonseca 1299462611 -0500 committer Jonas Fonseca 1299462611 -0500 Update for version tig-0.17 commit 8d99dce35f9792ec97e3c21036d1e035581bfe94 dff2fc535ef823a4217e9e1d684cd716a0da74da c2e1c3fc6576afe962ebaa82a8578210563be99d tree 29bb1eac004a01f7936dca28567b3cea69b94f36 parent dff2fc535ef823a4217e9e1d684cd716a0da74da parent c2e1c3fc6576afe962ebaa82a8578210563be99d author Jonas Fonseca 1299462588 -0500 committer Jonas Fonseca 1299462588 -0500 Merge branch 'master' into release commit c2e1c3fc6576afe962ebaa82a8578210563be99d 607cfb11cd9b6e2beaa36158d77842f8aac7fd67 tree a0b077b4696c4c578efd9b375eba5dec32654afd parent 607cfb11cd9b6e2beaa36158d77842f8aac7fd67 author Jonas Fonseca 1299462581 -0500 committer Jonas Fonseca 1299462581 -0500 tig-0.17 commit 607cfb11cd9b6e2beaa36158d77842f8aac7fd67 389378ae4f62653a77d6b1679989734715a0fc22 tree 3076d8400a927645751c68ff2b1e4205e424d5a3 parent 389378ae4f62653a77d6b1679989734715a0fc22 author Jonas Fonseca 1260569123 -0500 committer Jonas Fonseca 1299462334 -0500 Rewrite the revision graph renderer The new renderer is more 'square' but comes with three modes: UTF-8, ncurses (using chtype graphical characters), and ASCII. The three modes can be toggled. Enable revision graph rendering by default. commit 389378ae4f62653a77d6b1679989734715a0fc22 609028fbfc199d0626bca8ba1917988aee2b4041 tree f66c282e0fdab56584972303c2b70347f2f36834 parent 609028fbfc199d0626bca8ba1917988aee2b4041 author Jonas Fonseca 1269224218 -0400 committer Jonas Fonseca 1299460695 -0500 Move IO API to src/io.[ch] commit 609028fbfc199d0626bca8ba1917988aee2b4041 ddae52065f967db43f4d9aa07340c950cdb2b433 tree 09a6bc889377b299b2ee81674c3cd57ab6a68ebc parent ddae52065f967db43f4d9aa07340c950cdb2b433 author Jonas Fonseca 1269003403 -0400 committer Jonas Fonseca 1299460694 -0500 Move includes, macros and core utilities to tig.h commit ddae52065f967db43f4d9aa07340c950cdb2b433 89f7fc38e2b0e80512b06c2aca9bdbaad6fafcf5 tree db79e6a435284308ed452f907a838354f385b945 parent 89f7fc38e2b0e80512b06c2aca9bdbaad6fafcf5 author Loui Chang 1298842175 -0500 committer Jonas Fonseca 1299459940 -0500 Initialise views and screens with nonzero size. This fixes problems with ncurses 2.8 Signed-off-by: Loui Chang Signed-off-by: Jonas Fonseca commit 89f7fc38e2b0e80512b06c2aca9bdbaad6fafcf5 4cf7c37fccfcbeb4eabdb71db210e032c4564b4a tree 729777c19c179009fc658f3adce61a02bc6f21d6 parent 4cf7c37fccfcbeb4eabdb71db210e032c4564b4a author Jonas Fonseca 1287194050 -0400 committer Jonas Fonseca 1287194050 -0400 Remove draw_text()s trim parameter ... it's TRUE at all call sites. commit 4cf7c37fccfcbeb4eabdb71db210e032c4564b4a 936ec2915a24550c232e4be98e32eb2f2ece73b0 tree 6d178cb93df04e0b662cb1a6e16c4fc743085c14 parent 936ec2915a24550c232e4be98e32eb2f2ece73b0 author Jonas Fonseca 1286150357 -0400 committer Jonas Fonseca 1286150357 -0400 Remove unnecessary braces commit 936ec2915a24550c232e4be98e32eb2f2ece73b0 61817e8ac2440b361b8e4192c10a72528d2e4ed0 tree 190eb7be50fd265e1e3f359a32e10844aab5fac7 parent 61817e8ac2440b361b8e4192c10a72528d2e4ed0 author Jonas Fonseca 1286081753 -0400 committer Jonas Fonseca 1286081818 -0400 Reduce the number of windows to max two by sharing them between all views commit 61817e8ac2440b361b8e4192c10a72528d2e4ed0 3cbb9e7331cb101136c509b741d97985420c5a45 tree 4d78136b53056aeb996987ce601a746ae5f69bd1 parent 3cbb9e7331cb101136c509b741d97985420c5a45 author Jonas Fonseca 1286075558 -0400 committer Jonas Fonseca 1286075726 -0400 Use AX_WITH_CURSES from GNU autoconf archive to detect ncurses commit 3cbb9e7331cb101136c509b741d97985420c5a45 8869ebf96178755c9c88e011db35048b93647ae2 tree 07a1bf144f16439d4732c68199716d6fabfa4fac parent 8869ebf96178755c9c88e011db35048b93647ae2 author Loui Chang 1285983249 -0400 committer Jonas Fonseca 1286031748 -0400 configure.ac: Set value-if-not-found, don't check for program 'false' Signed-off-by: Loui Chang Signed-off-by: Jonas Fonseca commit 8869ebf96178755c9c88e011db35048b93647ae2 000a3bf3d784108a2d735f3268d36d644aa6c9d5 tree b995717fb80331a82998a017ca4d73ae759a1258 parent 000a3bf3d784108a2d735f3268d36d644aa6c9d5 author Jonas Fonseca 1286031677 -0400 committer Jonas Fonseca 1286031677 -0400 Unify option toggling commit 000a3bf3d784108a2d735f3268d36d644aa6c9d5 f0fc79b198d1205eccde1aae23b7127e49cf4bd9 tree a022ad71930a7fc9e1c2d2b5c00e978d73b0fd89 parent f0fc79b198d1205eccde1aae23b7127e49cf4bd9 author Jonas Fonseca 1285547256 -0400 committer Jonas Fonseca 1285645937 -0400 Refactor option parsing error handling to use error codes commit f0fc79b198d1205eccde1aae23b7127e49cf4bd9 c3658955af8be4763fba1f0b0b9a2fe5eac48c02 tree 35d6bbca27e5909492c36401bf3232b377df75a6 parent c3658955af8be4763fba1f0b0b9a2fe5eac48c02 author Jonas Fonseca 1285546419 -0400 committer Jonas Fonseca 1285546471 -0400 Add possiblity to pass data to io_load property reader commit c3658955af8be4763fba1f0b0b9a2fe5eac48c02 104cc85bbcb9d2f6b7ebff4f3740756f614100e9 tree ad3937a62d52ef5274ae46fc3cd2b9d14d50dd61 parent 104cc85bbcb9d2f6b7ebff4f3740756f614100e9 author Jonas Fonseca 1285546206 -0400 committer Jonas Fonseca 1285546206 -0400 Rename opt_*_args to opt_*_argv commit 104cc85bbcb9d2f6b7ebff4f3740756f614100e9 be20537106bc3b76f732f2407dbf589ef44d5de7 tree 392206359367338de438858104c4a869db017bcb parent be20537106bc3b76f732f2407dbf589ef44d5de7 author Jonas Fonseca 1285539785 -0400 committer Jonas Fonseca 1285539785 -0400 Improve viewing of diffs when browsing branches commit dff2fc535ef823a4217e9e1d684cd716a0da74da 8ed4bf09f9fd75ff1de3d4cc47a891e048cf4f48 tree 78e7983f648c60da23ff36f096e4a39f789b5dcf parent 8ed4bf09f9fd75ff1de3d4cc47a891e048cf4f48 author Jonas Fonseca 1285073044 -0400 committer Jonas Fonseca 1285073044 -0400 Update for version tig-0.16.2 commit 8ed4bf09f9fd75ff1de3d4cc47a891e048cf4f48 3dcbf403de2d6139aff321c16979ac5fe2b22710 be20537106bc3b76f732f2407dbf589ef44d5de7 tree 940fd9cab525864da1a210a598de61e31a34e59a parent 3dcbf403de2d6139aff321c16979ac5fe2b22710 parent be20537106bc3b76f732f2407dbf589ef44d5de7 author Jonas Fonseca 1285073020 -0400 committer Jonas Fonseca 1285073020 -0400 Merge branch 'master' into release commit be20537106bc3b76f732f2407dbf589ef44d5de7 f7efb4dad86bc0317f18817d243c5d7b015cdbd6 tree ef378e4ba7c42bcc226855b2713df6cf649be47c parent f7efb4dad86bc0317f18817d243c5d7b015cdbd6 author Jonas Fonseca 1285073015 -0400 committer Jonas Fonseca 1285073015 -0400 tig-0.16.2 commit f7efb4dad86bc0317f18817d243c5d7b015cdbd6 3ff7fff834173c6d01f04feef6403c6b0a724ebf tree 1c6e68b63fb354206b16fdac5c5c3e56d8b06333 parent 3ff7fff834173c6d01f04feef6403c6b0a724ebf author Jonas Fonseca 1285072691 -0400 committer Jonas Fonseca 1285072983 -0400 Fix 'tig show ' fix which causes empty tree views Introduced by 80e97cdd456dfe71d0dbf32d77a73bb5a2ab158e. commit 3ff7fff834173c6d01f04feef6403c6b0a724ebf 72d07e4ecfee2960e21ab94a34ac592ac955d519 tree a1dcf118a9f36b3e03849041ceaa60f3551e8477 parent 72d07e4ecfee2960e21ab94a34ac592ac955d519 author Kumar Appaiah 1285024211 -0500 committer Jonas Fonseca 1285072982 -0400 Check the ncurses version before using set_tabsize This patch checks the ncurses patch level to decide if set_tabsize is to be used in place of the TABSIZE macro, for setting the tab size. Signed-off-by: Jonas Fonseca commit 3dcbf403de2d6139aff321c16979ac5fe2b22710 b272aa318da266f6a1e0d40af0678044cf0d962e tree ac8b5317c50b43b46ead95005783ba12f03538d5 parent b272aa318da266f6a1e0d40af0678044cf0d962e author Jonas Fonseca 1284920574 -0400 committer Jonas Fonseca 1284920574 -0400 Update for version tig-0.16.1 commit b272aa318da266f6a1e0d40af0678044cf0d962e 21c987395eb39cde6bbd126a0281857db0d68159 72d07e4ecfee2960e21ab94a34ac592ac955d519 tree 4ed3ef5d13720941d9a6d0b97951b5bda73102e3 parent 21c987395eb39cde6bbd126a0281857db0d68159 parent 72d07e4ecfee2960e21ab94a34ac592ac955d519 author Jonas Fonseca 1284920551 -0400 committer Jonas Fonseca 1284920551 -0400 Merge branch 'master' into release commit 72d07e4ecfee2960e21ab94a34ac592ac955d519 80e97cdd456dfe71d0dbf32d77a73bb5a2ab158e tree a223b9fd7058108117558d0cec5ba33bf287a481 parent 80e97cdd456dfe71d0dbf32d77a73bb5a2ab158e author Jonas Fonseca 1284920546 -0400 committer Jonas Fonseca 1284920546 -0400 tig-0.16.1 commit 80e97cdd456dfe71d0dbf32d77a73bb5a2ab158e f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d tree 965267a419277eb16a8d1eea51a9bfe27d2a9983 parent f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d author Jonas Fonseca 1284908981 -0400 committer Jonas Fonseca 1284908981 -0400 Fix tig show by replacing %(commit) with %(revargs) on first display Broken in commit 53c089443cd9885fa677becee4bf7ffd56c3c357. commit f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d 0e324883ecdfcaade6061d518541572c327ae33a tree 35bd6f07d2ccc664d1cf71f4c16522cfe94a82cb parent 0e324883ecdfcaade6061d518541572c327ae33a author Stefan Naewe 1284282232 +0200 committer Jonas Fonseca 1284598935 -0400 Use function set_tabsize() this fixes the following compile error on cygwin: tig.c: In function `init_display': tig.c:7112: error: invalid lvalue in assignment Signed-off-by: Stefan Naewe Signed-off-by: Jonas Fonseca commit 0e324883ecdfcaade6061d518541572c327ae33a 7630a8f859e723186a1e411edd304a90d7b7f439 tree a47806475b1e152073d0d38bb67948f0fb4f0f86 parent 7630a8f859e723186a1e411edd304a90d7b7f439 author Jonathan Neuschäfer 1284598870 -0400 committer Jonas Fonseca 1284598870 -0400 Don't show out-of-sight tildes Signed-off-by: Jonas Fonseca commit 7630a8f859e723186a1e411edd304a90d7b7f439 d96d1665973a45f3313f3fbfbac99b1e298ccab3 tree 8f5abb33c4f9c3f5eb8ae42abbc1e4a66ffccfbb parent d96d1665973a45f3313f3fbfbac99b1e298ccab3 author Pierre Habouzit 1277713577 +0200 committer Jonas Fonseca 1277777826 -0400 Add an option to ignore unknown directories contents in the status view Similar to git ls-files --directory Signed-off-by: Jonas Fonseca commit d96d1665973a45f3313f3fbfbac99b1e298ccab3 2e02e650f57d1760fe4dd0576eeaa0664416b18d tree aabba038c7de0210b3fb66e9710c993836a7eb89 parent 2e02e650f57d1760fe4dd0576eeaa0664416b18d author Jonas Fonseca 1277589598 -0400 committer Jonas Fonseca 1277589685 -0400 Remove remains from the obsoleted toggle-date-short action The default keybinding and handling code was removed in commit b9247a4639adcfa4e8f816d75c62917575757619 commit 2e02e650f57d1760fe4dd0576eeaa0664416b18d 5b1f4fe12444f406fc16d8cfa423710960cc30ce tree 3cd3b65b65ca27e5819ed600f7531226892330ec parent 5b1f4fe12444f406fc16d8cfa423710960cc30ce author Pierre Habouzit 1277586947 +0200 committer Jonas Fonseca 1277588880 -0400 Actually add the ^D binding to move-page-down Signed-off-by: Pierre Habouzit Signed-off-by: Jonas Fonseca commit 5b1f4fe12444f406fc16d8cfa423710960cc30ce 032da7d416636bb436ed6a6e288a6b1702cf53ac tree 48056469c0b03fa3570d8a713579c872ec3ef605 parent 032da7d416636bb436ed6a6e288a6b1702cf53ac author Pierre Habouzit 1277393064 +0200 committer Jonas Fonseca 1277512866 -0400 Add a scroll-first-col command Signed-off-by: Pierre Habouzit [ jf: fix built-in description and add entry to the manual ] Signed-off-by: Jonas Fonseca commit 032da7d416636bb436ed6a6e288a6b1702cf53ac af62b665f0d33070a1d6d71be31576d5dd569e17 tree 9c1008a0eac6702bc56e0f7a27ecb9f3318a3639 parent af62b665f0d33070a1d6d71be31576d5dd569e17 author Pierre Habouzit 1277393063 +0200 committer Jonas Fonseca 1277512866 -0400 Add vi-like ^ bindings ^N/^P for previous/next ^Y/^E for scroll_up/scroll_down ^D/^U for page_up/page_down ^L for redraw Signed-off-by: Pierre Habouzit Signed-off-by: Jonas Fonseca commit af62b665f0d33070a1d6d71be31576d5dd569e17 5355b6ed446a22714d944c316f3c037348f67d76 tree 0f416182bf7af1f5e03736e34e517548ff56cbde parent 5355b6ed446a22714d944c316f3c037348f67d76 author Pierre Habouzit 1277393062 +0200 committer Jonas Fonseca 1277512861 -0400 Allow tig to parse control-modified chars in tigrc Signed-off-by: Pierre Habouzit [ jf: s/0x32/0x20/ per request from Pierre ] Signed-off-by: Jonas Fonseca commit 5355b6ed446a22714d944c316f3c037348f67d76 04b1febd46b3edf2c47ad5d39d6b974bda7ec071 tree 58b2b024b2afb086a7c06644e967c82960483a67 parent 04b1febd46b3edf2c47ad5d39d6b974bda7ec071 author Jonas Fonseca 1277510467 -0400 committer Jonas Fonseca 1277510511 -0400 Fix segfault when starting tig in pager mode Thanks to Pierre Habouzit and Tobias Heinlein for reporting this. commit 04b1febd46b3edf2c47ad5d39d6b974bda7ec071 e63f5aaf6f56ebcb60bc34615db52d849585740d tree 2ceb74094f6ac189e7169408bfd0618b89caffe3 parent e63f5aaf6f56ebcb60bc34615db52d849585740d author Jonas Fonseca 1277261578 -0400 committer Jonas Fonseca 1277261734 -0400 Fall back to retry if no diff will be shown This can happen if a file spec was passed on the command line and the diff view is opened from the blame view with a different path. commit e63f5aaf6f56ebcb60bc34615db52d849585740d abd68b5ab942dcf48bb93d8346047e26149d8ec2 tree a13d47983e7d472c3afcc5b4e3e1e574b9aedd0b parent abd68b5ab942dcf48bb93d8346047e26149d8ec2 author Jonas Fonseca 1277259815 -0400 committer Jonas Fonseca 1277261625 -0400 Refactor argv_size out from argv_append commit 21c987395eb39cde6bbd126a0281857db0d68159 1f40f496979065c2c3e9c344b0464cd1e7f1149c tree 9298f21c36148ee2ed1d3b6c801816a25844dcf0 parent 1f40f496979065c2c3e9c344b0464cd1e7f1149c author Jonas Fonseca 1276357134 -0400 committer Jonas Fonseca 1276357134 -0400 Update for version tig-0.16 commit 1f40f496979065c2c3e9c344b0464cd1e7f1149c 2d76cce48878f03ba1501c33e5cf37492d5f0e70 abd68b5ab942dcf48bb93d8346047e26149d8ec2 tree 186f9701da2b34cefa8c48367e8a511c5ae6ff53 parent 2d76cce48878f03ba1501c33e5cf37492d5f0e70 parent abd68b5ab942dcf48bb93d8346047e26149d8ec2 author Jonas Fonseca 1276357113 -0400 committer Jonas Fonseca 1276357113 -0400 Merge branch 'master' into release commit abd68b5ab942dcf48bb93d8346047e26149d8ec2 98b18c8ed2b8af03b19db45f7ec346c17f1fedb9 tree 4b4dfeaeae130fbae9caa6832388f672f37180b0 parent 98b18c8ed2b8af03b19db45f7ec346c17f1fedb9 author Jonas Fonseca 1276357104 -0400 committer Jonas Fonseca 1276357104 -0400 tig-0.16 commit 98b18c8ed2b8af03b19db45f7ec346c17f1fedb9 ac02669e69c583b09ce6fe4c19f0f29b6392e151 tree 649478bd8070969f77dad402339c5077fe937c4b parent ac02669e69c583b09ce6fe4c19f0f29b6392e151 author Jonas Fonseca 1276356572 -0400 committer Jonas Fonseca 1276356572 -0400 Fix missing ID reference ... the original ID was removed in commit b00784cc39b2d7b6069d382a2405fb3e117386d1. commit ac02669e69c583b09ce6fe4c19f0f29b6392e151 e7977a8210addabb191308ea89b0eac610fc475d tree f9a5bb91bed1ee944e52ced27bac9e573f2ba74f parent e7977a8210addabb191308ea89b0eac610fc475d author Jonas Fonseca 1276353388 -0400 committer Jonas Fonseca 1276353388 -0400 Rename {diff,file,rev}-args to {diff,file,rev}args commit e7977a8210addabb191308ea89b0eac610fc475d a7dbd419967a1e1880b00bc6f7ed7c80ac102bc9 tree 8e7c96649880d2d25c26f094ef99e00d8bc79d10 parent a7dbd419967a1e1880b00bc6f7ed7c80ac102bc9 author Jonas Fonseca 1276214559 -0400 committer Jonas Fonseca 1276214559 -0400 Load diff arguments from TIG_DIFF_OPTS if defined and no diff args was passed This is the missing part of 53c089443cd9885fa677becee4bf7ffd56c3c357. commit a7dbd419967a1e1880b00bc6f7ed7c80ac102bc9 47f8cdf12413e6c4a6d3a7082b2ea282381c068d tree bdf121814b9fc4cc8adf1afe72a3b09b03ec3e27 parent 47f8cdf12413e6c4a6d3a7082b2ea282381c068d author Jonas Fonseca 1276213428 -0400 committer Jonas Fonseca 1276213428 -0400 Move application of string_expand to draw_text ... fixes bug which truncated long lines to a fixed number of chars. commit 47f8cdf12413e6c4a6d3a7082b2ea282381c068d e9229893603b060aaaa83e4e53f5760c99dc8587 tree a6113d28335e725f05c918c3e3653d8e21710c83 parent e9229893603b060aaaa83e4e53f5760c99dc8587 author Jeff King 1276133247 -0400 committer Jonas Fonseca 1276136358 -0400 Improve parent blame to handle line-jumping for renames better ... by using git diff to compare directly the current and parent blob. Signed-off-by: Jonas Fonseca commit e9229893603b060aaaa83e4e53f5760c99dc8587 0bc05be08ffc3b7eed6544c7d637a4da67e16917 tree 9a01db8fc1054c57ac79d8791ee33dd4b06b5130 parent 0bc05be08ffc3b7eed6544c7d637a4da67e16917 author Jonas Fonseca 1275766517 -0400 committer Jonas Fonseca 1276133225 -0400 Improve parent blame to detect renames by using the previous information From git commit 96e117099c0e4f7d508eb071f60b6275038f6f37: It gives the parent commit of the blamed commit, _and_ a path in that parent commit that corresponds to the blamed path --- in short, it is the origin that would have been blamed (or passed blame through) for the line _if_ the blamed commit did not change that line. This functionality was released in git version 1.6.3 in 2009-05-06. commit 0bc05be08ffc3b7eed6544c7d637a4da67e16917 c2c2839e98eb79c86012845c063680c3b8c8ecf0 tree 564a245950cf0f5a16d2fc3798a7461e505e4c55 parent c2c2839e98eb79c86012845c063680c3b8c8ecf0 author Jonas Fonseca 1276053008 -0400 committer Jonas Fonseca 1276053089 -0400 Free blame view data when reloading view commit c2c2839e98eb79c86012845c063680c3b8c8ecf0 b00784cc39b2d7b6069d382a2405fb3e117386d1 tree 410a33228086882dcb414c23398a8ac057c529ad parent b00784cc39b2d7b6069d382a2405fb3e117386d1 author Jonas Fonseca 1275955602 -0400 committer Jonas Fonseca 1275955754 -0400 Fix clearing of the loading flag in the input select loop The bug was introduced in 33e10c2599e16ff6690e7b0bbdd7a95e7f97c886. commit b00784cc39b2d7b6069d382a2405fb3e117386d1 53c089443cd9885fa677becee4bf7ffd56c3c357 tree 84942829ac4f59567b6b7bcd8f6f6915fdc6c501 parent 53c089443cd9885fa677becee4bf7ffd56c3c357 author Jonas Fonseca 1275711789 -0400 committer Jonas Fonseca 1275712051 -0400 Deprecate use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables commit 53c089443cd9885fa677becee4bf7ffd56c3c357 4702c2a6720b8480acf5698e77848710e018b28d tree 8f63938d6593b2261103ed9df69ea1eeb9b61ead parent 4702c2a6720b8480acf5698e77848710e018b28d author Jonas Fonseca 1275479101 -0400 committer Jonas Fonseca 1275709752 -0400 Add support for splitting command line arguments commit 4702c2a6720b8480acf5698e77848710e018b28d 827aaa0e8d1938b5936e7b26d71ef99de2d03a3e tree 562daff33ae28e9e6cdb1b02bece9687903129b5 parent 827aaa0e8d1938b5936e7b26d71ef99de2d03a3e author Jonas Fonseca 1275692101 -0400 committer Jonas Fonseca 1275692101 -0400 Make the branch view always prepare how the main view is loaded commit 827aaa0e8d1938b5936e7b26d71ef99de2d03a3e bee45eda64e73a78bcfa27d358c4cb93082ad1aa tree 40de70936011ab8bc21fbab3b9fab38e37fb227f parent bee45eda64e73a78bcfa27d358c4cb93082ad1aa author Jonas Fonseca 1275691246 -0400 committer Jonas Fonseca 1275691246 -0400 Cleanup initialization of built-in run requests commit bee45eda64e73a78bcfa27d358c4cb93082ad1aa bb46d935db3f3548bbe2d411f58588943058148c tree 3919466de87dbcb87ca4b0424f25bb0f7e21357a parent bb46d935db3f3548bbe2d411f58588943058148c author Jonas Fonseca 1275657654 -0400 committer Jonas Fonseca 1275657654 -0400 Make view and run request argv members flexible and allocated commit bb46d935db3f3548bbe2d411f58588943058148c c08f9887e5861a0603e45d2bcc7b7b9db0b90a6a tree 90f95eb60b43c9d683700ffb9b3eef1965280bdf parent c08f9887e5861a0603e45d2bcc7b7b9db0b90a6a author Jonas Fonseca 1275565704 -0400 committer Jonas Fonseca 1275617865 -0400 Further cleanup IO startup and initialization; fix io_run_append commit c08f9887e5861a0603e45d2bcc7b7b9db0b90a6a 117e270f1ff02b56302627331e8d97645012a2a0 tree 8c65d3608a15a35aa9a37e2c9a111b9a535e64b6 parent 117e270f1ff02b56302627331e8d97645012a2a0 author Jonas Fonseca 1275528837 -0400 committer Jonas Fonseca 1275528891 -0400 Cleanup IO struct initialization commit 117e270f1ff02b56302627331e8d97645012a2a0 81b85275ea6cbc32ceda5270a750a2147f91c8cc tree c4112d088aaa10af24de6b927c81810104328581 parent 81b85275ea6cbc32ceda5270a750a2147f91c8cc author Jonas Fonseca 1275510552 -0400 committer Jonas Fonseca 1275528891 -0400 Make argv_copy always allocate its members commit 81b85275ea6cbc32ceda5270a750a2147f91c8cc dbc64f433b0def1fd57af89c818ac4de67b63f0c tree b35405415757883ac170c1c1a8f02cf5ca05b1cc parent dbc64f433b0def1fd57af89c818ac4de67b63f0c author Jonas Fonseca 1275509724 -0400 committer Jonas Fonseca 1275528884 -0400 Move struct io's argv and dir members to struct view commit dbc64f433b0def1fd57af89c818ac4de67b63f0c 01223083701dfebf0d5588b4217452b902e3a78b tree 39161c89c0d6e45e0e1ea01a4ad1bc6f3bcfce2d parent 01223083701dfebf0d5588b4217452b902e3a78b author Jonas Fonseca 1275527491 -0400 committer Jonas Fonseca 1275527751 -0400 Remove format_flags enum and its companion format_argv forward declaration commit 01223083701dfebf0d5588b4217452b902e3a78b c3a7a0786471a54310966520e4eddb37241e40eb tree 012fcc416c3c194cd730d16914d18ac144de484c parent c3a7a0786471a54310966520e4eddb37241e40eb author Jonas Fonseca 1275495020 -0400 committer Jonas Fonseca 1275527751 -0400 Move and rewrite io_format to become prepare_io commit c3a7a0786471a54310966520e4eddb37241e40eb 9d7281d114548bf491d00c9aa207f280b9e658e2 tree 12b969bf0cb325242e4149097c4d9f7f208a278e parent 9d7281d114548bf491d00c9aa207f280b9e658e2 author Jonas Fonseca 1275494315 -0400 committer Jonas Fonseca 1275527751 -0400 Make argv_copy support allocating argv members commit 9d7281d114548bf491d00c9aa207f280b9e658e2 9b2d063f47427490f4a605ccc708cdfab522f9d9 tree 59b00d604f45f303f246a9bae2011f63ec8f63b5 parent 9b2d063f47427490f4a605ccc708cdfab522f9d9 author Jonas Fonseca 1275493863 -0400 committer Jonas Fonseca 1275527751 -0400 Plug another memory leak and cleanup update start code while at it commit 9b2d063f47427490f4a605ccc708cdfab522f9d9 c3961fe1f3310d5c8ebfd993e9d3be24beb09ed0 tree 208db7eb3fed9aa2a47128881f6281d9755b5f8a parent c3961fe1f3310d5c8ebfd993e9d3be24beb09ed0 author Jonas Fonseca 1275509228 -0400 committer Jonas Fonseca 1275527751 -0400 Mark the argument array as freed in argv_free commit c3961fe1f3310d5c8ebfd993e9d3be24beb09ed0 2ae980f4dec0c8f239fa00544c29a4869117db7c tree f02fdc7d9894ce51c308b3058cc5aa65613b1e5a parent 2ae980f4dec0c8f239fa00544c29a4869117db7c author Jonas Fonseca 1275396031 -0400 committer Jonas Fonseca 1275397326 -0400 Refactor io_complete into a single backend for {back,fore}ground and append IO commit 2ae980f4dec0c8f239fa00544c29a4869117db7c ffc8ed2fb88045fde13cbbeda46a58222c35864f tree a2fe4d8c53363f22128f06d9cf23912883e48c93 parent ffc8ed2fb88045fde13cbbeda46a58222c35864f author Jonas Fonseca 1275395817 -0400 committer Jonas Fonseca 1275397326 -0400 Introduce io_prepare as a fix to plug memory leaks related to argv formatting commit ffc8ed2fb88045fde13cbbeda46a58222c35864f d67ba1089abc68c5a101767daa1ba25a4c99dccc tree 2ed58b87ad03e5bac72539d55da49e5ef5b211f3 parent d67ba1089abc68c5a101767daa1ba25a4c99dccc author Jonas Fonseca 1275352669 -0400 committer Jonas Fonseca 1275397325 -0400 Internalize format flags in the IO layer commit d67ba1089abc68c5a101767daa1ba25a4c99dccc ed9609d748ebf5b76d7c97a7c21902d5a817d68e tree 060ac57098640a63a17520368bf448b448002548 parent ed9609d748ebf5b76d7c97a7c21902d5a817d68e author Jonas Fonseca 1275394757 -0400 committer Jonas Fonseca 1275397292 -0400 Make the blame view format its own command arguments commit ed9609d748ebf5b76d7c97a7c21902d5a817d68e 0007343a51f71b0fa74c6874fb81f86b5c3b0df9 tree ea1effa0368e88a53b4b0f9e6f0cfca3c810e48a parent 0007343a51f71b0fa74c6874fb81f86b5c3b0df9 author Jonas Fonseca 1274067094 -0400 committer Jonas Fonseca 1275309012 -0400 Use view_request to unconditionally refresh views after run requests commit 0007343a51f71b0fa74c6874fb81f86b5c3b0df9 0f72b5ff45c8c083b81c6f255618713579bc61ce tree f270f2a39b79b656f53c7abe634b761db48d6914 parent 0f72b5ff45c8c083b81c6f255618713579bc61ce author Jonas Fonseca 1273441386 -0400 committer Jonas Fonseca 1275308939 -0400 Add view_request to call the view request method commit 0f72b5ff45c8c083b81c6f255618713579bc61ce 47160e2fd648baf177f4949a6b69455824f1d618 tree 121a043af5c05654ee9a21f9259212cc7f3715cf parent 47160e2fd648baf177f4949a6b69455824f1d618 author Jonas Fonseca 1275180452 -0400 committer Jonas Fonseca 1275194542 -0400 Move and rename free_argv to argv_free commit 47160e2fd648baf177f4949a6b69455824f1d618 9e211ea9ee3c0563ec8310cfd40f311a302701f4 tree 408242b2b62a98388b617ba82acc2d32164426ef parent 9e211ea9ee3c0563ec8310cfd40f311a302701f4 author Jonas Fonseca 1273458284 -0400 committer Jonas Fonseca 1275194453 -0400 Make open_blob_editor use its own argv show and take blob ID as an argument commit 9e211ea9ee3c0563ec8310cfd40f311a302701f4 eb129e3ab126b4b618268ed2b9c8b30382680576 tree 883e4d03047e6c33a5ce3be624119070864828a1 parent eb129e3ab126b4b618268ed2b9c8b30382680576 author Jonas Fonseca 1275003530 -0400 committer Jonas Fonseca 1275193641 -0400 Use view_is_displayed when figuring setting up the open flags commit eb129e3ab126b4b618268ed2b9c8b30382680576 0ff67fd52c98c24653faeb7262adea299271b2e1 tree 5e17050fee70bda398b44f2f4443f87bbbe9a20e parent 0ff67fd52c98c24653faeb7262adea299271b2e1 author Jonas Fonseca 1273441348 -0400 committer Jonas Fonseca 1274153043 -0400 Restructure option management code to separate section commit 0ff67fd52c98c24653faeb7262adea299271b2e1 a02d423ea80b29b368ee452585b49e5e15a38a4a tree 7dad933555c1a564ccd0571676421c32d2030c5b parent a02d423ea80b29b368ee452585b49e5e15a38a4a author Jonas Fonseca 1273283202 -0400 committer Jonas Fonseca 1274039814 -0400 Only update status view at EOF for displayed views commit a02d423ea80b29b368ee452585b49e5e15a38a4a 5568f99e97b0f79c1c4367fa14f6319f8dde6826 tree f23602e90f4e459d1d7a710e9170b9115a7e0c49 parent 5568f99e97b0f79c1c4367fa14f6319f8dde6826 author Jeff King 1273481704 -0400 committer Jonas Fonseca 1273489026 -0400 fix off-by-one on parent selection Originally, we use "git rev-list -1 --parents" to get the list of parents, and therefore the 0th slot was the commit in question, the 1st slot was the 1st parent, and so forth. Commit 0a46941 switched this to use --pretty=format:%P, so that the menu-selection code could be easily used (which counts items starting from 0). However, we only use the menu code in the case of multiple parents. For a single parent, this introduced an off-by-one where we look just past the parent we want. This patch fixes it by explicitly selecting the 0th parent for the single parent case. Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit 5568f99e97b0f79c1c4367fa14f6319f8dde6826 f2204106ecea0bb877e90d2080f203da5ab990c7 tree ae5d335716da613de7e1a50a2c0fa4c74576923a parent f2204106ecea0bb877e90d2080f203da5ab990c7 author Jonas Fonseca 1273017718 -0400 committer Jonas Fonseca 1273017718 -0400 Simplify handling of REQ_NEXT/REQ_PREVIOUS by using view->parent commit f2204106ecea0bb877e90d2080f203da5ab990c7 7477b655031cb925ea2937d679a49f128bea77cc tree 80a21833927006ebbe5a1959ee1d74e7183b1dfd parent 7477b655031cb925ea2937d679a49f128bea77cc author Jonas Fonseca 1273016997 -0400 committer Jonas Fonseca 1273016997 -0400 Add view->prev to track history leaving view->parent for split views commit 7477b655031cb925ea2937d679a49f128bea77cc 1e27747895fa12b047dcd5248a75e71cc3bf67fa tree 3fa8157780d5622dfdb145525c6da28346154d94 parent 1e27747895fa12b047dcd5248a75e71cc3bf67fa author Ingmar Vanhassel 1272377905 +0200 committer Jonas Fonseca 1272461213 -0400 Color 'Reviewed-by' and 'Tested-by' lines Signed-off-by: Ingmar Vanhassel Rename the symbols 'reviewed' and 'tested'. Signed-off-by: Jonas Fonseca commit 1e27747895fa12b047dcd5248a75e71cc3bf67fa 002dfe5b40524bfd4c26566da8fea835eefcb096 tree 3b797f93d08e2f937fecf39f9d0ca4beb8f5e130 parent 002dfe5b40524bfd4c26566da8fea835eefcb096 author Jonas Fonseca 1271903652 -0400 committer Jonas Fonseca 1271903728 -0400 When adding a keybinding check if the key is already bound ... and then overwrite it with the new request. commit 002dfe5b40524bfd4c26566da8fea835eefcb096 aa6d1129b336af4f95636bac0b3d857c4c698179 tree 718bf40858d8c32167236f906a281f79651a7e43 parent aa6d1129b336af4f95636bac0b3d857c4c698179 author Jonas Fonseca 1271902508 -0400 committer Jonas Fonseca 1271903636 -0400 Allow built-in run requests to be unbound By adding built-in run requests after loading config files and checking if each of them conflicts with an existing keybinding. Reported by Simon Ruderich. commit aa6d1129b336af4f95636bac0b3d857c4c698179 af1bb582742ee329013278c8e05f6753ef43e49f tree 3312d65ee6240fa9afcd880667b509c0b88b0177 parent af1bb582742ee329013278c8e05f6753ef43e49f author Jonas Fonseca 1271901236 -0400 committer Jonas Fonseca 1271901476 -0400 Fix set_keymap to error when resolving an unknown keymap The underlying interface was changed in commit f50084da to return TRUE/FALSE instead of OK/ERR, but the only usage of set_keymap was not updated. This lead to a potential segmentation fault. Reported by Simon Ruderich. commit af1bb582742ee329013278c8e05f6753ef43e49f 991ea94492cd3d4fc6001efebf39493aff79815f tree b8035a597aab4988fece901fdd0a17e47401b711 parent 991ea94492cd3d4fc6001efebf39493aff79815f author Simon Gerber 1271250057 +0200 committer Jonas Fonseca 1271638410 -0400 Added support for displaying dates in localtime. [ jf: updated documentation and added NEWS entry ] Signed-off-by: Jonas Fonseca commit 991ea94492cd3d4fc6001efebf39493aff79815f 61d7c560632f6ac55b0ab5b2fb275d556b84b677 tree 2e5cef49a798cd31b1d6d12011d60ba9c12e1719 parent 61d7c560632f6ac55b0ab5b2fb275d556b84b677 author Simon Gerber 1271246558 +0200 committer Jonas Fonseca 1271638410 -0400 Fixed parse_timezone to correctly calculate the offset in seconds. Signed-off-by: Jonas Fonseca commit 61d7c560632f6ac55b0ab5b2fb275d556b84b677 0b0b05419c79cba56f939e6448772d1198221335 tree 68028d20cbf877c6b0adc0d1d627bb6645025a4e parent 0b0b05419c79cba56f939e6448772d1198221335 author Simon Ruderich 1271330477 -0400 committer Jonas Fonseca 1271638410 -0400 tigrc(5): fix typo Signed-off-by: Jonas Fonseca commit 0b0b05419c79cba56f939e6448772d1198221335 a63119f83870f851a1a230ddcbe15f00a42d65e9 tree 40e68ac5721b82b4c98159f835f0e973274a1dee parent a63119f83870f851a1a230ddcbe15f00a42d65e9 author Jonas Fonseca 1270948534 -0400 committer Jonas Fonseca 1271638404 -0400 Fix unbind behavoir Fix problem where binding a key to none to deactivate it did not work. Furthermore, make it show the usual "Unknown key, press 'h' for help". Reported by Simon Ruderich. commit a63119f83870f851a1a230ddcbe15f00a42d65e9 a0ab665dc528e4314da21b5cb3a2c2ba953b6c89 tree b6a8b3c9571495644d72796168c60e481e986b7c parent a0ab665dc528e4314da21b5cb3a2c2ba953b6c89 author Jonas Fonseca 1271122459 -0400 committer Jonas Fonseca 1271330418 -0400 Introduce view->type member commit a0ab665dc528e4314da21b5cb3a2c2ba953b6c89 9f46dbb1bc906778758fd8d99b42b003b5c95133 tree 966fb180ff8de3fbad2a9db73a7f652398763eee parent 9f46dbb1bc906778758fd8d99b42b003b5c95133 author Jonas Fonseca 1271040434 -0400 committer Jonas Fonseca 1271330418 -0400 Use foreach_view for the stop loading action commit 9f46dbb1bc906778758fd8d99b42b003b5c95133 0765672adb93eab1fa26dae31ba450c3bf4012a4 tree f83cd36f6751601e6c4ecd85271b96f85b9e9235 parent 0765672adb93eab1fa26dae31ba450c3bf4012a4 author Jonas Fonseca 1271040206 -0400 committer Jonas Fonseca 1271330418 -0400 Remove unused VIEW_REQ() macro commit 0765672adb93eab1fa26dae31ba450c3bf4012a4 b206672a46f06a652fbc0028129c72cea438f9a3 tree c05604d1a9e8b79cb6566360949502a05bd9b71f parent b206672a46f06a652fbc0028129c72cea438f9a3 author Jonas Fonseca 1271040172 -0400 committer Jonas Fonseca 1271330417 -0400 Add view flag with information about whether the view supports refreshing commit b206672a46f06a652fbc0028129c72cea438f9a3 a7b1c1c096424f4af7f9083d2437cb6b6d0eb5f4 tree b4d00af6bfc6501d8b6245082f5f79eb57ed95be parent a7b1c1c096424f4af7f9083d2437cb6b6d0eb5f4 author Jonas Fonseca 1270001570 -0400 committer Jonas Fonseca 1271330417 -0400 argv: remove now unused FORMAT_DASH commit a7b1c1c096424f4af7f9083d2437cb6b6d0eb5f4 7332344186ab02b45babce8299162b1b56ad7cc0 tree 36baa43f5f4b73d5e477decd7d33bd5ee3c7b274 parent 7332344186ab02b45babce8299162b1b56ad7cc0 author Jonas Fonseca 1270001491 -0400 committer Jonas Fonseca 1271330417 -0400 argv: make prepare_update use FORMAT_NONE commit 7332344186ab02b45babce8299162b1b56ad7cc0 915e5b745f64bf3e4d2e69c6c5e47b99b136a35a tree 4b5f8770fb1b92854af4d91595266f885db31bad parent 915e5b745f64bf3e4d2e69c6c5e47b99b136a35a author jipey 1269830948 -0400 committer Jonas Fonseca 1269948570 -0400 Branch view: add %(branch) variable tracking currently selected branch This makes it possible to easily change branches from the branch view. [ jf: updated docs, added NEWS entry, added checkout run request ] Signed-off-by: Jonas Fonseca commit 915e5b745f64bf3e4d2e69c6c5e47b99b136a35a 8a7e650dee5794cacb982a6aec1ddbe107191a0f tree 66ef0e29c327f155d2def47ceba8f0f032111db7 parent 8a7e650dee5794cacb982a6aec1ddbe107191a0f author Jonas Fonseca 1269220257 -0400 committer Jonas Fonseca 1269947147 -0400 argv: move report call to format_arg method commit 8a7e650dee5794cacb982a6aec1ddbe107191a0f 61a871f4f1214475d54b6e83d4521b7826455800 tree e893af24373d6e27538f69b64138d75993511593 parent 61a871f4f1214475d54b6e83d4521b7826455800 author Jonas Fonseca 1269221596 -0400 committer Jonas Fonseca 1269947145 -0400 argv: refactor argv_from_env to return an error state commit 61a871f4f1214475d54b6e83d4521b7826455800 6946396de310c62bb4f26a7c215a9c55aa641651 tree a9b2e4fab7ff1a37becd3e52ee353233fab059b9 parent 6946396de310c62bb4f26a7c215a9c55aa641651 author Jonas Fonseca 1269946997 -0400 committer Jonas Fonseca 1269947114 -0400 utf8: move unicode related functions below the string helpers commit 6946396de310c62bb4f26a7c215a9c55aa641651 fca29b02e7f12119ac06a00a090e515b95de9f05 tree 7ffd52d4a5cf798881d28b67318ed79b5cc3b8ad parent fca29b02e7f12119ac06a00a090e515b95de9f05 author Jonas Fonseca 1269946835 -0400 committer Jonas Fonseca 1269947097 -0400 utf8: make utf8_to_unicode return 0 when encountering invalid symbols ... instead of calling die. commit fca29b02e7f12119ac06a00a090e515b95de9f05 2fe753ea3855128b25a327ca49424f69ca65f00f tree 9a9d630a387cde04aa13b345f8d7d13b86ae3fde parent 2fe753ea3855128b25a327ca49424f69ca65f00f author Jonas Fonseca 1269205238 -0400 committer Jonas Fonseca 1269821897 -0400 io: consolidate formatting into io_format commit 2fe753ea3855128b25a327ca49424f69ca65f00f 2464a776b1aee321094d5775ba07f2cc7fb873de tree 676d7d713ea4217628fd0d2ab2be643f76f89b19 parent 2464a776b1aee321094d5775ba07f2cc7fb873de author Jonas Fonseca 1269704110 -0400 committer Jonas Fonseca 1269821897 -0400 io: set io->error when syscalls fail and remove calls to report and die commit 2464a776b1aee321094d5775ba07f2cc7fb873de a8d18eb70b31a36b73fca7f61a93111b4b8632c1 tree a1bb7438ccc7ad9b426aef4b5443e2b549e58d6e parent a8d18eb70b31a36b73fca7f61a93111b4b8632c1 author Jonas Fonseca 1269198759 -0400 committer Jonas Fonseca 1269821897 -0400 io: rename IO methods to have io_ prefix commit a8d18eb70b31a36b73fca7f61a93111b4b8632c1 75b5ceed0922d48516233e8aacf5d4948b64aeb2 tree 3c254a216f818f1ba39ee2a4d216f42aee198810 parent 75b5ceed0922d48516233e8aacf5d4948b64aeb2 author Jonas Fonseca 1269198769 -0400 committer Jonas Fonseca 1269821897 -0400 io: fix comment in io struct commit 75b5ceed0922d48516233e8aacf5d4948b64aeb2 33e10c2599e16ff6690e7b0bbdd7a95e7f97c886 tree 750fe347aee37bec53b2b6a26deb964f9d5a7a44 parent 33e10c2599e16ff6690e7b0bbdd7a95e7f97c886 author Jonas Fonseca 1269791792 -0400 committer Jonas Fonseca 1269821897 -0400 Rename string_date to mkdate and add incorporate common checks commit 33e10c2599e16ff6690e7b0bbdd7a95e7f97c886 6ad8ba990d7eee9869a7e26b76248b0f32c3bfcd tree 2055bf0cff5048e424b27bbb380ac6b4e95a9c6f parent 6ad8ba990d7eee9869a7e26b76248b0f32c3bfcd author Jonas Fonseca 1269699277 -0400 committer Jonas Fonseca 1269821897 -0400 Move nodelay logic to the get_input read loop commit 6ad8ba990d7eee9869a7e26b76248b0f32c3bfcd 054e357010a660fd8a261417d215e64655dd8ec2 tree b9608819a997b7fb740a6b40375b8f565ca8b794 parent 054e357010a660fd8a261417d215e64655dd8ec2 author Jonas Fonseca 1269664564 -0400 committer Jonas Fonseca 1269821897 -0400 Mark detached heads with [HEAD]; replace opt_head_rev with a struct ref commit 054e357010a660fd8a261417d215e64655dd8ec2 b4b46f95d548829da5317dfecde8f90310569b61 tree 527f3167e3bd1490f9335270653673569cac6f7c parent b4b46f95d548829da5317dfecde8f90310569b61 author Jonas Fonseca 1269567866 -0400 committer Jonas Fonseca 1269821896 -0400 opt_codeset is only use in main, so make it local commit b4b46f95d548829da5317dfecde8f90310569b61 a7fe625eb15d2b95bdcc3ce2aa1e5e4ad2339535 tree dff4fe7f9391109d795beab9547c6abb9ed649ab parent a7fe625eb15d2b95bdcc3ce2aa1e5e4ad2339535 author Jonas Fonseca 1269434113 -0400 committer Jonas Fonseca 1269821896 -0400 Make utf8_length take opt_tab_size as a parameter commit a7fe625eb15d2b95bdcc3ce2aa1e5e4ad2339535 b13787bfdde904c42c3603ce7ce0bf595bd7a80f tree 2621b5c3f1461c94ac3c074cf93ee554ecc69bba parent b13787bfdde904c42c3603ce7ce0bf595bd7a80f author Jonas Fonseca 1269434862 -0400 committer Jonas Fonseca 1269821896 -0400 Remove line_graphic enum commit b13787bfdde904c42c3603ce7ce0bf595bd7a80f 542e6b1ab290b6ae628a55e6106273b6ea46dcaf tree 2ce2ae1b81c6483d0935f0551bbbb0b0c65d65f2 parent 542e6b1ab290b6ae628a55e6106273b6ea46dcaf author Jonas Fonseca 1269309510 -0400 committer Jonas Fonseca 1269435437 -0400 Silence warning about unused computed value commit 542e6b1ab290b6ae628a55e6106273b6ea46dcaf 74323336d4df16c9465109dd72cee4316afbb04f tree de8b57399ff8421fd4350f7945614c9821a8b4cb parent 74323336d4df16c9465109dd72cee4316afbb04f author Jonas Fonseca 1264266627 -0500 committer Jonas Fonseca 1264266627 -0500 Update copyrights commit 74323336d4df16c9465109dd72cee4316afbb04f c29d53f15aad5935deddb5e710cc8d969f9130db tree f17e47015027c83f677d94cf24e5cfa98c5469c1 parent c29d53f15aad5935deddb5e710cc8d969f9130db author Jonas Fonseca 1261282272 -0500 committer Jonas Fonseca 1261282272 -0500 Only draw dates with non-zero seconds commit c29d53f15aad5935deddb5e710cc8d969f9130db d976593a0d4ea46128704588e89ec38ca986d0e8 tree b4af26e7c8dc0ea9a176a84247a59439a0472149 parent d976593a0d4ea46128704588e89ec38ca986d0e8 author Jonas Fonseca 1261282046 -0500 committer Jonas Fonseca 1261282268 -0500 Fix the display of relative date by storing the time zone information commit d976593a0d4ea46128704588e89ec38ca986d0e8 18f066c70819529df93e3292bed6736f7c73ebfd tree e2ca904a6143e39b5a733772df9c826e3e422fa7 parent 18f066c70819529df93e3292bed6736f7c73ebfd author Jonas Fonseca 1261013975 -0500 committer Jonas Fonseca 1261013975 -0500 Fix author abbreviation to handle multi-byte and multi-column characters commit 18f066c70819529df93e3292bed6736f7c73ebfd 42fc7dbe8a913dc2679379cbe561a551f73ab6e1 tree fa8f0ebd2674b44329b90da84282f298d909d036 parent 42fc7dbe8a913dc2679379cbe561a551f73ab6e1 author Jonas Fonseca 1260896240 -0500 committer Jonas Fonseca 1260896240 -0500 Use FALSE marco instead of C++ false value commit 42fc7dbe8a913dc2679379cbe561a551f73ab6e1 a4ab5f99718cb5bbeb8a00902b383075a9e6047a tree 82ef07d6adf44dc23d080739c405248fb4b8c814 parent a4ab5f99718cb5bbeb8a00902b383075a9e6047a author Jonas Fonseca 1260891797 -0500 committer Jonas Fonseca 1260891797 -0500 prepare_update_file: assume file is relative to root directory commit a4ab5f99718cb5bbeb8a00902b383075a9e6047a 9943b4276784c6ff1c78ecd9099614fc3573e05f tree 6747d6f75c0036e202ce7eec7dc8fa7f670c5a0a parent 9943b4276784c6ff1c78ecd9099614fc3573e05f author Jonas Fonseca 1260891641 -0500 committer Jonas Fonseca 1260891772 -0500 Status view: limit untracked file by the prefix/subdirectory This reinstates the original behavior reverted in commit e7d0ebc0ec190e3a07fc28a2f551426e34a1ee6e. commit 9943b4276784c6ff1c78ecd9099614fc3573e05f 87c0e74d7ee7cf40503849c482c44952a19675c0 tree daac57452a1596c242149a746c78b830defa7ace parent 87c0e74d7ee7cf40503849c482c44952a19675c0 author Jonas Fonseca 1260891597 -0500 committer Jonas Fonseca 1260891597 -0500 open_editor: always open path relative to the repository root directory commit 87c0e74d7ee7cf40503849c482c44952a19675c0 f902cc21563a2ae22ffdd81a293f070571786ddb tree 5099a9eb5fe60f3439371c1eab00a58a6db3512f parent f902cc21563a2ae22ffdd81a293f070571786ddb author Jonas Fonseca 1260891141 -0500 committer Jonas Fonseca 1260891141 -0500 get_author_initials: improve and fix to not read outside of name string Added FIXME about multi-byte and multi-column characters. commit f902cc21563a2ae22ffdd81a293f070571786ddb 7ea608c5cb1c74066278a65ca09c4c837915a7b2 tree 168202b077da8fb13b13a2b617db4aa01d7a3852 parent 7ea608c5cb1c74066278a65ca09c4c837915a7b2 author Jonas Fonseca 1260846119 -0500 committer Jonas Fonseca 1260846119 -0500 Abbreviation of author names is now configurable and toggleable commit 7ea608c5cb1c74066278a65ca09c4c837915a7b2 26b879d549c9baad5628cc8c2957cfd345fa09e6 tree d6de650cd69a606b34e0d8b9716d1dc4da3a769b parent 26b879d549c9baad5628cc8c2957cfd345fa09e6 author Jonas Fonseca 1260807511 -0500 committer Jonas Fonseca 1260841649 -0500 Refactor format variable lookup and expansion commit 26b879d549c9baad5628cc8c2957cfd345fa09e6 5c054b1f63469fac38075ed425fbbae94fe9b495 tree 1139660ec007fa862c490816e2c8b6cd22279228 parent 5c054b1f63469fac38075ed425fbbae94fe9b495 author Jonas Fonseca 1260828379 -0500 committer Jonas Fonseca 1260841611 -0500 Oops, fix enum_equals commit 5c054b1f63469fac38075ed425fbbae94fe9b495 637c68941aec2cd77da135fdce7275e929c3afca tree 7325a8a7dc811ec4ad07dcf7bb87b60f5426d067 parent 637c68941aec2cd77da135fdce7275e929c3afca author Jonas Fonseca 1260737985 -0500 committer Jonas Fonseca 1260738007 -0500 Make return value of string_date const commit 637c68941aec2cd77da135fdce7275e929c3afca b6c315d056a6e7d8fe36f9e3baab3be35e7b9bd2 tree 714db010d6a1c9cead5a8aa6d041940cac875270 parent b6c315d056a6e7d8fe36f9e3baab3be35e7b9bd2 author Jonas Fonseca 1260735077 -0500 committer Jonas Fonseca 1260735077 -0500 Simplify enum name comparison with enum_equals macro commit b6c315d056a6e7d8fe36f9e3baab3be35e7b9bd2 e2242ffae02818d54cdcf170da9bf9096c707cff tree 10be7487070b5ed019f17889d0c981455448d51c parent e2242ffae02818d54cdcf170da9bf9096c707cff author Jonas Fonseca 1260573985 -0500 committer Jonas Fonseca 1260573985 -0500 Define date values in DATE_INFO macro commit e2242ffae02818d54cdcf170da9bf9096c707cff 29ebb7c3bd378358d56cf1a2c464cd507288611b tree 263281050c9a50139f8210f43d804230c6aea879 parent 29ebb7c3bd378358d56cf1a2c464cd507288611b author Jonas Fonseca 1260571967 -0500 committer Jonas Fonseca 1260573159 -0500 Refactor toggle_date_option into a generic enum_map based toggler commit 29ebb7c3bd378358d56cf1a2c464cd507288611b 0cc55146effae5fa6095a142248cc45e5b24d05a tree e6c794454f25792d547600d188e912a94375d7a2 parent 0cc55146effae5fa6095a142248cc45e5b24d05a author Jonas Fonseca 1260571838 -0500 committer Jonas Fonseca 1260571838 -0500 Introduce parse_enum and use it to parse the show-date option commit 0cc55146effae5fa6095a142248cc45e5b24d05a 6c8ab51718426530e89e3d742c64054e539ee524 tree fd4338f5fae7da2222dd6486d420d008e2748a93 parent 6c8ab51718426530e89e3d742c64054e539ee524 author Jonas Fonseca 1260571361 -0500 committer Jonas Fonseca 1260571768 -0500 Refactor help_name into enum_name commit 6c8ab51718426530e89e3d742c64054e539ee524 154c248585aa6895f9a6604ea37ed310722dec73 tree d2a225eb8ce81cc4ee429f8dbae914f69ef9e0ac parent 154c248585aa6895f9a6604ea37ed310722dec73 author Jonas Fonseca 1260569617 -0500 committer Jonas Fonseca 1260569617 -0500 Fix parsing of boolean show-date values It was broken during the introduction of relative dates. commit 154c248585aa6895f9a6604ea37ed310722dec73 e7d0ebc0ec190e3a07fc28a2f551426e34a1ee6e tree d9aaf329afe61e6946f57c634eb8aeb462563fcb parent e7d0ebc0ec190e3a07fc28a2f551426e34a1ee6e author Jonas Fonseca 1260569197 -0500 committer Jonas Fonseca 1260569197 -0500 toggle_date_option: use passed date argument instead of opt_date commit e7d0ebc0ec190e3a07fc28a2f551426e34a1ee6e 60978a3b810dac65b5a1209f1e3f70eef9952aa0 tree aae894d770efccd81f43c3c70b9690d1435315fc parent 60978a3b810dac65b5a1209f1e3f70eef9952aa0 author Jonas Fonseca 1260568997 -0500 committer Jonas Fonseca 1260568997 -0500 Fix usage of the status view from a sub directory commit 60978a3b810dac65b5a1209f1e3f70eef9952aa0 51ecf42b2a58966b7989c1436493005d21cab4ad tree 2cd5b270dd87b737861dd3040fb28448d290656d parent 51ecf42b2a58966b7989c1436493005d21cab4ad author Jonas Fonseca 1234995296 +0100 committer Jonas Fonseca 1259513552 -0500 Encode everything internally as UTF-8 Store all strings internally as UTF-8 and convert them when they are displayed if the locale is non-UTF-8. Improve the install documentation related to proper support for UTF-8 via ncursesw. commit 51ecf42b2a58966b7989c1436493005d21cab4ad e177b41c8e3291088cf36cd4222fb806b6344d5c tree 43880754b2bd5e3e3924e20323b62bd686563013 parent e177b41c8e3291088cf36cd4222fb806b6344d5c author Jonas Fonseca 1259325698 -0500 committer Jonas Fonseca 1259325698 -0500 Branch view: support browsing --all branches commit e177b41c8e3291088cf36cd4222fb806b6344d5c 9c45a9c80cd684f9b92a2a79756477861bb725e7 tree f1ce55b57f0d45fcf731176c8711459ed920652e parent 9c45a9c80cd684f9b92a2a79756477861bb725e7 author Jonas Fonseca 1259325468 -0500 committer Jonas Fonseca 1259325468 -0500 Cleanup bluring of the previous view's title bar commit 9c45a9c80cd684f9b92a2a79756477861bb725e7 b86dcbe70b9c5acdeb4c11ffde101cabfd4522e1 tree 290b26bee87383fefd3e268c2d2d31abfee255ce parent b86dcbe70b9c5acdeb4c11ffde101cabfd4522e1 author Jonas Fonseca 1259032834 -0500 committer Jonas Fonseca 1259032834 -0500 foreach_ref: make ref argument const commit b86dcbe70b9c5acdeb4c11ffde101cabfd4522e1 08a8567bee89062a58d13e3cabe283ffa2aec632 tree 938534bb617e0e9c76978e35e50410f905677358 parent 08a8567bee89062a58d13e3cabe283ffa2aec632 author Jonas Fonseca 1259032352 -0500 committer Jonas Fonseca 1259032757 -0500 Status view: update the file variable when a line is selected ... so %(file) works as expected. commit 08a8567bee89062a58d13e3cabe283ffa2aec632 57f3216b13421d8ec92a006919cf5f0f15e5eb24 tree 3e787f24318dcf76806904b41874dc50bf1ca73e parent 57f3216b13421d8ec92a006919cf5f0f15e5eb24 author Jonas Fonseca 1258917516 -0500 committer Jonas Fonseca 1258917516 -0500 TODO: line wrapping Requested by Eskild Hustvedt. commit 57f3216b13421d8ec92a006919cf5f0f15e5eb24 7fe7b4127b997464f8127cb6ac0e7181aacad33a tree 6e4e4192ced662c8e002b7dfe6582b53a9910140 parent 7fe7b4127b997464f8127cb6ac0e7181aacad33a author Jonas Fonseca 1258814246 -0500 committer Jonas Fonseca 1258814246 -0500 Fix install-release-doc make rules to use origin/release Thanks to bill lam for spotting this. commit 7fe7b4127b997464f8127cb6ac0e7181aacad33a 00adbecbc5dea92562b8eacd78238d75d3e0ba0d tree d227d891d74f0f186c087ab786eed71be56406e4 parent 00adbecbc5dea92562b8eacd78238d75d3e0ba0d author Jonas Fonseca 1258770472 -0500 committer Jonas Fonseca 1258770472 -0500 Add make rules to install documentation from the release branch commit 2d76cce48878f03ba1501c33e5cf37492d5f0e70 f2733f78a9aac729b800ff0759b4e30a6471ca46 tree 253d6eb655ed94cae1a899a999fb31be7267b2cb parent f2733f78a9aac729b800ff0759b4e30a6471ca46 author Jonas Fonseca 1258722327 -0500 committer Jonas Fonseca 1258722327 -0500 Update for version tig-0.15 commit f2733f78a9aac729b800ff0759b4e30a6471ca46 81d29c12396d9af8dd4fef5c5bf8001b56eebd74 00adbecbc5dea92562b8eacd78238d75d3e0ba0d tree c9281f8c086735ebdc5db668af33d20333bf4092 parent 81d29c12396d9af8dd4fef5c5bf8001b56eebd74 parent 00adbecbc5dea92562b8eacd78238d75d3e0ba0d author Jonas Fonseca 1258722306 -0500 committer Jonas Fonseca 1258722306 -0500 Merge branch 'master' into release commit 00adbecbc5dea92562b8eacd78238d75d3e0ba0d 29b1fccb6aaa8140fc2fdf82d750891444379ce1 tree a3848c3eeb6a0ac304f584f8af072b114fa549ce parent 29b1fccb6aaa8140fc2fdf82d750891444379ce1 author Jonas Fonseca 1258722300 -0500 committer Jonas Fonseca 1258722300 -0500 tig-0.15 commit 29b1fccb6aaa8140fc2fdf82d750891444379ce1 9df24565c2c4848cb470ac5415e142ac5d243b4a tree 88a95d5156aec7609305e074e419970d5e57cac3 parent 9df24565c2c4848cb470ac5415e142ac5d243b4a author Ingmar Vanhassel 1258645834 +0100 committer Jonas Fonseca 1258720412 -0500 Makefile: Fix typo in 157ebf54 Signed-off-by: Jonas Fonseca commit 9df24565c2c4848cb470ac5415e142ac5d243b4a ffccf1b1f837812ee3d33bf0cef5f5036f858ed4 tree d17ac4fad9049107acece2da806820668cd64462 parent ffccf1b1f837812ee3d33bf0cef5f5036f858ed4 author Jonas Fonseca 1258599765 -0500 committer Jonas Fonseca 1258599809 -0500 Status view: special case revert of unmerged entries with no physical file commit ffccf1b1f837812ee3d33bf0cef5f5036f858ed4 6859ce581a2d983ac77f7e7cdd4318244cd11f2e tree a01c788c1631f7953600881ef9aff76cd013df5b parent 6859ce581a2d983ac77f7e7cdd4318244cd11f2e author Jonas Fonseca 1258516881 -0500 committer Jonas Fonseca 1258518691 -0500 io_open: take path as a vararg format commit 6859ce581a2d983ac77f7e7cdd4318244cd11f2e 300fb142532a9f5394d2d53509dc55498a574ad1 tree 2a5e7e4359a1e42e7ab933400f54775b2572e284 parent 300fb142532a9f5394d2d53509dc55498a574ad1 author Jonas Fonseca 1258516145 -0500 committer Jonas Fonseca 1258518691 -0500 run_io_rd_dir: obsolete by switching call sites to run_io_rd_dir commit 300fb142532a9f5394d2d53509dc55498a574ad1 0e1214b9bf380cda0278f7535b39ac9177b148d5 tree fca3220b892ea7e0a843b9e9e8d481cd8656f214 parent 0e1214b9bf380cda0278f7535b39ac9177b148d5 author Jonas Fonseca 1258516133 -0500 committer Jonas Fonseca 1258518691 -0500 run_io_dir: take dir argument commit 0e1214b9bf380cda0278f7535b39ac9177b148d5 e2a1e4713a33a5ef971f241add9af111896aebba tree 3590fb91dd2e52da10b415137b02360763acb1eb parent e2a1e4713a33a5ef971f241add9af111896aebba author Jonas Fonseca 1258515808 -0500 committer Jonas Fonseca 1258518691 -0500 begin_update: simplify control flow commit e2a1e4713a33a5ef971f241add9af111896aebba 157ebf5433e98ddca88fcec4319bcaf510cfc4ad tree 228cb1f05376cc8c7e7161a3041332b110bac263 parent 157ebf5433e98ddca88fcec4319bcaf510cfc4ad author Jonas Fonseca 1235217850 +0100 committer Jonas Fonseca 1258518691 -0500 Remove build dependency on git from the configure script commit 157ebf5433e98ddca88fcec4319bcaf510cfc4ad fa41280ad285af9c866c49f8db6e60817729d912 tree d5221e73b55a08a53bac045bebe987c13d0ceae5 parent fa41280ad285af9c866c49f8db6e60817729d912 author Jonas Fonseca 1258514749 -0500 committer Jonas Fonseca 1258518688 -0500 tigmanual(7): provide the manual as a man page commit fa41280ad285af9c866c49f8db6e60817729d912 71f547b89a5ee765abf8aa56c42241748de377e7 tree 5e019002b13c7f4631ed4ccc56f90061fdc7a12b parent 71f547b89a5ee765abf8aa56c42241748de377e7 author Jonas Fonseca 1258511084 -0500 committer Jonas Fonseca 1258514852 -0500 Update asciidoc table syntax to the one supported by version 8.4.4 Also, fix README.html dependencies. commit 71f547b89a5ee765abf8aa56c42241748de377e7 7432cb6e62cd01dfecaed9fcf28b95cb46e8ffb7 tree b03ecbc846dc9cb7ec947bd466a20db4f6056076 parent 7432cb6e62cd01dfecaed9fcf28b95cb46e8ffb7 author Jonas Fonseca 1258511065 -0500 committer Jonas Fonseca 1258511065 -0500 NEWS: Improve bug fix description commit 7432cb6e62cd01dfecaed9fcf28b95cb46e8ffb7 1cb715dd72650568a45b63f69dc9470304d5d35c tree 7fc7edffb8c8b30416a688732a4cb0ddf83833f4 parent 1cb715dd72650568a45b63f69dc9470304d5d35c author Jonas Fonseca 1258433760 -0500 committer Jonas Fonseca 1258434000 -0500 Fix loading of blame data when opened from the tree view ... and CWD is a subdirectory (Debian bug 540766). Also, improve the tree view to allow entering the parent directory. commit 1cb715dd72650568a45b63f69dc9470304d5d35c 035ab1a8ea61b3fe90d21908c06d43fbf5dd76ad tree 3a59cb329e7fba4cdd3bb232c2016ce52451c346 parent 035ab1a8ea61b3fe90d21908c06d43fbf5dd76ad author Jonas Fonseca 1258431054 -0500 committer Jonas Fonseca 1258431054 -0500 Fix draw_date to not format anything when time arg is NULL commit 035ab1a8ea61b3fe90d21908c06d43fbf5dd76ad b9247a4639adcfa4e8f816d75c62917575757619 tree 6a0203a3c44344de3d42b6c4c5bd25389084b596 parent b9247a4639adcfa4e8f816d75c62917575757619 author bill lam 1257994962 +0800 committer Jonas Fonseca 1258113465 -0500 Fix whitespace There is whitespaces on 2 of the original source line. Signed-off-by: Jonas Fonseca commit b9247a4639adcfa4e8f816d75c62917575757619 c0db8aad14a1ecc6a7418b0ee5596aca8c4076db tree 36d4e36b1f53fbaeb1efb8ddb1de9c1c78760d20 parent c0db8aad14a1ecc6a7418b0ee5596aca8c4076db author Jonas Fonseca 1234870371 +0100 committer Jonas Fonseca 1258113321 -0500 Add support for displaying relative dates Also unifies all date formats to use the show-date option and the toggle-date action. commit c0db8aad14a1ecc6a7418b0ee5596aca8c4076db 13ebe539156e5ce5b338975d05b457b07561f1aa tree a9dd988c22380dc40e296143fee2ed64af6b4f80 parent 13ebe539156e5ce5b338975d05b457b07561f1aa author Jonas Fonseca 1257909782 -0500 committer Jonas Fonseca 1257909782 -0500 NEWS: Mention date-shorten feature commit 13ebe539156e5ce5b338975d05b457b07561f1aa 0c818263da3767600cf50f333bd4cfc37e0b45e4 f2d95af83227cea265bcce5e8604eccc6d3fd849 tree 360dae64eb8e24a1c69aea24ccfdd5cf635042f5 parent 0c818263da3767600cf50f333bd4cfc37e0b45e4 parent f2d95af83227cea265bcce5e8604eccc6d3fd849 author Jonas Fonseca 1257909627 -0500 committer Jonas Fonseca 1257909627 -0500 Merge remote branch 'samb/short-dates' commit 0c818263da3767600cf50f333bd4cfc37e0b45e4 1e696329f182b67f87bd323d098cf35d301e7de3 tree b09c9cbfb0c3166802b97afc4441bcfb80dd39d7 parent 1e696329f182b67f87bd323d098cf35d301e7de3 author Jonas Fonseca 1234215219 +0100 committer Jonas Fonseca 1257908932 -0500 Show the active (instead of the default) keybindings in the help view Furthermore, honor the keymap when suggesting actions in the help messages. commit f2d95af83227cea265bcce5e8604eccc6d3fd849 1e696329f182b67f87bd323d098cf35d301e7de3 tree 6fdb5110742ef359a01605fac8966f00176abbfb parent 1e696329f182b67f87bd323d098cf35d301e7de3 author Samuel Bronson 1250115115 -0400 committer Samuel Bronson 1250115115 -0400 Add an option (and toggle) for shortening the date column by skipping the time. Signed-off-by: Samuel Bronson commit 1e696329f182b67f87bd323d098cf35d301e7de3 ac66fdb0a7d9af37eeecc59c0fd284f6b065d7fe tree f1d0fab31e9129a3a10fa254aa9dda6d698694a8 parent ac66fdb0a7d9af37eeecc59c0fd284f6b065d7fe author Jonas Fonseca 1243651271 +0000 committer Jonas Fonseca 1243938578 +0200 Build with asciidoc-8.4.5 This version seems to be stricter about presubs attributes: asciidoc -aversion=0.14.1-28-gac66fdb -asysconfdir=/usr/local/etc -b docbook -d manpage tigrc.5.txt ERROR: tigrc.5.txt: line 12: malformed presubs attribute: normal ERROR: tigrc.5.txt: line 41: malformed presubs attribute: normal ERROR: tigrc.5.txt: line 149: malformed presubs attribute: normal ERROR: tigrc.5.txt: line 366: malformed presubs attribute: normal make: *** [tigrc.5.xml] Error 1 Based on patch by Ingmar Vanhassel. Signed-off-by: Jonas Fonseca commit ac66fdb0a7d9af37eeecc59c0fd284f6b065d7fe cfb363b18ca3394bd07428fde7ae63b5dd84d6c4 tree 7fff84da28054a18b8f3736d62ceee00b467c123 parent cfb363b18ca3394bd07428fde7ae63b5dd84d6c4 author Sebastian Harl 1238776448 +0200 committer Jonas Fonseca 1239637012 +0200 Fixed some uninitialized variable warnings GCC 4.3.3, when used with -Wall, emits warnings that those variables "may be used uninitialized in this function". Signed-off-by: Sebastian Harl Signed-off-by: Jonas Fonseca commit cfb363b18ca3394bd07428fde7ae63b5dd84d6c4 c023b2787c22fd6fd266b5b1d0dab0e7a2edbd19 tree ba4a459b84814a4d5b2cf5799918cef21a6fbcc7 parent c023b2787c22fd6fd266b5b1d0dab0e7a2edbd19 author Jonas Fonseca 1239636854 +0200 committer Jonas Fonseca 1239636854 +0200 Allow multiple text attributes for color commands This also fixes lazy behavior so that setting the cursor color no longer automatically sets the text to bold. commit c023b2787c22fd6fd266b5b1d0dab0e7a2edbd19 39582f2ac584031e7f3eacd09bfb0c4645cb5fe7 tree 76e44e1c8eba1e05cc11909eef6d4a0cb0b37075 parent 39582f2ac584031e7f3eacd09bfb0c4645cb5fe7 author Jonas Fonseca 1235660642 +0100 committer Jonas Fonseca 1235660642 +0100 Remove macros which are only used for default option values commit 39582f2ac584031e7f3eacd09bfb0c4645cb5fe7 ced92a5dd3c253ffc4591a22609ce0cd9574615c tree f32f36dfddb59a9a59369558e2828777d898227a parent ced92a5dd3c253ffc4591a22609ce0cd9574615c author Tilo Schwarz 1235427843 +0100 committer Jonas Fonseca 1235599798 +0100 Make height of split view configurable Signed-off-by: Tilo Schwarz Signed-off-by: Jonas Fonseca commit ced92a5dd3c253ffc4591a22609ce0cd9574615c 6a72f9bcd5aa5ef11500357077eb00a3c271bb61 tree 6af7077cc92979b248fe8847a428a33a492c8b82 parent 6a72f9bcd5aa5ef11500357077eb00a3c271bb61 author Jonas Fonseca 1235573606 +0100 committer Jonas Fonseca 1235573606 +0100 Manual: document that : jumps to the line number commit 6a72f9bcd5aa5ef11500357077eb00a3c271bb61 0a4694191613f887151a52f0c70e6b6181ea5fb6 tree 2aef92c7c96c20bcc7a746fe4b6c226ad0ea228b parent 0a4694191613f887151a52f0c70e6b6181ea5fb6 author Jonas Fonseca 1235325505 +0100 committer Jonas Fonseca 1235325505 +0100 Fix memory allocation check in open_commit_parent_menu The check was not converted when the code was moved to a separate function before the commit. To test the menu using the tig repository start tig using: tig blame cf63d30cbc4efb2bb87e52c4e54366751bb958fa Makefile Then go to line 80 (type ":80") and press the key for moving to the parent (bound to ',' by default). commit 0a4694191613f887151a52f0c70e6b6181ea5fb6 91e804121ff75571de99e3018b89fb7d700ebacd tree 98ae19aa10b71ac2f720fe5e166849ffd452cae9 parent 91e804121ff75571de99e3018b89fb7d700ebacd author Jonas Fonseca 1235262669 +0100 committer Jonas Fonseca 1235262833 +0100 Use menus with the commit subject to present selectable commit parents commit 91e804121ff75571de99e3018b89fb7d700ebacd 914710a2bf5947fabefe24da086b0e680277a8fd tree ed58023403502bd4cbd3028c959d9652ceb9db51 parent 914710a2bf5947fabefe24da086b0e680277a8fd author Jonas Fonseca 1235261998 +0100 committer Jonas Fonseca 1235262113 +0100 Add simple support for showing menues and use it for showing option menu The general goal is to have certain lesser used options not take up a key for toggling. commit 914710a2bf5947fabefe24da086b0e680277a8fd 129cf793c915ac00dac86c561c25099cd3cd4be0 tree 0df4916b48dffd2a4f3e962ba5860dad09c9fc11 parent 129cf793c915ac00dac86c561c25099cd3cd4be0 author Jonas Fonseca 1235230655 +0100 committer Jonas Fonseca 1235230655 +0100 Restore the branch view position after refreshing commit 129cf793c915ac00dac86c561c25099cd3cd4be0 da8b99da8f4dc5512c23154ec6c0aa7d3c313555 tree 75c018aeeeff29c0d2e591a15e4117e105452dba parent da8b99da8f4dc5512c23154ec6c0aa7d3c313555 author Jonas Fonseca 1235227552 +0100 committer Jonas Fonseca 1235229312 +0100 Fix reloading of references to not cause access to freed memory Make the allocation of refs stable across reloads (of either the main, branch or log view) by changing the storage method and introducing a struct ref_list to keep track of lists of references. read_ref now always scans the already allocated refs. To speed this up keep the list sorted and use binary search when inserting and updating. commit da8b99da8f4dc5512c23154ec6c0aa7d3c313555 bb9a850a77f85331a151141907b0bae72263fa82 tree d2ab5dbf7e8735456831979e6c78ad6808582364 parent bb9a850a77f85331a151141907b0bae72263fa82 author Giuseppe Bilotta 1235176121 +0100 committer Jonas Fonseca 1235218222 +0100 Predefined external command: git commit Status view allows management of the stage area, and the user is likely to issue a commit as soon as (s)he's satisfied with the result. Mapping 'git commit' to the 'C' key in status view makes this straightforward and allows a very streamlined workflow from within git. Signed-off-by: Giuseppe Bilotta Signed-off-by: Jonas Fonseca commit bb9a850a77f85331a151141907b0bae72263fa82 74f6f11e317f05e45a1950095f0e0e64ec7e6d36 tree a27f1c6b0c0c7f07c5560a628dc4fb787b123294 parent 74f6f11e317f05e45a1950095f0e0e64ec7e6d36 author Giuseppe Bilotta 1235178453 +0100 committer Jonas Fonseca 1235218118 +0100 Fix previous/next with branch+main view If the main view was opened as a child window of branch view, the previous/next key would scroll the child window instead of the parent one, which was not consistent with other dual-window situations. Fix by checking for a branch+main too when delegating the request. Signed-off-by: Giuseppe Bilotta Signed-off-by: Jonas Fonseca commit 74f6f11e317f05e45a1950095f0e0e64ec7e6d36 aab9ae5e8c60c10daae078e3944d808cb74bb448 tree 1b4d6409cd34530f1c55291a33e21e23f6599a50 parent aab9ae5e8c60c10daae078e3944d808cb74bb448 author Jonas Fonseca 1235180096 +0100 committer Jonas Fonseca 1235217906 +0100 Add support for sorting branch entries by name, date and author commit aab9ae5e8c60c10daae078e3944d808cb74bb448 87f9b5b5c58653c4de05aa9cc3c14e8d5ba60b93 tree 62171b972e072ec84cafacfc63e5dc7f027ee836 parent 87f9b5b5c58653c4de05aa9cc3c14e8d5ba60b93 author Jonas Fonseca 1235180027 +0100 committer Jonas Fonseca 1235217902 +0100 Add support for sorting tree entries by name, date or author commit 87f9b5b5c58653c4de05aa9cc3c14e8d5ba60b93 994bb6e9ef5ae7fac447c17e4bc01f49853d4679 tree 82e8b707305e13f341a92045e4873b78d891a467 parent 994bb6e9ef5ae7fac447c17e4bc01f49853d4679 author Jonas Fonseca 1235175305 +0100 committer Jonas Fonseca 1235175380 +0100 Branch view: fix loading to handle when two branches have same commit commit 994bb6e9ef5ae7fac447c17e4bc01f49853d4679 a50b5b0f00be8b0edf509b4f7ea7550364a64a02 tree 37e49f7dfbd6d824716c496bb39a3294c0ef63b9 parent a50b5b0f00be8b0edf509b4f7ea7550364a64a02 author Jonas Fonseca 1235169569 +0100 committer Jonas Fonseca 1235171816 +0100 Use temporary variable in refs loop in main_draw commit a50b5b0f00be8b0edf509b4f7ea7550364a64a02 04cd7add72b518b12d782f935997dda94b6e5828 tree 9f0b0c78340814d866e24059cef9230e479cd9e8 parent 04cd7add72b518b12d782f935997dda94b6e5828 author Jonas Fonseca 1235170364 +0100 committer Jonas Fonseca 1235171799 +0100 Minor fix to always sort even if allocation fails in get_refs commit 04cd7add72b518b12d782f935997dda94b6e5828 de5969ac01296177d2bf736b8737cdb4181f072d tree b69e306514bf8c7f03c88d8864088833d5c79256 parent de5969ac01296177d2bf736b8737cdb4181f072d author Jonas Fonseca 1235171557 +0100 committer Jonas Fonseca 1235171557 +0100 Add primitive branch view For now it let's you browse the branches and choose one to show in the main view. commit de5969ac01296177d2bf736b8737cdb4181f072d 920d8d1cdc485bd8222e3cffe9d694037aaab488 tree 83f0e1b8f8494724695caf893f075a9f0a5610cc parent 920d8d1cdc485bd8222e3cffe9d694037aaab488 author Jeff King 1235100223 -0500 committer Jonas Fonseca 1235138656 +0100 Add missing NULL in blame_grep Commit 436674f introduced a grep_text utility function which takes a NULL-terminated list; the callsite in blame_grep forgot to put in a NULL, leading to segmentation faults. Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit 920d8d1cdc485bd8222e3cffe9d694037aaab488 656883f1f076a33de4a643e4621953d8a589d59b tree e4a53b125da7cff982bdf1a98b52679d3b5c30e9 parent 656883f1f076a33de4a643e4621953d8a589d59b author Jonas Fonseca 1235062582 +0100 committer Jonas Fonseca 1235075294 +0100 Fix a potential problem with reading tokens larger then BUFSIZ If io_get() is not able to find the end marker it will go into an infinite loop. To fix this make it possible to reallocate and increase the buffer if necessary. To avoid problems with callers reading into a stack allocated buffer, change these to no longer use the "zero-copy" strategy. This in turns cleans the callers up a bit. commit 656883f1f076a33de4a643e4621953d8a589d59b 7f8f12b6ce7e30df211e1143e8e297b16f7ed961 tree 9cd65f4a1dc340afe24e0bfdc35262de8f6bffe1 parent 7f8f12b6ce7e30df211e1143e8e297b16f7ed961 author Jonas Fonseca 1235006499 +0100 committer Jonas Fonseca 1235006499 +0100 Update the current branch information when reloading all references Fixes problem of improper highlighting of current branch after switching branch and reloading. commit 7f8f12b6ce7e30df211e1143e8e297b16f7ed961 6bd4d0f8008ced39afd8406a414b4dd8d9ca379a tree 2331b1da07a9edd2ee0d1561baab3d0725f7e39b parent 6bd4d0f8008ced39afd8406a414b4dd8d9ca379a author Jonas Fonseca 1234955352 +0100 committer Jonas Fonseca 1234966492 +0100 Define an allocator for run requests Comparing the size of the binary before and after this change, shows that the size does not increase when -02 is used. commit 6bd4d0f8008ced39afd8406a414b4dd8d9ca379a b2ff9a4ff12328580ae7402c1c09a0814c1b4c60 tree b60203f5c25ea916c7fdd9dcf1b83f16f54a7359 parent b2ff9a4ff12328580ae7402c1c09a0814c1b4c60 author Jonas Fonseca 1234954591 +0100 committer Jonas Fonseca 1234954772 +0100 Remove the need for alloc variables commit b2ff9a4ff12328580ae7402c1c09a0814c1b4c60 b2d7778afb70e1d2493a66b71e4838ca91644743 tree 04102785b7f1b7132bb7c0906fb3b303b7b3bb3a parent b2d7778afb70e1d2493a66b71e4838ca91644743 author Jonas Fonseca 1234954078 +0100 committer Jonas Fonseca 1234954078 +0100 Make the granular allocators more customizable using macros Add a DEFINE_ALLOCATOR macro which can be used to define a custom allocator which is more type safe than the current realloc_items and which removed the need for using temporary variables for holding the newly allocated chunk. The custom allocator also allows the allocation granularity to be tweaked to the need of the user instead of being hardcoded to 256 chunks for all. commit b2d7778afb70e1d2493a66b71e4838ca91644743 436674f1b36e7257dd8b0089c19f55d9ac93a561 tree 9835c0bfa7a0f81e2b7bc844ec6939352ca67b7e parent 436674f1b36e7257dd8b0089c19f55d9ac93a561 author Jonas Fonseca 1234840048 +0100 committer Jonas Fonseca 1234871723 +0100 Define a tree_grep and fixing searching It was broken by the move to the annotated tree view. commit 436674f1b36e7257dd8b0089c19f55d9ac93a561 6125c6c0048dcca231214b27bedcc83286bb5c28 tree d27d57fad23642988e2a7d1dc09f7e3199c0b5c8 parent 6125c6c0048dcca231214b27bedcc83286bb5c28 author Jonas Fonseca 1234840022 +0100 committer Jonas Fonseca 1234871723 +0100 Simplify searching in view lines by defining grep_text utility commit 6125c6c0048dcca231214b27bedcc83286bb5c28 2063b4e98bfe7b10ea10c287c973ab19d8bc09fe tree fdc3178be0f57250802b518ba6a4de4561deaa35 parent 2063b4e98bfe7b10ea10c287c973ab19d8bc09fe author Jonas Fonseca 1234832445 +0100 committer Jonas Fonseca 1234871723 +0100 Reduce memory and startup time by storing author times as time_t Which means that drawing will have to do some more formatting, however, the startup time is shorter since gmtime_r() is no longer called. Same repository as last commit. 18980 fonseca 20 0 17776 15m 872 S 0 0.8 0:01.26 tig 18630 fonseca 20 0 23224 20m 868 S 0 1.0 0:01.26 tig-0.14.1 commit 2063b4e98bfe7b10ea10c287c973ab19d8bc09fe 5ba81063e64cbc0bbb62e086e0818318fba952f2 tree b1d0b7de6b64be21e3555f59c61fd480e2df53d5 parent 5ba81063e64cbc0bbb62e086e0818318fba952f2 author Jonas Fonseca 1234831886 +0100 committer Jonas Fonseca 1234871719 +0100 Add small cache for author names to reduce memory foot-print Numbers from an old linux kernel repository with 2740 unique authors shows that it takes a little longer time to start up but the gain is quite good. Furthermore, it lifts the name length restriction. 18191 fonseca 20 0 19712 17m 872 S 3 0.8 0:01.34 tig 18180 fonseca 20 0 23224 20m 868 S 0 1.0 0:01.26 tig-0.14.1 commit 81d29c12396d9af8dd4fef5c5bf8001b56eebd74 b540e1ce1779d0f1f4fe50a7f18d1c46c8b0f41c tree cd976ee0133dc36ac74223afe702fe17c3770227 parent b540e1ce1779d0f1f4fe50a7f18d1c46c8b0f41c author Jonas Fonseca 1234738941 +0100 committer Jonas Fonseca 1234738941 +0100 Update for version tig-0.14.1 commit b540e1ce1779d0f1f4fe50a7f18d1c46c8b0f41c 996697af991069f83feed9e262d70ceb8938151d 5ba81063e64cbc0bbb62e086e0818318fba952f2 tree 9d42f2245dff8d5627018e2b16cbac6d255251dc parent 996697af991069f83feed9e262d70ceb8938151d parent 5ba81063e64cbc0bbb62e086e0818318fba952f2 author Jonas Fonseca 1234738926 +0100 committer Jonas Fonseca 1234738926 +0100 Merge branch 'master' into release commit 5ba81063e64cbc0bbb62e086e0818318fba952f2 3edbcadc11508d834d1ce5f8bb580bc75ea5310a tree 277232bfe07eb202523ea08a74eec89909258964 parent 3edbcadc11508d834d1ce5f8bb580bc75ea5310a author Jonas Fonseca 1234738920 +0100 committer Jonas Fonseca 1234738920 +0100 tig-0.14.1 commit 3edbcadc11508d834d1ce5f8bb580bc75ea5310a 6f337aee3a4cdf21bce3661171a9ee36cbd7d689 tree 4103cb1603d298893074e9ef2e545d544d55237e parent 6f337aee3a4cdf21bce3661171a9ee36cbd7d689 author Jonas Fonseca 1234736483 +0100 committer Jonas Fonseca 1234736483 +0100 Remove unneeded doupdate from view_driver commit 6f337aee3a4cdf21bce3661171a9ee36cbd7d689 366fedec453f87ef524cdc4cd38b733587457f07 tree 2ec4f74092b1260a1b2c69f6729a3857deb6f8ad parent 366fedec453f87ef524cdc4cd38b733587457f07 author Jonas Fonseca 1234736446 +0100 committer Jonas Fonseca 1234736446 +0100 Keep the cursor fixed while initial stage progress is reported commit 366fedec453f87ef524cdc4cd38b733587457f07 7a6f2dd185946eaaa38373c92667631edecd76ab tree 863495e62493eabc22262ced871804c4ff86f4b4 parent 7a6f2dd185946eaaa38373c92667631edecd76ab author Jonas Fonseca 1234718624 +0100 committer Jonas Fonseca 1234718624 +0100 Fix draw_lineno to always set the static format buffer commit 7a6f2dd185946eaaa38373c92667631edecd76ab dc5f8a5c527e7bf6197117271913fbe8580b0666 tree f516b0800c9953f7f47774bb95464dde8076973f parent dc5f8a5c527e7bf6197117271913fbe8580b0666 author Jonas Fonseca 1234717805 +0100 committer Jonas Fonseca 1234717842 +0100 Fix bug in draw_space to not access memory outside the space buffer commit dc5f8a5c527e7bf6197117271913fbe8580b0666 3694a57a24597848687b409415d4f6bf28df0bd9 tree cf701e8e46c356982438fa8c6c95f2148900796e parent 3694a57a24597848687b409415d4f6bf28df0bd9 author Jonas Fonseca 1234715734 +0100 committer Jonas Fonseca 1234717459 +0100 Refactor draw_lineno to use draw_graphic commit 3694a57a24597848687b409415d4f6bf28df0bd9 93a489f3b538aa250ff00559500c57f2461cdbe3 tree 3f991ee166ded5894e516e4e3ec4be2e7d10f9a5 parent 93a489f3b538aa250ff00559500c57f2461cdbe3 author Jonas Fonseca 1234714943 +0100 committer Jonas Fonseca 1234717438 +0100 Fix horizontal scrolling ... to not be limited to the view width and to account for view->yoffset. commit 93a489f3b538aa250ff00559500c57f2461cdbe3 59f77488e57435243f935ad098823e7959d2729a tree 4bcb075e64fbc878bcdf53525598b5c295e19801 parent 59f77488e57435243f935ad098823e7959d2729a author Jonas Fonseca 1234715292 +0100 committer Jonas Fonseca 1234717437 +0100 Remove limitation of horizontal scrolling Tig now behaves similar to less in that the user can scroll without limit to the right. commit 59f77488e57435243f935ad098823e7959d2729a a01f7e62eddba5600531be250a854cbd4fdc8242 tree d3686e0a8cb1669e7a7fa28138bf58cdfecda7e1 parent a01f7e62eddba5600531be250a854cbd4fdc8242 author Jonas Fonseca 1234544916 +0100 committer Jonas Fonseca 1234545065 +0100 tigrc(5): suggest git aliases for external commands requiring shell ops commit a01f7e62eddba5600531be250a854cbd4fdc8242 ab798b42f8724161619360ac838dd138cbda1cad tree b2674fb2ed6a8b803001691d142e907faa4ca2b1 parent ab798b42f8724161619360ac838dd138cbda1cad author Jonas Fonseca 1234532500 +0100 committer Jonas Fonseca 1234532500 +0100 Fix the view clearing to only be effective for displayed views The feature was introduced in ec9aa4f62ae2977d598dda865e6a50b9fc799428. commit ab798b42f8724161619360ac838dd138cbda1cad b43e701fc529bbc22f7669a3029c9aa8c5cf2dcb tree 3966e4d52283a61b32dae74cb9652ffa974c41b7 parent b43e701fc529bbc22f7669a3029c9aa8c5cf2dcb author Jonas Fonseca 1234532280 +0100 committer Jonas Fonseca 1234532478 +0100 Make behavior of horizontal scrolling configurable Requested by bill lam. commit b43e701fc529bbc22f7669a3029c9aa8c5cf2dcb 7b507b4156865c87a78f9ae8b22267264b9f9083 tree e96ca55ae2052ec0952e04c7cf82d7fbb7df5f99 parent 7b507b4156865c87a78f9ae8b22267264b9f9083 author Sebastian Harl 1234530626 +0100 committer Jonas Fonseca 1234531976 +0100 Fix handling of quoted strings in the config file parse_string() adapts the string length to automatically remove quotation marks when copying the string. However, when calling string_ncopy_do() strlen(arg) used to be called again instead of using the adapted value. This e.g. led to wrong locale settings when using set commit-encoding = "UTF-8" and thus a slightly messed up display. Thanks to Gerfried Fuchs for reporting this. Signed-off-by: Sebastian Harl Signed-off-by: Jonas Fonseca commit 7b507b4156865c87a78f9ae8b22267264b9f9083 acf6a1a86df28192fb3201615968c26ae769145d tree 9225bae7fa4b6900ff362aabcfeff8bdf64cb4bb parent acf6a1a86df28192fb3201615968c26ae769145d author Jonas Fonseca 1234449078 +0100 committer Jonas Fonseca 1234449078 +0100 tigrc(5): fix error in examples for the set command Fixes Debian bug #514990 reported by Gerfried Fuchs. commit acf6a1a86df28192fb3201615968c26ae769145d e278600f599f60a2b98aeae6bfbb6ba92cf92d6f tree 416483f763293a1114da55088b6f2ead6e4d688f parent e278600f599f60a2b98aeae6bfbb6ba92cf92d6f author Jonas Fonseca 1234297900 +0100 committer Jonas Fonseca 1234297900 +0100 Tree view: draw submodule entry modes as "m---------" Inspired by gitweb. commit e278600f599f60a2b98aeae6bfbb6ba92cf92d6f 47a628bcf24d0e2ee14c977b639e75f161eba33a tree e92fe3e94e72b447328ea76187b65c49ce5e0833 parent 47a628bcf24d0e2ee14c977b639e75f161eba33a author Jonas Fonseca 1234263995 +0100 committer Jonas Fonseca 1234264035 +0100 Status view: report failures to update a file Also, wait showing update progress until 5% has been reached. commit 47a628bcf24d0e2ee14c977b639e75f161eba33a 46ef80d6e6650ae5d39dbd308ccf893cba20e57a tree 5b766070580b8cbbdfa3b2e921d4090004b2b89f parent 46ef80d6e6650ae5d39dbd308ccf893cba20e57a author Jonas Fonseca 1234263762 +0100 committer Jonas Fonseca 1234263762 +0100 Ignore broken pipe signals Can be caused if a forked git process exits with an error. Tig should detect this by checking the exit code of the child using the return value done_io(). commit 46ef80d6e6650ae5d39dbd308ccf893cba20e57a deefc9e2b8508d621aed566adfa833f4c402d3a0 tree cc7668c1659de0f6c8f2f3b17245081a1048d9c0 parent deefc9e2b8508d621aed566adfa833f4c402d3a0 author Jonas Fonseca 1234263059 +0100 committer Jonas Fonseca 1234263059 +0100 Use putenv instead of setenv Not all platforms (e.g. Solaris) provide setenv. Based on patch by SungHyun Nam. commit deefc9e2b8508d621aed566adfa833f4c402d3a0 a7fff549aa5df2d23903308252da625b079b944f tree 8e6301c4ae8f2e6e9626683c873b0cda6b4a51e7 parent a7fff549aa5df2d23903308252da625b079b944f author Carsten Brockmann 1234206263 +0000 committer Jonas Fonseca 1234215243 +0100 manual: Correct the keys to move the cursor one line up/down Signed-off-by: Carsten Brockmann Signed-off-by: Jonas Fonseca commit a7fff549aa5df2d23903308252da625b079b944f f19442c30c6cf04495461c65afc333c4452798e3 tree 18df286b491aafe08df8de5db363ab1765df9eff parent f19442c30c6cf04495461c65afc333c4452798e3 author Jonas Fonseca 1234148680 +0100 committer Jonas Fonseca 1234149575 +0100 Status view: upon failure to open a file show error message commit f19442c30c6cf04495461c65afc333c4452798e3 72d8aa701171e6cf7332d6f3c21b4d945c35254e tree 98c6f133a68fe30645cda5858fd45140801adbb7 parent 72d8aa701171e6cf7332d6f3c21b4d945c35254e author Jonas Fonseca 1234148553 +0100 committer Jonas Fonseca 1234148553 +0100 Refactor and share view maximization code from view-close handling commit 72d8aa701171e6cf7332d6f3c21b4d945c35254e f4953fa0c187ddc3b9dc5b7f61650112c3b3963a tree e2226a611434f9914b64d318afd5409b6c548e76 parent f4953fa0c187ddc3b9dc5b7f61650112c3b3963a author Jonas Fonseca 1234148508 +0100 committer Jonas Fonseca 1234148508 +0100 Fix io_strerror return type commit f4953fa0c187ddc3b9dc5b7f61650112c3b3963a b1fc02d40407a367f64c6bc3517e6e4b66ed0b51 tree 1d367bd0be2111fa950def5014daecd372c6cd53 parent b1fc02d40407a367f64c6bc3517e6e4b66ed0b51 author Jonas Fonseca 1234140940 +0100 committer Jonas Fonseca 1234141867 +0100 Add support for handling core.worktree If this option is found set up GIT_DIR and GIT_WORK_TREE. Also, pass the known git directory path to git ls-remote. Requested-by: bill lam commit b1fc02d40407a367f64c6bc3517e6e4b66ed0b51 b7aa1ca3ffa363caf0ed4966433da99032761b3c tree 1baad0dfd7a511bbb76b939e808cbe6ac03766d9 parent b7aa1ca3ffa363caf0ed4966433da99032761b3c author Jonas Fonseca 1234140881 +0100 committer Jonas Fonseca 1234140881 +0100 Optimize read_repo_config_option to reduce string comparisons commit b7aa1ca3ffa363caf0ed4966433da99032761b3c 39eb860f9efcd1dc5c8a376adffd84369dbf3b43 tree d1ce236822d3624e674f43b8f8f39bd0e10f74b5 parent 39eb860f9efcd1dc5c8a376adffd84369dbf3b43 author Jonas Fonseca 1234140572 +0100 committer Jonas Fonseca 1234140572 +0100 Move setting of remote branch from repo config to separate function commit 39eb860f9efcd1dc5c8a376adffd84369dbf3b43 546ba5d08c4cba61b32911d2833ee3aef201e7de tree e03f169d38e5bb5c6c9f2bd8d50310f5b5472dcc parent 546ba5d08c4cba61b32911d2833ee3aef201e7de author Jonas Fonseca 1234121831 +0100 committer Jonas Fonseca 1234121831 +0100 Mark enum_maps and other data tables as const commit 546ba5d08c4cba61b32911d2833ee3aef201e7de 085b5720c3e697a36fc3d0f168751f9a7b7a3fc7 tree 7110247c3eff9e84ea24c5e969fb3e7af58453ac parent 085b5720c3e697a36fc3d0f168751f9a7b7a3fc7 author Jonas Fonseca 1234121788 +0100 committer Jonas Fonseca 1234121788 +0100 Use check_blame_commit when handling REQ_ENTER commit 085b5720c3e697a36fc3d0f168751f9a7b7a3fc7 cfb6b75c4633e576675dd8eab84dc45831b3c8d7 tree 66bbdf7b1bdc1acc473c0dd12bfc206aaaad9815 parent cfb6b75c4633e576675dd8eab84dc45831b3c8d7 author Jonas Fonseca 1234121714 +0100 committer Jonas Fonseca 1234121714 +0100 NEWS: Mention Jeff's uninitialized variable bug fix From commit 2677b744313c939890a8f6b3316f9d5452581ab8. commit cfb6b75c4633e576675dd8eab84dc45831b3c8d7 b6d0d41e01e4e435385db260cf34fd5d9069d782 tree 24a3db6bdb96f6c91060507b5845cfe9fa95a993 parent b6d0d41e01e4e435385db260cf34fd5d9069d782 author Jeff King 1234090842 -0500 committer Jonas Fonseca 1234096221 +0100 Handle blaming beyond the creation of file more gracefully Currently when you ask to re-blame from the parent of a commit that created the file, blame_read_file will complain that it cannot get the file contents ("No blame exist"). At the time we try to read the file, it is too late to abort the operation, as we have already changed to the new blame view. However, we can detect this situation early by limiting the selection of the parent revision to the particular path of interest: if it returns a parent even with path-limiting, then we know the path exists; if not, then we know it doesn't. Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit b6d0d41e01e4e435385db260cf34fd5d9069d782 ba7c7d30bbed330fe7e9ceb4dc9c65a22dc8d6dc tree cd0070f2f0e37ab9dfb2ea41b1f49bc4d126a398 parent ba7c7d30bbed330fe7e9ceb4dc9c65a22dc8d6dc author Jonas Fonseca 1234020176 +0100 committer Jonas Fonseca 1234043143 +0100 Blame view: add guesstimation of line number when blaming parent commit ... by looking through the commit's diff for the hunk which introduced the line. Also, try to set the filename properly. commit ba7c7d30bbed330fe7e9ceb4dc9c65a22dc8d6dc 0288f58ca65024cad91f0fb71ba3063fb42e9f67 tree c3a23690682a288b67dc42c17c84d4d22c9a12e0 parent 0288f58ca65024cad91f0fb71ba3063fb42e9f67 author Jonas Fonseca 1234015078 +0100 committer Jonas Fonseca 1234038425 +0100 Use file and line number information when loading blame for commit This was developed in parallel and is very similar to patch posted by Jeff King, however, with different goals in mind. Message-Id: <20090207112613.GA18079@coredump.intra.peff.net> commit 0288f58ca65024cad91f0fb71ba3063fb42e9f67 e55a9880d76df4f35070aa06a45ddc05a9fd36be tree 8eba4dd6890ad8e736a55bbd93d1ed76126955f7 parent e55a9880d76df4f35070aa06a45ddc05a9fd36be author Jonas Fonseca 1234020147 +0100 committer Jonas Fonseca 1234038425 +0100 Make the blame view expand tabs at drawing time commit e55a9880d76df4f35070aa06a45ddc05a9fd36be 539db82f2e00f9e3dd3d718acbd631b44b79092b tree 5a9904d529fa4a48dcb8a08caa7da869aff6adcb parent 539db82f2e00f9e3dd3d718acbd631b44b79092b author Jonas Fonseca 1234038103 +0100 committer Jonas Fonseca 1234038411 +0100 Introduce common view position update helper So jumping to search results and line numbers will work more uniform. commit 539db82f2e00f9e3dd3d718acbd631b44b79092b 06d4108f0806a5ef028b7a88e55efb07baa86f65 tree 75d3bbca684c8189a5cd6fedce8656267839a04f parent 06d4108f0806a5ef028b7a88e55efb07baa86f65 author Jonas Fonseca 1234020354 +0100 committer Jonas Fonseca 1234038235 +0100 Improve restoring of the view position to bound the offset commit 06d4108f0806a5ef028b7a88e55efb07baa86f65 96c65b4936476eca46302ab6ef71d691eb313476 tree af81426da73b3957c8660afdaf2fbe57e2937e52 parent 96c65b4936476eca46302ab6ef71d691eb313476 author Jonas Fonseca 1234016457 +0100 committer Jonas Fonseca 1234038235 +0100 Jump to line when a number is entered in the prompt commit 96c65b4936476eca46302ab6ef71d691eb313476 2677b744313c939890a8f6b3316f9d5452581ab8 tree b563ab61e8ed94a80b19795a6f1e76194d6bdbe6 parent 2677b744313c939890a8f6b3316f9d5452581ab8 author Jonas Fonseca 1234016359 +0100 committer Jonas Fonseca 1234038235 +0100 Warn users about integers in ~/.tigrc being out of bound commit 2677b744313c939890a8f6b3316f9d5452581ab8 d270e1f14a7a4ce58f70f865730673359e5f3294 tree 996c756212ec12ccf40aa1da7a5d28829fadb08c parent d270e1f14a7a4ce58f70f865730673359e5f3294 author Jeff King 1234003043 -0500 committer Jonas Fonseca 1234016632 +0100 Fix uninitialized variable in string_expand_length This led to totally unpredictable results from the function. The style matches the loop in string_expand. Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit d270e1f14a7a4ce58f70f865730673359e5f3294 d06137edac36fa9f977b5df38b267bb9de28a374 tree f5c2231abc3bb194c3e20410c1f8b070af3220e9 parent d06137edac36fa9f977b5df38b267bb9de28a374 author Witold Filipczyk 1233965795 +0100 committer Jonas Fonseca 1233966624 +0100 Add support for 256 colors by allowing "colorN" names similar to Mutt Signed-off-by: Jonas Fonseca commit d06137edac36fa9f977b5df38b267bb9de28a374 19115b2d561f7d113e702906f596e38f8317bd27 tree 011a79650b30bd49a43e7d166a4856d5ddb01318 parent 19115b2d561f7d113e702906f596e38f8317bd27 author Jonas Fonseca 1233839386 +0100 committer Jonas Fonseca 1233867588 +0100 Improve on branch information in the status view The file checks was inspired by the prompt code from the git bash completion script. commit 19115b2d561f7d113e702906f596e38f8317bd27 60c440586f21704fcfec49d5c4dcfb8b840c737f tree 9de753db6dd47a8d5abe9259e0c6f10ebcd63619 parent 60c440586f21704fcfec49d5c4dcfb8b840c737f author Jonas Fonseca 1233855527 +0100 committer Jonas Fonseca 1233867410 +0100 Simplify setting the default for the system configuration file commit 60c440586f21704fcfec49d5c4dcfb8b840c737f 5ae38fbf811596ae3a20fe6cfed17d8b88af8d3a tree 1aa546b8c40974aaa3e5fb1ec5ecff496265dd4f parent 5ae38fbf811596ae3a20fe6cfed17d8b88af8d3a author Jonas Fonseca 1233763804 +0100 committer Jonas Fonseca 1233867410 +0100 Refactor and unify timezone parsing commit 5ae38fbf811596ae3a20fe6cfed17d8b88af8d3a dafe22262f36ba3ba32a22fd9741672345b89877 tree 87c775b30b94b9a88d292d460d523d7e2637c947 parent dafe22262f36ba3ba32a22fd9741672345b89877 author Jonas Fonseca 1233755995 +0100 committer Jonas Fonseca 1233867410 +0100 Remove the need for the OPEN_NOMAXIMIZE flag It was only used for the status view together with the OPEN_RELOAD flag. However, since reloading and refreshing is the same for the status use OPEN_REFRESH instead. commit dafe22262f36ba3ba32a22fd9741672345b89877 1923cae0393e246f7a580f9e10b677040ce4c3d0 tree 6efb738925ffbcfed056f80060ef5526ea2adce1 parent 1923cae0393e246f7a580f9e10b677040ce4c3d0 author Jonas Fonseca 1233754544 +0100 committer Jonas Fonseca 1233867410 +0100 Remove unused OPEN_BACKGROUNDED flag commit 1923cae0393e246f7a580f9e10b677040ce4c3d0 5907672f44532dc707de0f5a2c0347c18e9b2543 tree 9f9ec964f03813cceeb8f5bb6f4ad1c34cb6cc56 parent 5907672f44532dc707de0f5a2c0347c18e9b2543 author Jonas Fonseca 1233753929 +0100 committer Jonas Fonseca 1233867410 +0100 Use enum_map for handling obsolete color names commit 5907672f44532dc707de0f5a2c0347c18e9b2543 f50084da14b734f771c908cb2b4428502b33dbd9 tree 84d43236832b150ad02c23117a475ba254bd4fbc parent f50084da14b734f771c908cb2b4428502b33dbd9 author Jonas Fonseca 1233753906 +0100 committer Jonas Fonseca 1233867410 +0100 Use enum_map for handling obsolete request names commit f50084da14b734f771c908cb2b4428502b33dbd9 87e44317369ecb435426d9b835f97ad1a410def2 tree b26495ca95afa9a67d0e37aa8c0cb5bfc9e73236 parent 87e44317369ecb435426d9b835f97ad1a410def2 author Jonas Fonseca 1233753790 +0100 committer Jonas Fonseca 1233867409 +0100 Refactor the int_map interface into new enum_map interface Renames int_map to enum_map and set_from_int_map to map_enum, which now uses string_enum_compare instead of strncasecmp. commit 87e44317369ecb435426d9b835f97ad1a410def2 8520298ff3c67b5a857e895dcaff75520bd0df67 tree 1dc269f4fde01bca7945d8b70e972c21bc618377 parent 8520298ff3c67b5a857e895dcaff75520bd0df67 author Jonas Fonseca 1233736189 +0100 committer Jonas Fonseca 1233867409 +0100 Cleanup and simplify option file parsing commit 996697af991069f83feed9e262d70ceb8938151d 3de2c371864c567b8dc70f036d4571ae065a009d tree 5ffd542146558a58db2c4d3f84143ad72ac9f572 parent 3de2c371864c567b8dc70f036d4571ae065a009d author Jonas Fonseca 1233865250 +0100 committer Jonas Fonseca 1233865250 +0100 Update for version tig-0.14 commit 3de2c371864c567b8dc70f036d4571ae065a009d 75bee33a2bf20fa20e4d0aeca97ff8bf34bd6486 8520298ff3c67b5a857e895dcaff75520bd0df67 tree 872cb7270dd62e55a4436cde234836a126ad0e5d parent 75bee33a2bf20fa20e4d0aeca97ff8bf34bd6486 parent 8520298ff3c67b5a857e895dcaff75520bd0df67 author Jonas Fonseca 1233865238 +0100 committer Jonas Fonseca 1233865238 +0100 Merge branch 'master' into release commit 8520298ff3c67b5a857e895dcaff75520bd0df67 51c22f5501881cb1753baa82d2d1d4e02a77769f tree c23a00d73a86db14fc2a7a88ef27c172231a028f parent 51c22f5501881cb1753baa82d2d1d4e02a77769f author Jonas Fonseca 1233865234 +0100 committer Jonas Fonseca 1233865234 +0100 tig-0.14 commit 51c22f5501881cb1753baa82d2d1d4e02a77769f 6095c8b9221888c90081a5af2383f9987ab84a8e tree 70ead59afd14844623ba33578c0525bd1487a72a parent 6095c8b9221888c90081a5af2383f9987ab84a8e author Jonas Fonseca 1233834468 +0100 committer Jonas Fonseca 1233856653 +0100 Read tigrc(5) options from git configuration files commit 6095c8b9221888c90081a5af2383f9987ab84a8e 64cf5ff6ebceb9713826aeedecc2a44e88f88835 tree 01773b5a6b26648c3886dfdbcae312adb643dd2b parent 64cf5ff6ebceb9713826aeedecc2a44e88f88835 author Jonas Fonseca 1233834204 +0100 committer Jonas Fonseca 1233834528 +0100 tig(1): correct info on tree view related environment variables Was not updated during the introduction of %(directory) and move to the IO API. commit 64cf5ff6ebceb9713826aeedecc2a44e88f88835 16bda3aa4443fe29a3310bc682cfe9aad9ae54b5 tree 82ccc0e9b3e80a87ee3229867c63db26e7544ce8 parent 16bda3aa4443fe29a3310bc682cfe9aad9ae54b5 author Jonas Fonseca 1233769272 +0100 committer Jonas Fonseca 1233825079 +0100 Add release script documenting the release procedure commit 16bda3aa4443fe29a3310bc682cfe9aad9ae54b5 7809b830db99dbed8b0669bac221411ecad964ed tree fe15d321239bf04acb4feef63284454a9c49c76c parent 7809b830db99dbed8b0669bac221411ecad964ed author Jonas Fonseca 1233786031 +0100 committer Jonas Fonseca 1233825062 +0100 Spell check all text files and add dictionary to speed it up commit 7809b830db99dbed8b0669bac221411ecad964ed c4c786e28359f3d303f93e03ae9a4a8b27fa4b23 tree bc42a720c45d4d47b0cbe09b55592f8498508495 parent c4c786e28359f3d303f93e03ae9a4a8b27fa4b23 author Jonas Fonseca 1233742284 +0100 committer Jonas Fonseca 1233822906 +0100 tigrc(5): document the tree view colors Also renames the tree-parent line to tree-head. commit c4c786e28359f3d303f93e03ae9a4a8b27fa4b23 20742203a379f3d8453036627a7263a5693bb77f tree 8bcc8dd46e6e3d717aad1c493f6d71ea9e473a36 parent 20742203a379f3d8453036627a7263a5693bb77f author Jonas Fonseca 1233769215 +0100 committer Jonas Fonseca 1233822857 +0100 Refactor file mode drawing; rename tree-mode color to mode commit 20742203a379f3d8453036627a7263a5693bb77f 6df2d1501880b7d07ade215c60fe0369ace4bf83 tree 041920bfcb514440a80ee62687fe539426b0d4a3 parent 6df2d1501880b7d07ade215c60fe0369ace4bf83 author Jonas Fonseca 1233749352 +0100 committer Jonas Fonseca 1233822656 +0100 Replace usage of the main-author color with the author color It is used in draw_author() which is used by the main, blame and tree views. commit 6df2d1501880b7d07ade215c60fe0369ace4bf83 b63b625096f59fc0bf9ea75ddf31380110790034 tree 7180fbeb0c7be8ac1e3b3d1b8e026c3bed412821 parent b63b625096f59fc0bf9ea75ddf31380110790034 author Jonas Fonseca 1233755963 +0100 committer Jonas Fonseca 1233822656 +0100 Move usage string near parse_options commit b63b625096f59fc0bf9ea75ddf31380110790034 243829bbe83d3cbd5c6c4d6588d1271af8351ef1 tree 0a4289f90460d23741f7a83014f29d97dbda528b parent 243829bbe83d3cbd5c6c4d6588d1271af8351ef1 author Jonas Fonseca 1233696884 +0100 committer Jonas Fonseca 1233696884 +0100 Tree view: improve handling of empty trees commit 243829bbe83d3cbd5c6c4d6588d1271af8351ef1 7440d5cfec2351e88bad82d90d470c79e689dbae tree a55b066c829aacf496f6e913372a473e18055242 parent 7440d5cfec2351e88bad82d90d470c79e689dbae author Jonas Fonseca 1233672367 +0100 committer Jonas Fonseca 1233674515 +0100 Fix reverting of unmerged status entries ... by using update-index --cacheinfo. commit 7440d5cfec2351e88bad82d90d470c79e689dbae c147a4d920aa68dd292b7d7d78a4b341910851e2 tree 0c8f63754363089d387d448c47ffe756689149bb parent c147a4d920aa68dd292b7d7d78a4b341910851e2 author Jonas Fonseca 1233617683 +0100 committer Jonas Fonseca 1233671702 +0100 Add support for horizontal scrolling It is still basically a big hack, and might need some tuning. commit c147a4d920aa68dd292b7d7d78a4b341910851e2 0b2667708c086c0b302d03f4143c6bd31c6144af tree d94d0c91db377ad549554ef1ae686ad6ddaa322c parent 0b2667708c086c0b302d03f4143c6bd31c6144af author Jonas Fonseca 1233661852 +0100 committer Jonas Fonseca 1233671698 +0100 Expand tabs in displayed lines to not rely on ncurses to expand them commit 0b2667708c086c0b302d03f4143c6bd31c6144af 43ef4ce9f457a1a7d7239122f5a43f836074d467 tree 713c9724dad315bbd4e2f2a43f0c1c650d858d8a parent 43ef4ce9f457a1a7d7239122f5a43f836074d467 author Jeff King 1233640148 -0500 committer Jonas Fonseca 1233671250 +0100 Treat empty '/' as "find next" When the user requests a forward or backwards search, if they provide no search string then we just abort the search. However, many other programs (such as less and vi) treat this as "repeat the last search", so users may have their fingers trained to do this rather than use the explicit "find next" feature. This patch causes tig, if there was a previous search, to find the next (or previous, if "?" was used) match in such a case. Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit 43ef4ce9f457a1a7d7239122f5a43f836074d467 4cd776bfe171e0c9ffb20646715775e44e7326a7 tree dedec932fcc51d4e884c7ce93643bf1fb4a19206 parent 4cd776bfe171e0c9ffb20646715775e44e7326a7 author Jonas Fonseca 1233657236 +0100 committer Jonas Fonseca 1233671249 +0100 TODO: elaborate and regroup into 'before tig-1.0' and 'long term goals' commit 4cd776bfe171e0c9ffb20646715775e44e7326a7 723516ac5a75f3a025c079e15ed7905caa32440a tree dca31cd58f4e4d7846ff15c1c826a729e49aafab parent 723516ac5a75f3a025c079e15ed7905caa32440a author Jonas Fonseca 1232286426 +0100 committer Jonas Fonseca 1233671245 +0100 Move initial view setup into parse_options commit 723516ac5a75f3a025c079e15ed7905caa32440a f265ccd4eed21a0352df0b3366c4eb3128e7970c tree 973d5a76a8c629d7693011d9eecb2c6c69eca4f6 parent f265ccd4eed21a0352df0b3366c4eb3128e7970c author Jonas Fonseca 1232284457 +0100 committer Jonas Fonseca 1233671245 +0100 Move parse_option so it has access to view definitions commit f265ccd4eed21a0352df0b3366c4eb3128e7970c 37b8cf4848889adb48c16a0f1c90ea068cbe211a tree 77150a95f7600001dd4219fa972f028c49adf9b8 parent 37b8cf4848889adb48c16a0f1c90ea068cbe211a author Jonas Fonseca 1233305036 +0100 committer Jonas Fonseca 1233671244 +0100 Remove parsing of deprecated option -S and subcommands log and diff commit 37b8cf4848889adb48c16a0f1c90ea068cbe211a 40ebe02ada92c981f9cbd43bd2fad41185ca5834 tree da0a43ebd7b14faaa3369cb7fb552536cbeb327d parent 40ebe02ada92c981f9cbd43bd2fad41185ca5834 author Jonas Fonseca 1233669707 +0100 committer Jonas Fonseca 1233671244 +0100 Rename & move read_properties and git_properties They should be part of the IO API and are now called io_load and run_io_load. commit 40ebe02ada92c981f9cbd43bd2fad41185ca5834 b445baeb8e9c67d1d3cf943e350cbd4fd0cbd174 tree a898a0a0ed052840f5814a34b6731de97143a238 parent b445baeb8e9c67d1d3cf943e350cbd4fd0cbd174 author Jonas Fonseca 1233668824 +0100 committer Jonas Fonseca 1233671244 +0100 Use warn() for warnings emitted during config file loading commit b445baeb8e9c67d1d3cf943e350cbd4fd0cbd174 216b5a3395f265669e8424d0d836bb391925f5f3 tree 131c0cba611429e60234bb243e7c6845b583d80c parent 216b5a3395f265669e8424d0d836bb391925f5f3 author Jonas Fonseca 1233584292 +0100 committer Jonas Fonseca 1233584292 +0100 Fix scrolling bugs in gnome-terminal and (u)xterm Introduces workarounds to fix glitches appearing after the recent screen drawing optimizations. commit 216b5a3395f265669e8424d0d836bb391925f5f3 eb4bb8906cf89c541dd754879e5742931c979689 tree 0c54e5349755f943b30637838d5ec16a1083bdb9 parent eb4bb8906cf89c541dd754879e5742931c979689 author Jonas Fonseca 1233563091 +0100 committer Jonas Fonseca 1233563776 +0100 BUGS: document problem with scrolling in (u)xterm commit eb4bb8906cf89c541dd754879e5742931c979689 0c87f332c429907f0ba996445016a197aab9ef59 tree 01759f67f49d1249598e7751e1bf100f46369534 parent 0c87f332c429907f0ba996445016a197aab9ef59 author Jonas Fonseca 1233392790 +0100 committer Jonas Fonseca 1233563700 +0100 Tune the view clearing to wait until 2 seconds has passed The code introduced in ec9aa4f62ae2977d598dda865e6a50b9fc799428 broke the smoothness of updates in some cases. commit 0c87f332c429907f0ba996445016a197aab9ef59 5b4c4497047d65f8142802ce7e816285ccc066af tree 16363727597b1697374379a820b9aacb3911424f parent 5b4c4497047d65f8142802ce7e816285ccc066af author Jonas Fonseca 1233398461 +0100 committer Jonas Fonseca 1233563304 +0100 Handle all cursor positioning in get_input Also fixes use of the C++ true keyword which crept in in commit babaa6f7a97cbe3948588e5181de0801ce32b792 (Refactor user input handling into separate function). commit 5b4c4497047d65f8142802ce7e816285ccc066af 73771ecdbc1472b5506c90b4cb30fe464fd88403 tree 536deb35a535f3aad17be7e158b7276ff2b4405f parent 73771ecdbc1472b5506c90b4cb30fe464fd88403 author Jonas Fonseca 1233392464 +0100 committer Jonas Fonseca 1233563300 +0100 Optimize drawing by updating the screen in one go Switch to use wnoutrefresh everywhere and call doupdate in the get_input loop. This allows multiple updates to be made while only one burst of IO occurs. commit 73771ecdbc1472b5506c90b4cb30fe464fd88403 d52d839f5016f52dd09a3a309697b2696a28de5f tree 7bd5c1d3fe06a5cf8ee061049e4e3f82278baa71 parent d52d839f5016f52dd09a3a309697b2696a28de5f author Jonas Fonseca 1233359365 +0100 committer Jonas Fonseca 1233562678 +0100 Abbreviate author names to initials when author-width < 6 commit d52d839f5016f52dd09a3a309697b2696a28de5f a68b271e11a0c4dae6ac881bae758c81d9c183b6 tree 932d724b48c45bf0466c53d7f31f06face8a40b5 parent a68b271e11a0c4dae6ac881bae758c81d9c183b6 author Jonas Fonseca 1233352007 +0100 committer Jonas Fonseca 1233562678 +0100 Refactor author drawing into draw_author commit a68b271e11a0c4dae6ac881bae758c81d9c183b6 6fb8d7e3013e200918425675ebb387830daab34b tree 8ed2bcd0a6f27ea203593ee5595ba6ae34e40b7a parent 6fb8d7e3013e200918425675ebb387830daab34b author Jonas Fonseca 1233562126 +0100 committer Jonas Fonseca 1233562449 +0100 Fix tokenizing when parsing ~/.tigrc When moving to use argv_from_string() in set_option() a regression was introduced causing problems with parsing of multiple spaces between arguments. For example: color date yellow default Reported by Clifford Caoile. commit 6fb8d7e3013e200918425675ebb387830daab34b 560be3762c6948fb1cf1a9bbdb45d74b80fab218 tree 272c013c7b0bc6695755ae4ff1bb567077310f06 parent 560be3762c6948fb1cf1a9bbdb45d74b80fab218 author Jonas Fonseca 1233303864 +0100 committer Jonas Fonseca 1233303961 +0100 Workaround bug exposed by the redrawwin removal in do_scroll_view The bug means that the message from scrolling up one line when impossible followed by scrolling down one line is not removed by the next action. Workaround this by inserting an extra call to report("") before the call to wrefresh(). commit 560be3762c6948fb1cf1a9bbdb45d74b80fab218 3a69e0d8f0613cae37a9d97ab6994cb89fc853ae tree 4d75825985331a22597958015f73c110190b8bc6 parent 3a69e0d8f0613cae37a9d97ab6994cb89fc853ae author Jonas Fonseca 1233303146 +0100 committer Jonas Fonseca 1233303481 +0100 Make cursor updating when resizing the display and loading a view commit 3a69e0d8f0613cae37a9d97ab6994cb89fc853ae c571930de4e0991269d8f409bc42b93102de0eb0 tree 2f978288cc4c7edf3a380754e57d0a80a4fdc705 parent c571930de4e0991269d8f409bc42b93102de0eb0 author Jonas Fonseca 1233302591 +0100 committer Jonas Fonseca 1233303019 +0100 Change scrollok strategy to leave it off unless when calling wscrl Should lead to fewer calls. commit c571930de4e0991269d8f409bc42b93102de0eb0 792d0e0931fb8785135a6b5d250a570a597c7324 tree b85bf51ac9e66f599fd6dffa08855c389f615cbc parent 792d0e0931fb8785135a6b5d250a570a597c7324 author Jonas Fonseca 1233302059 +0100 committer Jonas Fonseca 1233302059 +0100 Initialize status_empty flag to FALSE Fixes cursor restoring when loading the status view at startup. commit 792d0e0931fb8785135a6b5d250a570a597c7324 9201e61aa1c4dcbcd9b65d0d7b113e442348c654 tree 07777d4cb697987ebf3ff6b4dfd9f96409026e2f parent 9201e61aa1c4dcbcd9b65d0d7b113e442348c654 author Jonas Fonseca 1233180610 +0100 committer Jonas Fonseca 1233180828 +0100 Eliminate unneeded calls to redrawwin This optimize the view drawing especially when scrolling/moving down the main view with the diff view open. Should make browsing more bareable over slow links. commit 9201e61aa1c4dcbcd9b65d0d7b113e442348c654 ac8d7a33ac5e2c0b3ed4aca0f4cbdab9dc53f668 tree 6826dd54e614bea0e9df6539e04630f658dfb392 parent ac8d7a33ac5e2c0b3ed4aca0f4cbdab9dc53f668 author Jonas Fonseca 1233180645 +0100 committer Jonas Fonseca 1233180826 +0100 TODO: a small commit cache should be employed at some point commit ac8d7a33ac5e2c0b3ed4aca0f4cbdab9dc53f668 7e82d90ea94f5ab62679ae54fdd783ce65e82bd1 tree 3cb22d67dd6eda897a7ab852167c09b7cfe8f090 parent 7e82d90ea94f5ab62679ae54fdd783ce65e82bd1 author Jonas Fonseca 1233167417 +0100 committer Jonas Fonseca 1233167835 +0100 Help view: show the action name similar as in Mutt's help view commit 7e82d90ea94f5ab62679ae54fdd783ce65e82bd1 312eb346a800ae543495690252df04944168d652 tree 4bf169830ef5489b3dafbfc8d299f86219189009 parent 312eb346a800ae543495690252df04944168d652 author Jonas Fonseca 1233167283 +0100 committer Jonas Fonseca 1233167283 +0100 Remove preallocation of view lines in help_open commit 312eb346a800ae543495690252df04944168d652 d426d85854e0d3a12b0af51ba487d7aaeada811a tree d78c090d1c1978a10c483dde36465de96584a9ce parent d426d85854e0d3a12b0af51ba487d7aaeada811a author Stefan Naewe 1233157471 +0100 committer Jonas Fonseca 1233167094 +0100 corrected doubly used ID view-manipulation in manual.txt Signed-off-by: Stefan Naewe Signed-off-by: Jonas Fonseca commit d426d85854e0d3a12b0af51ba487d7aaeada811a a2cebdb88437086d5083c893e472275e1cdf1957 tree 778cebad3a8309b2243350a4c294e614f34b29ff parent a2cebdb88437086d5083c893e472275e1cdf1957 author Jonas Fonseca 1232797898 +0100 committer Jonas Fonseca 1233098257 +0100 tigrc(5) & manual: move view specific actions out of the misc group commit a2cebdb88437086d5083c893e472275e1cdf1957 4bb953632068eb9e74bdad79be1e0cb9f75dbb09 tree 048515be9ee0a0491d7e8832680df91a7fd29f4b parent 4bb953632068eb9e74bdad79be1e0cb9f75dbb09 author Jonas Fonseca 1232055718 +0100 committer Jonas Fonseca 1233098157 +0100 Add support for loading blame for parent commits Requested by Jeff King in <20080410040213.GA29618@sigill.intra.peff.net> commit 4bb953632068eb9e74bdad79be1e0cb9f75dbb09 4ee3cffeabfc640a30a625b6de9b05c3b21a2cba tree 4e09c910554497e4be02b57f396045215ba4fe94 parent 4ee3cffeabfc640a30a625b6de9b05c3b21a2cba author Jonas Fonseca 1232112433 +0100 committer Jonas Fonseca 1233097747 +0100 Refactor prompting for user input commit 4ee3cffeabfc640a30a625b6de9b05c3b21a2cba c60dd8b28ddeae471f5a534edc066469b23dbcb5 tree 827d04d07c65b607ba0a33710060ea17c620f693 parent c60dd8b28ddeae471f5a534edc066469b23dbcb5 author Jonas Fonseca 1232796963 +0100 committer Jonas Fonseca 1233097432 +0100 Rename tree-parent action to parent commit c60dd8b28ddeae471f5a534edc066469b23dbcb5 62d8632339e0116f2fee53b39fe926dee9ae2ac1 tree 7427e3d3d539fa803fdabf4fa192f3e03401ad83 parent 62d8632339e0116f2fee53b39fe926dee9ae2ac1 author Jonas Fonseca 1233060672 +0100 committer Jonas Fonseca 1233070399 +0100 Minor cleanup of the tree view code; fix enter on the first line commit 62d8632339e0116f2fee53b39fe926dee9ae2ac1 c10765ff6134c67eb8c112f961d7eba4a0bc998e tree 4607e3af8cf3ba796e688afea7a00c704d323199 parent c10765ff6134c67eb8c112f961d7eba4a0bc998e author Jonas Fonseca 1233060680 +0100 committer Jonas Fonseca 1233070398 +0100 TODO: remove resolved item commit c10765ff6134c67eb8c112f961d7eba4a0bc998e e90f88c2205b828474de8343eb34344fdbd76fee tree f5cb8ae8fd3d1dade01949d7ac2641271dbd74d6 parent e90f88c2205b828474de8343eb34344fdbd76fee author Jonas Fonseca 1232970700 +0100 committer Jonas Fonseca 1233051505 +0100 Tree view: improve to look less like plumbing It is now more like `ls` by annotating the output of ls-tree with commit information. commit e90f88c2205b828474de8343eb34344fdbd76fee b14899fea3de8ac925678afd1abb20cad74a6aab tree 6ea43a87f593c2c88538b1263860085c5b813afb parent b14899fea3de8ac925678afd1abb20cad74a6aab author Jonas Fonseca 1233051464 +0100 committer Jonas Fonseca 1233051505 +0100 Refactor main_read to create parse_author_line commit b14899fea3de8ac925678afd1abb20cad74a6aab fa6db1b4558800ecdeb1554943b7ccb701cafa4d tree 9a9c2cec0fd2011c84fea766d9600541ea48c48b parent fa6db1b4558800ecdeb1554943b7ccb701cafa4d author Jonas Fonseca 1232970776 +0100 committer Jonas Fonseca 1232970831 +0100 update_view: remove an unneeded goto commit fa6db1b4558800ecdeb1554943b7ccb701cafa4d 0879fa98ad7fe921274fb3bdf91b59e4ba60ef56 tree cc59e2f055021e260506765e6497bd778c929da2 parent 0879fa98ad7fe921274fb3bdf91b59e4ba60ef56 author Jonas Fonseca 1232799844 +0100 committer Jonas Fonseca 1232799892 +0100 Fix floating point bug in the blame reporting commit 0879fa98ad7fe921274fb3bdf91b59e4ba60ef56 a443231efc41d9afe57ef190c63e3fd64abf09f8 tree f395bac088f81b9cb65e079029ac4e8733e26769 parent a443231efc41d9afe57ef190c63e3fd64abf09f8 author Jonas Fonseca 1232799760 +0100 committer Jonas Fonseca 1232799891 +0100 Also call end_update for views with custom open function Broken by 49dc4030694e22b7f141bfb13565783985c48b77 commit a443231efc41d9afe57ef190c63e3fd64abf09f8 9cc9fe34f17f62b46b4b3641d46932e5f113613b tree b65b66a7c074d7c55c7d0e35cf161f4154fd2676 parent 9cc9fe34f17f62b46b4b3641d46932e5f113613b author Jonas Fonseca 1232799723 +0100 committer Jonas Fonseca 1232799891 +0100 Add -O0 to the debug flags commit 9cc9fe34f17f62b46b4b3641d46932e5f113613b 1e85102418892f10ca567ff40f5e20e6a5e97f76 tree 6476a29cd8546ada5c56a6f959914258048f2317 parent 1e85102418892f10ca567ff40f5e20e6a5e97f76 author Jonas Fonseca 1232798372 +0100 committer Jonas Fonseca 1232798452 +0100 Rectify arg indexes changes in blame --no-color fix Introduced in 78685441f4effd81082a53abb4c1246ebd1e0e49 commit 1e85102418892f10ca567ff40f5e20e6a5e97f76 c521e13444cd2b09347da20bd7ee2b9facff2133 tree 8ec5f6b90095194876fa0ad07e2fbb85bf716e0f parent c521e13444cd2b09347da20bd7ee2b9facff2133 author Jonas Fonseca 1232797945 +0100 committer Jonas Fonseca 1232798254 +0100 Fix status loading of unmerged entries to avoid access to freed memory commit c521e13444cd2b09347da20bd7ee2b9facff2133 6791c11c3bef57c9018a8e9bb36ce2ef7b0377fe tree 27b1564fd6a9b73debe199915c4b8434e7240b2d parent 6791c11c3bef57c9018a8e9bb36ce2ef7b0377fe author Jonas Fonseca 1232730745 +0100 committer Jonas Fonseca 1232730745 +0100 Fix kill_io() to only call kill(2) when pid is non-zero commit 6791c11c3bef57c9018a8e9bb36ce2ef7b0377fe 78685441f4effd81082a53abb4c1246ebd1e0e49 tree 18aff61c0ae21492603865282989a25830082172 parent 78685441f4effd81082a53abb4c1246ebd1e0e49 author Jonas Fonseca 1232710628 +0100 committer Jonas Fonseca 1232710628 +0100 Blame view: fix reloading of the diff view for changes not yet committed The regression was introduced in e00ea5d (Blame: do to not reload the diff view for same commits). commit 78685441f4effd81082a53abb4c1246ebd1e0e49 63bf87394e78e2fb1debb7f5aaf8a8faa203a722 tree a7b28f9d66b4126024c5077312844e4a615f555d parent 63bf87394e78e2fb1debb7f5aaf8a8faa203a722 author Jonas Fonseca 1232709809 +0100 committer Jonas Fonseca 1232709809 +0100 Oops, always specify --no-color when using git diff commit 63bf87394e78e2fb1debb7f5aaf8a8faa203a722 d9f2ad15bc118a98d9db52a51fb43f91ab9b42eb tree 81da5fc1b7f8a6fcdac5d7819f64f67956d5da71 parent d9f2ad15bc118a98d9db52a51fb43f91ab9b42eb author Jonas Fonseca 1232709061 +0100 committer Jonas Fonseca 1232709290 +0100 Blame view: fix diffing of lines marked as not yet committed commit d9f2ad15bc118a98d9db52a51fb43f91ab9b42eb 8b27c17815d2fc623f59055422323c953aedac74 tree 005799c567ec07a5061ac1f63feb77bb8b37f0f6 parent 8b27c17815d2fc623f59055422323c953aedac74 author Jonas Fonseca 1224838611 +0200 committer Jonas Fonseca 1232709284 +0100 Add support for restoring the view position in reloadable views The status view still uses its own more specialized restoring code. There are still some cases which are not completely handled. For example, restoring will only be done when the current line is the first in the view, thus changing the view position will cancel the restoring. However, if you change back to the first line restoring will be enabled. commit 8b27c17815d2fc623f59055422323c953aedac74 499019c495095ecf265becbc1361548a676dc2ae tree afc241abffab07c5b02c68590807c13573f78175 parent 499019c495095ecf265becbc1361548a676dc2ae author Jonas Fonseca 1232640045 +0100 committer Jonas Fonseca 1232640373 +0100 Fix status_exists to be consistent with data displayed in the stage view commit 499019c495095ecf265becbc1361548a676dc2ae b5c0483d22cac69ea5b0891bf2cb31706b6b45ef tree 0bd5c6eea9b3bdb365125a376398c53c35bbaa81 parent b5c0483d22cac69ea5b0891bf2cb31706b6b45ef author Jonas Fonseca 1232639940 +0100 committer Jonas Fonseca 1232639940 +0100 Make it possible to call select_view_line for non-displayed views commit b5c0483d22cac69ea5b0891bf2cb31706b6b45ef babaa6f7a97cbe3948588e5181de0801ce32b792 tree 869bf363298b3af04a7bf3d1b6a66d380f0017dd parent babaa6f7a97cbe3948588e5181de0801ce32b792 author Jonas Fonseca 1232243927 +0100 committer Jonas Fonseca 1232619079 +0100 Refactor find_next_line into select_view_line commit babaa6f7a97cbe3948588e5181de0801ce32b792 85ecdc6d8494982efc01b90e7544bbc5eb9ff14d tree 599b3d6d2576dacc7909b4feb6abf4eb9ae7195d parent 85ecdc6d8494982efc01b90e7544bbc5eb9ff14d author Jonas Fonseca 1232197500 +0100 committer Jonas Fonseca 1232576474 +0100 Refactor user input handling into separate function Fixes resizing while the prompt is open. commit 85ecdc6d8494982efc01b90e7544bbc5eb9ff14d 52e3a2e59c7c721c440c0a5eeecbb9392393bda8 tree 1952627fb191dbecccb5a56e42e32281546b4b46 parent 52e3a2e59c7c721c440c0a5eeecbb9392393bda8 author Jonas Fonseca 1232183321 +0100 committer Jonas Fonseca 1232576466 +0100 Add support for opening any blob in an editor commit 52e3a2e59c7c721c440c0a5eeecbb9392393bda8 aef019ed5b5e83900a1094437de320341644165f tree 1fc35e1d816e7b4f0bd01e82c5975d9a9601dca5 parent aef019ed5b5e83900a1094437de320341644165f author Jonas Fonseca 1232376600 +0100 committer Jonas Fonseca 1232576117 +0100 Prefer werase to wclear when possible to reduce flickering Use werase instead of wclear in redraw_view and optionally make redraw_display use wclear before calling redraw_view. After this, wclear is only used when there is possibility that the screen could have been corrupted. commit aef019ed5b5e83900a1094437de320341644165f 2478dc95f56c67eb3aad3cfd117b4a85d7e071c1 tree dfcafce615aa9d8cea7da611e867ff61c022da72 parent 2478dc95f56c67eb3aad3cfd117b4a85d7e071c1 author Jonas Fonseca 1232378999 +0100 committer Jonas Fonseca 1232576117 +0100 Cleanup and improve option toggling actions to include help message commit 2478dc95f56c67eb3aad3cfd117b4a85d7e071c1 49dc4030694e22b7f141bfb13565783985c48b77 tree 3133e38422e7f68e63cdec4fd924b03196a8f4a9 parent 49dc4030694e22b7f141bfb13565783985c48b77 author Jonas Fonseca 1232576057 +0100 committer Jonas Fonseca 1232576117 +0100 Fix stage reloading to not close when staging chunks from group diff commit 49dc4030694e22b7f141bfb13565783985c48b77 beaef001087cc2238e9e8d5a80250f1151a4c993 tree 15b88785a142d3490fbc95cdbc4320345c60f68d parent beaef001087cc2238e9e8d5a80250f1151a4c993 author Jonas Fonseca 1232551635 +0100 committer Jonas Fonseca 1232575767 +0100 Do not terminate the update when switching back to a loading view Move call to end_update() to begin_update() so checks for view content is honored in the case where no reloading is necessary. commit beaef001087cc2238e9e8d5a80250f1151a4c993 00a26e247b9b0337c48ad0cfc488753644d68d43 tree 4f9286066d6f53360f70f8adc7751475c04c4649 parent 00a26e247b9b0337c48ad0cfc488753644d68d43 author Jonas Fonseca 1232401584 +0100 committer Jonas Fonseca 1232575630 +0100 Fix regression of main view drawing Hopefully last fix for dirty flag regressions. commit 00a26e247b9b0337c48ad0cfc488753644d68d43 495fd0788ecb4aeda6ee3b47fbfc000f70368948 tree 93363d37f665f6f5af4d67ec39fec9be1e4c5a39 parent 495fd0788ecb4aeda6ee3b47fbfc000f70368948 author Jonas Fonseca 1232375623 +0100 committer Jonas Fonseca 1232375948 +0100 Cleanup update_view's read loop commit 495fd0788ecb4aeda6ee3b47fbfc000f70368948 9cb30bba43afa408be71233978a98bd03b468877 tree b91818f2debdc3d98fcd07fc7b92b2e0424241e2 parent 9cb30bba43afa408be71233978a98bd03b468877 author Jonas Fonseca 1232374794 +0100 committer Jonas Fonseca 1232375944 +0100 Fix regression in handling of data for non-UTF-8 locales The bug was introduced in 65498141015b6070cf5c9b5704039389dba76e90 where the the IO API was changed from using stdio to 'raw' file descriptors. Part of the change removed the need for cutting the ending newline from the input line in update_view(). This caused the resulting iconv output buffer to not be NUL terminated since the input string no longer contained an ending NULL byte. Reported by Pavel Roskin. commit 9cb30bba43afa408be71233978a98bd03b468877 66eacf7398666d7c2a4562140d819100c4e79498 tree e47ffabe7eebddbc43db046d1040a0eeffeac674 parent 66eacf7398666d7c2a4562140d819100c4e79498 author Jonas Fonseca 1232230221 +0100 committer Jonas Fonseca 1232230484 +0100 Fix another regression from the dirty flag changes causing flickering Use redraw_view_from() instead of redraw_view() to avoid excessive calls to wclear(). commit 66eacf7398666d7c2a4562140d819100c4e79498 c6482888e3c06f6291ee5778c19d187a2503b23c tree d795bcef56e3ca6952b906dea3083fa68a07e0bc parent c6482888e3c06f6291ee5778c19d187a2503b23c author Jonas Fonseca 1232218630 +0100 committer Jonas Fonseca 1232230448 +0100 Fix serious bug where a stack allocated variable was returned Reproducable when calling tig with log arguments. commit c6482888e3c06f6291ee5778c19d187a2503b23c 85f9b524531fd1ba25568e630fc9dee857d5df47 tree 3b26054010628f05cbd1a5616c91c8d53f3158af parent 85f9b524531fd1ba25568e630fc9dee857d5df47 author Jonas Fonseca 1232177517 +0100 committer Jonas Fonseca 1232178542 +0100 Improve messages when preparing to load blame commits commit 85f9b524531fd1ba25568e630fc9dee857d5df47 273c28df2aa5cc0d122b1a0f3c0014a56ab8c392 tree 5a0c5b60e46da4c3e106b3970c82729a520a9c17 parent 273c28df2aa5cc0d122b1a0f3c0014a56ab8c392 author Jonas Fonseca 1232047684 +0100 committer Jonas Fonseca 1232055345 +0100 Fix regressions introduced in the last few dirty flag changes Regressions was introduced in ddc5064c42f2adab639feeacf86729a44f06f216. commit 273c28df2aa5cc0d122b1a0f3c0014a56ab8c392 ddc5064c42f2adab639feeacf86729a44f06f216 tree c9551f4a19930f6fe5bb1591da6f9457e73b5137 parent ddc5064c42f2adab639feeacf86729a44f06f216 author Jonas Fonseca 1232031371 +0100 committer Jonas Fonseca 1232031849 +0100 Tree view: make drawing more smooth by using the dirty flag commit ddc5064c42f2adab639feeacf86729a44f06f216 2c41915ca88d7685d029033b0b0257f639ed3af8 tree 7a5636e8dc9d19c1e1174c843cb591a1a95a18b4 parent 2c41915ca88d7685d029033b0b0257f639ed3af8 author Jonas Fonseca 1231949710 +0100 committer Jonas Fonseca 1232031849 +0100 Cleanup redrawing of views when updating by using the dirty flag commit 2c41915ca88d7685d029033b0b0257f639ed3af8 2fba3c2052ce600a16bc6d5899966734cc67a5e3 tree c73d7e70a54658da8e6ccca301c4da91c7de520a parent 2fba3c2052ce600a16bc6d5899966734cc67a5e3 author Jonas Fonseca 1232029479 +0100 committer Jonas Fonseca 1232031849 +0100 Cleanup the tree_read sorting loop commit 2fba3c2052ce600a16bc6d5899966734cc67a5e3 dc4a1e07935d7ac698c57d3e05202e45eb068464 tree d3549c780b5d7ae2478cfee0fa34cac1d3dab936 parent dc4a1e07935d7ac698c57d3e05202e45eb068464 author Jonas Fonseca 1232028894 +0100 committer Jonas Fonseca 1232031846 +0100 Fix memory corruption bug in tree_read when sorting the entries Triggered by defining ITEM_CHUNK_SIZE to 1. commit dc4a1e07935d7ac698c57d3e05202e45eb068464 aa16138ef57a10a2c4dc83e7e0aaa7b817dfd0fa tree 6a92e5bb555ee223b620f68bf39bf90ac5a74c8b parent aa16138ef57a10a2c4dc83e7e0aaa7b817dfd0fa author Jonas Fonseca 1232027080 +0100 committer Jonas Fonseca 1232031466 +0100 Cleanup and simplify the code by introducing add_line_format commit aa16138ef57a10a2c4dc83e7e0aaa7b817dfd0fa 3275e10453db937ed9be9d3e1703961e59652799 tree 14217466109ce8224e7f2d588e2c4c12aa2aa438 parent 3275e10453db937ed9be9d3e1703961e59652799 author Jonas Fonseca 1231936279 +0100 committer Jonas Fonseca 1232031425 +0100 Cleanup the code by calling realloc_lines in add_line_data commit 75bee33a2bf20fa20e4d0aeca97ff8bf34bd6486 68c301dd51c242e58d038ec783085e26873712bc tree 35e1c14a3a34d175377304d784a7b80223a39a07 parent 68c301dd51c242e58d038ec783085e26873712bc author Jonas Fonseca 1231884612 +0100 committer Jonas Fonseca 1231884612 +0100 Sync docs commit 68c301dd51c242e58d038ec783085e26873712bc 88bc41e79fa8989da9439088df2e13bf14dc803d 3275e10453db937ed9be9d3e1703961e59652799 tree 962fffa2548d300d51de6deadcc352723188ff88 parent 88bc41e79fa8989da9439088df2e13bf14dc803d parent 3275e10453db937ed9be9d3e1703961e59652799 author Jonas Fonseca 1231884598 +0100 committer Jonas Fonseca 1231884598 +0100 Merge branch 'master' into release commit 3275e10453db937ed9be9d3e1703961e59652799 2262d33832076ea2f2153a44bc8ee9632844495e tree 05f7e7f44f400d98ada4437f10110b29472a89d9 parent 2262d33832076ea2f2153a44bc8ee9632844495e author Jonas Fonseca 1231884481 +0100 committer Jonas Fonseca 1231884481 +0100 tig-0.13 commit 2262d33832076ea2f2153a44bc8ee9632844495e ec9aa4f62ae2977d598dda865e6a50b9fc799428 tree 2ff74b5460a0b7d0458763d325b4ddfe07e72d98 parent ec9aa4f62ae2977d598dda865e6a50b9fc799428 author Jonas Fonseca 1231868497 +0100 committer Jonas Fonseca 1231883721 +0100 Launch mergetool from the project root directory Fixes problem when in a subdirectory. commit ec9aa4f62ae2977d598dda865e6a50b9fc799428 a271d45efe4aa04ed04467caa9bfdac7305699ac tree dc3fc95c578454381f924e00b00359608593e643 parent a271d45efe4aa04ed04467caa9bfdac7305699ac author Jonas Fonseca 1227093862 +0100 committer Jonas Fonseca 1231883720 +0100 Clear the view after 1 second during updates where reading takes long Inspired by Karl Chen. commit a271d45efe4aa04ed04467caa9bfdac7305699ac 18e2a6a3812c8f79278e7d0116c674689ef76350 tree 7c84ea6d0393144220f2e2b1e79233893931b038 parent 18e2a6a3812c8f79278e7d0116c674689ef76350 author Jonas Fonseca 1226261085 +0100 committer Jonas Fonseca 1231883720 +0100 IO API: use select(2) to check if pipe is readable when updating a view commit 18e2a6a3812c8f79278e7d0116c674689ef76350 e9b8a8f124f87b0a04175fee697a69435aa4126b tree ac410f56acace8d42cb992e894ee2b52cd5da797 parent e9b8a8f124f87b0a04175fee697a69435aa4126b author Jonas Fonseca 1231863418 +0100 committer Jonas Fonseca 1231883720 +0100 IO API: reindent status_run main loop after the rewrite No code change. commit e9b8a8f124f87b0a04175fee697a69435aa4126b a6113cb070b460f715e3b677ab463b258fa3a3e0 tree 72b6df31a32a5abbb18702c3b5d53495435b4b0c parent a6113cb070b460f715e3b677ab463b258fa3a3e0 author Jonas Fonseca 1231856531 +0100 committer Jonas Fonseca 1231883720 +0100 IO API: replace io_gets with helper for scanning buffers Use in status_run() to simplify the code. commit a6113cb070b460f715e3b677ab463b258fa3a3e0 5679054751c38f1c3cf5b4a92f69252200cc043c tree 57615f1c7e62752d5b6c8910caef1f6ebb2d8bee parent 5679054751c38f1c3cf5b4a92f69252200cc043c author Jonas Fonseca 1231557704 -0500 committer Jonas Fonseca 1231883720 +0100 IO API: use fork+exec commit 5679054751c38f1c3cf5b4a92f69252200cc043c 65498141015b6070cf5c9b5704039389dba76e90 tree b0b723837eae2048e7585b0e64d4325c2b999ed7 parent 65498141015b6070cf5c9b5704039389dba76e90 author Jonas Fonseca 1231522197 -0500 committer Jonas Fonseca 1231883720 +0100 IO API: use argv internally commit 65498141015b6070cf5c9b5704039389dba76e90 754b7cf9bb01d82e6aa7b1f83ffdcdd2d271202e tree c64cd86982d62f74a409a6da81c22aa5fea57894 parent 754b7cf9bb01d82e6aa7b1f83ffdcdd2d271202e author Jonas Fonseca 1231521458 -0500 committer Jonas Fonseca 1231883720 +0100 IO API: use file descriptor internally commit 754b7cf9bb01d82e6aa7b1f83ffdcdd2d271202e 018510cedc58d41de2bed5810b1c692cb56e2cfd tree f8e304b761da15fed5a9ae0dc4307bcacfca3e7b parent 018510cedc58d41de2bed5810b1c692cb56e2cfd author Jonas Fonseca 1231510308 -0500 committer Jonas Fonseca 1231883719 +0100 IO API: replace init_io_fd with io_open which calls fopen(3) commit 018510cedc58d41de2bed5810b1c692cb56e2cfd e78d342e6ac2aaa9b31104825fc8d23e5d0db292 tree cd05325a3ed971f59b942b9f78999b4303828b0c parent e78d342e6ac2aaa9b31104825fc8d23e5d0db292 author Jonas Fonseca 1231768625 +0100 committer Jonas Fonseca 1231883719 +0100 IO API: use in the status view commit e78d342e6ac2aaa9b31104825fc8d23e5d0db292 f9977e22aa853749c6d1f113b5d989266d3c9df3 tree bb1b7efedb5ee85b6f5734dfc7b790955e258d24 parent f9977e22aa853749c6d1f113b5d989266d3c9df3 author Jonas Fonseca 1227868041 +0100 committer Jonas Fonseca 1231883719 +0100 IO API: use when loading repository properties This introduces an incompatibility regarding the format of the TIG_LS_REMOTE environment variable. commit f9977e22aa853749c6d1f113b5d989266d3c9df3 084e67f2a181500e57025a3ed2dced3ac2553cfa tree 7620f164d783a33e394e3e157c62c3056719d91e parent 084e67f2a181500e57025a3ed2dced3ac2553cfa author Jonas Fonseca 1231444165 -0500 committer Jonas Fonseca 1231883719 +0100 IO API: use in the stage view commit 084e67f2a181500e57025a3ed2dced3ac2553cfa 58cc60c95d9035d1077529fca35717ade735f118 tree 8ee939278c90e751c9e1a4402593fe558f5675e0 parent 58cc60c95d9035d1077529fca35717ade735f118 author Jonas Fonseca 1231712100 +0100 committer Jonas Fonseca 1231883719 +0100 IO API: obsolete opt_pipe commit 58cc60c95d9035d1077529fca35717ade735f118 d924cb2e4990c7e5f6042361e5907ad74c2ac478 tree b87af45ac9c24b745ed741f9bbec1ae6dbda8536 parent d924cb2e4990c7e5f6042361e5907ad74c2ac478 author Jonas Fonseca 1231438804 -0500 committer Jonas Fonseca 1231883719 +0100 IO API: obsolete opt_cmd by using prepare_update in status_enter commit d924cb2e4990c7e5f6042361e5907ad74c2ac478 034f90af053f2c3ba17ac4476ef3469ce3a49d90 tree 6932674c598a55568a47cfbc148a695e0f13f31e parent 034f90af053f2c3ba17ac4476ef3469ce3a49d90 author Jonas Fonseca 1227803500 +0100 committer Jonas Fonseca 1231883719 +0100 IO API: use prepare_update when parsing command line arguments commit 034f90af053f2c3ba17ac4476ef3469ce3a49d90 8cf58c4f67bc39a682753572420ac5b73e98a959 tree deb495a5d51c88952d9fa0e186b8a39342aaa8ae parent 8cf58c4f67bc39a682753572420ac5b73e98a959 author Jonas Fonseca 1230706615 -0500 committer Jonas Fonseca 1231883718 +0100 IO API: use in add_describe_ref commit 8cf58c4f67bc39a682753572420ac5b73e98a959 b9b87b855cdd7b2a8af10b50f2d4287e242564b4 tree 965c694901d097839a9c6b1747b6a4aeeab376b0 parent b9b87b855cdd7b2a8af10b50f2d4287e242564b4 author Jonas Fonseca 1227870950 +0100 committer Jonas Fonseca 1231883718 +0100 IO API: use in the blame view commit b9b87b855cdd7b2a8af10b50f2d4287e242564b4 227e2c0ecd782beb1bf6cb613a02060dfe08bd52 tree 8d79ce3b13d4ae04ec4d0734df53a96cc4d88e3a parent 227e2c0ecd782beb1bf6cb613a02060dfe08bd52 author Jonas Fonseca 1231624314 -0500 committer Jonas Fonseca 1231883718 +0100 IO API: unify tree view and the default path in begin_update commit 227e2c0ecd782beb1bf6cb613a02060dfe08bd52 dff8a4b12b0db2235c3da12cb33b49c3b1de3e1d tree aceabcd572709a847b6ff113cc3f124408598413 parent dff8a4b12b0db2235c3da12cb33b49c3b1de3e1d author Jonas Fonseca 1227804354 +0100 committer Jonas Fonseca 1231883718 +0100 IO API: use for the main, log, diff, tree and blob views This introduces an incompatibility with previous versions. commit dff8a4b12b0db2235c3da12cb33b49c3b1de3e1d ea035bcbfddb6d67f10cb49412202b8f1ecb3713 tree 561596d94f8cec9600d6b2a9675a7df42c241d15 parent ea035bcbfddb6d67f10cb49412202b8f1ecb3713 author Jonas Fonseca 1227804952 +0100 committer Jonas Fonseca 1231883718 +0100 IO API: use when preparing to run commands from the prompt commit ea035bcbfddb6d67f10cb49412202b8f1ecb3713 10b1023541ba21fe680716a7e560c834f0678dfc tree c1b7181a3bd6ef38fe1fb2eca543fb1afa184775 parent 10b1023541ba21fe680716a7e560c834f0678dfc author Jonas Fonseca 1231118784 -0500 committer Jonas Fonseca 1231883718 +0100 IO API: convert status checkout/revert support commit 10b1023541ba21fe680716a7e560c834f0678dfc c00eb27d07cc218c1b889e1e32a5f5ac4e40c308 tree d57645afa9707c3267d3fe1e676fd1fbc7a3bc3e parent c00eb27d07cc218c1b889e1e32a5f5ac4e40c308 author Jonas Fonseca 1230500489 -0500 committer Jonas Fonseca 1231883717 +0100 IO API: use when running external commands commit c00eb27d07cc218c1b889e1e32a5f5ac4e40c308 059f7d6bfa08c6badc4857a969c2e993d6c61ad1 tree 66354bba2f22f12aefff2ab7a99fc720d7e7ca05 parent 059f7d6bfa08c6badc4857a969c2e993d6c61ad1 author Jonas Fonseca 1227803343 +0100 committer Jonas Fonseca 1231883717 +0100 IO API: refactor the run request command formatter Adds support for new %(file), %(directory) and %(ref) identifiers. Also adds infrastructure for working with argument arrays commit 059f7d6bfa08c6badc4857a969c2e993d6c61ad1 e00ea5d38044a525bfccf8bacd8384788d7ca97e tree cecaeea28331e41268eb81bbd8b4a08594d7f1ec parent e00ea5d38044a525bfccf8bacd8384788d7ca97e author Jonas Fonseca 1230751045 -0500 committer Jonas Fonseca 1231883717 +0100 IO API: add small library for reading files and running programs commit e00ea5d38044a525bfccf8bacd8384788d7ca97e 460a26ad59d75f4b37bd2674b75593a7f55cae9a tree efc3302834730b0dc6539380fbb57877c825bc02 parent 460a26ad59d75f4b37bd2674b75593a7f55cae9a author Jonas Fonseca 1231883286 +0100 committer Jonas Fonseca 1231883717 +0100 Blame: do to not reload the diff view for same commits commit 460a26ad59d75f4b37bd2674b75593a7f55cae9a 4036f35cb03abc1e4672c9c3796a751da1e2a920 tree e81577f82bc196567090aa2fa304d3036a51e4ff parent 4036f35cb03abc1e4672c9c3796a751da1e2a920 author Jonas Fonseca 1231883151 +0100 committer Jonas Fonseca 1231883716 +0100 Blame: update blame to selected commit when pressing 'B' commit 4036f35cb03abc1e4672c9c3796a751da1e2a920 9a6b04c31d524f9f203f3fd47e452bf464f3fc37 tree 579375dbc77effb6ac44524ace27665a1608ac5d parent 9a6b04c31d524f9f203f3fd47e452bf464f3fc37 author Jonas Fonseca 1231883059 +0100 committer Jonas Fonseca 1231883699 +0100 Blame: remove unused member of struct blame commit 9a6b04c31d524f9f203f3fd47e452bf464f3fc37 a4da0896a29f20a7831a2195de46ade8a682bc4e tree 555e4c9f481e00c349f800b3909a951c48a8074c parent a4da0896a29f20a7831a2195de46ade8a682bc4e author Jonas Fonseca 1231524122 -0500 committer Jonas Fonseca 1231585278 -0500 Add setup_update for initialize incremental view updates Refactors common parts of begin_update and blame_open. commit a4da0896a29f20a7831a2195de46ade8a682bc4e 2eb85ecd3714695835a5542386c11d55bfb29d18 tree 77edc2c12d7af2c6b17916f7758b89bc2dfe832a parent 2eb85ecd3714695835a5542386c11d55bfb29d18 author Jonas Fonseca 1231346094 -0500 committer Jonas Fonseca 1231346146 -0500 Slightly reduce memory usage for keybindings commit 2eb85ecd3714695835a5542386c11d55bfb29d18 984c196588405ccf2ad840838a72f93d6915c189 tree d0e065d6cbb7669c1c1cf63cd262d4c61948dfc7 parent 984c196588405ccf2ad840838a72f93d6915c189 author Jonas Fonseca 1230747823 -0500 committer Jonas Fonseca 1230751208 -0500 Move formatting of blame --incremental command to blame_read_file Doing it in blame_open after starting the command makes error handling harder and the code was indeed buggy. commit 984c196588405ccf2ad840838a72f93d6915c189 d94d36453dfe079647aadde7e293fcac74c8e4fc tree f1473f522d46d1c7096cfd9c00a327d7f78bc0fa parent d94d36453dfe079647aadde7e293fcac74c8e4fc author Jonas Fonseca 1230747118 -0500 committer Jonas Fonseca 1230749198 -0500 Minor simplification of blame_open commit d94d36453dfe079647aadde7e293fcac74c8e4fc cbe1676b5f25c4866f0cf8bdddb59604e18fa134 tree 53a38d1d94fd3771baef85074aaba35e7dd63416 parent cbe1676b5f25c4866f0cf8bdddb59604e18fa134 author Jonas Fonseca 1230746133 -0500 committer Jonas Fonseca 1230746133 -0500 Don't use view->cmd to share state in the blame view commit cbe1676b5f25c4866f0cf8bdddb59604e18fa134 61f4ef88493cca416c6a4483aeadb104d706d648 tree 835fb896a86d61f0eacb3514252ba177d777a20d parent 61f4ef88493cca416c6a4483aeadb104d706d648 author Jonas Fonseca 1230746004 -0500 committer Jonas Fonseca 1230746120 -0500 Fix drawing loading views that are not displayed. commit 61f4ef88493cca416c6a4483aeadb104d706d648 17d9c7e826ac1a4cb4a2ae5ab93fb149dccb349e tree 0553b51dd182abb896388e595af29b8efaa6809f parent 17d9c7e826ac1a4cb4a2ae5ab93fb149dccb349e author Jonas Fonseca 1230490032 -0500 committer Jonas Fonseca 1230502579 -0500 Add support for launching the editor from the tree view Only supported for files in the currently checked out head. Requested by Cyril Romain. commit 17d9c7e826ac1a4cb4a2ae5ab93fb149dccb349e 918008baddc311e810c4bdc5fd548ee10fc83399 tree d68376fb90a189e81df725575cbc960d925ccd9b parent 918008baddc311e810c4bdc5fd548ee10fc83399 author Jonas Fonseca 1230488982 -0500 committer Jonas Fonseca 1230494308 -0500 Replace opt_no_head with opt_head_rev in order to save the HEAD rev Add is_initial_commit macro which replaces opt_no_head tests. Also, update ref_head and ref_commit with the resolved HEAD revision. commit 918008baddc311e810c4bdc5fd548ee10fc83399 8227054299f820435b1ddfd04c42c3daccc3168f tree c2f3036747165a20802f3e5e2cc01ce6086a55fb parent 8227054299f820435b1ddfd04c42c3daccc3168f author Jonas Fonseca 1230486448 -0500 committer Jonas Fonseca 1230494300 -0500 Use switch statement in tree_request commit 8227054299f820435b1ddfd04c42c3daccc3168f 581a2b04f0afe52adb557acb5e1f61baf8d0f635 tree 941d8bffb1dca085f0bb20228adf52686d35279b parent 581a2b04f0afe52adb557acb5e1f61baf8d0f635 author Jonas Fonseca 1230485532 -0500 committer Jonas Fonseca 1230485647 -0500 Refuse to open blame view for all non-file entries in the tree view commit 581a2b04f0afe52adb557acb5e1f61baf8d0f635 16dda24885bb405e4d5a8f8f4d6105ae7539a524 tree 1d4210f415634594f6e602a99fd06e96e2c20f6e parent 16dda24885bb405e4d5a8f8f4d6105ae7539a524 author Jonas Fonseca 1226868017 +0100 committer Jonas Fonseca 1226868062 +0100 Refuse to open deleted files from the status and stage views commit 16dda24885bb405e4d5a8f8f4d6105ae7539a524 e3a6003647b28971d83ad14756d1c1e05281eb59 tree 2b3a52da7620f22aafdbdbe80597fbfde514d3e1 parent e3a6003647b28971d83ad14756d1c1e05281eb59 author Jonas Fonseca 1225904495 +0100 committer Jonas Fonseca 1225904495 +0100 tigrc(5): minor fixes and improvements from wip/run-command commit e3a6003647b28971d83ad14756d1c1e05281eb59 cb7138b216275f5197ee621b674b03edd95cf1b6 tree 90fda0637cac9db34dbdd8c48656ee087f421ed6 parent cb7138b216275f5197ee621b674b03edd95cf1b6 author Jonas Fonseca 1224962991 +0200 committer Jonas Fonseca 1224964353 +0200 Refuse to open a directory in the status and stage view Adds suffixcmp() used for checking if the status entry name ends with "/". Also use it for repository reference loading. commit cb7138b216275f5197ee621b674b03edd95cf1b6 4361847ff7578a8394e25b3127ed680c76a94f78 tree 572b82cf5ed640677b04977486308e8725ff8479 parent 4361847ff7578a8394e25b3127ed680c76a94f78 author Jonas Fonseca 1224065258 +0200 committer Jonas Fonseca 1224065457 +0200 Fix waiting for input after executing a run request in pager mode When in pager mode, stdin should not be touched. After executing a run request a getc(stdin) was done to wait for the user's command to continue, which didn't result in the expected behavior. To fix this store the proper TTY handle in the new opt_tty variable which is set up by init_display(). commit 4361847ff7578a8394e25b3127ed680c76a94f78 0417853c9a1ea412bc1680cd7bd6c92c21b803b5 tree 680da75637717010f7571732b05424b250c7c5ba parent 0417853c9a1ea412bc1680cd7bd6c92c21b803b5 author Jonas Fonseca 1224058473 +0200 committer Jonas Fonseca 1224058594 +0200 update_view: Check the pipes and call end_update() before redrawing This allows the main view to finish its updating of the revision graph so that it is rendered properly for the last commit. As a bonus, it also removes a goto. commit 0417853c9a1ea412bc1680cd7bd6c92c21b803b5 d55c104fbc423fede3a70f866ca16ae8988c0e86 tree b30482988278db21058eda93eac6883f433ed32a parent d55c104fbc423fede3a70f866ca16ae8988c0e86 author Jonas Fonseca 1223963705 +0200 committer Jonas Fonseca 1223963705 +0200 Use "--" to separate file argument to git-checkout commit d55c104fbc423fede3a70f866ca16ae8988c0e86 d35386a8214a193ade08999938ba6d684daefaaa tree 67afc1197d1cdb375e2465d90ba5c4528099a99b parent d35386a8214a193ade08999938ba6d684daefaaa author Jonas Fonseca 1223727288 +0200 committer Jonas Fonseca 1223727288 +0200 Cleanup and fix the main loop to make view point to the current view commit 88bc41e79fa8989da9439088df2e13bf14dc803d f44e95ef56756edeba3888dada409f735d3d86e9 tree 2be0ee4c7bed5e4084d239715f30e8e56b6ba0a0 parent f44e95ef56756edeba3888dada409f735d3d86e9 author Jonas Fonseca 1223723972 +0200 committer Jonas Fonseca 1223723972 +0200 Sync docs commit f44e95ef56756edeba3888dada409f735d3d86e9 6d06525567ca5fc2bc91bca853f70fa011e4bffc d35386a8214a193ade08999938ba6d684daefaaa tree 002bcf4782c521fde7dbd4274088dd0b09ef9bb2 parent 6d06525567ca5fc2bc91bca853f70fa011e4bffc parent d35386a8214a193ade08999938ba6d684daefaaa author Jonas Fonseca 1223723963 +0200 committer Jonas Fonseca 1223723963 +0200 Merge branch 'master' into release commit d35386a8214a193ade08999938ba6d684daefaaa 2476a6d79f9f26b24a7326ffe067a32ca058ddf9 tree 37f02b27cd2fca65121b04e788bc821e0e86a5b9 parent 2476a6d79f9f26b24a7326ffe067a32ca058ddf9 author Jonas Fonseca 1223720656 +0200 committer Jonas Fonseca 1223722549 +0200 Update and improve the manual Especially the section on external commands and commands from the environment is reworked. The section on the viewer is moved up. commit 2476a6d79f9f26b24a7326ffe067a32ca058ddf9 c172297d0b826513f4e05786aa874bceafc484bd tree ccb2155b99112abd7b511562a32eb04d5899f08e parent c172297d0b826513f4e05786aa874bceafc484bd author Jonas Fonseca 1223667016 +0200 committer Jonas Fonseca 1223667016 +0200 Remove documentation relicts from before the option parsing was changed commit c172297d0b826513f4e05786aa874bceafc484bd 6ba2ebb79cd968ed170ab969b537c0ffc2a529c2 tree b1d8bfd2f506f68e7d80af186d9c164bf9770670 parent 6ba2ebb79cd968ed170ab969b537c0ffc2a529c2 author Jonas Fonseca 1223660051 +0200 committer Jonas Fonseca 1223660277 +0200 Introduce prefixcmp macro to reduce code verbosity commit 6ba2ebb79cd968ed170ab969b537c0ffc2a529c2 9fb7a26d27a8a82bee445a3915589d0174316f8a tree d3c68867af37136a73b0cf510b79ffd4d188d2e7 parent 9fb7a26d27a8a82bee445a3915589d0174316f8a author Jonas Fonseca 1223640047 +0200 committer Jonas Fonseca 1223640047 +0200 Separate blame revision and file argument by "--" to avoid problems commit 9fb7a26d27a8a82bee445a3915589d0174316f8a 5bea5cb36b8ea04d05870beee21fa358173f2e07 tree 8ae14828f494eea556a5c196018235a2a80e21c0 parent 5bea5cb36b8ea04d05870beee21fa358173f2e07 author Jonas Fonseca 1223638996 +0200 committer Jonas Fonseca 1223639375 +0200 Add bash completion for the blame subcommand commit 5bea5cb36b8ea04d05870beee21fa358173f2e07 268d8675bef3d7074b9ccd435f7aeebf592b1280 tree 20a9c4af8f39a616d54f464088c1f89f28f93ff2 parent 268d8675bef3d7074b9ccd435f7aeebf592b1280 author Jonas Fonseca 1223637004 +0200 committer Jonas Fonseca 1223637004 +0200 Remove outdated comment commit 268d8675bef3d7074b9ccd435f7aeebf592b1280 8fbf675cbd006c4335e829f89558e61f40c54a02 tree 2b6d108b98fea9d9e93dcdf8246be44aef663a05 parent 8fbf675cbd006c4335e829f89558e61f40c54a02 author Jonas Fonseca 1223553955 +0200 committer Jonas Fonseca 1223553955 +0200 Make more strings const commit 8fbf675cbd006c4335e829f89558e61f40c54a02 1cdcf6a089b54d666fcb98ddb8e968db664b6565 tree e65be4cc69a40c0cb14b25a52fe210a0ecc63de5 parent 1cdcf6a089b54d666fcb98ddb8e968db664b6565 author Jonas Fonseca 1223550568 +0200 committer Jonas Fonseca 1223552339 +0200 Sort references in the order: tags, heads, tracked remotes, remotes commit 6d06525567ca5fc2bc91bca853f70fa011e4bffc c95fe72f0e801707f7a61070d3b1bd2872a6b23f tree 5b7c775cb299f9d04d9ce956479fcfb53e747daa parent c95fe72f0e801707f7a61070d3b1bd2872a6b23f author Jonas Fonseca 1223469897 +0200 committer Jonas Fonseca 1223469897 +0200 Sync docs commit c95fe72f0e801707f7a61070d3b1bd2872a6b23f 22bc19572233f3b8d609afb88eb7945cce0f7ce4 1cdcf6a089b54d666fcb98ddb8e968db664b6565 tree 9ede2736dc28352a779b10af091b758647180329 parent 22bc19572233f3b8d609afb88eb7945cce0f7ce4 parent 1cdcf6a089b54d666fcb98ddb8e968db664b6565 author Jonas Fonseca 1223469887 +0200 committer Jonas Fonseca 1223469887 +0200 Merge branch 'master' into release commit 1cdcf6a089b54d666fcb98ddb8e968db664b6565 4e9fb6728821b3d7bd006a84595c70ae77c199e2 tree 86f24f704587b77b11d4e99054897e8ddda83a4a parent 4e9fb6728821b3d7bd006a84595c70ae77c199e2 author Jonas Fonseca 1223468965 +0200 committer Jonas Fonseca 1223468965 +0200 tig-0.12.1 commit 4e9fb6728821b3d7bd006a84595c70ae77c199e2 58fc3b1db70f52badd3cd9d88773107e3201469d tree 4e3e83b1cad7320df6007604d9f2b935cd29f703 parent 58fc3b1db70f52badd3cd9d88773107e3201469d author Jonas Fonseca 1223420412 +0200 committer Jonas Fonseca 1223449593 +0200 Rename checkout to revert and support individual diff chunks reverts commit 58fc3b1db70f52badd3cd9d88773107e3201469d 93afcbad8a315c69ca98ce6c8aed61a2d0ad1da1 tree e3ee0680962ee778253a537f75190905e2cb56b7 parent 93afcbad8a315c69ca98ce6c8aed61a2d0ad1da1 author Jonas Fonseca 1223405004 +0200 committer Jonas Fonseca 1223405194 +0200 Avoid triggering assertion failure when reloading the status view After staging a diff chunk, the stage view automatically reloads the status view. If the staging happened while the status view is not displayed an assertion failure is triggered by draw_view_line(). Fix it by only conditionally redrawing the view in open_view(). commit 93afcbad8a315c69ca98ce6c8aed61a2d0ad1da1 a72bf50e07c10aa0b567ab0da7c4284769abcc7d tree cdbbe3b2126a200b7233e464fe5eda14542feb74 parent a72bf50e07c10aa0b567ab0da7c4284769abcc7d author Jonas Fonseca 1223404943 +0200 committer Jonas Fonseca 1223405194 +0200 Consolidate and share view resetting via new reset_view() commit a72bf50e07c10aa0b567ab0da7c4284769abcc7d 1ef90b72a892ac3a2d313937a587e129b107443e tree 9e23ab525c1b859de3abe46e7c5e5ee12c6fda5d parent 1ef90b72a892ac3a2d313937a587e129b107443e author Jonas Fonseca 1223402666 +0200 committer Jonas Fonseca 1223402666 +0200 Help view: move requests from the Misc group into separate groups commit 1ef90b72a892ac3a2d313937a587e129b107443e fea345fe6e1c38db156692afedeae48eb3ac1331 tree 0e268f3fbd3004b14feac022045ef4fa9839c61d parent fea345fe6e1c38db156692afedeae48eb3ac1331 author Jonas Fonseca 1223400268 +0200 committer Jonas Fonseca 1223400268 +0200 Help view: use "(no key)" instead of "'?'" to not confuse unbound actions commit fea345fe6e1c38db156692afedeae48eb3ac1331 49f88913922d50488b3a9b73e5f0ad1f723396f2 tree e8fcf28937cff611d39eef33c91c28d5e1e0c0c4 parent 49f88913922d50488b3a9b73e5f0ad1f723396f2 author Jonas Fonseca 1223398743 +0200 committer Jonas Fonseca 1223398743 +0200 Clear the status line when closing a view Avoids confusion from stale messages. commit 49f88913922d50488b3a9b73e5f0ad1f723396f2 5f98d3777fa515115d74d3a58deb29765f8b22bd tree 575a7a7a0f71c0916616b7d3bd3a05c179c6300b parent 5f98d3777fa515115d74d3a58deb29765f8b22bd author Jonas Fonseca 1223381881 +0200 committer Jonas Fonseca 1223381881 +0200 Fix bug introduced in commit for using --exclude-standard flag Introduced in commit 33623c0022b49a5f2774b37a58726a95a4367447. The bug is reproducible when running tig status in a newly created repository. commit 5f98d3777fa515115d74d3a58deb29765f8b22bd 0773ae0035ba0f29e2d63fb38370afe9ca5dab5e tree bdcc535b874f9ee9df82e9d635ffb669f138f71f parent 0773ae0035ba0f29e2d63fb38370afe9ca5dab5e author Jonas Fonseca 1223375281 +0200 committer Jonas Fonseca 1223375281 +0200 Add support for refreshing the log view commit 0773ae0035ba0f29e2d63fb38370afe9ca5dab5e 83f54aa267186de1921c64922002afb833068a17 tree 19f6d8636a1a1777770d154bd741526e683f8f26 parent 83f54aa267186de1921c64922002afb833068a17 author Jonas Fonseca 1223375028 +0200 committer Jonas Fonseca 1223375028 +0200 Make OPEN_REFRESH imply OPEN_NOMAXIMIZE ... so the main view keeps its dimension when refreshing with the diff view open. commit 83f54aa267186de1921c64922002afb833068a17 d6c429b6f570948c603ea8a7ca4670f01224b4c4 tree 5f094be38b20c185abebed4dcd2249a353df2a48 parent d6c429b6f570948c603ea8a7ca4670f01224b4c4 author Jonas Fonseca 1223374134 +0200 committer Jonas Fonseca 1223374194 +0200 Simplify view refreshing by adding new OPEN_REFRESH flag for open_view commit d6c429b6f570948c603ea8a7ca4670f01224b4c4 3f25aec09f98ff97a80e4d3df0956edcf0bab8a1 tree 50153d6e1c2668a0f38d137c947d6bf737494ca2 parent 3f25aec09f98ff97a80e4d3df0956edcf0bab8a1 author Jonas Fonseca 1223328458 +0200 committer Jonas Fonseca 1223373499 +0200 Show complete shortlog for small releases commit 3f25aec09f98ff97a80e4d3df0956edcf0bab8a1 6aff4d8ff0f51fdca57421b8090b23f0ee285832 tree 3d64b9e8af0bd3e766e1ab199bf082f2872fbffb parent 6aff4d8ff0f51fdca57421b8090b23f0ee285832 author Jonas Fonseca 1223323782 +0200 committer Jonas Fonseca 1223323782 +0200 Improve checkout error reporting commit 6aff4d8ff0f51fdca57421b8090b23f0ee285832 a6b02acc2ce43f5b6cc4c0768236cf97a19b939e tree 1c06ab3586c4e938d29228fc322c09ebbcaf7058 parent a6b02acc2ce43f5b6cc4c0768236cf97a19b939e author Jonas Fonseca 1223321360 +0200 committer Jonas Fonseca 1223321360 +0200 Cleanup and make option argument strings const commit a6b02acc2ce43f5b6cc4c0768236cf97a19b939e 5b09a46944f164781c148cc61655dc1a8392189a tree 52580264dc3cd404a38454331a1ab52cd195b7b5 parent 5b09a46944f164781c148cc61655dc1a8392189a author Jonas Fonseca 1223321330 +0200 committer Jonas Fonseca 1223321330 +0200 Improve handling of unmatched quotes in ~/.tigrc commit 5b09a46944f164781c148cc61655dc1a8392189a d991d4a172a1eb585947572d88138f50b9b2f973 tree 71b5b0d1736afa17d32e99b28265db95a25bd90e parent d991d4a172a1eb585947572d88138f50b9b2f973 author Jonas Fonseca 1223319658 +0200 committer Jonas Fonseca 1223319658 +0200 Make GIT_CONFIG only contain the config subcommand commit d991d4a172a1eb585947572d88138f50b9b2f973 8f2a69d8be49017f716c30ed2acf9a000d742f31 tree 40198a2bb14f7f56b0a2090ddd8d94973bacf4b1 parent 8f2a69d8be49017f716c30ed2acf9a000d742f31 author Jonas Fonseca 1223291481 +0200 committer Jonas Fonseca 1223291897 +0200 Reload repository references when refreshing the main view commit 8f2a69d8be49017f716c30ed2acf9a000d742f31 e73f2b2d8167eb44b38611557ac3fa5ad09e855a tree b80620b16238aa620e9508c974c647e73d6208e9 parent e73f2b2d8167eb44b38611557ac3fa5ad09e855a author Jonas Fonseca 1222875592 +0200 committer Jonas Fonseca 1222875592 +0200 Avoid refreshing views when checkout is canceled by user commit e73f2b2d8167eb44b38611557ac3fa5ad09e855a 33623c0022b49a5f2774b37a58726a95a4367447 tree 77b020530b26f5654d996102e929768359e77620 parent 33623c0022b49a5f2774b37a58726a95a4367447 author Jonas Fonseca 1222875037 +0200 committer Jonas Fonseca 1222875037 +0200 Also allow files to be checked out from stage view commit 33623c0022b49a5f2774b37a58726a95a4367447 7eaf9264771a0f74b3ab378cf2e43a75b87f7d6e tree 5afd5fa6dcc54f12174131f9587229521f1cfcbc parent 7eaf9264771a0f74b3ab378cf2e43a75b87f7d6e author Jonas Fonseca 1222786648 +0200 committer Jonas Fonseca 1222797893 +0200 Cleanup exclude rule setup by using ls-files --exclude-standard flag This makes user specific ignore rules effective in the status view. commit 7eaf9264771a0f74b3ab378cf2e43a75b87f7d6e 8536cc818a2d1b192a09bf3699d57a41eecb42ab tree 3df10d00ec86cff01b48995d74ba841dbc0f69c5 parent 8536cc818a2d1b192a09bf3699d57a41eecb42ab author Jonas Fonseca 1222784502 +0200 committer Jonas Fonseca 1222784502 +0200 Main: use --topo-order when arguments are given on the command line commit 8536cc818a2d1b192a09bf3699d57a41eecb42ab 5152b2f016a09afaf80ebc4ada4a31e0e140be5f tree 27387b3244eb6357a22b82ea2db1b679d635c33e parent 5152b2f016a09afaf80ebc4ada4a31e0e140be5f author Jonas Fonseca 1222016397 +0200 committer Jonas Fonseca 1222016397 +0200 main: automatically refresh after run requests commit 5152b2f016a09afaf80ebc4ada4a31e0e140be5f 1a797acc0ddd03eac0efb947becc9200a4162d38 tree 8ad054bfec4b5a01dadc9cde7e0a8afa3d1c5bd1 parent 1a797acc0ddd03eac0efb947becc9200a4162d38 author Jonas Fonseca 1221995725 +0200 committer Jonas Fonseca 1221995725 +0200 status: add support for checking out files with unstaged changes commit 1a797acc0ddd03eac0efb947becc9200a4162d38 3e50aaff716e4568eef88be07aab78a20a97649a tree 1ddc5f373d379af9f2fe52c07e845fc9dafc6648 parent 3e50aaff716e4568eef88be07aab78a20a97649a author Jonas Fonseca 1221506764 +0200 committer Jonas Fonseca 1221506764 +0200 TODO: support for jumping to parents' blame in the blame view commit 3e50aaff716e4568eef88be07aab78a20a97649a 04df8b7d15890606483afb4e7a518933c6e95889 tree ee3bc33bc36e41c4a83ea8431dd349b56f54fc1c parent 04df8b7d15890606483afb4e7a518933c6e95889 author Jonas Fonseca 1221506606 +0200 committer Jonas Fonseca 1221506637 +0200 Add script for preparing release announcements commit 22bc19572233f3b8d609afb88eb7945cce0f7ce4 e1e6a92dcb29c9156463b846536cb5e600cb5849 tree 11d8db44786b900cbdef828a87ac703593a045b5 parent e1e6a92dcb29c9156463b846536cb5e600cb5849 author Jonas Fonseca 1221504439 +0200 committer Jonas Fonseca 1221504439 +0200 Sync docs commit e1e6a92dcb29c9156463b846536cb5e600cb5849 328d84f4f9f2201d33c9e16edcf079aff179848d 04df8b7d15890606483afb4e7a518933c6e95889 tree 7a181ee888f51377901eb39cd1b81b64c975e9f3 parent 328d84f4f9f2201d33c9e16edcf079aff179848d parent 04df8b7d15890606483afb4e7a518933c6e95889 author Jonas Fonseca 1221504430 +0200 committer Jonas Fonseca 1221504430 +0200 Merge branch 'master' into release commit 04df8b7d15890606483afb4e7a518933c6e95889 8b88037ef58dfdce4d930737c43fa02eae0cd229 tree 6d2cde27d60caf7504f645f041555f9f7327c404 parent 8b88037ef58dfdce4d930737c43fa02eae0cd229 author Jonas Fonseca 1221503972 +0200 committer Jonas Fonseca 1221504372 +0200 tig-0.12 commit 8b88037ef58dfdce4d930737c43fa02eae0cd229 cae23453bf77ee4b9d037061b13d4f1c094700e1 tree 05865c9bfaabb9dbb3abfea6cd4984d34fdf035c parent cae23453bf77ee4b9d037061b13d4f1c094700e1 author Jonas Fonseca 1221503751 +0200 committer Jonas Fonseca 1221503751 +0200 Do not show boundary commits by default They can cause confusing results when combined with the --author flag. If they should be shown the --boundary option should be passed. commit cae23453bf77ee4b9d037061b13d4f1c094700e1 81dec53570e3e2621af8c652aceb0d59ca316431 tree e21bd2c2d3baef5997ca494e33fa340f8f7db467 parent 81dec53570e3e2621af8c652aceb0d59ca316431 author Jonas Fonseca 1221054411 +0200 committer Jonas Fonseca 1221054836 +0200 main: implement refreshing by just rerunning the original command Also updates NEWS to mention the fix from last commit. commit 81dec53570e3e2621af8c652aceb0d59ca316431 ad9f9954419b5d3f595580d5184db59a00711f92 tree 9f2a8fe927c69ec5fbd3065f46b81196daf97aa2 parent ad9f9954419b5d3f595580d5184db59a00711f92 author Jeff King 1219282844 -0400 committer Jonas Fonseca 1219398214 +0200 Continue updates when pipe read has errno "Success" When we are reading from a pipe and receive a signal, our read call fails and ferror() returns true. The current behavior is to call end_update and report failure. However, we can detect this situation by checking that errno is set to success and continue the reading process. You can provoke this behavior by running a "tig blame" that takes a few seconds and then resizing the terminal that tig is running in (you should get an incomplete blame output and the error "Failed to read: Success"). Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit 328d84f4f9f2201d33c9e16edcf079aff179848d ed7fc56b0d6b9dbcb5aa960fb26967ead9df869c tree d62d289bd0b148400c03e7640638dc20988e6dc7 parent ed7fc56b0d6b9dbcb5aa960fb26967ead9df869c author Jonas Fonseca 1218113542 +0200 committer Jonas Fonseca 1218113542 +0200 Sync docs commit ed7fc56b0d6b9dbcb5aa960fb26967ead9df869c 3b8b8dc6a3a750ea450eb9782a060d118165e937 ad9f9954419b5d3f595580d5184db59a00711f92 tree 0ebc4f63c2ceb90262b7b479ecedb36362c1ac8e parent 3b8b8dc6a3a750ea450eb9782a060d118165e937 parent ad9f9954419b5d3f595580d5184db59a00711f92 author Jonas Fonseca 1218113531 +0200 committer Jonas Fonseca 1218113531 +0200 Merge branch 'master' into release commit ad9f9954419b5d3f595580d5184db59a00711f92 60e8ea56880fc2e42008075d516c356ef605bc60 tree a9654f6dd6ff2412f2ef63dab6f69a6c37b6dd70 parent 60e8ea56880fc2e42008075d516c356ef605bc60 author Jonas Fonseca 1217972421 +0200 committer Jonas Fonseca 1217972728 +0200 Clean up incomplete commits from main view listed for --no-walk When --no-walk is given on the command line by the user it causes boundary commits to be output with just the commit line, i.e: > git rev-list --pretty=raw --boundary --no-walk HEAD commit 60e8ea56880fc2e42008075d516c356ef605bc60 tree 5b76086e4deaf62d3f7baffc6f49840f61d4e79c parent 145194bdfc8bf0b58185bbe28bc0097ce429de4d author Jonas Fonseca 1217797175 +0200 committer Jonas Fonseca 1217797402 +0200 Remove the global opt_request variable commit -145194bdfc8bf0b58185bbe28bc0097ce429de4d commit 60e8ea56880fc2e42008075d516c356ef605bc60 145194bdfc8bf0b58185bbe28bc0097ce429de4d tree 5b76086e4deaf62d3f7baffc6f49840f61d4e79c parent 145194bdfc8bf0b58185bbe28bc0097ce429de4d author Jonas Fonseca 1217797175 +0200 committer Jonas Fonseca 1217797402 +0200 Remove the global opt_request variable commit 145194bdfc8bf0b58185bbe28bc0097ce429de4d 328b442d0d84a515d7f3284abd10ed91de69b049 tree 8b07830d0807355c6dc1d7155eb3bef68c17784c parent 328b442d0d84a515d7f3284abd10ed91de69b049 author Jonas Fonseca 1217795926 +0200 committer Jonas Fonseca 1217795926 +0200 TODO: Option for abbreviating author names using just the initials commit 328b442d0d84a515d7f3284abd10ed91de69b049 e6d4219625f469c6f5cd6b817a50121b157d6b68 tree 3dd06040151ac7b72fb9c858692174d7caac39b1 parent e6d4219625f469c6f5cd6b817a50121b157d6b68 author Jonas Fonseca 1216833792 +0200 committer Jonas Fonseca 1216833792 +0200 Gracefully ignore negative values given to options in ~/.tigrc commit e6d4219625f469c6f5cd6b817a50121b157d6b68 436a96c95048ad35c9e681f157edabbcb8952350 tree 820972bd8f2000e658b01e5416ab8db5dddfd9ae parent 436a96c95048ad35c9e681f157edabbcb8952350 author Rodolfo Borges 1210887457 -0300 committer Jonas Fonseca 1216833148 +0200 Add option 'author-width' to consumize the width of the author column This can be used when the first few characteres are enough to tell the authors apart or when the default width is too narrow. To set the width of the author column to 10 put the following in the ~/.tigrc file: set author-width = 10 commit 436a96c95048ad35c9e681f157edabbcb8952350 220fa281d2df7989d68fbde0c669edc4f12e3dd0 tree cf3d2548f6bb77f0da1fe4c9972018614d6f3afc parent 220fa281d2df7989d68fbde0c669edc4f12e3dd0 author Jonas Fonseca 1209767391 +0200 committer Jonas Fonseca 1209767391 +0200 INSTALL: Mention the release notes in the NEWS file commit 220fa281d2df7989d68fbde0c669edc4f12e3dd0 b2c507bfa5cf9024cfba453d24d387915244b777 tree 13d142bfa013ac6b26f795ec073b4ac23dc19750 parent b2c507bfa5cf9024cfba453d24d387915244b777 author Jonas Fonseca 1209766156 +0200 committer Jonas Fonseca 1209766156 +0200 Update NEWS commit b2c507bfa5cf9024cfba453d24d387915244b777 566708902aef029b9c93f90b094419cadf8ae8bf tree 7eda2ee5d43dedc015167bdde2a183a6eff84646 parent 566708902aef029b9c93f90b094419cadf8ae8bf author Jonas Fonseca 1209765719 +0200 committer Jonas Fonseca 1209765724 +0200 Remove useless check in blame_read_file() commit 566708902aef029b9c93f90b094419cadf8ae8bf 0c7a00a005c330f4ece1f577414fd624c97691ff tree ef5e3eae647a991542739d73f224f1a49eb98803 parent 0c7a00a005c330f4ece1f577414fd624c97691ff author Jonas Fonseca 1209418018 +0200 committer Jonas Fonseca 1209418018 +0200 Rename the gitlink:[] AsciiDoc macro to manpage:[] It breaks for AsciiDoc version 8.2.3. commit 0c7a00a005c330f4ece1f577414fd624c97691ff 4f6de33425cfd673dafbd1c3c689bf1ecec35c27 tree baae4f247c55f9f2a130c8f65e951ecdd03eab75 parent 4f6de33425cfd673dafbd1c3c689bf1ecec35c27 author Jonas Fonseca 1209409547 +0200 committer Jonas Fonseca 1209412261 +0200 Fix reopening blame view when it is already loading Move call to end_update() if view->pipe is non-NULL from begin_update() to open_view() so it is called also for views that defines an open() operation. Triggered by Jeff King's "show blame for parent" patch posted to the git mailing list in <20080410040213.GA29618@sigill.intra.peff.net>. commit 4f6de33425cfd673dafbd1c3c689bf1ecec35c27 83c78d3a82fa76aaf7525772573b4a87b1bd072f tree 6a9f279d303ef4babe01b4f6e429b064ed549d0a parent 83c78d3a82fa76aaf7525772573b4a87b1bd072f author Jonas Fonseca 1209334867 +0200 committer Jonas Fonseca 1209335600 +0200 Fix the view notification of end of reading Move notification from update_view() to end_update() so _read() functions are also called when the user requests that loading views are stopped. Allow ends to be forced so the extra spawning in the blame view is closed as well. commit 83c78d3a82fa76aaf7525772573b4a87b1bd072f fd73e841d9db03eaddd929bd084adbffaafbc3c2 tree 073791e79630ef7b823bd77a2108ac8404fa7c0f parent fd73e841d9db03eaddd929bd084adbffaafbc3c2 author Jonas Fonseca 1209286985 +0200 committer Jonas Fonseca 1209287045 +0200 Makefile: remove bashism from distclean rule commit fd73e841d9db03eaddd929bd084adbffaafbc3c2 7a5eba335c2a925b94c28b4ecaf013932a002f65 tree fccf5502e60d2e3aaf60e22551ae92fe77c8b2eb parent 7a5eba335c2a925b94c28b4ecaf013932a002f65 author Jonas Fonseca 1209024454 +0200 committer Jonas Fonseca 1209024870 +0200 Add stage-next action to jump to next diff chunk that can be staged By default bound to '@'. Requested by Pascal Obry. commit 7a5eba335c2a925b94c28b4ecaf013932a002f65 50efd29ce94c4dd90421db29d2516fdde675f8e8 tree 76814ca062c5ceff253381421592e74bb294dcab parent 50efd29ce94c4dd90421db29d2516fdde675f8e8 author Jonas Fonseca 1208987365 +0200 committer Jonas Fonseca 1209024866 +0200 Make configure check for ncurses header files First ncursesw/ncurses.h, then ncurses/ncurses.h, and finally ncurses.h. Also include ncurses.h by default instead of curses.h. On most system ncurses.h should be a symlink to curses.h and this will avoid the problem of including a non-ncurses header file. This should fix systems like Solaris who ships their own version of /usr/include/curses.h that is incompatible with ncurses. Reported by SungHyun Nam. commit 50efd29ce94c4dd90421db29d2516fdde675f8e8 67e3046aa0b07e53833b2262bbdc22b14d6b1f9e tree fdfe932d3527a34b9cf1f1c76fc1969aab729536 parent 67e3046aa0b07e53833b2262bbdc22b14d6b1f9e author Jonas Fonseca 1208978048 +0200 committer Jonas Fonseca 1208987529 +0200 Drop use of $(...) for popen() and system() calls Some shells don't support it, like the jsh that is used as /bin/sh on some Solaris boxes, which results in the following error: sh: syntax error at line 1: `(' unexpected Fix the only user (reading remote information via git-ls-remote) to use a much simpler shell syntax. Reported by SungHyun Nam. commit 3b8b8dc6a3a750ea450eb9782a060d118165e937 d7cb2133b0e3fd4031f84754f98cd5b833e55f65 tree 1985a4739b8aff35edb7ed038139effac833f847 parent d7cb2133b0e3fd4031f84754f98cd5b833e55f65 author Jonas Fonseca 1208911614 +0200 committer Jonas Fonseca 1208911614 +0200 Sync docs commit d7cb2133b0e3fd4031f84754f98cd5b833e55f65 292c4303d70ee0acb36e34a9925bb5a5fce64c93 67e3046aa0b07e53833b2262bbdc22b14d6b1f9e tree 6723a975874eeed239f34070b5081a148dc36b07 parent 292c4303d70ee0acb36e34a9925bb5a5fce64c93 parent 67e3046aa0b07e53833b2262bbdc22b14d6b1f9e author Jonas Fonseca 1208911605 +0200 committer Jonas Fonseca 1208911605 +0200 Merge branch 'master' into release commit 67e3046aa0b07e53833b2262bbdc22b14d6b1f9e d1a6f3279503f0a70b9e7f7ff02a33827d59d795 tree 110fc94e66120bef6f19265b5574a72866b1e840 parent d1a6f3279503f0a70b9e7f7ff02a33827d59d795 author Jonas Fonseca 1208728297 +0200 committer Jonas Fonseca 1208911484 +0200 Add NEWS file commit d1a6f3279503f0a70b9e7f7ff02a33827d59d795 4d5f2434495aa105ba5bbe6e68fbab35e2b1cf02 tree 4d92d0d04f75a17f118a75d020280a500182236b parent 4d5f2434495aa105ba5bbe6e68fbab35e2b1cf02 author Jonas Fonseca 1205953718 +0100 committer Jonas Fonseca 1208905811 +0200 Fix warnings emitted with -pedantic commit 4d5f2434495aa105ba5bbe6e68fbab35e2b1cf02 19d872acee5d702bbfb473301931daa00bbab0c7 tree 256d194879b9bc72cb40dc653ac27fde47eb65b1 parent 19d872acee5d702bbfb473301931daa00bbab0c7 author Jonas Fonseca 1207329778 +0200 committer Jonas Fonseca 1208867412 +0200 Refactor management of the current draw column and max draw width Do it in the draw_* functions instead of all the view draw functions. commit 19d872acee5d702bbfb473301931daa00bbab0c7 12c9cbfb54b1e0a9b79ba23b5197f92ba881c40a tree 5b6997527eb7d932493767e8afb470d60c418cbb parent 12c9cbfb54b1e0a9b79ba23b5197f92ba881c40a author Jonas Fonseca 1208866293 +0200 committer Jonas Fonseca 1208867266 +0200 Use draw_field() for the author field This requires that utf8_length() makes the width/column available to draw_text(). commit 12c9cbfb54b1e0a9b79ba23b5197f92ba881c40a 3485ce24442160d83a37752046438761f254c477 tree c8e3fc693e54fc550f42cd2f2753c57fd1e41789 parent 3485ce24442160d83a37752046438761f254c477 author Jonas Fonseca 1208866114 +0200 committer Jonas Fonseca 1208867256 +0200 Introduce draw_field() helper for drawing main and blame fields It will draw spaces if the passed string is NULL. commit 3485ce24442160d83a37752046438761f254c477 9d2d87286d4dbe502df81e04ae1ba18c1ffe4831 tree 1e036b02bf7ec1863672a7ebf28d98d57139630b parent 9d2d87286d4dbe502df81e04ae1ba18c1ffe4831 author Jonas Fonseca 1208863128 +0200 committer Jonas Fonseca 1208864018 +0200 Refactor revgraph drawing into draw_graphic() commit 9d2d87286d4dbe502df81e04ae1ba18c1ffe4831 df711b9cfd8deccd1a307613c1d2ffaefab2f438 tree 9e0ba785d44f618c69e57c626d400cb952aa3a1f parent df711b9cfd8deccd1a307613c1d2ffaefab2f438 author Jonas Fonseca 1208861822 +0200 committer Jonas Fonseca 1208861822 +0200 blame: simplify handling of incomplete commit information Always wait for the final blame information (the commit filename) to be read before showing any commit information. commit df711b9cfd8deccd1a307613c1d2ffaefab2f438 6362c217c5356b6df6e74fbec066fe756ed479bd tree c84fee97cc306bdb32b4665ee48a383d2984199b parent 6362c217c5356b6df6e74fbec066fe756ed479bd author Jonas Fonseca 1208805456 +0200 committer Jonas Fonseca 1208861418 +0200 Simplify line attribute handling - Add set_view_attr() that wraps calls to wattrset() and does the right thing for the selected line. For successive calls without a change of the attribute nothing will be done. - Make draw_text() take a line attribute since all callers were already calling set_view_attr(). Note: all attribute updates will now also call wchgat() in addition to wattrset(). commit 6362c217c5356b6df6e74fbec066fe756ed479bd d1191d380dd7850b0ca941e56515ed3f565f8e45 tree 71d7b60a551be708ec0c84253ec7ff28f557773f parent d1191d380dd7850b0ca941e56515ed3f565f8e45 author Jonas Fonseca 1208727247 +0200 committer Jonas Fonseca 1208727247 +0200 Keep line graphics characters in a table initialized on startup ... and use ACS_VLINE instead of '|' for the revgraph. commit d1191d380dd7850b0ca941e56515ed3f565f8e45 1cedefdddea3b12d7777eaa523bd6e3fa30b2330 tree 5eb70a08354400fcd456c0f9bdfd11bd9cb4a4e1 parent 1cedefdddea3b12d7777eaa523bd6e3fa30b2330 author Dominik Vogt 1207599303 +0200 committer Jonas Fonseca 1208610991 +0200 Add line-graphics option to disable graphics characters for line drawing Signed-off-by: Jonas Fonseca commit 1cedefdddea3b12d7777eaa523bd6e3fa30b2330 f8bf1324373ee4894327f15a6d6c5d909f55e96c tree 7e29d176a00e0e6d179bb62c2bd0c1386b0bec5f parent f8bf1324373ee4894327f15a6d6c5d909f55e96c author Dominik Vogt 1207568093 +0200 committer Jonas Fonseca 1208434673 +0200 Search checks reference names too Do not search for matches in hidden view elements. Signed-off-by: Jonas Fonseca commit f8bf1324373ee4894327f15a6d6c5d909f55e96c 32751def0d3db091d8a2bc46774ae9eaec5b031d tree cfd52fd5258efa7262795a83d20b11cf0a93b71e parent 32751def0d3db091d8a2bc46774ae9eaec5b031d author Dominik Vogt 1207570825 +0200 committer Jonas Fonseca 1208434654 +0200 Document the main-commit colour option Signed-off-by: Jonas Fonseca commit 32751def0d3db091d8a2bc46774ae9eaec5b031d edd085a6f706cfcba28cb3c7eadc69ce24d38988 tree adbf1444283ba0054772539add727ded3695a759 parent edd085a6f706cfcba28cb3c7eadc69ce24d38988 author Jonas Fonseca 1208434319 +0200 committer Jonas Fonseca 1208434319 +0200 Let ncurses take care of expanding tabs by setting its TABSIZE variable Rename the default tab size from TABSIZE to TAB_SIZE, since it shadows the public ncurses TABSIZE variable which controls how the waddch-family expands tabs when drawing. This makes it possible to finally handle tabsizes different from 8 for UTF-8. commit edd085a6f706cfcba28cb3c7eadc69ce24d38988 808aeafbbf3d49f6232b6132b789ceabc656e079 tree ff9a8c42dcf5e03836c36630b631e4604ca4530e parent 808aeafbbf3d49f6232b6132b789ceabc656e079 author Jonas Fonseca 1207864789 +0200 committer Jonas Fonseca 1207864877 +0200 Refreshing the current view when F5 is pressed (like gitk) commit 808aeafbbf3d49f6232b6132b789ceabc656e079 3003363eb7109d0b25a2ef32615119be0669a2e9 tree 0fa36afd0f7a5c2e86368911c25be3812af40cea parent 3003363eb7109d0b25a2ef32615119be0669a2e9 author Jonas Fonseca 1207864317 +0200 committer Jonas Fonseca 1207864317 +0200 Fix regression from "Improve staging of diff chunks" In commit 234918423a4fac44375317e6c9e7ee54ea09379c the change to stage_update reads: static bool stage_update(struct view *view, struct line *line) { - if (!opt_no_head && stage_line_type != LINE_STAT_UNTRACKED && - (line->type == LINE_DIFF_CHUNK || !stage_status.status)) { - if (!stage_update_chunk(view, line)) { where the !stage_status.status part was meant to match whole sections. Reinstate this behavior so that pressing 'u' when in the stage view for a section of changes it will stage all changed files in that section. commit 3003363eb7109d0b25a2ef32615119be0669a2e9 2ee62946d3aa4fd61ee93ae57c3ae4de690d18db tree ad84da942d25268f3a07eb778e1b13d34fe0627e parent 2ee62946d3aa4fd61ee93ae57c3ae4de690d18db author Jonas Fonseca 1207863903 +0200 committer Jonas Fonseca 1207863903 +0200 Do not reload status and stage views on errors It hides the error message. commit 2ee62946d3aa4fd61ee93ae57c3ae4de690d18db 1e90604620d1a4cc3a3315310ca925eb4cdf7d17 tree 08b5c50b15948517c46b731c2eab02b89f06b25b parent 1e90604620d1a4cc3a3315310ca925eb4cdf7d17 author Jonas Fonseca 1207863828 +0200 committer Jonas Fonseca 1207863828 +0200 Fix AsciiDoc replacing -- in --with-libiconv commit 1e90604620d1a4cc3a3315310ca925eb4cdf7d17 149e5c6e48045ca0e75cca9b3cb68a20346bc443 tree 3c8451d35804d54dd4768d75d5fb8dd4deb2fd7e parent 149e5c6e48045ca0e75cca9b3cb68a20346bc443 author Jonas Fonseca 1207666250 +0200 committer Jonas Fonseca 1207696043 +0200 Squelsh output of update-index when loading the status view (part II) Also include messages from stdout. commit 149e5c6e48045ca0e75cca9b3cb68a20346bc443 429f2f16d67387cebb5b6cc9ef0dfbcfd5b328c2 tree c0d4ed0b360f6be2c9d7bcaddc5fffd36214e727 parent 429f2f16d67387cebb5b6cc9ef0dfbcfd5b328c2 author Jonas Fonseca 1207666147 +0200 committer Jonas Fonseca 1207696038 +0200 Rebind the maximize action to 'O' instead of 'M' The latter is already used for launching the mergetool when in the status view. commit 292c4303d70ee0acb36e34a9925bb5a5fce64c93 464c45fe0d5cc30b4d07421193b596585dd3a6c5 tree 8dd8876a89853259293226a5931a7d31e22eee36 parent 464c45fe0d5cc30b4d07421193b596585dd3a6c5 author Jonas Fonseca 1207510216 +0200 committer Jonas Fonseca 1207510216 +0200 Sync docs commit 464c45fe0d5cc30b4d07421193b596585dd3a6c5 e99559fac68109f3d2dd77ceb6978933316bb95c 429f2f16d67387cebb5b6cc9ef0dfbcfd5b328c2 tree 491c3c5dfb4dc76bb03ca2f9d9047d519a29646a parent e99559fac68109f3d2dd77ceb6978933316bb95c parent 429f2f16d67387cebb5b6cc9ef0dfbcfd5b328c2 author Jonas Fonseca 1207510208 +0200 committer Jonas Fonseca 1207510208 +0200 Merge branch 'master' into release commit 429f2f16d67387cebb5b6cc9ef0dfbcfd5b328c2 621beeda3b56ecbcd5faca712794a0461f0fe0bb tree c4e01e557d72fa6fb91745e455fd12fdf5406817 parent 621beeda3b56ecbcd5faca712794a0461f0fe0bb author Jonas Fonseca 1207510094 +0200 committer Jonas Fonseca 1207510094 +0200 tig-0.11 commit 621beeda3b56ecbcd5faca712794a0461f0fe0bb 1f062cba8e5f8d131b7b03cd9790723f5fe93bd8 tree 00faf11bd8b83ad3c48c5f2289648f5f87eff0e6 parent 1f062cba8e5f8d131b7b03cd9790723f5fe93bd8 author Jonas Fonseca 1207510051 +0200 committer Jonas Fonseca 1207510051 +0200 Use sans-serif font for the README page commit 1f062cba8e5f8d131b7b03cd9790723f5fe93bd8 fcd29a27c232f4baf8253ab027b935332f64e539 tree 02a48dd2a20bb468897208e790cc733a501fb5be parent fcd29a27c232f4baf8253ab027b935332f64e539 author Jonas Fonseca 1207503996 +0200 committer Jonas Fonseca 1207503996 +0200 Update copyright notice for the manual commit fcd29a27c232f4baf8253ab027b935332f64e539 1f1349b63aa85edd4c4843a8e98c1143fe2ad606 tree 90efc7a5db0cd4b44163fb3ab61072bddec0f5c2 parent 1f1349b63aa85edd4c4843a8e98c1143fe2ad606 author Jonas Fonseca 1207503978 +0200 committer Jonas Fonseca 1207503978 +0200 Remove unused blame line attributes commit 1f1349b63aa85edd4c4843a8e98c1143fe2ad606 f1b8c11103e7c7f45c896396c5f4ff88884e46a3 tree 1f75fc3228ea58a75f9cccb80087de0fcef9b2db parent f1b8c11103e7c7f45c896396c5f4ff88884e46a3 author Jonas Fonseca 1207503965 +0200 committer Jonas Fonseca 1207503965 +0200 Use tables for listing the UI colors commit f1b8c11103e7c7f45c896396c5f4ff88884e46a3 a7135f692feeebce9cef7a3c287ea6072c1ef2d5 tree 32dbfdc09a818c6ced8082a71d6c4bf72b20a5ff parent a7135f692feeebce9cef7a3c287ea6072c1ef2d5 author Jonas Fonseca 1207240499 +0200 committer Jonas Fonseca 1207483530 +0200 Minor cleanup in blame_draw commit a7135f692feeebce9cef7a3c287ea6072c1ef2d5 5962bec9409eaae80b8fb35cbcb7caabdffb73ae tree 6dbe81b7545d2925a29129284c8f48ac7dc036b1 parent 5962bec9409eaae80b8fb35cbcb7caabdffb73ae author Jonas Fonseca 1207237629 +0200 committer Jonas Fonseca 1207483530 +0200 Setup colors for the selected line in draw_view_line() commit 5962bec9409eaae80b8fb35cbcb7caabdffb73ae 6bc9f975323a4f43cd5d2ba90df3dbd5c12b42cd tree 8de707f1255590c9fab19fed6f7fbae8c562265a parent 6bc9f975323a4f43cd5d2ba90df3dbd5c12b42cd author Jonas Fonseca 1207251042 +0200 committer Jonas Fonseca 1207483488 +0200 Make the main and blame view share date drawing and date colors Renames the main-date color to date. commit 6bc9f975323a4f43cd5d2ba90df3dbd5c12b42cd 10c6cb0c5fce3628932f9695e25d44537fd1de60 tree 9cf1cd74a0878c3914a020b3354ff6b6f125e9af parent 10c6cb0c5fce3628932f9695e25d44537fd1de60 author Jonas Fonseca 1207348843 +0200 committer Jonas Fonseca 1207348843 +0200 Squelsh output of update-index when loading the status view commit 10c6cb0c5fce3628932f9695e25d44537fd1de60 c8116003a284e9772d000ad8089ab512ea9d9dd3 tree b21fd28b1bbc2e684d2d7c64c378d92b53d3dac3 parent c8116003a284e9772d000ad8089ab512ea9d9dd3 author Jonas Fonseca 1207340244 +0200 committer Jonas Fonseca 1207340244 +0200 Avoid splitting the view when navigating stage view in full screen commit c8116003a284e9772d000ad8089ab512ea9d9dd3 d9d43d617e6ed462fdd3b8ced31f08312bc15870 tree 56a525de3f37f21b2f1c15aff36d91a9a927449c parent d9d43d617e6ed462fdd3b8ced31f08312bc15870 author Jonas Fonseca 1207302203 +0200 committer Jonas Fonseca 1207302203 +0200 Use 3 as the minimum width of formatted line numbers It gives a more pleasant experience when "digging" through commits. And of course, most commits will have diffs smaller than 1000 lines!? For the blame view it means less flickering in the startup when the whole file is read. commit d9d43d617e6ed462fdd3b8ced31f08312bc15870 3704f96bd94e20eb7e516afdd9e324ea1dcc7f4d tree 4eed7d054293ac65cefab55810e9205b8f506d50 parent 3704f96bd94e20eb7e516afdd9e324ea1dcc7f4d author Jonas Fonseca 1207301447 +0200 committer Jonas Fonseca 1207301447 +0200 Revert "When toggling options redraw the view instead of the whole display" This reverts commit d79f15772b0489ae3bf77322706016c733a714c9. commit 3704f96bd94e20eb7e516afdd9e324ea1dcc7f4d 3bdbba9aef3a4945f9e3ee93162579b05e64e900 tree 0a88f7df71fbfb2e0400687eae8c6ba6aecc9f5b parent 3bdbba9aef3a4945f9e3ee93162579b05e64e900 author Jonas Fonseca 1207266687 +0200 committer Jonas Fonseca 1207266687 +0200 Fix compatibility for git rev-parse without --symbolic-full-name Use symbolic-ref instead. commit 3bdbba9aef3a4945f9e3ee93162579b05e64e900 234918423a4fac44375317e6c9e7ee54ea09379c tree 83bf406b84955f854cac81251f1d9772c0e01e67 parent 234918423a4fac44375317e6c9e7ee54ea09379c author Jonas Fonseca 1207266206 +0200 committer Jonas Fonseca 1207266206 +0200 Error out when starting up in empty main or blame view This usually means that the arguments did not match any revisions or file. commit 234918423a4fac44375317e6c9e7ee54ea09379c 1e61580b7bdf4f60e4b222f9aeb9421a50c27eb2 tree e1a4a0b60e95dbade0f108bdba8f808de45ce1b3 parent 1e61580b7bdf4f60e4b222f9aeb9421a50c27eb2 author Jonas Fonseca 1207263801 +0200 committer Jonas Fonseca 1207263801 +0200 Improve staging of diff chunks As suggested by Petr Baudis some year ago, make updating of chunks work stage the chunk the cursor line is within instead of the whole file. Still stage everything when the cursor is in the diff --stat header. commit 1e61580b7bdf4f60e4b222f9aeb9421a50c27eb2 61e39818ca8d9f26a248bed6d92198b37849ecc1 tree c08987a9a7eabba637cba60c9b7c53b2168683b7 parent 61e39818ca8d9f26a248bed6d92198b37849ecc1 author Jonas Fonseca 1207233960 +0200 committer Jonas Fonseca 1207244010 +0200 Reload the status and stage views after a run request has been handled commit 61e39818ca8d9f26a248bed6d92198b37849ecc1 d79f15772b0489ae3bf77322706016c733a714c9 tree f762983ccb587a286d51d503f243dda7c55c9442 parent d79f15772b0489ae3bf77322706016c733a714c9 author Jonas Fonseca 1207233669 +0200 committer Jonas Fonseca 1207244010 +0200 Add support for refreshing of the stage view Consolidate stage reloading for the edit, refresh, and update requests. It works by first reloading the status view after which the stage view is closed or reloaded depending on whether the status information of the stage view still is valid. commit d79f15772b0489ae3bf77322706016c733a714c9 cc73d2e1c7f323f59b565720b15f5e21401168e4 tree 4d78e23860fc7e56e73336788dfbe8166f50f100 parent cc73d2e1c7f323f59b565720b15f5e21401168e4 author Jonas Fonseca 1207243091 +0200 committer Jonas Fonseca 1207243316 +0200 When toggling options redraw the view instead of the whole display commit cc73d2e1c7f323f59b565720b15f5e21401168e4 2a67fb2a5ea1238b3606b62a3de98fb80bf98547 tree a12a5b816403d0dcf7b52c742a86d3b48d75b7ac parent 2a67fb2a5ea1238b3606b62a3de98fb80bf98547 author Jonas Fonseca 1207242462 +0200 committer Jonas Fonseca 1207242665 +0200 Use werase() instead of wclear() when reloading a view It behaves much better by not causing the parent view to be repainted. commit 2a67fb2a5ea1238b3606b62a3de98fb80bf98547 417ae6d7b27e0869a03a68d0d486c70e1c68c907 tree ed1c628472a21e483b5008c18dd760d540bb4a8a parent 417ae6d7b27e0869a03a68d0d486c70e1c68c907 author Jonas Fonseca 1207234935 +0200 committer Jonas Fonseca 1207237847 +0200 Share the line number colors between blame view and others Renames the blame-lineno color to line-number. commit 417ae6d7b27e0869a03a68d0d486c70e1c68c907 fbe047c9fd2c848e9eeb22bc2055dc8f52d3b7c6 tree ab6b236abe44cf6b71c7c01b16c30f2a314fc331 parent fbe047c9fd2c848e9eeb22bc2055dc8f52d3b7c6 author Jonas Fonseca 1207230441 +0200 committer Jonas Fonseca 1207230441 +0200 Rename load_repo_config() to load_git_config() commit fbe047c9fd2c848e9eeb22bc2055dc8f52d3b7c6 251acae219225cb1b6e5cfef73e1720b6dd2d528 tree 498a4fb0783f746d37d2775ad741a317bc58e4d1 parent 251acae219225cb1b6e5cfef73e1720b6dd2d528 author Jonas Fonseca 1207229084 +0200 committer Jonas Fonseca 1207229084 +0200 Do not load repository references when acting as a pager It will cause git ls-remote to print an error message. commit 251acae219225cb1b6e5cfef73e1720b6dd2d528 8f0bd8d8dc279355288e955a12949808fddf484a f2cd17cdbf366aa2c3b22b710c9161cd9b201dff tree f9a38a21944229275874cb3981fdb88b866ca47a parent 8f0bd8d8dc279355288e955a12949808fddf484a parent f2cd17cdbf366aa2c3b22b710c9161cd9b201dff author Jonas Fonseca 1207173675 +0200 committer Jonas Fonseca 1207173675 +0200 Merge branch 'master' of remote-server:src/tig commit f2cd17cdbf366aa2c3b22b710c9161cd9b201dff f4de14c5762fe2beef8633a254c470a37376b4c2 tree 15c722d028f575678c962674f866cb54a2b37d2f parent f4de14c5762fe2beef8633a254c470a37376b4c2 author Jonas Fonseca 1207174422 +0200 committer Jonas Fonseca 1207174422 +0200 status: use draw_text completely commit 8f0bd8d8dc279355288e955a12949808fddf484a 8b3475e63853b53144e06ee9f808f434ad1239d3 tree a4d3055fc8170bc2f6ab4d8019382323f239a7b7 parent 8b3475e63853b53144e06ee9f808f434ad1239d3 author Jonas Fonseca 1207173555 +0200 committer Jonas Fonseca 1207173581 +0200 Make local tags and normal branches use normal font-weight Change color of HEAD reference to use cyan as normal branches but with bold font. commit 8b3475e63853b53144e06ee9f808f434ad1239d3 d7e6b0e8becfba33c786a4f154e9841275b9d03d tree 46e9f150c788d8cbef71519b671530e691e18f2d parent d7e6b0e8becfba33c786a4f154e9841275b9d03d author Jonas Fonseca 1207173428 +0200 committer Jonas Fonseca 1207173428 +0200 Show the tracked remote branch with bold text ... and others with normal font-weight. commit f4de14c5762fe2beef8633a254c470a37376b4c2 47dd652b1b266895fca36f8dec07b16a506fb56a tree d5663c3a39828599d09d0ed82f36b62c087e63c7 parent 47dd652b1b266895fca36f8dec07b16a506fb56a author Jonas Fonseca 1207170880 +0200 committer Jonas Fonseca 1207172284 +0200 Add draw_lineno() and use when drawing the blame and pager view commit 47dd652b1b266895fca36f8dec07b16a506fb56a d7e6b0e8becfba33c786a4f154e9841275b9d03d tree d1a2cbd0787cdc5ba26733e12c9c0720a144ef0d parent d7e6b0e8becfba33c786a4f154e9841275b9d03d author Jonas Fonseca 1207168026 +0200 committer Jonas Fonseca 1207168346 +0200 Add action to maximize the current view; bound to M by default commit d7e6b0e8becfba33c786a4f154e9841275b9d03d 094e6ab0e900bf8546bc95e3e034e7630574b644 tree 8347071c519d8fedbefaa04724f895ab136f75ae parent 094e6ab0e900bf8546bc95e3e034e7630574b644 author Jonas Fonseca 1206985882 +0200 committer Jonas Fonseca 1206985882 +0200 Disable opening views that require a git directory when in pager mode commit 094e6ab0e900bf8546bc95e3e034e7630574b644 bc02ff85afe6c89ea38a2bba765504276dc3b113 tree c0adeed2e655f57adc03ba6edb04013b76e57f62 parent bc02ff85afe6c89ea38a2bba765504276dc3b113 author Jonas Fonseca 1206985862 +0200 committer Jonas Fonseca 1206985862 +0200 Fix pager mode by always doing the isatty() Also relax the opt_git_dir check. commit bc02ff85afe6c89ea38a2bba765504276dc3b113 cbbd7f62503d2aa28a268540a3491933d0d7171d tree 46a8751fed5c319b2141f135c09ca0bb2a4322bb parent cbbd7f62503d2aa28a268540a3491933d0d7171d author Jonas Fonseca 1206961425 +0200 committer Jonas Fonseca 1206961425 +0200 stage: disable whitespace warnings from git apply when staging updates commit cbbd7f62503d2aa28a268540a3491933d0d7171d 318628193256a71ffe9a7a9f595ad1c8e74b239f tree 47c1de57a7deb397510f8ef8f90c126afa1f72f4 parent 318628193256a71ffe9a7a9f595ad1c8e74b239f author Jonas Fonseca 1206647063 +0100 committer Jonas Fonseca 1206647122 +0100 Improve perfomance and usability when updating many files Split the update function into one for single file and all files in a section so that only one fork of update-index is required in both cases. Show progress for long running updates (e.g. importing the Linux kernel) where git needs to hash many objects (>20k). commit 318628193256a71ffe9a7a9f595ad1c8e74b239f 7672417830e55a1544b7e9d0d1afd11f0f98dbf6 tree 90750bc4f3420de2d314df9dc51c8a7d08b09096 parent 7672417830e55a1544b7e9d0d1afd11f0f98dbf6 author Jonas Fonseca 1206614820 +0100 committer Jonas Fonseca 1206647122 +0100 Fix and improve status refreshing after updating Update the view offset so the current line is already visible. This requires that the display is split or initialized before starting to load the view so status_open has the view->height available. commit 7672417830e55a1544b7e9d0d1afd11f0f98dbf6 ab7a48a1c2dcfc89bc89f3bf28674d724bb58ee3 tree 53605fa4189a98757d3f8845e3ac4d0ee9bbd694 parent ab7a48a1c2dcfc89bc89f3bf28674d724bb58ee3 author Jonas Fonseca 1206645610 +0100 committer Jonas Fonseca 1206647121 +0100 Fix uninitialized variable warning commit ab7a48a1c2dcfc89bc89f3bf28674d724bb58ee3 7be144b43e6ab74dd5ad9d8f109e5f2bc84e5118 tree 6693a6d045d774212017abd491b2171889a9fbe7 parent 7be144b43e6ab74dd5ad9d8f109e5f2bc84e5118 author Stefan Naewe 1206533093 +0100 committer Jonas Fonseca 1206606689 +0100 Output extra \n on tig -h The usage string does not contain a '\n' as the last character which is annoying when calling 'tig -h'. Signed-off-by: Jonas Fonseca commit 7be144b43e6ab74dd5ad9d8f109e5f2bc84e5118 accccb2b9d89e13e5b86ac7af7160446a65349ab tree cc580202931f74349e9d70922b9c179bed6ea2c8 parent accccb2b9d89e13e5b86ac7af7160446a65349ab author Jonas Fonseca 1206528868 +0100 committer Jonas Fonseca 1206528868 +0100 Avoid reloading the status view when nothing was updated commit accccb2b9d89e13e5b86ac7af7160446a65349ab 22d9b77cc7819b2dfce44f968c3df3ee4c2ccdae tree 2b95baa1f70d84ff7a241800e003b211040b92ff parent 22d9b77cc7819b2dfce44f968c3df3ee4c2ccdae author Jonas Fonseca 1206527966 +0100 committer Jonas Fonseca 1206527966 +0100 Oops, fix delimiter documentation commit 22d9b77cc7819b2dfce44f968c3df3ee4c2ccdae de46362f24d53b4a6ccb9c70e446a1d32b05f08d tree 0978582f679dcfaef0c670456bde90a50e3d81b9 parent de46362f24d53b4a6ccb9c70e446a1d32b05f08d author Jonas Fonseca 1206527160 +0100 committer Jonas Fonseca 1206527160 +0100 Add support for preparing the initial commit in the status view commit de46362f24d53b4a6ccb9c70e446a1d32b05f08d f5a5e640f1fc42e3e95c51b827dff738e7dbf1ec tree bf2ead626eb6bc8ccc81052cc5247df27f8a124e parent f5a5e640f1fc42e3e95c51b827dff738e7dbf1ec author Jonas Fonseca 1206522947 +0100 committer Jonas Fonseca 1206522947 +0100 Rename "main-delim" color to the more generic "delimiter" It was already used by views other than main. commit f5a5e640f1fc42e3e95c51b827dff738e7dbf1ec 70ea81756390302e6dd816b3c2de87a614879d0f tree db9b8e0f33b20d5761fe7155384be024b2527207 parent 70ea81756390302e6dd816b3c2de87a614879d0f author Jonas Fonseca 1206521419 +0100 committer Jonas Fonseca 1206521768 +0100 Show the current branch in the status view Also, improve the positioning of the cursor line after updates to restore or select something that is "updateable". Adding new files should now work more intuitively. commit 70ea81756390302e6dd816b3c2de87a614879d0f 8f298f3e6cb13baaf569690aedd00cb3713039b9 tree 9ed09d6a8fbe0d04c024447415ab6a05db60b99b parent 8f298f3e6cb13baaf569690aedd00cb3713039b9 author Jonas Fonseca 1206477818 +0100 committer Jonas Fonseca 1206520832 +0100 Save current branch from rev-parse output and highlight it The chosen color is red with bold font, however, maybe all other refs should be toned down and only the current branch should use bold font. commit 8f298f3e6cb13baaf569690aedd00cb3713039b9 33d43e78b3c214adc9178b1c3b6e02311247da79 tree 48c8adcf0645eb375a7837391a1c5438f91b77e0 parent 33d43e78b3c214adc9178b1c3b6e02311247da79 author Jonas Fonseca 1206317423 +0100 committer Jonas Fonseca 1206318464 +0100 blame: Fix opening from subdirectory and consecutive invokations commit 33d43e78b3c214adc9178b1c3b6e02311247da79 442cbee3410462e4b1303ccc0dda1d7f5b5242a3 tree 3ef0ab9c5085bb82f38abbaa84acd01a9ef6dbb5 parent 442cbee3410462e4b1303ccc0dda1d7f5b5242a3 author Jonas Fonseca 1206235781 +0100 committer Jonas Fonseca 1206280265 +0100 Remove deprecated options and cleanup option parsing commit 442cbee3410462e4b1303ccc0dda1d7f5b5242a3 a2d5d9ef5bf234e230a5bac2ad36ba24158774d8 tree 4fba7b9d3c894d3bcbc8ca079994c8cb4c29b064 parent a2d5d9ef5bf234e230a5bac2ad36ba24158774d8 author Jonas Fonseca 1206280248 +0100 committer Jonas Fonseca 1206280265 +0100 More blame view fixes commit a2d5d9ef5bf234e230a5bac2ad36ba24158774d8 8a6809884863eb60c9c0f8727ff77722d6b85414 tree b076eafb7ee634a52eafdea263d2559dc7f322bc parent 8a6809884863eb60c9c0f8727ff77722d6b85414 author Jonas Fonseca 1206237603 +0100 committer Jonas Fonseca 1206243890 +0100 Various fixes and improvements of the new blame view - Fix entering from status and stage views by making opt_ref setting optional. - Use separate opt_file variable, since the tree view also uses opt_path. commit 8a6809884863eb60c9c0f8727ff77722d6b85414 4ed67514df1103bfaeec3d549578e59cead74151 tree 99d03a05182cb19f03462ea870756c48f390a8ba parent 4ed67514df1103bfaeec3d549578e59cead74151 author Jonas Fonseca 1206151500 +0100 committer Jonas Fonseca 1206226588 +0100 Add blame view It may both be entered from the command line using: tig blame [rev] path or from either the status and stage, as well as by using the tree view to navigte. commit 4ed67514df1103bfaeec3d549578e59cead74151 c36979d964f582a51e2b6e5c8d82d7974218efd1 tree 3da340a46bb0102cd17b9f0fb4c4e57d37798363 parent c36979d964f582a51e2b6e5c8d82d7974218efd1 author Jonas Fonseca 1206218131 +0100 committer Jonas Fonseca 1206218131 +0100 Add hack to allow view loading to have multiple phases .. by avoiding end_update() call after last read line. commit c36979d964f582a51e2b6e5c8d82d7974218efd1 a00fff3cc7b71eb6b75ef38e6fe7de060921f53f tree c62369d47b044b7979813d76dcf71f3082024216 parent a00fff3cc7b71eb6b75ef38e6fe7de060921f53f author Jonas Fonseca 1206116848 +0100 committer Jonas Fonseca 1206217251 +0100 Simplify subcommand option parsing by moving it out of the loop commit a00fff3cc7b71eb6b75ef38e6fe7de060921f53f d3b19ca4812677d06507cb70de40ed0de3cbe41b tree 2a5c1229a83f64053d060062fc234ec776c8b95a parent d3b19ca4812677d06507cb70de40ed0de3cbe41b author Jonas Fonseca 1206122694 +0100 committer Jonas Fonseca 1206122694 +0100 draw_text: remove unused col argument commit d3b19ca4812677d06507cb70de40ed0de3cbe41b 504fbeeb9b6e7db4c9dfac9c54489b19a33a9c67 tree 65b387a99d0751a435efddbbbc34ab1c1e56b38f parent 504fbeeb9b6e7db4c9dfac9c54489b19a33a9c67 author Jonas Fonseca 1206118426 +0100 committer Jonas Fonseca 1206120045 +0100 Use rewritten parent info from --parents to simplify the revgraph commit 504fbeeb9b6e7db4c9dfac9c54489b19a33a9c67 e97cce13451bb19332b2b1546ed50ab615a92f18 tree fc530981343e1eb6350508746a7a99fc43544d78 parent e97cce13451bb19332b2b1546ed50ab615a92f18 author Jonas Fonseca 1206037664 +0100 committer Jonas Fonseca 1206037664 +0100 Move unrelated UTF-8 setup code out of parse_options commit e97cce13451bb19332b2b1546ed50ab615a92f18 e62ea4d3cba6b8872882879bc663fa486d35f297 tree dc8b7e5caf3cf53ba8198b916176e822ae909a00 parent e62ea4d3cba6b8872882879bc663fa486d35f297 author Jonas Fonseca 1206036522 +0100 committer Jonas Fonseca 1206036522 +0100 tigrc(5): Improve documentation of new show-* options commit e62ea4d3cba6b8872882879bc663fa486d35f297 518234f10b5edacca3400f197f4e32d9448bf2e6 tree 950dc78cbf568d6c2dbf4fc49f476516af824875 parent 518234f10b5edacca3400f197f4e32d9448bf2e6 author Jonas Fonseca 1206035885 +0100 committer Jonas Fonseca 1206035994 +0100 configure: test for git binary and improve config subcommand test commit 518234f10b5edacca3400f197f4e32d9448bf2e6 8d762458a1fba788888c7b06d971e3ddb927fbc9 tree 4a62691c8c01d96eb120a66ed9ee5d6a26b0ae1a parent 8d762458a1fba788888c7b06d971e3ddb927fbc9 author Dominik Vogt 1206025745 +0100 committer Jonas Fonseca 1206035994 +0100 Call realloc() less often because it is potentially slow. Signed-off-by: Dominik Vogt Signed-off-by: Jonas Fonseca commit 8d762458a1fba788888c7b06d971e3ddb927fbc9 2384880b53023f3ee48642ca2e68a84d9ff6c3a4 tree cd3c29162ae992775935110f0bcf386fac9fcdb0 parent 2384880b53023f3ee48642ca2e68a84d9ff6c3a4 author Dominik Vogt 1206027676 +0100 committer Jonas Fonseca 1206035994 +0100 New config options show-author, show-date, show-refs, show-line-numbers. Signed-off-by: Jonas Fonseca commit 2384880b53023f3ee48642ca2e68a84d9ff6c3a4 823057f4b3ca7e63b599e3812d41566b8313ca67 tree 42cfa8fd9e91a9d6e51b23c783e6d2745bb8552f parent 823057f4b3ca7e63b599e3812d41566b8313ca67 author Dominik Vogt 1205964520 +0100 committer Jonas Fonseca 1206035994 +0100 Fixed displaying local tags. Added a new colour main-local-tag. Signed-off-by: Dominik Vogt Signed-off-by: Jonas Fonseca commit 823057f4b3ca7e63b599e3812d41566b8313ca67 b1744cbe9a54bc7b62b1c5316b6e73ab95cfea12 tree 4bfa94991c9b84ac14c7f1d2b01885912b80b3bf parent b1744cbe9a54bc7b62b1c5316b6e73ab95cfea12 author Dominik Vogt 1206008606 +0100 committer Jonas Fonseca 1206016470 +0100 New actions toggle-date, toggle-author, and toggle-refs. Signed-off-by: Dominik Vogt Signed-off-by: Jonas Fonseca commit b1744cbe9a54bc7b62b1c5316b6e73ab95cfea12 220265483d86f175a23b09407b6923e5829e800f tree 567ff44f2096dd18efe37946f9402a42299b5954 parent 220265483d86f175a23b09407b6923e5829e800f author Jonas Fonseca 1206015700 +0100 committer Jonas Fonseca 1206016470 +0100 Fix index refreshing into separate call so diff-files is always run commit 220265483d86f175a23b09407b6923e5829e800f 7102999334501e11d293c43fe13bd1ad982ddb2e tree 594efde5ea9a264955671d8392d99c0553b57398 parent 7102999334501e11d293c43fe13bd1ad982ddb2e author Jonas Fonseca 1205974466 +0100 committer Jonas Fonseca 1206013131 +0100 draw_text: reduce indentation level commit 7102999334501e11d293c43fe13bd1ad982ddb2e 012e76e9df6edd83b9546303a2d334dfcd682f41 tree 94fde1ba0483d5602b53462e2413c45610c8690d parent 012e76e9df6edd83b9546303a2d334dfcd682f41 author Jonas Fonseca 1205974416 +0100 committer Jonas Fonseca 1206013130 +0100 draw_text: minor cleanup to use fewer local variables commit 012e76e9df6edd83b9546303a2d334dfcd682f41 23222036303a7c36afcd008a02bc80299ea9932c tree 571ddd8769b2bbfbd1985ee438e31b0ab9d37a31 parent 23222036303a7c36afcd008a02bc80299ea9932c author Jonas Fonseca 1205974269 +0100 committer Jonas Fonseca 1206013130 +0100 utf8_length: add reserve flag for reserving a trailing character Replace unused coloffset with reserve flag, which will reserve at least one character cell at the end. Use it for reserving a delimiter character when use_tilde is TRUE, and avoid a second call to utf8_length(). commit 23222036303a7c36afcd008a02bc80299ea9932c 6aa902418a42bbc8636d24c833f5f98f223ef910 tree 290bd7f2bb65286cbd37f170dc56feb8e4986c47 parent 6aa902418a42bbc8636d24c833f5f98f223ef910 author Jonas Fonseca 1205974301 +0100 committer Jonas Fonseca 1206013130 +0100 TODO: --boundary flag is already used commit 6aa902418a42bbc8636d24c833f5f98f223ef910 abc10a73a9d05a8d3c697e83fc4c71f39f4c2e80 tree e1cfdcf540ca8dd01b6d89a7e58013e3e68dab1c parent abc10a73a9d05a8d3c697e83fc4c71f39f4c2e80 author Jonas Fonseca 1206012477 +0100 committer Jonas Fonseca 1206012604 +0100 0.11.git commit e99559fac68109f3d2dd77ceb6978933316bb95c 57a336b7ec1783ee4973841de0748485a03fde18 tree 53c80237e465ad042520e68fc4a8071caddf8e5c parent 57a336b7ec1783ee4973841de0748485a03fde18 author Jonas Fonseca 1205967109 +0100 committer Jonas Fonseca 1205967109 +0100 Sync docs commit 57a336b7ec1783ee4973841de0748485a03fde18 47efdc1242e73bdba63bb125449c066f8f77e035 abc10a73a9d05a8d3c697e83fc4c71f39f4c2e80 tree 9ebdb3fd83d7a346faf4a75225d3c92de5ada867 parent 47efdc1242e73bdba63bb125449c066f8f77e035 parent abc10a73a9d05a8d3c697e83fc4c71f39f4c2e80 author Jonas Fonseca 1205967102 +0100 committer Jonas Fonseca 1205967102 +0100 Merge branch 'master' into release commit abc10a73a9d05a8d3c697e83fc4c71f39f4c2e80 ee74874b7fa9a16c92fae85365ed625196f6f3b4 tree 5ae19945ec13711d4ead8e7ff9a287c4dfd213c3 parent ee74874b7fa9a16c92fae85365ed625196f6f3b4 author Jonas Fonseca 1205966736 +0100 committer Jonas Fonseca 1205967003 +0100 tig-0.10.1 commit ee74874b7fa9a16c92fae85365ed625196f6f3b4 749cdc920d998d1c9a0b05c94c5f1f63cb96ab46 tree f9d95b147c82e10840507d9aaef9bc2c0443ec57 parent 749cdc920d998d1c9a0b05c94c5f1f63cb96ab46 author Dominik Vogt 1202482226 +0100 committer Jonas Fonseca 1205967003 +0100 More verbose diff headers (including dates and committer) Signed-off-by: Jonas Fonseca commit 749cdc920d998d1c9a0b05c94c5f1f63cb96ab46 1c919d6892fd73b7fb51643df250eda4e325ce74 tree 688e254d9af3f9002d1a472c261b281cd07be00e parent 1c919d6892fd73b7fb51643df250eda4e325ce74 author Jonas Fonseca 1205966154 +0100 committer Jonas Fonseca 1205967000 +0100 Fix drawing "outside" the screen in the status and pager views It was causing text to wrap to next line, but with the new function to draw text with limited width this has become much easier. commit 1c919d6892fd73b7fb51643df250eda4e325ce74 6a19a30372cca7c252afcf6adbb31b6e9ecdee9b tree 4a8a5dfd8e57a8a933c04dc46c6723a4515ffba5 parent 6a19a30372cca7c252afcf6adbb31b6e9ecdee9b author Dominik Vogt 1198755796 +0100 committer Jonas Fonseca 1205966223 +0100 Fixed handling of UTF8 tag names and commit messages. [ jf: fix off-by-one error for trimmed tilde drawing and bad padding substraction ] Signed-off-by: Jonas Fonseca commit 6a19a30372cca7c252afcf6adbb31b6e9ecdee9b 9295982a3492d52bc85a6b7b12817ca3d6fbe007 tree 770a8a775770020fcb582b9935e439d54dc13f65 parent 9295982a3492d52bc85a6b7b12817ca3d6fbe007 author Jonas Fonseca 1205959226 +0100 committer Jonas Fonseca 1205960823 +0100 Make configure search for the ncursesw library first Also (unconditionally) define _XOPEN_SOURCE_EXTENDED before including curses.h to have extended functions as recommended by ncurses(3). commit 9295982a3492d52bc85a6b7b12817ca3d6fbe007 5bdd523b102f44471068e52db0e0462440a78fd1 tree 332cf7d9239b01841acf54f2ff0c08fe64c155a5 parent 5bdd523b102f44471068e52db0e0462440a78fd1 author Dominik Vogt 1202836472 +0100 committer Jonas Fonseca 1205959659 +0100 Fix compiler warnings: pointer of type ‘void *’ used in arithmetic Signed-off-by: Jonas Fonseca commit 5bdd523b102f44471068e52db0e0462440a78fd1 bfb1ff9519ef60d33d6befe6c24b77233b776a33 tree e28dc9ea1c815a2fc1920579779587415f189b72 parent bfb1ff9519ef60d33d6befe6c24b77233b776a33 author Russell Steicke 1205830063 +0900 committer Jonas Fonseca 1205959659 +0100 Fix signed char comparison where char is unsigned by default tig uses a char as a flag, and expects that to have three values: TRUE, FALSE, and -1. When char is unsigned char (such as on PPC), this fails with the compiler warning "comparison is always false due to limited range of data type". So explicitly make the flag a signed char. Detecting the int8_t type with the autoconf macro AC_CREATE_STDINT_H would probably be a better fix. Signed-off-by: Russell Steicke Signed-off-by: Jonas Fonseca commit bfb1ff9519ef60d33d6befe6c24b77233b776a33 c630ef12f388ecb40834d9b4456ce80fc499dedf tree 47994de94c2afced06a7d00a05ce60ff561df93f parent c630ef12f388ecb40834d9b4456ce80fc499dedf author Peter Karlsson 1205829744 +0100 committer Jonas Fonseca 1205959659 +0100 Fixed spurious "/bin/sh: --list: command not found" error If git has been installed with a separate libexecdir which is not in path (for example, a standard msysgit installation), tig would not find "git-config", and we must instead find the "git" binary and call it as "git config". Signed-off-by: Peter Karlsson Signed-off-by: Jonas Fonseca commit 47efdc1242e73bdba63bb125449c066f8f77e035 1267e0adf89c2370bddc8371fbb76356b21925e5 tree 8e23ac6c5fd6535ec3b285492da3412b1b2425fc parent 1267e0adf89c2370bddc8371fbb76356b21925e5 author Jonas Fonseca 1205763096 +0100 committer Jonas Fonseca 1205763096 +0100 Sync docs commit 1267e0adf89c2370bddc8371fbb76356b21925e5 ea8b16de525465d73e3f03f6922db6c88a804a49 c630ef12f388ecb40834d9b4456ce80fc499dedf tree e36145ae672728e0563e517292ffbbe264da13cd parent ea8b16de525465d73e3f03f6922db6c88a804a49 parent c630ef12f388ecb40834d9b4456ce80fc499dedf author Jonas Fonseca 1205763089 +0100 committer Jonas Fonseca 1205763089 +0100 Merge branch 'master' into release commit c630ef12f388ecb40834d9b4456ce80fc499dedf 5ba030cfa7b4b6729000c8f3d36fdc78d4b77f95 tree dd0255e46167a228b00e0864478e3332b5027695 parent 5ba030cfa7b4b6729000c8f3d36fdc78d4b77f95 author Jonas Fonseca 1205762331 +0100 committer Jonas Fonseca 1205762473 +0100 Refresh the index when opening the status view to avoid "empty diffs" commit 5ba030cfa7b4b6729000c8f3d36fdc78d4b77f95 c9ae230ff7fa3cb944f228e1fb0329cd370a9ee5 tree 1168c30fe224acc4db7b833f6e45633d18c95b02 parent c9ae230ff7fa3cb944f228e1fb0329cd370a9ee5 author Jonas Fonseca 1205525114 +0100 committer Jonas Fonseca 1205761003 +0100 Add rename support to the status view Renames are now picked up and displayed with the 'R' flag instead of being shown as a 'C'opy and 'D'eletion. Remove --find-copies-harder from the arguments to diff-index and diff-files since this option seem to interfere with rename detection. commit c9ae230ff7fa3cb944f228e1fb0329cd370a9ee5 4eb7501bb0efa87ca23e24b8f6d839d26b59fa61 tree a5a294fe64c973e873c2b1f9f5299c1d204b3a25 parent 4eb7501bb0efa87ca23e24b8f6d839d26b59fa61 author Jonas Fonseca 1205755394 +0100 committer Jonas Fonseca 1205755394 +0100 Make it more clear that use of configure (and autoreconf) is optional Suggested by Junio. commit 4eb7501bb0efa87ca23e24b8f6d839d26b59fa61 0573ba1c5130b08471bcce9be5545929b70b4b8f tree ee829ab1f7187affb84b4097e98e051dc7b37591 parent 0573ba1c5130b08471bcce9be5545929b70b4b8f author Jonas Fonseca 1205748425 +0100 committer Jonas Fonseca 1205753844 +0100 Replace SYSCONFDIR value in distributed documentation distributed .. by defining sysconfdir to ++SYSCONFDIR++ when building documentation for the release branch. This also improved quoting of paths during installation. Reported by Jakub Narebski. commit 0573ba1c5130b08471bcce9be5545929b70b4b8f 161942b2847d27cd44d380461bddb04edc02f0f3 tree d6991f6a0a71a838f8fc325258dc9c802e2a187d parent 161942b2847d27cd44d380461bddb04edc02f0f3 author Jonas Fonseca 1205753827 +0100 committer Jonas Fonseca 1205753844 +0100 tig-0.10.1.git commit ea8b16de525465d73e3f03f6922db6c88a804a49 8beabedc9026fe2fb9087187633ec2cfa05e359a tree 7e182171c794cbbd0f28b2e91d6117991570fc3d parent 8beabedc9026fe2fb9087187633ec2cfa05e359a author Jonas Fonseca 1205750931 +0100 committer Jonas Fonseca 1205750931 +0100 Sync docs commit 8beabedc9026fe2fb9087187633ec2cfa05e359a ec753b15a9ccfe3bfc8d3f59c6ffeed0ea8d8a05 317cd86ff24fcab3b7ce39fbf034cf3ba19b5b3f tree 2d52f09dd5cafd34667594b72c0ef9f14be33056 parent ec753b15a9ccfe3bfc8d3f59c6ffeed0ea8d8a05 parent 317cd86ff24fcab3b7ce39fbf034cf3ba19b5b3f author Jonas Fonseca 1205750924 +0100 committer Jonas Fonseca 1205750924 +0100 Merge branch 'master' into release commit 317cd86ff24fcab3b7ce39fbf034cf3ba19b5b3f 161942b2847d27cd44d380461bddb04edc02f0f3 tree 73da825351edeeadc7ad26db8196197b7f76e57c parent 161942b2847d27cd44d380461bddb04edc02f0f3 author Jonas Fonseca 1205748425 +0100 committer Jonas Fonseca 1205750698 +0100 Replace SYSCONFDIR value in distributed documentation distributed .. by defining sysconfdir to ++SYSCONFDIR++ when building documentation for the release branch. Reported by Jakub Narebski. commit ec753b15a9ccfe3bfc8d3f59c6ffeed0ea8d8a05 52a35d60d5bbc085b02b7fde89bca628be45df29 tree 96f89de345ab512f2e58f730b275bd455c00a83c parent 52a35d60d5bbc085b02b7fde89bca628be45df29 author Jonas Fonseca 1205717202 +0100 committer Jonas Fonseca 1205717202 +0100 Sync docs commit 52a35d60d5bbc085b02b7fde89bca628be45df29 4c4104b6f6760dbd95b53860c8273002c1b0a01a 161942b2847d27cd44d380461bddb04edc02f0f3 tree bda05d6902bae10af2bab2ccd993e78551022bea parent 4c4104b6f6760dbd95b53860c8273002c1b0a01a parent 161942b2847d27cd44d380461bddb04edc02f0f3 author Jonas Fonseca 1205717194 +0100 committer Jonas Fonseca 1205717194 +0100 Merge branch 'master' into release commit 161942b2847d27cd44d380461bddb04edc02f0f3 77452abca082e3d7d6ec4f079928583aa1ad6f50 tree a83255788b62ae296b59eaab313f719f42e186ad parent 77452abca082e3d7d6ec4f079928583aa1ad6f50 author Jonas Fonseca 1205716981 +0100 committer Jonas Fonseca 1205716981 +0100 tig-0.10 commit 77452abca082e3d7d6ec4f079928583aa1ad6f50 b6607e7e796f5b58d64211c022d3e1af6159bdaa tree 4d37476543102331abbe0542a4336d429d6a1b33 parent b6607e7e796f5b58d64211c022d3e1af6159bdaa author Jonas Fonseca 1202410838 +0100 committer Jonas Fonseca 1205716945 +0100 Make command line parsing more compatible with gitk Many of the command line arguments are relics from the beginning of the project and served as a method of configuring tig before support for the configuration file was introduced. Since then they have become less useful and make tig less compatible with gitk and other git repo viewers. This commit tries to fix this by deprecating all command line arguments except the very tig specific version and help arguments. The option to enter the status view (-S) is moved to a new "status" subcommand. Tig will warn about the deprecation and advise -S users to use the new subcommand. The handling of "--" is kept as it is for compatibility, but will be removed in a future version. Finally, the man page and manual was updated to reflect the new options and subcommands. So enjoy the new less cludgy `tig --all' ... I will! :) commit b6607e7e796f5b58d64211c022d3e1af6159bdaa 62c7d1a796bcb6bc5577b643efdc0f753c195e8b tree a8da37c2478ff7e3fbc1d368bb7b740e54863300 parent 62c7d1a796bcb6bc5577b643efdc0f753c195e8b author Dominik Vogt 1198750288 +0100 committer Jonas Fonseca 1205702287 +0100 Add system-wide configuration file and new config file environment vars Introduced envvars TIGRC_USER and TIGRC_SYSTEM to control which config file is used. The default user specific config file can be overridden with TIGRC_USER. Before loading the user config file, tig now looks for a system wide config file ($(sysconfdir)/tirgc by default). This can be overridden with the environment variable TIGRC_SYSTEM. Also corrected a small mistake in the Makefile. Instead of setting CFLAGS for '-D...' compiler options, use CPPFLAGS. [ The original code from Dominik was changed so that tig always reads the system-wide configuration file. The documentation was improved so the configured sysconfdir is used in the generated documentation. -- jonas ] Signed-off-by: Jonas Fonseca commit 62c7d1a796bcb6bc5577b643efdc0f753c195e8b e81e9c2ccdfadf96afc5d8f4009a5928b2abe722 tree fd27e213e1891c4b9dd1f2413ccf8002f56add8c parent e81e9c2ccdfadf96afc5d8f4009a5928b2abe722 author Jonas Fonseca 1205699216 +0100 committer Jonas Fonseca 1205700997 +0100 Make it possible to overwrite the default (terminal) colors Use the setting of the "default" color pair to set the default colors of the terminal via assume_default_colors(). Fall back to white on black. With this it is possible to no longer use the terminal colors if desired. This was requested by Sebastian Harl as a way to fix Debian bug 399884. commit e81e9c2ccdfadf96afc5d8f4009a5928b2abe722 4ef1bf121de1697c9d54e10addcd34a4d19d3526 tree 55222a326c807d5e2862218fd983e89e851ee33b parent 4ef1bf121de1697c9d54e10addcd34a4d19d3526 author Jonas Fonseca 1202292478 +0100 committer Jonas Fonseca 1202294103 +0100 Add support for showing boundary commits in the main view The boundary commits are marked using a "^" character, which hopefully is somewhat intuitive and familiar since git revision specification uses it as its cut-off prefix. commit 4ef1bf121de1697c9d54e10addcd34a4d19d3526 c8d9229378cdb6f67e471ee8d0f8fd463ecc1779 tree ea13da318481ad338c736d15c9e4e271179fa08c parent c8d9229378cdb6f67e471ee8d0f8fd463ecc1779 author Jonas Fonseca 1202265023 +0100 committer Jonas Fonseca 1202293681 +0100 Drop -B from diff options My main motivation is a recent (almost) rewrite where I actually wanted to see a "real" diff instead of a rewrite diff. commit c8d9229378cdb6f67e471ee8d0f8fd463ecc1779 d46b9c2601beb10afed76b72a203c3f65b1d2cae tree d9f47de3c61e2512a50d912741a7fd2aeef8c7ec parent d46b9c2601beb10afed76b72a203c3f65b1d2cae author Jonas Fonseca 1202221274 +0100 committer Jonas Fonseca 1202221274 +0100 Simplify documentation building and fix asciidoc.conf dependency commit d46b9c2601beb10afed76b72a203c3f65b1d2cae 5f053ea3204422b8a2736b18164865dcf6b5e36c tree 3dc5743e6619c0484e69a89cfa266791058c2b19 parent 5f053ea3204422b8a2736b18164865dcf6b5e36c author Jonas Fonseca 1202216160 +0100 committer Jonas Fonseca 1202221234 +0100 Replace the manpage XSL workarounds with AsciiDoc conf workarounds This is a lot simpler and generates better manpages (with the required documentation tools). The XSL stuff was a nightmarish adventure, anyway. Of course this probably breaks documentation building on some systems. commit 5f053ea3204422b8a2736b18164865dcf6b5e36c c3c24b0b819eb1bf56822c53752d6bddcda9d236 tree 005da3cd20174186d5129df23d7310e02842326c parent c3c24b0b819eb1bf56822c53752d6bddcda9d236 author Jonas Fonseca 1202216018 +0100 committer Jonas Fonseca 1202216018 +0100 INSTALL: Document the optional documentation tools commit c3c24b0b819eb1bf56822c53752d6bddcda9d236 d3e4750b4a590f60076a0def184c48872638d27d tree 7b94ce53531e3ce303bb39739e8067420443b1f8 parent d3e4750b4a590f60076a0def184c48872638d27d author Jonas Fonseca 1202215851 +0100 committer Jonas Fonseca 1202215851 +0100 Update manpages to not contain contain so many formatting workarounds ... like indentation. However, the '.git/config' thing no longer works. commit d3e4750b4a590f60076a0def184c48872638d27d 4b095571068a9231b31d48def1e2102efe84d02a tree f55d99c2d822f9a5b7f57052ef6e328d1b526a74 parent 4b095571068a9231b31d48def1e2102efe84d02a author Dominik Vogt 1198759473 +0100 committer Jonas Fonseca 1202212200 +0100 Added examples to tig(1) manpage Signed-off-by: Jonas Fonseca commit 4b095571068a9231b31d48def1e2102efe84d02a 3b0d681fb673dba9402ac3a182e7903b7715712f tree 71da053ad6de0db83e7063d028ca5c22d1bca34c parent 3b0d681fb673dba9402ac3a182e7903b7715712f author Jonas Fonseca 1202210237 +0100 committer Jonas Fonseca 1202210853 +0100 TODO: Mention tig.c splitting and revgraph rewrite commit 3b0d681fb673dba9402ac3a182e7903b7715712f 2f21bd2be85fe83d15b5ed3a211ade87d51fe7af tree cac0464561c5bc006461ccff3041e0779606fe6b parent 2f21bd2be85fe83d15b5ed3a211ade87d51fe7af author Jonas Fonseca 1202209162 +0100 committer Jonas Fonseca 1202209162 +0100 Install manpages in $(prefix)/share/man ... instead of just $(prefix)/man. This location is also used by git. commit 2f21bd2be85fe83d15b5ed3a211ade87d51fe7af 598b9e7dd703a55d1ae60d553680b41f359b8176 tree a6a9b120bc22252c35d525f95a234214445cf83b parent 598b9e7dd703a55d1ae60d553680b41f359b8176 author Dominik Vogt 1198748316 +0100 committer Jonas Fonseca 1202209011 +0100 Updated .gitignore [ Also ignore XML files. ] Signed-off-by: Jonas Fonseca commit 598b9e7dd703a55d1ae60d553680b41f359b8176 c509eed2a58445ada9cfee14cc012f47f44a9668 tree 513e888ee147dcd610821f80f8be5cf790c9f50b parent c509eed2a58445ada9cfee14cc012f47f44a9668 author Dominik Vogt 1198747041 +0100 committer Jonas Fonseca 1202208946 +0100 Removed trailing whitespace. Signed-off-by: Jonas Fonseca commit c509eed2a58445ada9cfee14cc012f47f44a9668 f83b1c333d1babbbf3b2b52d042b7af696fb9d28 tree e96c5157150f60d1e5803f451d6e2337d08419ab parent f83b1c333d1babbbf3b2b52d042b7af696fb9d28 author Dominik Vogt 1193909420 +0100 committer Jonas Fonseca 1193962542 +0100 Added action tree-parent and bound it to backspace by default. This allow to leave the current directory in the tree view and change to the parent tree / directory. At the top of the tree, this closes the tree view. Bound to ',' by default. Example: bind tree Left tree-parent bind tree Right Enter bind blob Left view-close This allows to navigate the tree and blob views just with the cursor keys. [ Cleanup the patch a bit and mention the default keybinding in manual.txt --jonas ] Signed-off-by: Jonas Fonseca commit f83b1c333d1babbbf3b2b52d042b7af696fb9d28 13f3482f850d1674c483dee657d8673042f5e87a tree efebc11d847bc7dea57ac1086989a71d57605b51 parent 13f3482f850d1674c483dee657d8673042f5e87a author Dominik Vogt 1193664936 +0100 committer Jonas Fonseca 1193926408 +0100 Added color option main-revgraph to color the revision graph. Signed-off-by: Jonas Fonseca commit 13f3482f850d1674c483dee657d8673042f5e87a 7389c87e749c88622d7dc1230108850c6cbec80d tree 76bc73e29a03da31b10f27f7721c01cb889458c8 parent 7389c87e749c88622d7dc1230108850c6cbec80d author Dominik Vogt 1193664935 +0100 committer Jonas Fonseca 1193664935 +0100 Add documentation for undocumented color options. pp-refs tree-dir, tree-file stat-section, stat-none, stat-staged, stat-unstaged, stat-untracked Signed-off-by: Jonas Fonseca commit 7389c87e749c88622d7dc1230108850c6cbec80d 346254fdf8095e2763211b5c79eaffacd931b8b2 tree 24ccff4bcaec5c081c37c29e47a92c57045c6c14 parent 346254fdf8095e2763211b5c79eaffacd931b8b2 author Dominik Vogt 1193664935 +0100 committer Jonas Fonseca 1193664935 +0100 Minor formatting and spelling fixes. Signed-off-by: Jonas Fonseca commit 346254fdf8095e2763211b5c79eaffacd931b8b2 fef9238e38364e160c8f212686f4e4501c19f94e tree e1898d2aa36ee5a0a0cbeba7267826ebeb98fb6e parent fef9238e38364e160c8f212686f4e4501c19f94e author Jonas Fonseca 1192736001 +0200 committer Jonas Fonseca 1192736001 +0200 Ignore HTML files in general commit fef9238e38364e160c8f212686f4e4501c19f94e 3e8b133e061f5093163a0672c3fd22e8ebfd198d tree 1196ad2aaa1c22c67d15709f04ae5bbc390f7f43 parent 3e8b133e061f5093163a0672c3fd22e8ebfd198d author Jonas Fonseca 1192735926 +0200 committer Jonas Fonseca 1192735926 +0200 manual: remove section on porcelains People should already know git and Cogito is being phased out. commit 3e8b133e061f5093163a0672c3fd22e8ebfd198d f99c60950a00d72ca0fc7626de6034c704ea3883 tree ea0562928f464b13addb4871eab225646dc53a5c parent f99c60950a00d72ca0fc7626de6034c704ea3883 author Jari Aalto 1192732512 +0300 committer Jonas Fonseca 1192735717 +0200 Makefile: add ASCIIDOC_FLAGS ... so that under Cygwin it can be set to --unsafe, in order for asciidoc to work. Signed-off-by: Jari Aalto Signed-off-by: Jonas Fonseca commit f99c60950a00d72ca0fc7626de6034c704ea3883 8897e66a80af5e60266d03d01e55bd9183f043e7 tree e724fe522562a0148e38e45e3dffd80dfc27e5ba parent 8897e66a80af5e60266d03d01e55bd9183f043e7 author Jonas Fonseca 1192735565 +0200 committer Jonas Fonseca 1192735585 +0200 Avoid using git-diff since it might run external diff drivers Relying only on the diff plumbing seems to be the safer thing to do. commit 8897e66a80af5e60266d03d01e55bd9183f043e7 bfe97931bbc4e0b93bc48a2b912d3a227deb50f3 tree 21ada0d4c490d7b2cde0ec820659543437861120 parent bfe97931bbc4e0b93bc48a2b912d3a227deb50f3 author Jonas Fonseca 1192287397 +0200 committer Jonas Fonseca 1192287397 +0200 Use --no-color option when calling git-log and git-diff This fixes problems when user has set color.diff=true. The problem was first reported for gitk on the git mailing list. commit bfe97931bbc4e0b93bc48a2b912d3a227deb50f3 91521b9da4337f6d7f5dc29b02fb04cf7f0ccd02 tree d27fe436e88ff02953014697d781a02221355c5a parent 91521b9da4337f6d7f5dc29b02fb04cf7f0ccd02 author Jonas Fonseca 1192283543 +0200 committer Jonas Fonseca 1192283543 +0200 Rearrange the order of option parsing commit 91521b9da4337f6d7f5dc29b02fb04cf7f0ccd02 738bee4ad125374010dec040f79667e861439a82 tree d7dee2ca54dea656ca57b18dc7abbb50a930c935 parent 738bee4ad125374010dec040f79667e861439a82 author Jonas Fonseca 1192027768 +0200 committer Jonas Fonseca 1192028244 +0200 Fix crash when opening mergetool for lines that are not unmerged commit 738bee4ad125374010dec040f79667e861439a82 f40385aecbd2ae3c0c4e1db441c78b4ca9005d52 tree b393e35fb78442033ec711f6d7a52d7d40625d4b parent f40385aecbd2ae3c0c4e1db441c78b4ca9005d52 author Jonas Fonseca 1191890581 +0200 committer Jonas Fonseca 1191890581 +0200 Use get_key_name() in get_key() It was factored out in the external command patch. commit f40385aecbd2ae3c0c4e1db441c78b4ca9005d52 b86250daae850bc6f456df3f520a706501347b75 tree ca310cee2e49f4ff9511d9482511c52928c5f305 parent b86250daae850bc6f456df3f520a706501347b75 author James Bowes 1191890136 +0200 committer Jonas Fonseca 1191890145 +0200 Add missing = for comparison in obsolete actions check Signed-off-by: James Bowes Signed-off-by: Jonas Fonseca commit b86250daae850bc6f456df3f520a706501347b75 e77aa656c6003eb56d55ce514a1826466b351564 tree edae458ad529445cb3b2fbbdb4b6e3a484499201 parent e77aa656c6003eb56d55ce514a1826466b351564 author Jonas Fonseca 1191750801 +0200 committer Jonas Fonseca 1191750801 +0200 Collect remaining string in last entry when parsing config file lines This raises the length of external commands to what fits in the command buffer (1024 characters). commit e77aa656c6003eb56d55ce514a1826466b351564 f655964f625ffdc0720f600477542602c66a6723 tree 3e3d155caf01c3275317c7577bfe6c2bc566bf4f parent f655964f625ffdc0720f600477542602c66a6723 author Jonas Fonseca 1191710333 +0200 committer Jonas Fonseca 1191711417 +0200 Improve sanity check error messages commit f655964f625ffdc0720f600477542602c66a6723 9eb14b72b27aedbd14b99332b22bb48651812204 tree 70a2ea634e485ac250ca15a075b016ab1ee452a6 parent 9eb14b72b27aedbd14b99332b22bb48651812204 author Jonas Fonseca 1191709974 +0200 committer Jonas Fonseca 1191711410 +0200 Obsolete the cherry-pick action and define as builtin external command commit 9eb14b72b27aedbd14b99332b22bb48651812204 d31a629d7a569b7f80a914c540f994ed7c15d4ee tree 0e35fd07e26aa52224241f9bc591a0fa83f1a2b0 parent d31a629d7a569b7f80a914c540f994ed7c15d4ee author Jonas Fonseca 1191707363 +0200 committer Jonas Fonseca 1191711299 +0200 Add support binding keys to running external commands Each command can have replacement string such as %(commit), %(head), and %(blob), which are substituted before the command is run. commit d31a629d7a569b7f80a914c540f994ed7c15d4ee b5a10859e8011fb0021f7d80f4565c6e587f57c6 tree 46a1f9952a3b6405cc86cd3f19bdb9b41a4e6c65 parent b5a10859e8011fb0021f7d80f4565c6e587f57c6 author Jonas Fonseca 1191694976 +0200 committer Jonas Fonseca 1191694976 +0200 Unify REQ_NONE and REQ_UNKNOWN by moving REQ_NONE to be the last request commit b5a10859e8011fb0021f7d80f4565c6e587f57c6 a6f2842b5f6518c5270bb529bdd28f653a97a775 tree eff02b4d48b6fbeeb2d159c639ffcc8b8db71de3 parent a6f2842b5f6518c5270bb529bdd28f653a97a775 author Jonas Fonseca 1191101008 +0200 committer Jonas Fonseca 1191101008 +0200 tig-0.10.git commit 4c4104b6f6760dbd95b53860c8273002c1b0a01a a9b9a4b0795656ce606a8570d9e6f57d55e87e05 tree 0a49d88e45b80e8ad2b75648275c28776c3e4e6f parent a9b9a4b0795656ce606a8570d9e6f57d55e87e05 author Jonas Fonseca 1191100587 +0200 committer Jonas Fonseca 1191100587 +0200 Sync docs commit a9b9a4b0795656ce606a8570d9e6f57d55e87e05 b11906d3bae2f1623e97a9ebc723d22b893f56d0 tree 468a1f0134807e94fad95212d35512d6da44dcd5 parent b11906d3bae2f1623e97a9ebc723d22b893f56d0 author Jonas Fonseca 1191100543 +0200 committer Jonas Fonseca 1191100543 +0200 Sync docs commit b11906d3bae2f1623e97a9ebc723d22b893f56d0 8970e3c9bbea39f3b4911470a44acb0a4c96c9e0 a6f2842b5f6518c5270bb529bdd28f653a97a775 tree 6e569aeea5fbb45f8c1b4e50e7f092084d9dbc70 parent 8970e3c9bbea39f3b4911470a44acb0a4c96c9e0 parent a6f2842b5f6518c5270bb529bdd28f653a97a775 author Jonas Fonseca 1191100531 +0200 committer Jonas Fonseca 1191100531 +0200 Merge branch 'master' into release commit a6f2842b5f6518c5270bb529bdd28f653a97a775 b4f9c50e5ef7d522017866ba73509361c4f4f68f tree 16db393cd5e1d4d69f83847c5651f9f99990ac47 parent b4f9c50e5ef7d522017866ba73509361c4f4f68f author Jonas Fonseca 1191100384 +0200 committer Jonas Fonseca 1191100384 +0200 tig-0.9.1 commit b4f9c50e5ef7d522017866ba73509361c4f4f68f 17a27c168dc82bf424bd94bbaba44c65fe57b280 tree 61285285d647da1973b49750a4286e8a58f20ab5 parent 17a27c168dc82bf424bd94bbaba44c65fe57b280 author Jonas Fonseca 1191082546 +0200 committer Jonas Fonseca 1191082546 +0200 SITES: 'Tarballs' is a bit more telling than 'Releases' commit 17a27c168dc82bf424bd94bbaba44c65fe57b280 b5c18d9d6f568c0779d3f5d7e12eb3dffe3603da tree a3265247e51c3314aa9ee5a164497138ed53c643 parent b5c18d9d6f568c0779d3f5d7e12eb3dffe3603da author Jonas Fonseca 1191030203 +0200 committer Jonas Fonseca 1191030230 +0200 Cleanup status_request to make it reload the status view by default commit b5c18d9d6f568c0779d3f5d7e12eb3dffe3603da d24ef76cf48b2f63c7cf173200f4cf522c119ec9 tree 942e010bb90fea684e7e37a7ad205edb1f1b574f parent d24ef76cf48b2f63c7cf173200f4cf522c119ec9 author Jonas Fonseca 1191029784 +0200 committer Jonas Fonseca 1191029784 +0200 Add support for launching git-mergetool from the status view Unmerged entries now suggests to press M to resolve merge conflicts. Unmerged entries are no longer shown for the "staged changes"; the same goes for 'M'odified entries following an 'U'nmerged entry. commit d24ef76cf48b2f63c7cf173200f4cf522c119ec9 c38c64bb6e5e9c1f173e24c964b06497e24108d9 tree fb759579eea3117d06db5b4e352f82ef7f15f8f3 parent c38c64bb6e5e9c1f173e24c964b06497e24108d9 author Jonas Fonseca 1190995187 +0200 committer Jonas Fonseca 1190995194 +0200 Refactor code to open_external_viewer This way there is only one place calling system. In addition, files opened in an editor will now wait for the user to press Enter to continue. Whether this is good or bad can be discussed but it feels more consistent and could help the user spot any errors printed by the editor. commit c38c64bb6e5e9c1f173e24c964b06497e24108d9 272818eafff98333c51f1b614704160f265405ed tree 7d72ddc6d7623db844b54a93fa1611899e2964f6 parent 272818eafff98333c51f1b614704160f265405ed author Jonas Fonseca 1190994760 +0200 committer Jonas Fonseca 1190994760 +0200 Detect working trees and disable the status view when it is missing In the process, make any call to report() before a view has been set end up in die() to avoid problems with uninitialized views. commit 272818eafff98333c51f1b614704160f265405ed 0e4360b62504f1f96754744fa1bb66c340a17955 tree a1f408fe01e4f948e09f738288931d83c1091f42 parent 0e4360b62504f1f96754744fa1bb66c340a17955 author Jonas Fonseca 1190899162 +0200 committer Jonas Fonseca 1190917051 +0200 Document the refresh request commit 0e4360b62504f1f96754744fa1bb66c340a17955 201f10e2aeffaec27636572224d79ea2577532d2 tree 751e00c4efeb28144622941de72cac3a861aae46 parent 201f10e2aeffaec27636572224d79ea2577532d2 author Jonas Fonseca 1190859175 +0200 committer Jonas Fonseca 1190917048 +0200 Ignore REQ_NONE in the help view and improve unbound request handling commit 201f10e2aeffaec27636572224d79ea2577532d2 dcae5a1c313c6e1a4cc30189c30ad993788e26fa tree 7920403351779593ecd836565bf0d373911ac4c6 parent dcae5a1c313c6e1a4cc30189c30ad993788e26fa author Jonas Fonseca 1190849315 +0200 committer Jonas Fonseca 1190849358 +0200 Never put the release number in the tarball name for tagged versions ... when the version is given using DIST_VERSION! commit dcae5a1c313c6e1a4cc30189c30ad993788e26fa acaef3b3645a81aa7d617b3ffe42715f75be6d36 tree fbc896c7c13403085e0a7bb6a18028aa91dd93c2 parent acaef3b3645a81aa7d617b3ffe42715f75be6d36 author Jonas Fonseca 1190849270 +0200 committer Jonas Fonseca 1190849270 +0200 Also ignore generated .md5 files for tarballs commit acaef3b3645a81aa7d617b3ffe42715f75be6d36 3dd65d9533e11d892ed58e334cd9b69b27751ab5 tree 26884f15a650246fb8acaf5e80fd019fd66ab934 parent 3dd65d9533e11d892ed58e334cd9b69b27751ab5 author Jonas Fonseca 1190715322 +0200 committer Jonas Fonseca 1190715322 +0200 Add support for refreshing/reloading the status view ... and also refresh it after edits to capture any changes in the working tree. commit 3dd65d9533e11d892ed58e334cd9b69b27751ab5 e8361135abcff8f7316f5696c1f84f00df55ef00 tree 6983b9880ea6fc284289a8ee4d0879c7aede09f9 parent e8361135abcff8f7316f5696c1f84f00df55ef00 author Jonas Fonseca 1190584301 +0200 committer Jonas Fonseca 1190584310 +0200 Remove unused 'view' argument from open_editor commit e8361135abcff8f7316f5696c1f84f00df55ef00 4b551e77e010b7a4126e6ce863463a10f94142b1 tree f7c586a93e6df4cdd92053b762a9f4aea0dbed9f parent 4b551e77e010b7a4126e6ce863463a10f94142b1 author Jonas Fonseca 1190583788 +0200 committer Jonas Fonseca 1190583788 +0200 Include autoconf file for 'make dist' commit 4b551e77e010b7a4126e6ce863463a10f94142b1 12e8c2be5c217f1be8bfd48cc9723fc696b0fbf6 tree bbfda64b0a8fc25e0a38c7ff7ca104db96f96797 parent 12e8c2be5c217f1be8bfd48cc9723fc696b0fbf6 author Jonas Fonseca 1190581540 +0200 committer Jonas Fonseca 1190582106 +0200 Fix the clean rule to never remove generated doc files ... this is now done by new distclean rule, which will also purge autoconf files. commit 12e8c2be5c217f1be8bfd48cc9723fc696b0fbf6 7d31b0590bb4ae3f6a06d95e81ae54f13eebc632 tree 534fde5b751882b4f614749f100c76a5ac13d81e parent 7d31b0590bb4ae3f6a06d95e81ae54f13eebc632 author Jonas Fonseca 1190581245 +0200 committer Jonas Fonseca 1190581245 +0200 Fix out-of-range lineno when reloading the status view Reproducable when standing on the last line of the status view with no staged files and pressing 'u' twice. The first will make the current line point outside the range of lines in the view, making the second update read garbage memory and calling die because of an unknown status line ID. Restore previous line number if possible else move make the current line index be that of the last line in the updated view. commit 7d31b0590bb4ae3f6a06d95e81ae54f13eebc632 1bace428c4c924fff7a21e9f0d15feabafa756b3 tree c0b47e08554b829f02d7da2f774feb58d5340a60 parent 1bace428c4c924fff7a21e9f0d15feabafa756b3 author Jonas Fonseca 1190163012 +0200 committer Jonas Fonseca 1190163346 +0200 Fix open_editor to make the file path relative to the project root .. by prefixing the file path with opt_cdup if requested. commit 1bace428c4c924fff7a21e9f0d15feabafa756b3 226da94bdeb7c80ca7ecc889dc62a3fef9fd4e95 tree a2ab0591d8ed440b74a3437932ca1937add35b08 parent 226da94bdeb7c80ca7ecc889dc62a3fef9fd4e95 author Jonas Fonseca 1190073122 +0200 committer Jonas Fonseca 1190073122 +0200 Handle REQ_NONE upfront in view_driver It is very common during loading from pipe so deserves the small optimization. commit 226da94bdeb7c80ca7ecc889dc62a3fef9fd4e95 58a5e4eadff325af1edff4144e2746133faf6fd0 tree 5cf96e3368ace5a0ee938cf9d1ee04907d29dffa parent 58a5e4eadff325af1edff4144e2746133faf6fd0 author Jonas Fonseca 1190072322 +0200 committer Jonas Fonseca 1190072627 +0200 Support cherry-picking commits in main view to current branch Bound to 'C' by default. Idea by krh on #git. commit 58a5e4eadff325af1edff4144e2746133faf6fd0 e47afdf2f78acbcb5c08f422be5ce37e0e99a5fc tree f67ff866dc21f41992f3cf6bf4582434734a43b9 parent e47afdf2f78acbcb5c08f422be5ce37e0e99a5fc author Jonas Fonseca 1189778262 +0200 committer Jonas Fonseca 1189778262 +0200 Oops, always ensure that ICONV_CONST is defined commit e47afdf2f78acbcb5c08f422be5ce37e0e99a5fc ad8878a7694c64897795486a871d6c40d6861566 tree fc7f07cb73ef4984ac2a5e66248d4b095b693ca6 parent ad8878a7694c64897795486a871d6c40d6861566 author Jonas Fonseca 1189773960 +0200 committer Jonas Fonseca 1189774351 +0200 Use the more advanced iconv.m4 script from ELinks commit ad8878a7694c64897795486a871d6c40d6861566 c61b70c93bb1fe4322dd964e1c3df387afd4adc6 tree 53836eca071d6aa3935ce3352f1f6d73a31c168f parent c61b70c93bb1fe4322dd964e1c3df387afd4adc6 author Jonas Fonseca 1189774275 +0200 committer Jonas Fonseca 1189774275 +0200 tig-0.9.1.git commit 8970e3c9bbea39f3b4911470a44acb0a4c96c9e0 9ddc34870e83c63cb76ab7ccd383ccf1a35ef422 tree 8228801f08a199a2e375e0b2d6fce58de2370b87 parent 9ddc34870e83c63cb76ab7ccd383ccf1a35ef422 author Jonas Fonseca 1189675086 +0200 committer Jonas Fonseca 1189675086 +0200 Sync docs commit 9ddc34870e83c63cb76ab7ccd383ccf1a35ef422 9e382279390ceeb613dde3ea9a49464f917d77db c61b70c93bb1fe4322dd964e1c3df387afd4adc6 tree 49c4c75497c5e11ce60da5bfffd311961e93bd90 parent 9e382279390ceeb613dde3ea9a49464f917d77db parent c61b70c93bb1fe4322dd964e1c3df387afd4adc6 author Jonas Fonseca 1189675080 +0200 committer Jonas Fonseca 1189675080 +0200 Merge branch 'master' into release commit c61b70c93bb1fe4322dd964e1c3df387afd4adc6 53924375cddef4bc46847c40e8988eaa97044798 tree 0550a372060d6b88b3305112597e9ab51b9eada1 parent 53924375cddef4bc46847c40e8988eaa97044798 author Jonas Fonseca 1189674658 +0200 committer Jonas Fonseca 1189674658 +0200 tig-0.9 commit 53924375cddef4bc46847c40e8988eaa97044798 f9a044a436b05abfb853002b8d237b326dd8deb3 tree 7c1007426b3c94c4a9bf6a06820ca0f81502a4bd parent f9a044a436b05abfb853002b8d237b326dd8deb3 author Jonas Fonseca 1189674465 +0200 committer Jonas Fonseca 1189674465 +0200 Change the default styles for the status view It now uses cyan for the section headers. Mentioned by Miciah. commit f9a044a436b05abfb853002b8d237b326dd8deb3 2f990549b6abc93c6e81a936f43aa96d1472563b tree e14955f90e37e158ca7cef634a103c7af13ddb43 parent 2f990549b6abc93c6e81a936f43aa96d1472563b author Jonas Fonseca 1189674396 +0200 committer Jonas Fonseca 1189674396 +0200 Update documentation ... to list search option in tigrc and mention the stage view in the manual. commit 9e382279390ceeb613dde3ea9a49464f917d77db 233c6f38fc82c05264060c607000ef94dacb1ba4 tree 6fcefc975e6be588bab2a8438e4db9055774a386 parent 233c6f38fc82c05264060c607000ef94dacb1ba4 author Jonas Fonseca 1187860720 +0200 committer Jonas Fonseca 1187860720 +0200 Sync docs commit 233c6f38fc82c05264060c607000ef94dacb1ba4 0f4a8731695e8b3ed9f8c2c5e081bd50a615ec4c 2f990549b6abc93c6e81a936f43aa96d1472563b tree 877096b548ebd515cf5e89237087b9d1c5e77dbf parent 0f4a8731695e8b3ed9f8c2c5e081bd50a615ec4c parent 2f990549b6abc93c6e81a936f43aa96d1472563b author Jonas Fonseca 1187860714 +0200 committer Jonas Fonseca 1187860714 +0200 Merge branch 'master' into release commit 2f990549b6abc93c6e81a936f43aa96d1472563b 26a7f2718350bda0367b97d75fbc3627d4ad2a6f tree 39114899561e17f951f2cf24e43d089200f6b87f parent 26a7f2718350bda0367b97d75fbc3627d4ad2a6f author Jonas Fonseca 1187860709 +0200 committer Jonas Fonseca 1187860709 +0200 Force adding of doc files in the release-doc rule commit 26a7f2718350bda0367b97d75fbc3627d4ad2a6f 88d7f67ec4bee1f6041ed77d68540101735399a5 tree ad8a145068a6fa8739254d0df5fe5dea9d7fb968 parent 88d7f67ec4bee1f6041ed77d68540101735399a5 author Horst H. von Brand 1187860550 +0200 committer Jonas Fonseca 1187860550 +0200 Fix INSTALL Signed-off-by: Horst H. von Brand Update Makefile to also use autoreconf for `make configure`. Signed-off-by: Jonas Fonseca commit 88d7f67ec4bee1f6041ed77d68540101735399a5 da6333267414daee1a3dd0caa3ea2758cb608bfd tree d5e3aa62c5dca39e5bae4e91fd7f2f79cf90d425 parent da6333267414daee1a3dd0caa3ea2758cb608bfd author Jonas Fonseca 1187804472 +0200 committer Jonas Fonseca 1187804482 +0200 Build intermediate tig.o file to fix tig dependency on config.h commit da6333267414daee1a3dd0caa3ea2758cb608bfd 776bf2ac11e8ca1c9a900eb363687f5cb8781723 tree 08ad468e14faf2db066f2ea9a6f9e2cd886dab95 parent 776bf2ac11e8ca1c9a900eb363687f5cb8781723 author Jonas Fonseca 1187804280 +0200 committer Jonas Fonseca 1187804280 +0200 Ensure ICONV_INBUF_TYPE is always defined; fix GIT_CONFIG define commit 776bf2ac11e8ca1c9a900eb363687f5cb8781723 50544abac18ad37d76f235fa0e0334488d2d8a9f tree 2e26799f7c953a109bd8ef0f3c41bca645bd5a61 parent 50544abac18ad37d76f235fa0e0334488d2d8a9f author Jonas Fonseca 1187804160 +0200 committer Jonas Fonseca 1187804160 +0200 Guard config.h include with HAVE_CONFIG_H ... and add -DHAVE_CONFIG_H to CPPFLAGS in config.make.in. commit 50544abac18ad37d76f235fa0e0334488d2d8a9f 4b29e70084cbb55ff6b634b99c2377278a256e77 tree 13cf81f58b90af29568884455ee9b5e52928e3cf parent 4b29e70084cbb55ff6b634b99c2377278a256e77 author Jonas Fonseca 1187804020 +0200 committer Jonas Fonseca 1187804020 +0200 Define TIG_VERSION as intended when autoconf was introduced commit 4b29e70084cbb55ff6b634b99c2377278a256e77 aba0683cb4927c2f79202a6460aae5537c1405ca tree b64e7ed12c04ee91f568e4206188aec0811c6c43 parent aba0683cb4927c2f79202a6460aae5537c1405ca author Jonas Fonseca 1187775079 +0200 committer Jonas Fonseca 1187775079 +0200 Change last commit to make tig depend on config.h commit aba0683cb4927c2f79202a6460aae5537c1405ca c989862d94eb3c78f1410d53d9ef6188728cbbd2 tree 559a80639936a01efce7336e66eb46ca5d526eea parent c989862d94eb3c78f1410d53d9ef6188728cbbd2 author Jonas Fonseca 1187774980 +0200 committer Jonas Fonseca 1187774980 +0200 Make tig.c depend on config.h when using configure commit c989862d94eb3c78f1410d53d9ef6188728cbbd2 af32b365896b91225abc97a0cef8263a2e8ff9fa tree c5756f6ca1615e2ca9ad64987830f4e80e37f5c8 parent af32b365896b91225abc97a0cef8263a2e8ff9fa author Jonas Fonseca 1187774872 +0200 committer Jonas Fonseca 1187774872 +0200 Add CC to the list of expanded symbols by configure Also rearrange the list a bit. commit af32b365896b91225abc97a0cef8263a2e8ff9fa c115e7ac368dc9eb7fbebd24718e6ff2461a9ece tree 9965c429fdfd71a77f9b442d00044345a7a4c49a parent c115e7ac368dc9eb7fbebd24718e6ff2461a9ece author Jonas Fonseca 1187774296 +0200 committer Jonas Fonseca 1187774296 +0200 Allow LDLIBS to be overriden by configure commit c115e7ac368dc9eb7fbebd24718e6ff2461a9ece b33611d8ef05e5d5b63652ffe0448736d0787d94 tree b60b0af20bd8942b7a7cf17cf9a6ce4843f0cf7a parent b33611d8ef05e5d5b63652ffe0448736d0787d94 author Jonas Fonseca 1187774165 +0200 committer Jonas Fonseca 1187774165 +0200 Fix warning from blob_read returning pointer instead of bool commit b33611d8ef05e5d5b63652ffe0448736d0787d94 3e6341130ef0a886d126c6005e5ffcd6a36a8fd5 tree 48413129a6f453866a2690df72b2d47ba7e92b31 parent 3e6341130ef0a886d126c6005e5ffcd6a36a8fd5 author Jonas Fonseca 1187739418 +0200 committer Jonas Fonseca 1187739418 +0200 stage: add request handler supporting file edits and chunk staging This adds and interface (idea from git-gui) allowing a diff chunk to be staged/unstaged for the next commit. It should also make it more pleasant to make status updates when in the stage view. commit 3e6341130ef0a886d126c6005e5ffcd6a36a8fd5 c692b4e4a2fcddbde05187d2d37c228f91d36274 tree ec36b5cbdd380fd0153ef2451af8a2983e01c77c parent c692b4e4a2fcddbde05187d2d37c228f91d36274 author Jonas Fonseca 1187696633 +0200 committer Jonas Fonseca 1187696633 +0200 Add stage view, which is used for showing status changes commit c692b4e4a2fcddbde05187d2d37c228f91d36274 96e58f5bdc9c8c7ab3c3f07087a13c3959dcb2bd tree a8c106ccb0a29f852dabd28f92d06c91e3c3bfc0 parent 96e58f5bdc9c8c7ab3c3f07087a13c3959dcb2bd author Jonas Fonseca 1187644366 +0200 committer Jonas Fonseca 1187694495 +0200 autoconf: check for the AsciiDoc and XmlTo document tools commit 96e58f5bdc9c8c7ab3c3f07087a13c3959dcb2bd ec31d0d018f14973d7d91084a3582f8bfd53b0ef tree 54ea7a0bcd125c0f9c3d897bc4f1279a17c5fd02 parent ec31d0d018f14973d7d91084a3582f8bfd53b0ef author Jonas Fonseca 1187643801 +0200 committer Jonas Fonseca 1187691786 +0200 autoconf: check whether to use git-config or git-repo-config commit ec31d0d018f14973d7d91084a3582f8bfd53b0ef 69efc854376705ad0f0cda4994b015eea5ec2820 tree e9c2daf8c3fd7a8ceeb8882fa2dc3e6f27ddd2f6 parent 69efc854376705ad0f0cda4994b015eea5ec2820 author Steven Grimm 1187642945 +0200 committer Jonas Fonseca 1187691747 +0200 Add autoconf-based build infrastructure for tig This is a first cut at building tig using autoconf. With this patch, tig configures and builds on both Linux (FC4) and OS X. Signed-off-by: Steven Grimm Reworked to not use aclocal+automake and external scripts for bootstrapping. Instead, run `make configure` to generate the configure script. It will create a config.make file from config.make.in, which contains variables set by the configure script. Update .gitignore to list generated files. Signed-off-by: Jonas Fonseca commit 69efc854376705ad0f0cda4994b015eea5ec2820 809a9f4877cd60312dfb5fb314dd250d74a386fc tree 87d620b8f767e1d66014c2551f88f0712d978960 parent 809a9f4877cd60312dfb5fb314dd250d74a386fc author Jonas Fonseca 1187656630 +0200 committer Jonas Fonseca 1187685834 +0200 tree: use simple stack to remember the previous subtree line numbers commit 809a9f4877cd60312dfb5fb314dd250d74a386fc 14a2d3ce4d46a06eb53520db201fbcddd3f29ed3 tree e900bbec27a1796ac6bed0f4396d844fd899eafc parent 14a2d3ce4d46a06eb53520db201fbcddd3f29ed3 author Jonas Fonseca 1187649332 +0200 committer Jonas Fonseca 1187685831 +0200 Only show the command being loaded from for the pager view This feature was introduced in 035ba11f40c0a045989ed861e72327012af022b4. commit 14a2d3ce4d46a06eb53520db201fbcddd3f29ed3 b9b5b4cd7b1c5ad0bf496c37708fc3c2300f5428 tree 9efebd85f88ec2bbe32f5ef1796fd50cb8720e20 parent b9b5b4cd7b1c5ad0bf496c37708fc3c2300f5428 author Jonas Fonseca 1187646587 +0200 committer Jonas Fonseca 1187685822 +0200 TODO: tig now has a status view commit b9b5b4cd7b1c5ad0bf496c37708fc3c2300f5428 328d27f731f4b47d216d5170fd880a3e783a631e tree 4fe56ac307ebc2f3a6c0b492cc28106cbdf9e41f parent 328d27f731f4b47d216d5170fd880a3e783a631e author Jonas Fonseca 1187515863 +0200 committer Jonas Fonseca 1187515863 +0200 Make it possible to browse all status changes once the diff view is open commit 328d27f731f4b47d216d5170fd880a3e783a631e 249016a60b0dd8f8db59202b963e53c8ada53095 tree 450dfc069e6de0df6c9b1c33482c2cf7a96c7b18 parent 249016a60b0dd8f8db59202b963e53c8ada53095 author Jonas Fonseca 1187514141 +0200 committer Jonas Fonseca 1187514141 +0200 Fix handling of REQ_NEXT/REQ_PREVIOUS The special browsing of the main view was broken by commit 586c423dd99238a85c556df86e043dcfacffe277, when the REQ_ENTER case was removed. commit 249016a60b0dd8f8db59202b963e53c8ada53095 531c6c69e616a1f3f6a56aaec08334891af078ac tree 4563d694185596f22496b88798df3891000aba49 parent 531c6c69e616a1f3f6a56aaec08334891af078ac author Jonas Fonseca 1187513079 +0200 committer Jonas Fonseca 1187513079 +0200 Fix updating of the view title to show the current position in the view It regressed in 11359638c5dfc91b4b14a003a0519b2a5bc7f89d. commit 531c6c69e616a1f3f6a56aaec08334891af078ac 0cea0d4342ebe783d788b872ebbede545432f1e6 tree 7361e6d563d266a61221d01edf614294ae621e9d parent 0cea0d4342ebe783d788b872ebbede545432f1e6 author Jonas Fonseca 1187457167 +0200 committer Jonas Fonseca 1187457167 +0200 Warn about nothing to enter if REQ_ENTER reaches the view_driver switch commit 0cea0d4342ebe783d788b872ebbede545432f1e6 88f66e2de99d90d36c196d715b38b410e459f618 tree cee98b47cbea1aa34ac1fe26c6b3b5ef874fa0e5 parent 88f66e2de99d90d36c196d715b38b410e459f618 author Jonas Fonseca 1187451949 +0200 committer Jonas Fonseca 1187452418 +0200 status: implement support for opening files in editor commit 88f66e2de99d90d36c196d715b38b410e459f618 dec7b4378b549a214eb5feea77a0855d16893db1 tree 4e37931be22392a04393f8b45635a1d5b4b62382 parent dec7b4378b549a214eb5feea77a0855d16893db1 author Jonas Fonseca 1187441019 +0200 committer Jonas Fonseca 1187441019 +0200 status: cleanup status_request by resurrection status_enter commit dec7b4378b549a214eb5feea77a0855d16893db1 586c423dd99238a85c556df86e043dcfacffe277 tree daebcf9c43a59338154877020210c93d09de631b parent 586c423dd99238a85c556df86e043dcfacffe277 author Jonas Fonseca 1187399692 +0200 committer Jonas Fonseca 1187399692 +0200 status: "wire" REQ_STATUS_UPDATE handling through status_request commit 586c423dd99238a85c556df86e043dcfacffe277 bdcc0d6bbed273f1c7cc55e7f67b91db07a08192 tree 0d019ebbc227af448c8e4da1a60b241d30abab56 parent bdcc0d6bbed273f1c7cc55e7f67b91db07a08192 author Jonas Fonseca 1187399243 +0200 committer Jonas Fonseca 1187399243 +0200 Add view request operation for handling view specific requests For now _enter is replaced with _request. commit bdcc0d6bbed273f1c7cc55e7f67b91db07a08192 11359638c5dfc91b4b14a003a0519b2a5bc7f89d tree 0d69bfbbbabdbbbb9472be888f33e46d17b9e654 parent 11359638c5dfc91b4b14a003a0519b2a5bc7f89d author Jonas Fonseca 1187389009 +0200 committer Jonas Fonseca 1187389040 +0200 status: fix switching to the main view when starting in status view commit 11359638c5dfc91b4b14a003a0519b2a5bc7f89d 93e4c4f6bdd04a86a105e4548acf966772be51b7 tree 7d7d3b94a7a8656984b6f071bf543c6078a9af31 parent 93e4c4f6bdd04a86a105e4548acf966772be51b7 author Jonas Fonseca 1187388852 +0200 committer Jonas Fonseca 1187388852 +0200 status: improve title and report messages commit 93e4c4f6bdd04a86a105e4548acf966772be51b7 351917f81715a8be275ea61d64e4f4d316a4e68a tree c1b9f5a719c0c855c857074912e2952cb08f3259 parent 351917f81715a8be275ea61d64e4f4d316a4e68a author Jonas Fonseca 1187387977 +0200 committer Jonas Fonseca 1187387977 +0200 status: make it possible to batch updates by pressing on the section line commit 351917f81715a8be275ea61d64e4f4d316a4e68a 4e8159cf403aaea82fa281f8a37e40b52ab67e2e tree f9b0342efe32dde469a2e82f6ee3c34e126fe817 parent 4e8159cf403aaea82fa281f8a37e40b52ab67e2e author Jonas Fonseca 1187385860 +0200 committer Jonas Fonseca 1187385860 +0200 status: assert that there are always view lines in the status view commit 4e8159cf403aaea82fa281f8a37e40b52ab67e2e a4927c1d12c8765f3b3718f0375e15cd0986bcac tree 1fc241cc65f7d21d8ae4ea3421b526798f55cc14 parent a4927c1d12c8765f3b3718f0375e15cd0986bcac author Jonas Fonseca 1187383653 +0200 committer Jonas Fonseca 1187383653 +0200 status: make it possible to see all changes for a status section ... except untracked files. commit a4927c1d12c8765f3b3718f0375e15cd0986bcac 89d917a2473a8510ccf420d8d67d668c2bcda36f tree 7a39b21aed126e2d072e1a6e8b2145870518774f parent 89d917a2473a8510ccf420d8d67d668c2bcda36f author Jeff King 1186768723 +0200 committer Jonas Fonseca 1186768723 +0200 status window: mention 'u' instead of Enter Commits ca1d71ea and 89d917a bound the Enter functionality to 'u' (and Enter now shows the diff). [ Slightly changed to use get_key(). --jonas ] Signed-off-by: Jeff King Signed-off-by: Jonas Fonseca commit 89d917a2473a8510ccf420d8d67d668c2bcda36f ca1d71eaa9b69092b0d210f6d45b8afea9070b0d tree 6a0554ad7767b808ff18bb60c8dafc107d273159 parent ca1d71eaa9b69092b0d210f6d45b8afea9070b0d author Jonas Fonseca 1186751981 +0200 committer Jonas Fonseca 1186751981 +0200 Add support for showing staged/unstaged changes and untracked files When pressing enter on a file in the status view either a diff or the content of the untracked file will be shown. commit ca1d71eaa9b69092b0d210f6d45b8afea9070b0d 034001361c7764dacf9cc75dc999eafc25a72637 tree 99d91e7a40c308727acf7a11543bb86a29b45590 parent 034001361c7764dacf9cc75dc999eafc25a72637 author Jonas Fonseca 1186747952 +0200 committer Jonas Fonseca 1186750222 +0200 Introduce status-update action bound to 'u' by default For now this obsoletes the action triggered when pressing Enter. commit 034001361c7764dacf9cc75dc999eafc25a72637 56b6ea55c47e7dfeb6edd13f8a9702ca78256114 tree 727917f31ac3c1669b696723c555cef343bc6353 parent 56b6ea55c47e7dfeb6edd13f8a9702ca78256114 author Witold Filipczyk 1186576762 +0200 committer Jonas Fonseca 1186576770 +0200 Avoid flickering when moving past the main view's first and last line In diff mode when first or last item is displayed KEY_UP or KEY_DOWN respectively cause flickering. I know that I should not press those keys in that situation, but this annoys me anyway. Signed-off-by: Jonas Fonseca commit 56b6ea55c47e7dfeb6edd13f8a9702ca78256114 b9470268ad8c4a3ed9b611a321a9f185c42e3dec tree 364b2fc6e1102a41b29d69f937d5738b222fc54c parent b9470268ad8c4a3ed9b611a321a9f185c42e3dec author Jonas Fonseca 1183479543 +0200 committer Jonas Fonseca 1183479543 +0200 Ignore generated HTML pages Also ':sort u' the .gitignore file. commit b9470268ad8c4a3ed9b611a321a9f185c42e3dec f218b6c87fa04cd06e995242e9e5a05e4ce1ad0e tree bcebdeb4eaff8a6e7aaba58e01e8f367c7edd6c9 parent f218b6c87fa04cd06e995242e9e5a05e4ce1ad0e author Brian Gernhardt 1183474225 -0400 committer Jonas Fonseca 1183479291 +0200 Ignore generated manpages. Adds tig.1 and tigrc.5 to .gitignore Signed-off-by: Brian Gernhardt Signed-off-by: Jonas Fonseca commit f218b6c87fa04cd06e995242e9e5a05e4ce1ad0e cdda87c23277e576678acb58d07a17b50c816fb0 tree d1eabf44a1b0c6d1baf83115f404d844fc6eefdb parent cdda87c23277e576678acb58d07a17b50c816fb0 author Jonas Fonseca 1182591437 +0200 committer Jonas Fonseca 1182591437 +0200 Include the tig bash completion script as documentation commit cdda87c23277e576678acb58d07a17b50c816fb0 72f0962147050d8bfdb10755715a257dc477a02b tree ade108379a10ec6344ac52e1bca5b41bd70c4f34 parent 72f0962147050d8bfdb10755715a257dc477a02b author Jonas Fonseca 1182591297 +0200 committer Jonas Fonseca 1182591297 +0200 Rename contrib/tig-completion.sh to contrib/tig-completion.bash commit 72f0962147050d8bfdb10755715a257dc477a02b 276346b0d0f2797e971dcca8f4912dc78dc3ff87 tree af5ffff7f791e6c1d672f1e724158b048e23a7bd parent 276346b0d0f2797e971dcca8f4912dc78dc3ff87 author Jonas Fonseca 1182591225 +0200 committer Jonas Fonseca 1182591225 +0200 Fix a few typos in the bash completion commit 276346b0d0f2797e971dcca8f4912dc78dc3ff87 1b48a10d72621017541c31d91f9bc8bbd4cae7a2 tree 2ccec03031a783b3bc0e7fa1d6c80a1ff1a1159b parent 1b48a10d72621017541c31d91f9bc8bbd4cae7a2 author Jakub Narebski 1182548382 +0200 committer Jonas Fonseca 1182550710 +0200 Simplify naming (versioning) of non-release tig tarball and rpm file Use the tag part of git-describe output, with `tig-' prefix stripped off, as version number. Use number of commits since given tag as release number, using 0 if we are at tagged version, and adding '.dirty' suffix if working directory is dirty. Do not use 'g' part of git-describe output. For example, when git-describe output was tig-0.7-8-g26d0386, before this commit tarball was named tig-0.7.8.g26d0386.tar.gz and rpm was named tig-0.7.8.g26d0386-1.src.rpm (for dirty tree tarball was tig-0.7.8.g26d0386.dirty.tar.gz), now tarball is named tig-0.7-8.tar.gz and rpm is named tig-0.7-8.src.rpm (for dirty tree tarball is tig-0.7-8.dirty.tar.gz). [ Simplify the version extraction a bit. --jonas ] Signed-off-by: Jakub Narebski Signed-off-by: Jonas Fonseca commit 1b48a10d72621017541c31d91f9bc8bbd4cae7a2 cde445f3d418bf310a5c4fd7101801bf9541d04c tree f010b6d1146ab951facd6056da14575bf92a071a parent cde445f3d418bf310a5c4fd7101801bf9541d04c author Jonas Fonseca 1182524775 +0200 committer Jonas Fonseca 1182524800 +0200 Move tig.spec.in to the contrib area commit cde445f3d418bf310a5c4fd7101801bf9541d04c d195d49ebe6e5fcc0e12cc41b78ea42c639ba2ab tree d07733540739518158032a54405d2f29b8b2da8a parent d195d49ebe6e5fcc0e12cc41b78ea42c639ba2ab author Jonas Fonseca 1182524685 +0200 committer Jonas Fonseca 1182524685 +0200 Move tigrc to the contrib area commit d195d49ebe6e5fcc0e12cc41b78ea42c639ba2ab 4393be9e5547971d53cf470ff7d9c01c058c9524 tree cf47db10c3479b7e6e133976b0910ace3f5330cd parent 4393be9e5547971d53cf470ff7d9c01c058c9524 author Jonas Fonseca 1182524484 +0200 committer Jonas Fonseca 1182524484 +0200 Add tig bash completion script Based on git-completion.sh by Shawn Pearce. commit 4393be9e5547971d53cf470ff7d9c01c058c9524 0e9f95f4aa7f234efd39c46ba4ba4c84151bc015 tree a7439028985c2efc6f508dc6f6ce68348c1e5d23 parent 0e9f95f4aa7f234efd39c46ba4ba4c84151bc015 author Jonas Fonseca 1182325227 +0200 committer Jonas Fonseca 1182325227 +0200 Delete the old VERSION file before appending the new one in make dist commit 0e9f95f4aa7f234efd39c46ba4ba4c84151bc015 421ab13a2aa652d6b07ecc1a270a8b1ce5be451d tree d4eeeeff8aacf4f58ee7b1ee78dbf4eebd62b614 parent 421ab13a2aa652d6b07ecc1a270a8b1ce5be451d author Jonas Fonseca 1182323040 +0200 committer Jonas Fonseca 1182323040 +0200 Use $(MAKE) instead of 'make' and 'git *' instead of 'git-*' commit 421ab13a2aa652d6b07ecc1a270a8b1ce5be451d b3c6d4028e1d6870dede152fb3abb00a6b90d60e tree 5e924ab9184edc0b4e6a12bb44861384559fed94 parent b3c6d4028e1d6870dede152fb3abb00a6b90d60e author Jonas Fonseca 1182237537 +0200 committer Jonas Fonseca 1182237537 +0200 tig-0.8.git commit 0f4a8731695e8b3ed9f8c2c5e081bd50a615ec4c 09e7c902dd48e3e89c05f72eda342d38e92e6883 tree 85468d4bdde4eb68357777d96bd6b45e3a98667e parent 09e7c902dd48e3e89c05f72eda342d38e92e6883 author Jonas Fonseca 1182237415 +0200 committer Jonas Fonseca 1182237415 +0200 Sync docs commit 09e7c902dd48e3e89c05f72eda342d38e92e6883 e8735467cd68fd3f24c5c2673717333cee75d82c b3c6d4028e1d6870dede152fb3abb00a6b90d60e tree 6e5daeb7229b4dbf9b863791fa08a90976e57376 parent e8735467cd68fd3f24c5c2673717333cee75d82c parent b3c6d4028e1d6870dede152fb3abb00a6b90d60e author Jonas Fonseca 1182237409 +0200 committer Jonas Fonseca 1182237409 +0200 Merge branch 'master' into release commit b3c6d4028e1d6870dede152fb3abb00a6b90d60e b64c5b75c8471be59d0083a75cfd4bd8df90bdbf tree ccc43067b0eb86e8ccda70bbfc0238f68a880dae parent b64c5b75c8471be59d0083a75cfd4bd8df90bdbf author Jonas Fonseca 1182237108 +0200 committer Jonas Fonseca 1182237108 +0200 tig-0.8 commit b64c5b75c8471be59d0083a75cfd4bd8df90bdbf d1858debc412dfdeac02a081cb6379d87b577ac3 tree e8dfea5bbe1d0e7f205e38e0fb567ed1fcf81ee1 parent d1858debc412dfdeac02a081cb6379d87b577ac3 author Jonas Fonseca 1182175799 +0200 committer Jonas Fonseca 1182175808 +0200 Fix pager mode regressions This fixes both a segfault when starting tig in pager mode, caused by no view being setup before calling report(). Introduced in: "Add notice about empty pager view" (5c4358d1b309381997a5c4780a432140fefa5bcb). Reported by Lars Noschinski in debian bug 429448. Also, a fix for actually reading from stdin, caused by comparison of view->vid and view->id being reported as equal leading to no actual update. Introduced in: "Improve management of view->ref and the title line" (035ba11f40c0a045989ed861e72327012af022b4). Now, the title line in pager mode will say "stdin" when reading from externally piped input. commit d1858debc412dfdeac02a081cb6379d87b577ac3 07c3971e15e6eb8279ca1a112ab3b2cdc3ca020c tree 62c09916a41bd83efb33d4b4b11f89e4b2c14dcb parent 07c3971e15e6eb8279ca1a112ab3b2cdc3ca020c author Jonas Fonseca 1180939521 +0200 committer Jonas Fonseca 1180939521 +0200 Fix (another) integer type mismatch on 64-bit systems Similar to previous commit, use int type as the first parameter to printf field width specifier (%.*s). commit 07c3971e15e6eb8279ca1a112ab3b2cdc3ca020c 4291ca047e95de44b7a9ef60583fe011e76359e0 tree 8e1c76bdf09d5694f7f0fd8f9c40980ed7a3bcce parent 4291ca047e95de44b7a9ef60583fe011e76359e0 author Steven Grimm 1180905126 -0700 committer Jonas Fonseca 1180939188 +0200 Fix integer type mismatch on 64-bit systems fprintf wants an int parameter for the field width of a "%.*s" expression, but the code was passing a size_t instead. This potentially broke systems where sizeof(size_t) != sizeof(int). And even on systems where it did't break, it still caused a compiler warning. Signed-off-by: Jonas Fonseca commit 4291ca047e95de44b7a9ef60583fe011e76359e0 e0f50df03cabbf7edb97b271115d033277c34690 tree a4e887062cb94c140129de5be602f7b18ec1f049 parent e0f50df03cabbf7edb97b271115d033277c34690 author Jonas Fonseca 1180939065 +0200 committer Jonas Fonseca 1180939065 +0200 Add TODO about using non-blocking I/O for incremental view loading Seems to be the fix for debian bug #427093. commit e0f50df03cabbf7edb97b271115d033277c34690 89de1d4e186c22dac7cb07c8d00de8c7e75a4dbc tree 92288c9f685625722c982c50f641f7f133249b36 parent 89de1d4e186c22dac7cb07c8d00de8c7e75a4dbc author Jonas Fonseca 1180873915 +0200 committer Jonas Fonseca 1180873915 +0200 Only emit one "Not a git repository" error message commit 89de1d4e186c22dac7cb07c8d00de8c7e75a4dbc 810f007894cd333324da29f962a9d5eadbc60150 tree 92f45889898290eda23c684e85ae4a56a815f0a5 parent 810f007894cd333324da29f962a9d5eadbc60150 author James Bowes 1180804490 -0400 committer Jonas Fonseca 1180808939 +0200 Allow CFLAGS to be overridden while preserving VERSION If someone defined their own CFLAGS, they would have to include a -DVERSION= as well (or else get unknown-version as the version). Signed-off-by: James Bowes Signed-off-by: Jonas Fonseca commit 810f007894cd333324da29f962a9d5eadbc60150 5699e0cfd59c6a6b30776efeab8b96fbdc586fa7 tree 8053cd722ddb37ee7713513b1c372c93e2d64f7d parent 5699e0cfd59c6a6b30776efeab8b96fbdc586fa7 author Jonas Fonseca 1180802964 +0200 committer Jonas Fonseca 1180805128 +0200 Grab path to the git directory; use it when listing untracked files commit 5699e0cfd59c6a6b30776efeab8b96fbdc586fa7 739e81def0105e91ba4f8b0e6209834983d68019 tree ca0e85b2b685debd427a6d33ae70c01f67f55b43 parent 739e81def0105e91ba4f8b0e6209834983d68019 author Jonas Fonseca 1180804482 +0200 committer Jonas Fonseca 1180804482 +0200 read_properties: use size_t instead of int for callback commit 739e81def0105e91ba4f8b0e6209834983d68019 91c5d983a57f52daca6794cad36cb2a4f1a232a7 tree d9176d18477b18077cc7cd5ad77ea3d52ed4b35b parent 91c5d983a57f52daca6794cad36cb2a4f1a232a7 author Jonas Fonseca 1180803810 +0200 committer Jonas Fonseca 1180803810 +0200 Fix wrong uses of string_copy() with pointer instead of buffer Follow up to commit 751e27c90eea47b4eacdd7b657731712712f7356 that caused these bugs to be revealed. commit 91c5d983a57f52daca6794cad36cb2a4f1a232a7 751e27c90eea47b4eacdd7b657731712712f7356 tree 1f1a2fdf3b92c72576f44a4f1a7d8772b3156b8b parent 751e27c90eea47b4eacdd7b657731712712f7356 author Jonas Fonseca 1180774529 +0200 committer Jonas Fonseca 1180801456 +0200 Fix use of the status view from subdirectories commit 751e27c90eea47b4eacdd7b657731712712f7356 cf63d30cbc4efb2bb87e52c4e54366751bb958fa tree 8a78282fe106becec8bfd22a9e342f540682dc18 parent cf63d30cbc4efb2bb87e52c4e54366751bb958fa author Jonas Fonseca 1180801104 +0200 committer Jonas Fonseca 1180801450 +0200 Fix string_copy macro to use sizeof(src) for the source buffer commit cf63d30cbc4efb2bb87e52c4e54366751bb958fa 70a83764575d379f853ef0401269d52100ddd1e3 b253ee86a072bf5232ec674c6483e07c29806a64 tree 305d9f6e4d07c8ab2b38805f4c9e38832d0981b5 parent 70a83764575d379f853ef0401269d52100ddd1e3 parent b253ee86a072bf5232ec674c6483e07c29806a64 author Jonas Fonseca 1180774992 +0200 committer Jonas Fonseca 1180775044 +0200 Merge branch 'jn/rpm-updates' Conflicts: Makefile commit b253ee86a072bf5232ec674c6483e07c29806a64 22eb36aa18ae5bf94d7a3ff852cab9ccdc40b930 tree 1516940d5cc66e9fe1745550c4bca495d0b93220 parent 22eb36aa18ae5bf94d7a3ff852cab9ccdc40b930 author Jakub Narebski 1180715668 +0200 committer Jonas Fonseca 1180774878 +0200 Refresh VERSION file when building distribution tarball in "make dist" Overwrite contents of VERSION file from the HEAD revision with the current version (at the time of building), so VERSION file in the tarball generated by "make dist" (and which follows also rpm package generated by "make rpm") is up to date. Otherwise for example when building rpm it will be compiled with wrong version string. Signed-off-by: Jakub Narebski Signed-off-by: Jonas Fonseca commit 22eb36aa18ae5bf94d7a3ff852cab9ccdc40b930 1f84ca3dff6138846552e08f70c0ead5721d0bcd tree 41af53a76bf31f2fd4146c417cc334534b780a9d parent 1f84ca3dff6138846552e08f70c0ead5721d0bcd author Jakub Narebski 1180715250 +0200 committer Jonas Fonseca 1180774878 +0200 Include documentation sources for rpmbuild with '--without docs' This includes _all_ documentation sources (and not only manual.txt) in the rpm file build with '--without docs' option. Signed-off-by: Jakub Narebski Signed-off-by: Jonas Fonseca commit 1f84ca3dff6138846552e08f70c0ead5721d0bcd e61a1e30d7a6208a892eabf9a1f7742014bd7294 tree c740b20a881e8bff2068a0928b2cc929e1675e86 parent e61a1e30d7a6208a892eabf9a1f7742014bd7294 author Jakub Narebski 1180715047 +0200 committer Jonas Fonseca 1180774877 +0200 Remove PDF version of manual from being build and installed Because PDF version of "The tig Manual" doesn't offer anything new that is not present in HTML version, and building PDF requires additional tools (docbook2pdf) and their dependencies present, remove it from tig rpm. Signed-off-by: Jakub Narebski Signed-off-by: Jonas Fonseca commit 70a83764575d379f853ef0401269d52100ddd1e3 e61a1e30d7a6208a892eabf9a1f7742014bd7294 tree 62042347a6d2859ebbd9b1626e71eb2ab7931086 parent e61a1e30d7a6208a892eabf9a1f7742014bd7294 author Jonas Fonseca 1180730628 +0200 committer Jonas Fonseca 1180730628 +0200 Make dist rule more robust using '&&'; create .tar.gz.md5 file commit e61a1e30d7a6208a892eabf9a1f7742014bd7294 a066a53681c331e096cc88ffbeaced33372c5448 tree 7aa98757c05bfe58c34918ccb823634788164439 parent a066a53681c331e096cc88ffbeaced33372c5448 author Jonas Fonseca 1180684835 +0200 committer Jonas Fonseca 1180684835 +0200 Fix typo the INSTALL file The make command to build the documentation "make install-doc", not "make install-docs". Kindly pointed out by Michael G. Noll. commit a066a53681c331e096cc88ffbeaced33372c5448 1aff6a0f47a87c561628009d2e925353d0e2b0ca tree b2bc7ba3d1f9fcddedc358d9f1a934274010a2c9 parent 1aff6a0f47a87c561628009d2e925353d0e2b0ca author Jeffrey C. Ollie 1180639232 -0500 committer Jonas Fonseca 1180641030 +0200 Supply explicit permission bits to 'install' 'install' will install files with permissions set to '0755' if the permissions are not specified on the command line. Having the execute bits set on non-executable content is not desireable. Specify mode 0644 for non-executable content as well as specify mode 0755 for executable content (in case the defaults change or are different on different systems). Also tell 'install' to preserve timestamps. [ Updated to also do it when installing HTML files. --jonas ] Signed-off-by: Jeffrey C. Ollie Signed-off-by: Jonas Fonseca commit 1aff6a0f47a87c561628009d2e925353d0e2b0ca 27f2e6ce3fbd2dc511f34df8e1537f28d03029e1 tree 51974b5239d346288a144f9540759c45deeb2d89 parent 27f2e6ce3fbd2dc511f34df8e1537f28d03029e1 author Jonas Fonseca 1180606788 +0200 committer Jonas Fonseca 1180606788 +0200 tig-0.7.git commit e8735467cd68fd3f24c5c2673717333cee75d82c e2c13318b4e695a9b7f3e59d793667ae9465ce70 tree 04d39936920a2212755095fa6f2f28be177b038b parent e2c13318b4e695a9b7f3e59d793667ae9465ce70 author Jonas Fonseca 1180606726 +0200 committer Jonas Fonseca 1180606726 +0200 Sync docs commit e2c13318b4e695a9b7f3e59d793667ae9465ce70 2b83fb59bf87c486065c3fd7f26df5ad9c55d842 27f2e6ce3fbd2dc511f34df8e1537f28d03029e1 tree b9fd28fb5d3890e4a657a7648cca19e2f290571d parent 2b83fb59bf87c486065c3fd7f26df5ad9c55d842 parent 27f2e6ce3fbd2dc511f34df8e1537f28d03029e1 author Jonas Fonseca 1180606720 +0200 committer Jonas Fonseca 1180606720 +0200 Merge branch 'master' into release commit 27f2e6ce3fbd2dc511f34df8e1537f28d03029e1 3f20fe551338d020fa017280fa6204445f3f2086 tree fdc618d6922c200bf073328b92d32f0d339183db parent 3f20fe551338d020fa017280fa6204445f3f2086 author Jonas Fonseca 1180606653 +0200 committer Jonas Fonseca 1180606653 +0200 tig-0.7 commit 3f20fe551338d020fa017280fa6204445f3f2086 c4c9cd3b9eba7570b5541e19324d6f5ef45f08ef tree 0455e5dc5a44dd8b572759f9d9f25201a17fe30b parent c4c9cd3b9eba7570b5541e19324d6f5ef45f08ef author Jonas Fonseca 1180605412 +0200 committer Jonas Fonseca 1180606585 +0200 Rename sync-docs to release-doc; add release-dist rule Additionally, allow VERSION to be overwritten from the command line by setting DIST_VERSION. commit c4c9cd3b9eba7570b5541e19324d6f5ef45f08ef a49dc47141232e7e505acbae2d21918e8e4d8534 tree 1d7cdc20b18541ab4b06d625085115f89755dc6a parent a49dc47141232e7e505acbae2d21918e8e4d8534 author Jonas Fonseca 1180605291 +0200 committer Jonas Fonseca 1180606502 +0200 Various random Makefile cleanups commit 2b83fb59bf87c486065c3fd7f26df5ad9c55d842 b07bab116edd87d1ee24bc7270299c9073f9157c a49dc47141232e7e505acbae2d21918e8e4d8534 tree 5e2c432b8f31ab1b03e955d8800addd28e662472 parent b07bab116edd87d1ee24bc7270299c9073f9157c parent a49dc47141232e7e505acbae2d21918e8e4d8534 author Jonas Fonseca 1180604532 +0200 committer Jonas Fonseca 1180604532 +0200 Merge branch 'master' into release commit a49dc47141232e7e505acbae2d21918e8e4d8534 8cdf56913e7e486bb3f527c24ee4a4d19f2a4f61 tree 345e0e3bf4f28be3d3bd6924d020ef2ae08df5a5 parent 8cdf56913e7e486bb3f527c24ee4a4d19f2a4f61 author Jonas Fonseca 1180603549 +0200 committer Jonas Fonseca 1180604523 +0200 Update sync-docs target to use git porcelain instead of cogito commit 8cdf56913e7e486bb3f527c24ee4a4d19f2a4f61 737856053db9065ab83e348b4885c479381845d2 tree 36efcc39b63730276996679f04711805b967e8ea parent 737856053db9065ab83e348b4885c479381845d2 author Jakub Narebski 1180603205 +0200 committer Jonas Fonseca 1180603205 +0200 Infrastructure for tig rpm builds Adds RPM_VERSION to Makefile and new make targets: tig.spec, dist, and rpm. A simple 'make rpm' will build the rpm. Also adds tig.spec.in which is used to generate tig.spec. Accidentally VERSION (and adding -DVERSION=$(VERSION) to CFLAGS) is now defined always, even if we do not compile from the "live" tig repository. Minimally tested (meaning "make rpm" from tig repository works). Signed-off-by: Jakub Narebski Signed-off-by: Jonas Fonseca commit 737856053db9065ab83e348b4885c479381845d2 bb0ab19f0540342604a8b9dfc97bd7b3bb822a51 tree 8bae3f04999b4c043d9ff5c0a27c4f20f1094ab5 parent bb0ab19f0540342604a8b9dfc97bd7b3bb822a51 author Jonas Fonseca 1180601180 +0200 committer Jonas Fonseca 1180602452 +0200 Move "static" version info to VERSION file Cleanup dynamic version acquiring via git. commit bb0ab19f0540342604a8b9dfc97bd7b3bb822a51 738cb15a2f9326fa0c4c129d6b3a43774932a1b9 tree b3aa2eff4ff24b2bcd3ed2fea9d23380d615ee14 parent 738cb15a2f9326fa0c4c129d6b3a43774932a1b9 author Jonas Fonseca 1180600294 +0200 committer Jonas Fonseca 1180600294 +0200 Add version information to man pages Inspired and copied from git 7ef195ba3efe0ffa815e12afc4cb1e39a21ddfb4: Override the [header] macro of asciidoc's docbook backend to add version information to the generated man pages. by Frank Lichtenheld . Slightly improved to use asciidoc {version} macro to avoid having to invoke sed. commit 738cb15a2f9326fa0c4c129d6b3a43774932a1b9 173d76ea34a54342687c3d03ed71930429dca299 tree dde7caee27b4ba4b5778eca7a766592346f7b8b6 parent 173d76ea34a54342687c3d03ed71930429dca299 author Jonas Fonseca 1180599562 +0200 committer Jonas Fonseca 1180599562 +0200 Add manpage XSL from git and enhance with literallayout fixes It ensures that .sp tags will be properly output so they do not appear in the rendered manpages. Grabed from git's Documentation/callouts.xsl file. From the git's commit 7ef0435088f41165ece95b6f226d3c15438505a5: This is just a random hack to work around problems people seem to be seeing in manpage backend of xmlto (it appears we are getting ".sp" at the end of line without line break). Additionally, output an empty line after literallayout blocks (.nf .fi) so that any text following it will appear in a separate block. commit 173d76ea34a54342687c3d03ed71930429dca299 0ff3b97cdb548763d320ef004a846e20b86209b7 tree 1f5da93f21b7e742bb6e93394a7a8547789cb943 parent 0ff3b97cdb548763d320ef004a846e20b86209b7 author Jonas Fonseca 1180558549 +0200 committer Jonas Fonseca 1180559168 +0200 Add status view The new view supports staging, unstaging, and adding of untracked files. It is still only very basic. The colors might need a few tweaks. Bound to 'S' by default. commit 0ff3b97cdb548763d320ef004a846e20b86209b7 e314c36d0422488191aea046b2485d5a22c2c791 tree 7826772aa301b130b85c1289ed6d80672a667ad2 parent e314c36d0422488191aea046b2485d5a22c2c791 author Jonas Fonseca 1180551200 +0200 committer Jonas Fonseca 1180551672 +0200 main_read: cleanup and simplify commit e314c36d0422488191aea046b2485d5a22c2c791 f098944b7ed412914f2a6f095d0d454d2102c62b tree 543c02f6f9ef633e7f0709e6771a860707cf0a5a parent f098944b7ed412914f2a6f095d0d454d2102c62b author Jonas Fonseca 1180549324 +0200 committer Jonas Fonseca 1180549370 +0200 Refactor add_line_text parts into add_line_data; use it in main_read commit f098944b7ed412914f2a6f095d0d454d2102c62b 2463b4ea11714543dcb091f83f6dedfa00bae938 tree 8bec46ea1313ab4eeff85d656ecb0c88b7ee67dd parent 2463b4ea11714543dcb091f83f6dedfa00bae938 author Jonas Fonseca 1180480711 +0200 committer Jonas Fonseca 1180480722 +0200 Add open method to view_ops Use it to turn open_help_view into help_open and make a backend for the help view. commit 2463b4ea11714543dcb091f83f6dedfa00bae938 5c4358d1b309381997a5c4780a432140fefa5bcb tree a33e96746044867ddeca8b7b909414272f3e5f18 parent 5c4358d1b309381997a5c4780a432140fefa5bcb author Jonas Fonseca 1180447918 +0200 committer Jonas Fonseca 1180448420 +0200 Add notice about empty pager view Similar to notice for blob view, mention when there is no pager content to view and suggest the user to open the prompt to run a command. commit 5c4358d1b309381997a5c4780a432140fefa5bcb 550cd4b501c0f8c95caeb9f6195b48db1783495b tree 47e30bc42dd1bf052510e2bceb46bf5c65125f2d parent 550cd4b501c0f8c95caeb9f6195b48db1783495b author Jonas Fonseca 1180447918 +0200 committer Jonas Fonseca 1180447918 +0200 Add notice about empty pager view Similar to notice for blob view, mention when there is no pager content to view and suggest the user to open the prompt to run a command. commit 550cd4b501c0f8c95caeb9f6195b48db1783495b 520094b447952529317234c6f32b49bbf0ededff tree 164ecb781bf7d7189221105b2bfe38f88c0e077a parent 520094b447952529317234c6f32b49bbf0ededff author Jonas Fonseca 1180447560 +0200 committer Jonas Fonseca 1180447560 +0200 Make keybinding reference more dynamic It doesn't honor any key map info, however, hardcoding key information seems wrong when get_key already exists. Used for the notice when blob view is requested and no blob ID has yet been assigned to ref_blob. commit 520094b447952529317234c6f32b49bbf0ededff 035ba11f40c0a045989ed861e72327012af022b4 tree 8243e57d42da215e6ad3395ac6dd00b4cbc61691 parent 035ba11f40c0a045989ed861e72327012af022b4 author Jonas Fonseca 1180447224 +0200 committer Jonas Fonseca 1180447224 +0200 Move space separator from get_key to formatting in open_help_view commit 035ba11f40c0a045989ed861e72327012af022b4 f0f114ac9b184c90d9bd371ec99792d96b9a890c tree a7c04bd7f08471c3aee4353ffe8f6d9a3dfd1942 parent f0f114ac9b184c90d9bd371ec99792d96b9a890c author Jonas Fonseca 1180444058 +0200 committer Jonas Fonseca 1180446031 +0200 Improve managment of view->ref and the title line This removes a blob view specific hack needed for keeping the title line synchronized with the current blob ID. It further also changes the pager view to show the actual command that was run, regardless of whether a commit line has been hovered. commit f0f114ac9b184c90d9bd371ec99792d96b9a890c a39653656755cc0d01165043922d6f38b2db2cf9 tree 377e3a1ab2837f1e1e55654d3ecc750ec6bd2a6f parent a39653656755cc0d01165043922d6f38b2db2cf9 author Jonas Fonseca 1180445650 +0200 committer Jonas Fonseca 1180445650 +0200 Be more paranoid about paths when updating the tree view Shell quote the path always. commit a39653656755cc0d01165043922d6f38b2db2cf9 0a0d891082ac72087026071ab30a39381da75da3 tree 4daa0a5aab1a41d3285ad95cf151bc937f440221 parent 0a0d891082ac72087026071ab30a39381da75da3 author Jonas Fonseca 1180436901 +0200 committer Jonas Fonseca 1180436901 +0200 move_view: fix view->offset overflow bug Reproducable by opening the tree view, then maximizing the blob view, move up, and then closing the blob view, causing the view->offset to have "wrapped around" and nothing to be displayed in the tree view. The invalid update of view->offset only happend when moving non-displayed views. Instead use the checked scroll_steps variable instead of the steps variable. Add a guarding assert after the update. commit 0a0d891082ac72087026071ab30a39381da75da3 9eded3792d88216d21db2b1cec7917035650d843 tree e566bb2f1cc4773728e2d0f368b63b3545755e88 parent 9eded3792d88216d21db2b1cec7917035650d843 author Jonas Fonseca 1180433693 +0200 committer Jonas Fonseca 1180433693 +0200 Introduce add_line_text to simplify pager based rendering commit 9eded3792d88216d21db2b1cec7917035650d843 befb497073bc6b64c4fe72008d44bddfce3ec61b tree 6f7e3ff7de270cfe22dd2326d8716f31b6f3a3fa parent befb497073bc6b64c4fe72008d44bddfce3ec61b author Jonas Fonseca 1179521429 +0200 committer Jonas Fonseca 1179521429 +0200 Fix revision graph visualization during incremental updating This caused certain commit lines in the main view to not have have a visual revision graph. The reason is that revision graph visualization requires knowledge about the parent commit. This causes a further one-off needed to be redrawn for incremental updates. commit befb497073bc6b64c4fe72008d44bddfce3ec61b ec4b9d915578f734f7a92acf35a3398b09cc2abf tree 522be8912bb10277773e90391047039ae189f4ef parent ec4b9d915578f734f7a92acf35a3398b09cc2abf author Jonas Fonseca 1178716498 +0200 committer Jonas Fonseca 1178716498 +0200 Add TODO item about diff chunk staging/unstaging Requested by Pasky. commit ec4b9d915578f734f7a92acf35a3398b09cc2abf a1d285540bd1765a7588d78a96482f5b12af1c20 tree fea7a14406c4ab57cbe5c7c5a5a97a52ba89304b parent a1d285540bd1765a7588d78a96482f5b12af1c20 author Greg KH 1178709957 +0200 committer Jonas Fonseca 1178710035 +0200 Make it possible to install man pages and html files separately [ Fixed typo and finally corrected the manual.html dependency on manual.toc. --jonas ] commit b07bab116edd87d1ee24bc7270299c9073f9157c f93946c2c4b7d755c81a9a4910e3b61b24511cf3 tree 22435e6865d6d292e495a306d352e7d70f7e645f parent f93946c2c4b7d755c81a9a4910e3b61b24511cf3 author Jonas Fonseca 1174820829 +0200 committer Jonas Fonseca 1174820829 +0200 Fix synced docs ... stupid Mac OS X sed ;) commit f93946c2c4b7d755c81a9a4910e3b61b24511cf3 79b543b5cabf03ccfe347542d93c7778ba963ff4 tree 6a05e77c7585aeefa19cddb8be13ed7ff0e835f4 parent 79b543b5cabf03ccfe347542d93c7778ba963ff4 author Jonas Fonseca 1174818808 +0200 committer Jonas Fonseca 1174818808 +0200 Sync docs commit 79b543b5cabf03ccfe347542d93c7778ba963ff4 60e10e16c82e25bf2d52a3def45c93633e3c2b5c 7e02cd1a0b4d5f8a63ba55178bef0ea09d7c8c1d tree 7e6ae3012d51bcca805a9883b733dca5f35b8aee parent 60e10e16c82e25bf2d52a3def45c93633e3c2b5c parent 7e02cd1a0b4d5f8a63ba55178bef0ea09d7c8c1d author Jonas Fonseca 1174818773 +0200 committer Jonas Fonseca 1174818773 +0200 Merge with tig-0.6 commit a1d285540bd1765a7588d78a96482f5b12af1c20 7e02cd1a0b4d5f8a63ba55178bef0ea09d7c8c1d tree 68ba16c5f41edca84efcb357d543734ca111e1df parent 7e02cd1a0b4d5f8a63ba55178bef0ea09d7c8c1d author Jonas Fonseca 1174814819 +0200 committer Jonas Fonseca 1174814819 +0200 tig-0.6.git commit 7e02cd1a0b4d5f8a63ba55178bef0ea09d7c8c1d a6ec85e1cbdcc241b5e67b714a1760afcc45ad94 tree d9025f1462da0c841b61859a1fa5c339261d3854 parent a6ec85e1cbdcc241b5e67b714a1760afcc45ad94 author Jonas Fonseca 1174814653 +0200 committer Jonas Fonseca 1174814653 +0200 Bump the version number to 0.6 commit a6ec85e1cbdcc241b5e67b714a1760afcc45ad94 11ce319e4f5162e3104538c342b6efe953b28cf8 tree 6ca8d2c4fc18eeeee333a3764b97d875f91e083d parent 11ce319e4f5162e3104538c342b6efe953b28cf8 author Jonas Fonseca 1174814548 +0200 committer Jonas Fonseca 1174814548 +0200 Oops, remove -liconv from LDFLAGS commit 11ce319e4f5162e3104538c342b6efe953b28cf8 71b01db299cae08ae7451659ef31e0abcf799358 tree 60b753961e556c277ac4bbd23e2069b1a741105d parent 71b01db299cae08ae7451659ef31e0abcf799358 author Jonas Fonseca 1174814055 +0200 committer Jonas Fonseca 1174814236 +0200 Disable show-rev-graph by default It can be enabled by adding set show-rev-graph = yes to ~/.tigrc or toggled by pressing 'g' when in the main viewer. commit 71b01db299cae08ae7451659ef31e0abcf799358 158a522c5740123fd1144f9045ef0a419dfcf090 e15ec88e61da8a2f67fa1e2212ebb7e60694552f tree c7876daeeed3c3b82a41e0e5b33a957121d2497c parent 158a522c5740123fd1144f9045ef0a419dfcf090 parent e15ec88e61da8a2f67fa1e2212ebb7e60694552f author Jonas Fonseca 1174813814 +0200 committer Jonas Fonseca 1174813814 +0200 Merge with master commit e15ec88e61da8a2f67fa1e2212ebb7e60694552f 2b594d1953ac48fa4a329b062e99c3104345f81c tree eb7fc4655408aa9be1edcc55392fadffae4cf478 parent 2b594d1953ac48fa4a329b062e99c3104345f81c author Jonas Fonseca 1170772828 +0100 committer Jonas Fonseca 1170772828 +0100 Improve handling of remotes Hightlight remotes similar to how tags are highlighted. Colors are configurable via main-remote. commit 2b594d1953ac48fa4a329b062e99c3104345f81c 337d7377fb08b547d5827328765f6c7d64ff3628 tree fac6f497cb36e3c8f70b62e72e1483e288a3f17f parent 337d7377fb08b547d5827328765f6c7d64ff3628 author Jonas Fonseca 1170772593 +0100 committer Jonas Fonseca 1170772593 +0100 TODO: use autoconf to detect newer git and git-config availability commit 337d7377fb08b547d5827328765f6c7d64ff3628 832a47c4563804cd3cbb42983832113bea88b291 tree 3101e9df04f3ffaf901876520243e01098d5b343 parent 832a47c4563804cd3cbb42983832113bea88b291 author Jonas Fonseca 1166653896 +0100 committer Jonas Fonseca 1166653929 +0100 Make tig handle GIT_DIR better The problem was caused by load_refs() calling "git-ls-remote ." completely ignoring GIT_DIR. This is fixed by using git-rev-parse --git-dir to extract the path to the requested git repository. commit 832a47c4563804cd3cbb42983832113bea88b291 a300856947a0f87669b7133b923cc0153444edfe tree 653311536ca621c0a914688517a8c652e5687605 parent a300856947a0f87669b7133b923cc0153444edfe author Jonas Fonseca 1166389512 +0100 committer Jonas Fonseca 1166389512 +0100 Drop --stat usage from the main command assembled during option parsing This is a follow up to commit fa187d6c87100b0c5d626eceb4369eef79176138 which removes one more useless use of --stat, which is very costly especially for the main view. A big thanks to Miciah for reporting this. commit a300856947a0f87669b7133b923cc0153444edfe 7361622d7b04e3ce3b84dd95545fb827b1c4e97d tree ec33d798294b9799d2ff3c0f860b6d434c4ecd62 parent 7361622d7b04e3ce3b84dd95545fb827b1c4e97d author Jonas Fonseca 1166212121 +0100 committer Jonas Fonseca 1166212121 +0100 Add note about using autoconf to detect iconv(3) presence in libc ... and other build dependencies. commit 7361622d7b04e3ce3b84dd95545fb827b1c4e97d 56e652be994f94b724f79cea0712663a62308034 tree 1e58c939a90f8da6c5cfa7245ebcec9c48d3faa9 parent 56e652be994f94b724f79cea0712663a62308034 author Horst H. von Brand 1166212018 +0100 committer Jonas Fonseca 1166212018 +0100 Fix parameter warning for iconv(3) [ This reverts commit d9c49e6ec76ac311bbe9a1d0d3699ff4be79e64f that tried to fix compile warning on Mac OS X. ] Signed-off-by: Horst H. von Brand Signed-off-by: Jonas Fonseca commit 56e652be994f94b724f79cea0712663a62308034 d3c345f7d3cb40c2e59137766c48ae8b91e024f4 tree 0d59bb99c67dc452c4ae3505c0cabf030407d20e parent d3c345f7d3cb40c2e59137766c48ae8b91e024f4 author Jonas Fonseca 1165275175 +0100 committer Jonas Fonseca 1165275238 +0100 Fix SITES URLs; promote git://repo.or.cz/tig.git mirror more commit d3c345f7d3cb40c2e59137766c48ae8b91e024f4 19c3ac60ede476130e693ece1752a29fa4e13512 tree 3d22c3a6f75d1a13ea7c61fc59c943be09f8e1cd parent 19c3ac60ede476130e693ece1752a29fa4e13512 author Jonas Fonseca 1165275055 +0100 committer Jonas Fonseca 1165275055 +0100 Discard error messages from git-describe commit 19c3ac60ede476130e693ece1752a29fa4e13512 aac64c17cd7dd8c6ceba5738cc27a7eee48b8e59 tree aa4ac00ed49bfd4c7185914f3d8715e232839cc8 parent aac64c17cd7dd8c6ceba5738cc27a7eee48b8e59 author Jonas Fonseca 1164571799 +0100 committer Jonas Fonseca 1164572129 +0100 Fix commit author line parsing for when the name is empty This is also a nice cleanup so the code uses chomp_string() instead of "custom" removal of spaces. commit 158a522c5740123fd1144f9045ef0a419dfcf090 2fe894e6391aeb6124902a5030dc2776877824fc aac64c17cd7dd8c6ceba5738cc27a7eee48b8e59 tree 855acda46cd1c34fa6e6bc3458b2bcb1b18c250d parent 2fe894e6391aeb6124902a5030dc2776877824fc parent aac64c17cd7dd8c6ceba5738cc27a7eee48b8e59 author Jonas Fonseca 1162174602 +0100 committer Jonas Fonseca 1162174602 +0100 Merge with master commit aac64c17cd7dd8c6ceba5738cc27a7eee48b8e59 d9c49e6ec76ac311bbe9a1d0d3699ff4be79e64f tree 17533846c09d5332a2fece3d6220a72a1cd31294 parent d9c49e6ec76ac311bbe9a1d0d3699ff4be79e64f author Jonas Fonseca 1162173677 +0100 committer Jonas Fonseca 1162173677 +0100 Never split the tree view when opening another tree view The resulting bogus display[] state ment that the blob view was not initialized causing segmentation faults in the redrawing code. Reported by Alexey Tourbin commit d9c49e6ec76ac311bbe9a1d0d3699ff4be79e64f 9073c64a86cf644d1c2563d610449da690d1533d tree 938bf06039ed272b33be66fb6d5c38e3ae9057a8 parent 9073c64a86cf644d1c2563d610449da690d1533d author Jonas Fonseca 1162154192 +0100 committer Jonas Fonseca 1162154192 +0100 Cast second arg to iconv to remove warning commit 9073c64a86cf644d1c2563d610449da690d1533d aea510c85bbf27d4cc7603b026ab760f98de6bb1 tree d8b4442c9c2d847c4d378526c7bfc9cd153b01b2 parent aea510c85bbf27d4cc7603b026ab760f98de6bb1 author Jonas Fonseca 1162131673 +0100 committer Jonas Fonseca 1162131673 +0100 main_read: handle titles that start with whitespace commit aea510c85bbf27d4cc7603b026ab760f98de6bb1 cf4d82e60e23c1a6a457c2df0b9b4c8afef40bef tree 0fe8ef4f9c7e7005af48426f73d7f3e4fe8309df parent cf4d82e60e23c1a6a457c2df0b9b4c8afef40bef author Alexey Tourbin 1162131442 +0100 committer Jonas Fonseca 1162131648 +0100 Increase commit.title size from 75 to 128 Courtesy of Dmitry Levin, my current aterm session has COLUMNS=141 (1280x1024 with standard 9x15 font). So in the main view I can see some commit headlines truncated. Changing hedline size from 75 to 128 characters seems to be reasonable. commit cf4d82e60e23c1a6a457c2df0b9b4c8afef40bef 8b534a13651f1416d368bcc10b496ca189c2ca0c tree a3926df370499e5844848a22daa5d1d520c11a1a parent 8b534a13651f1416d368bcc10b496ca189c2ca0c author Jonas Fonseca 1159444475 +0200 committer Jonas Fonseca 1159444475 +0200 Hardwire ERR to mean REQ_NONE in the main loop commit 8b534a13651f1416d368bcc10b496ca189c2ca0c d27080b3754c8d5ac000d5206d8331a738086809 tree 549bf0af4873dfc4b78edd4357b500b833bf506e parent d27080b3754c8d5ac000d5206d8331a738086809 author Jonas Fonseca 1159444298 +0200 committer Jonas Fonseca 1159444298 +0200 add_keybinding: always allocate the new keybinding Fixes infinite loop repoted by Miciah. Also simply continue when wgetch returns ERR (-1) instead of calling get_keybinding() etc. commit d27080b3754c8d5ac000d5206d8331a738086809 4f3855b3198a48f94cadd0b7bff78f6daa80d611 tree ad35a8b360cdabd9877b693621f3b09812368e59 parent 4f3855b3198a48f94cadd0b7bff78f6daa80d611 author Jonas Fonseca 1159309906 +0200 committer Jonas Fonseca 1159309945 +0200 tig-0.5.git Crap, forgot to update the VERSION string again. commit 60e10e16c82e25bf2d52a3def45c93633e3c2b5c b799b7d277f85f1dd2b2c998b6d0c63c40b0d9ea tree 2ad0af1297e3c5dcf0b159921d8297cbcab2b35e parent b799b7d277f85f1dd2b2c998b6d0c63c40b0d9ea author Jonas Fonseca 1159139736 +0200 committer Jonas Fonseca 1159139736 +0200 Sync docs commit b799b7d277f85f1dd2b2c998b6d0c63c40b0d9ea af4c75a274ce4a06f0bc069dc94820a4b700e8bc 4f3855b3198a48f94cadd0b7bff78f6daa80d611 tree d6d4b2122ba66d37a9a66925841d57fef2bdb6e7 parent af4c75a274ce4a06f0bc069dc94820a4b700e8bc parent 4f3855b3198a48f94cadd0b7bff78f6daa80d611 author Jonas Fonseca 1159139631 +0200 committer Jonas Fonseca 1159139631 +0200 Merge with master commit 4f3855b3198a48f94cadd0b7bff78f6daa80d611 42ea463a72bf4f819cf731b187497a74c4e41b75 tree 8b3842e2f52d1d6958950f20656fd692774d5dbb parent 42ea463a72bf4f819cf731b187497a74c4e41b75 author Jonas Fonseca 1158792222 +0200 committer Jonas Fonseca 1158792222 +0200 SITES: Point to pasky's git proxy repo.or.cz commit 42ea463a72bf4f819cf731b187497a74c4e41b75 66c86725fdb3e159b2fde146e26c7dadd51e528c tree 7c160e4dcea54fcf78a96b666ab37249ec2708cb parent 66c86725fdb3e159b2fde146e26c7dadd51e528c author Jonas Fonseca 1158763360 +0200 committer Jonas Fonseca 1158763360 +0200 INSTALL: mention possible iconv problems and workarounds commit 66c86725fdb3e159b2fde146e26c7dadd51e528c 7a06ebdfce5b597b918cea0599db65ac30b5afea tree b1e718d67e8cbe86da0d5d264eebebaf7878e08f parent 7a06ebdfce5b597b918cea0599db65ac30b5afea author Jonas Fonseca 1158599227 +0200 committer Jonas Fonseca 1158599227 +0200 manual: document the tree/blob environment variables commit af4c75a274ce4a06f0bc069dc94820a4b700e8bc 168352eaabb19cdcaeaa7e0d4ef6f97b103e7b29 tree 8d17f9944f8f6775e88f9fafe6407376f7bfc1e5 parent 168352eaabb19cdcaeaa7e0d4ef6f97b103e7b29 author Jonas Fonseca 1158596695 +0200 committer Jonas Fonseca 1158596695 +0200 Sync docs commit 168352eaabb19cdcaeaa7e0d4ef6f97b103e7b29 2c14847eb7c6155f2bf3980159c5dc6525e2d072 7a06ebdfce5b597b918cea0599db65ac30b5afea tree b9aaf1294da52e38ae5c75e8ba0ed5dd57970d99 parent 2c14847eb7c6155f2bf3980159c5dc6525e2d072 parent 7a06ebdfce5b597b918cea0599db65ac30b5afea author Jonas Fonseca 1158596489 +0200 committer Jonas Fonseca 1158596489 +0200 Merge with master commit 7a06ebdfce5b597b918cea0599db65ac30b5afea 3621d94edb435e4a3c66da7ff192f01bf811865b tree 778b04d5e2506ca9f3393da6c990c6b170c56fcc parent 3621d94edb435e4a3c66da7ff192f01bf811865b author Jonas Fonseca 1158595356 +0200 committer Jonas Fonseca 1158595356 +0200 Always clear the status window after prompting commit 3621d94edb435e4a3c66da7ff192f01bf811865b 390a82626ffbaa2f74184ea9ad80eb2d9e15bcf8 tree a99a9d121ce55e8551390879725d3c0ea96a1de3 parent 390a82626ffbaa2f74184ea9ad80eb2d9e15bcf8 author Jonas Fonseca 1158593608 +0200 committer Jonas Fonseca 1158593608 +0200 Oops, check log, diff, and show before options Fixes 8d27b36ea5e4e2f282d6e080b9bc0c134d29257a. commit 390a82626ffbaa2f74184ea9ad80eb2d9e15bcf8 21be28fb8413c6b0f01ae9423824213be2d4177d tree 471b9884a10e843322717422279b1e21ad57158f parent 21be28fb8413c6b0f01ae9423824213be2d4177d author Jonas Fonseca 1158587830 +0200 committer Jonas Fonseca 1158587830 +0200 Use wclrtoeol instead of werase commit 21be28fb8413c6b0f01ae9423824213be2d4177d 8d27b36ea5e4e2f282d6e080b9bc0c134d29257a tree 464b9afe261a163f96f43b34a8f29becb97b120e parent 8d27b36ea5e4e2f282d6e080b9bc0c134d29257a author Jonas Fonseca 1158534029 +0200 committer Jonas Fonseca 1158534029 +0200 Fix clearing of the status window after prompting commit 8d27b36ea5e4e2f282d6e080b9bc0c134d29257a ab4af23ee7cbb59aadee65153e12e3a9ce2daeab tree 7fbaab093587edcb7a910bfc8463e01a03a48b44 parent ab4af23ee7cbb59aadee65153e12e3a9ce2daeab author Jonas Fonseca 1158533850 +0200 committer Jonas Fonseca 1158533850 +0200 parse_option: check for '-' first and break if it is not an option commit ab4af23ee7cbb59aadee65153e12e3a9ce2daeab 32553785b929e5d9f5da012b555291fff2824640 tree 5ebe263917abec95e8aa6c5b9519821a100bb9e9 parent 32553785b929e5d9f5da012b555291fff2824640 author Jonas Fonseca 1158533793 +0200 committer Jonas Fonseca 1158533793 +0200 Improve the "input mode" so the cursor is correctly positioned commit 32553785b929e5d9f5da012b555291fff2824640 554014a3b7966338f797928f3c865ecc8ffafa2a tree 2b9c98ef06f9f5d284c546e290a5189c11ec305f parent 554014a3b7966338f797928f3c865ecc8ffafa2a author Jonas Fonseca 1158522748 +0200 committer Jonas Fonseca 1158531961 +0200 add_keybinding: plug memory leak commit 554014a3b7966338f797928f3c865ecc8ffafa2a 9d6976b987b08e6b4c4077352ef72bbfd4eccce6 tree a5701bef310a89e075c623a03f92ce6b1dce55e3 parent 9d6976b987b08e6b4c4077352ef72bbfd4eccce6 author Jonas Fonseca 1158521399 +0200 committer Jonas Fonseca 1158531961 +0200 TODO: repository status view, better text-input support commit 9d6976b987b08e6b4c4077352ef72bbfd4eccce6 f7ffec0647ba2b0cfd171dd81f0d620038f690f0 tree e31723ab4d7f5892910ba85819a35a01517df363 parent f7ffec0647ba2b0cfd171dd81f0d620038f690f0 author Jonas Fonseca 1158431282 +0200 committer Jonas Fonseca 1158431282 +0200 tigrc(5): mention tree/blob view actions; use dash in favour of underscore commit f7ffec0647ba2b0cfd171dd81f0d620038f690f0 912dcffb56543b36d2cfd7c64941c64b4d107876 tree 60b29555a83c630aba4960cfbe3e3cab354120cc parent 912dcffb56543b36d2cfd7c64941c64b4d107876 author Jonas Fonseca 1158431077 +0200 committer Jonas Fonseca 1158431077 +0200 Run the documentation through aspell commit 2fe894e6391aeb6124902a5030dc2776877824fc 778e60b28d79bf6135ee127ce34400a5aeca4eec tree 6e970586afd85f5954510ad57f3b5212f6b2b544 parent 778e60b28d79bf6135ee127ce34400a5aeca4eec author Jonas Fonseca 1158408761 +0200 committer Jonas Fonseca 1158408822 +0200 push_rev_graph: iterate all graph revs when looking for duplicates Now atleast there will not be unconnected lines at the end of the graph. commit 912dcffb56543b36d2cfd7c64941c64b4d107876 71d1c7db12d1d0ad63ecfbefa8f14289e0501cc3 tree ef7ad12fb18533ecfd8a00e6bcbe43ed9e4c5b28 parent 71d1c7db12d1d0ad63ecfbefa8f14289e0501cc3 author Jonas Fonseca 1158370580 +0200 committer Jonas Fonseca 1158370598 +0200 BUGS: Merge locale support with utf8-only bug, add horizontal scrolling commit 778e60b28d79bf6135ee127ce34400a5aeca4eec 446a5c3610dc9960923e7d9a14365949cb29a0ab 71d1c7db12d1d0ad63ecfbefa8f14289e0501cc3 tree 933621e25acb158e68dd1945fb941cc6f0076efb parent 446a5c3610dc9960923e7d9a14365949cb29a0ab parent 71d1c7db12d1d0ad63ecfbefa8f14289e0501cc3 author Jonas Fonseca 1158369269 +0200 committer Jonas Fonseca 1158369269 +0200 Merge with master commit 71d1c7db12d1d0ad63ecfbefa8f14289e0501cc3 5becf24488b3a0a7b44518f53a8b3e577614a64c tree acbfc1126e53cc88870314057c63de47f3e59694 parent 5becf24488b3a0a7b44518f53a8b3e577614a64c author Jonas Fonseca 1158367069 +0200 committer Jonas Fonseca 1158367069 +0200 Abbreviate the view reference in the view title for small widths commit 5becf24488b3a0a7b44518f53a8b3e577614a64c 3c112a880cfbee37741d7e00bc994390399c9527 tree dd97792f80681985de3633470437bb3e4f5070c5 parent 3c112a880cfbee37741d7e00bc994390399c9527 author Jonas Fonseca 1158366154 +0200 committer Jonas Fonseca 1158366195 +0200 update_view_title: format load seconds as part of the state string commit 3c112a880cfbee37741d7e00bc994390399c9527 4887d44e87f6ab759e32d30511d78e3f99d0fbcc tree 2abc172de27ef2f18bf024a08355a2cd48e9070a parent 4887d44e87f6ab759e32d30511d78e3f99d0fbcc author Jonas Fonseca 1158365544 +0200 committer Jonas Fonseca 1158365544 +0200 update_view_title: use string_format_from instead of wprintw commit 4887d44e87f6ab759e32d30511d78e3f99d0fbcc 2bee3bdeb5fef5d8f64ac047dbcc0c9f27ea26f1 tree a6210c059ee32f66f2ca99f3f174e7e2f626af51 parent 2bee3bdeb5fef5d8f64ac047dbcc0c9f27ea26f1 author Jonas Fonseca 1158363610 +0200 committer Jonas Fonseca 1158363788 +0200 A simple fix of the bad wrapping bugs This was surprisingly simple to fix by just turning off scrolling in draw_view_line. From the BUGS file: - If the screen width is very small the main view can draw outside the current view causing bad wrapping. Same goes for title and status windows. - The cursor can wrap-around on the last line and cause the window to scroll. commit 2bee3bdeb5fef5d8f64ac047dbcc0c9f27ea26f1 104463304fc6c7b9a251e3a079f11268347f8c21 tree 142a7ea3c4c48b32b57258bfab6808f2b875e020 parent 104463304fc6c7b9a251e3a079f11268347f8c21 author Jonas Fonseca 1158280880 +0200 committer Jonas Fonseca 1158280880 +0200 update_display_cursor: take view as arg commit 446a5c3610dc9960923e7d9a14365949cb29a0ab 61eed810a92c73bbbaa2b9e83619ad39c6ac5323 tree 3ae3d79f932660208e42bead6575cd3ace2c94c5 parent 61eed810a92c73bbbaa2b9e83619ad39c6ac5323 author Jonas Fonseca 1158195835 +0200 committer Jonas Fonseca 1158195835 +0200 Make the rev graph visualization have a one rev look-ahead commit 61eed810a92c73bbbaa2b9e83619ad39c6ac5323 be04d936881ab1cdb5b0728e8699dc4ceed9843b tree b0bff4c2c8ede32c26e00777c600c8bdbf86a4f1 parent be04d936881ab1cdb5b0728e8699dc4ceed9843b author Jonas Fonseca 1158195503 +0200 committer Jonas Fonseca 1158195503 +0200 update_rev_graph: move code to prepare_rev_graph commit be04d936881ab1cdb5b0728e8699dc4ceed9843b 2c27faac1c8fcd27a863cafdfb0543d1251f8176 tree 0833d968ccb4bfda059062577745aae48c5d2e4c parent 2c27faac1c8fcd27a863cafdfb0543d1251f8176 author Jonas Fonseca 1158193402 +0200 committer Jonas Fonseca 1158193402 +0200 Allow view readers to 'finalize' by calling with NULL line before closing commit 2c27faac1c8fcd27a863cafdfb0543d1251f8176 8716b9ed2fec0c119244a6905bac034267baa8ef tree 1fbd85b80404aef1940311d4f345b08a798baf6e parent 8716b9ed2fec0c119244a6905bac034267baa8ef author Jonas Fonseca 1158190136 +0200 committer Jonas Fonseca 1158190136 +0200 append_to_rev_graph: use local variable commit 8716b9ed2fec0c119244a6905bac034267baa8ef e937c2c861739b218378a5dc5526c97284712709 tree 2f66771eec4388638b65d0d2aa76335c76072ed0 parent e937c2c861739b218378a5dc5526c97284712709 author Jonas Fonseca 1158188928 +0200 committer Jonas Fonseca 1158188928 +0200 Always draw the space between end of rev graph and start of commit title The rev graph may have been increased so the old title should be overwritten. commit e937c2c861739b218378a5dc5526c97284712709 18ffaa238dfd737bc8205a6a949dc3d55cb4fd7b tree 794e3601125f02cbf49ebca39a386d958b5dab83 parent 18ffaa238dfd737bc8205a6a949dc3d55cb4fd7b author Jonas Fonseca 1158084347 +0200 committer Jonas Fonseca 1158084347 +0200 Refactor (separator, line) chtype management to use 'fillers' commit 18ffaa238dfd737bc8205a6a949dc3d55cb4fd7b 92507a247b407b7d1ff02255b0335e735d9de188 tree 4885a01d4627b48f11dedc135d778054db73b749 parent 92507a247b407b7d1ff02255b0335e735d9de188 author Jonas Fonseca 1158079975 +0200 committer Jonas Fonseca 1158079975 +0200 More graph_parent_is_merge usage commit 92507a247b407b7d1ff02255b0335e735d9de188 320df4eae0b1048d76f0725c9cf28cd691d60f10 tree 930c1e890243fd4c7a0a5e42c4736e067078b71a parent 320df4eae0b1048d76f0725c9cf28cd691d60f10 author Jonas Fonseca 1158079803 +0200 committer Jonas Fonseca 1158079803 +0200 draw_rev_graph: refactor stuff to get_rev_graph_symbol commit 320df4eae0b1048d76f0725c9cf28cd691d60f10 2ce5c87cfd1d739c8ae21bed60acd5bed3cfb21d tree 7576a843f7d27763e2ca88fc615033c02388a820 parent 2ce5c87cfd1d739c8ae21bed60acd5bed3cfb21d author Jonas Fonseca 1158079597 +0200 committer Jonas Fonseca 1158079597 +0200 Improve comments commit 2ce5c87cfd1d739c8ae21bed60acd5bed3cfb21d ccc33449d3e59d9b6048a4e2cd54fb8b2f3ba5e3 tree 7d6def0d915fb8730f1febe353de7f8c9dbfd228 parent ccc33449d3e59d9b6048a4e2cd54fb8b2f3ba5e3 author Jonas Fonseca 1158079432 +0200 committer Jonas Fonseca 1158079432 +0200 Use 'graph' instead of 'stack' in the rev graph code commit ccc33449d3e59d9b6048a4e2cd54fb8b2f3ba5e3 987890af2eaf079310ad4f15539089bf7f924d7a tree 601f834bc7d54fb12e23e9b261aaf7b4b476eac4 parent 987890af2eaf079310ad4f15539089bf7f924d7a author Jonas Fonseca 1158079079 +0200 committer Jonas Fonseca 1158079079 +0200 Move rev graph code to own section commit 987890af2eaf079310ad4f15539089bf7f924d7a 375650cf691b46f7c45b47791eb654d98d115a1a tree 30309d77542b380b0754972cba37d8242a8992e7 parent 375650cf691b46f7c45b47791eb654d98d115a1a author Jonas Fonseca 1158078706 +0200 committer Jonas Fonseca 1158078706 +0200 Move stuff to reset_rev_graph and rename it to done_rev_graph commit 375650cf691b46f7c45b47791eb654d98d115a1a 9e43b9cdf4dc7788c88afde3eb1331f18256c729 tree ccea188bcd72cca16ab0cd12b42eb4828b3c69f1 parent 9e43b9cdf4dc7788c88afde3eb1331f18256c729 author Jonas Fonseca 1158078353 +0200 committer Jonas Fonseca 1158078353 +0200 Simplify the update_rev_graph end-game commit 9e43b9cdf4dc7788c88afde3eb1331f18256c729 c65a501a6607eaa39537e3189d7057940559b97a tree 95726ad9eceb30872ee8788ebfe143c490d59bf0 parent c65a501a6607eaa39537e3189d7057940559b97a author Jonas Fonseca 1158078252 +0200 committer Jonas Fonseca 1158078252 +0200 Add graph_parent_is_merge commit c65a501a6607eaa39537e3189d7057940559b97a 88757ebdbd32ba72232e22d4afe1fe882f719e3d tree 832c36936198e3332ec85679a306d9c14bd4c1e9 parent 88757ebdbd32ba72232e22d4afe1fe882f719e3d author Jonas Fonseca 1158070231 +0200 committer Jonas Fonseca 1158070482 +0200 Now it actually starts looking like something commit 88757ebdbd32ba72232e22d4afe1fe882f719e3d 6c1864915391b8c448516ec4147e0782db69f0aa tree 33e826d941dc3912be4b8184f01287e15d65b31a parent 6c1864915391b8c448516ec4147e0782db69f0aa author Jonas Fonseca 1158062068 +0200 committer Jonas Fonseca 1158062068 +0200 Refactor graph drawing commit 6c1864915391b8c448516ec4147e0782db69f0aa b668954412c6709e54c22991b3f7aff012050d7b tree 5b203209c0e2c2885880cba1bab8b80a72d33922 parent b668954412c6709e54c22991b3f7aff012050d7b author Jonas Fonseca 1158060905 +0200 committer Jonas Fonseca 1158060905 +0200 Remove fprintf stuff commit b668954412c6709e54c22991b3f7aff012050d7b b5d8f20883633ba2384b92b340feb1812e145dfc tree 8aa300b1d626791e5e4b1b4a3412739f08bf0389 parent b5d8f20883633ba2384b92b340feb1812e145dfc author Jonas Fonseca 1158060861 +0200 committer Jonas Fonseca 1158060861 +0200 More cleanups commit b5d8f20883633ba2384b92b340feb1812e145dfc c8d60a25206a885e9218f57323f40731841c8756 tree 039066dffbca3ad2e2e79c8ccf483b0c441f5c60 parent c8d60a25206a885e9218f57323f40731841c8756 author Jonas Fonseca 1158060549 +0200 committer Jonas Fonseca 1158060549 +0200 Refector stuff into draw_rev_graph commit c8d60a25206a885e9218f57323f40731841c8756 110e948ed1b5c44de940b47d9244e02358228537 tree df1f4029395f3a65a11e5f6144b3cf2888afb0db parent 110e948ed1b5c44de940b47d9244e02358228537 author Jonas Fonseca 1158060288 +0200 committer Jonas Fonseca 1158060288 +0200 Some more refactoring and cleanups commit 110e948ed1b5c44de940b47d9244e02358228537 1dcb3bec828736c4a9d290d81b03e10aad1eaac8 tree 4b71361cdf02383e97c25ec36d3f3efb8e6c03ab parent 1dcb3bec828736c4a9d290d81b03e10aad1eaac8 author Jonas Fonseca 1158049066 +0200 committer Jonas Fonseca 1158049066 +0200 Cracking commit 1dcb3bec828736c4a9d290d81b03e10aad1eaac8 2b7575338c7e82c0f0973c0f50e76b20083862e2 tree fb13d8ee8e1b12f3805c2a5de0821c1baae34881 parent 2b7575338c7e82c0f0973c0f50e76b20083862e2 author Jonas Fonseca 1158046396 +0200 committer Jonas Fonseca 1158046396 +0200 Minor cleanups commit 2b7575338c7e82c0f0973c0f50e76b20083862e2 104463304fc6c7b9a251e3a079f11268347f8c21 tree 2e740009f32902082ddb2541645d581f842bb311 parent 104463304fc6c7b9a251e3a079f11268347f8c21 author Jonas Fonseca 1158045761 +0200 committer Jonas Fonseca 1158045761 +0200 Version 1 commit 104463304fc6c7b9a251e3a079f11268347f8c21 4795d620f98daae0f972ff61341991656af9c88b tree e755fada7d7bd3b65759948cd54b999f6b18ce7e parent 4795d620f98daae0f972ff61341991656af9c88b author Jonas Fonseca 1158032694 +0200 committer Jonas Fonseca 1158040895 +0200 SIZEOF_REV introduced: 41 bytes of pure madness! commit 4795d620f98daae0f972ff61341991656af9c88b ebbaf4fe5b6a8a0ef52120587495594e6dcf4752 tree a6eb7e567c3eb4c6fa75a923d2ae73447d8612c7 parent ebbaf4fe5b6a8a0ef52120587495594e6dcf4752 author Jonas Fonseca 1158021936 +0200 committer Jonas Fonseca 1158021936 +0200 Minor cleanups commit ebbaf4fe5b6a8a0ef52120587495594e6dcf4752 73c76ef5c12ef914484e1ee71e55126d74020c8d tree 4370fc118e27b7f009848a1f73b27d4f9f0a42fa parent 73c76ef5c12ef914484e1ee71e55126d74020c8d author Jonas Fonseca 1158020596 +0200 committer Jonas Fonseca 1158020596 +0200 Oops, always update the tree view ref commit 73c76ef5c12ef914484e1ee71e55126d74020c8d d4d8de8fb345853df54a2b3f25a1c9824ee6dedb tree 71237d2564074022f223c95bb116806369ab5ff2 parent d4d8de8fb345853df54a2b3f25a1c9824ee6dedb author Jonas Fonseca 1158019517 +0200 committer Jonas Fonseca 1158020205 +0200 Fix updating of the blob ref and the blob view ref So now pressing 'f' on a tree link won't open a blank blob view. Also, the blob reference shown in the title bar is always up to date. commit d4d8de8fb345853df54a2b3f25a1c9824ee6dedb dfaa6c81e5bb473fa3138f8c4f62b611c4fb7627 tree aabe5d9618db6416e20489fb4b08b2e36f65a674 parent dfaa6c81e5bb473fa3138f8c4f62b611c4fb7627 author Jonas Fonseca 1158017792 +0200 committer Jonas Fonseca 1158017792 +0200 Also color Acked-by lines commit dfaa6c81e5bb473fa3138f8c4f62b611c4fb7627 2b42e5d686833a9f45020dfeb8148832d0ad30f7 tree e0349bfe3c1fe571d77bc2f5b6414fe09922b1c7 parent 2b42e5d686833a9f45020dfeb8148832d0ad30f7 author Jonas Fonseca 1158017417 +0200 committer Jonas Fonseca 1158017417 +0200 Fix redrawing of old current line Hopefully the last of all this sloppy bug fixing of the recent cleanups. commit 2b42e5d686833a9f45020dfeb8148832d0ad30f7 8522ecc7a379df19d79220d555f09d2b36cccb28 tree 9d7957d5f6c0b59e9d9e7773905cb8020a1c967a parent 8522ecc7a379df19d79220d555f09d2b36cccb28 author Jonas Fonseca 1158013362 +0200 committer Jonas Fonseca 1158013362 +0200 Only split the tree view when the tree view is visible commit 8522ecc7a379df19d79220d555f09d2b36cccb28 8c317212e3f75826f5c789c29d63d72faccc90f5 tree 6eeaf6ecdbb83dce064597a42038d9801b2d5a3e parent 8c317212e3f75826f5c789c29d63d72faccc90f5 author Jonas Fonseca 1158012306 +0200 committer Jonas Fonseca 1158012306 +0200 move_view: drop redraw arg and handle backgrounded moves commit 8c317212e3f75826f5c789c29d63d72faccc90f5 a0087dd5e88eff34a7c816cce09a7aa070f1d978 tree db0fe294df73e4d5d36838775b663d8d1a086083 parent a0087dd5e88eff34a7c816cce09a7aa070f1d978 author Jonas Fonseca 1158009652 +0200 committer Jonas Fonseca 1158011092 +0200 do_scroll_view: drop redraw arg This redraw thing should be fixed in move_view since this is not relevant for scroll_view. commit a0087dd5e88eff34a7c816cce09a7aa070f1d978 c02d8fcea060d11f48d90e6bb66b5bd2e4a40c4d tree 99a2bd033c57dc1467b88815d2cec3ab42aefdec parent c02d8fcea060d11f48d90e6bb66b5bd2e4a40c4d author Jonas Fonseca 1158008866 +0200 committer Jonas Fonseca 1158008866 +0200 do_scroll_view: minor refactoring of the current line updating commit c02d8fcea060d11f48d90e6bb66b5bd2e4a40c4d 3fd9297e0568c9c88190beff3ac380e49942e514 tree bc23afb63d0bf3e88a75601d2a5e583f38730c17 parent 3fd9297e0568c9c88190beff3ac380e49942e514 author Jonas Fonseca 1158007222 +0200 committer Jonas Fonseca 1158007270 +0200 search_view: use opt_search directly instead of through an argument commit 3fd9297e0568c9c88190beff3ac380e49942e514 3c571d672aa2edbe8afc04cf452ea323eef96f6c tree 442e372ac6ddf873da3b29e8f3e659bec7d7874a parent 3c571d672aa2edbe8afc04cf452ea323eef96f6c author Jonas Fonseca 1158005408 +0200 committer Jonas Fonseca 1158005408 +0200 Remove some old cruft that was clearing hidden lines at the end This was used for the first attempt at fixing the bug where the cursor wraps around on the last line and causes the window to scroll. commit 3c571d672aa2edbe8afc04cf452ea323eef96f6c 5dcf8064ca55dfc77c3fcd18cdf6432ed0f51a94 tree d177b43f4fd3112e731b84b25710bcd486b37c3b parent 5dcf8064ca55dfc77c3fcd18cdf6432ed0f51a94 author Jonas Fonseca 1158005015 +0200 committer Jonas Fonseca 1158005015 +0200 Introduce selected flag and use it for refacter wclrtoeol usage This is used when clearing the old current line. commit 5dcf8064ca55dfc77c3fcd18cdf6432ed0f51a94 d720de4bb6ef9a214be1a86dbdd5d23cb665a953 tree c14892ea11144c60f9bb5219e53604be26004387 parent d720de4bb6ef9a214be1a86dbdd5d23cb665a953 author Jonas Fonseca 1158003843 +0200 committer Jonas Fonseca 1158003843 +0200 Add selected arg to the view draw operation commit d720de4bb6ef9a214be1a86dbdd5d23cb665a953 4038038fbb20f1fc72face6de03be5aee34c7ea7 tree 8d0be39c766f028a724139a87147af3f1b5a4ee6 parent 4038038fbb20f1fc72face6de03be5aee34c7ea7 author Jonas Fonseca 1157999900 +0200 committer Jonas Fonseca 1158000708 +0200 Refactor current line activation to new select view operation commit 4038038fbb20f1fc72face6de03be5aee34c7ea7 b77b2cb8e7407732c91ff56a14f83229472e4d63 tree c1742e9fee0db72304de039a913090b26144cd88 parent b77b2cb8e7407732c91ff56a14f83229472e4d63 author Jonas Fonseca 1157948629 +0200 committer Jonas Fonseca 1157948629 +0200 Fix tree viewing again; introduced by string safety patch commit b77b2cb8e7407732c91ff56a14f83229472e4d63 d42c8a35f25564c6c95500db3a6b0aebcd0a8f22 tree 5cc35cf3cea8856031e946215c5f48994931a221 parent d42c8a35f25564c6c95500db3a6b0aebcd0a8f22 author Jonas Fonseca 1157948571 +0200 committer Jonas Fonseca 1157948571 +0200 Make view->regex into a pointer commit d42c8a35f25564c6c95500db3a6b0aebcd0a8f22 9a48919bfae4a744d0f852d834aa93e71293e8f0 tree f7228867b46852197f634a58686e06a11c4c3be0 parent 9a48919bfae4a744d0f852d834aa93e71293e8f0 author Jonas Fonseca 1157947442 +0200 committer Jonas Fonseca 1157947442 +0200 Fix git-describe reference adding when there are no tags and thus no output commit 9a48919bfae4a744d0f852d834aa93e71293e8f0 0001fc3426ae001a0bd465dcd19a20e2005cdfb6 tree 9db9d5a6e8ace0c207a7809e79899bd2eb5017cc parent 0001fc3426ae001a0bd465dcd19a20e2005cdfb6 author Jonas Fonseca 1157937135 +0200 committer Jonas Fonseca 1157938776 +0200 Improve string buffer copy safety commit 0001fc3426ae001a0bd465dcd19a20e2005cdfb6 4ea4ce91c88b54bcf23dfc7d5edaee25bdae7e2a tree 0dd1480b57cafba98efbd3ac11ae555b91d5cd89 parent 4ea4ce91c88b54bcf23dfc7d5edaee25bdae7e2a author Jonas Fonseca 1157935583 +0200 committer Jonas Fonseca 1157935583 +0200 Hrmpf, fix one more default keybinding clash, this time the blob view By default, it is now bound to 'f'. commit 4ea4ce91c88b54bcf23dfc7d5edaee25bdae7e2a f88a5319d887b41b2bcceca6cfb2b6310ff2669d tree 9630315128fae300ebed25559cb87d8e6e010de1 parent f88a5319d887b41b2bcceca6cfb2b6310ff2669d author Jonas Fonseca 1157933628 +0200 committer Jonas Fonseca 1157933628 +0200 Review all string_format users and use string_format instead of snprintf commit f88a5319d887b41b2bcceca6cfb2b6310ff2669d 20f4b4a3dce08ccdf847d3e6c43da955051f2efc tree f011d8e0b4951cd3c8f1d39bd0000f9e2468dd92 parent 20f4b4a3dce08ccdf847d3e6c43da955051f2efc author Jonas Fonseca 1157931125 +0200 committer Jonas Fonseca 1157931125 +0200 Move the current line to the first entry in the tree view commit 20f4b4a3dce08ccdf847d3e6c43da955051f2efc e9cacd5869eeffc9905b3a12de8a73bbde9f679c tree cacb5f424ec364ad6221c804c882b44bb3e7ecf5 parent e9cacd5869eeffc9905b3a12de8a73bbde9f679c author Jonas Fonseca 1157930463 +0200 committer Jonas Fonseca 1157930463 +0200 Use ICONV_NONE instead of (iconv_t) -1 commit e9cacd5869eeffc9905b3a12de8a73bbde9f679c 3360f4491f10680a0e037c9afeb6b450f5aeea59 tree 20c99d2ec687f03e45a4e94e8a4b59d35c649c4f parent 3360f4491f10680a0e037c9afeb6b450f5aeea59 author Jonas Fonseca 1157927484 +0200 committer Jonas Fonseca 1157927484 +0200 Remove redundant ending ';' commit 3360f4491f10680a0e037c9afeb6b450f5aeea59 904e68d878402cde03164a9706d828a6bafa25ce tree 73e1b4f64dab8b682739a44573cc94247e35994e parent 904e68d878402cde03164a9706d828a6bafa25ce author Jonas Fonseca 1157922859 +0200 committer Jonas Fonseca 1157922859 +0200 manual: mention the tree/blob views commit 904e68d878402cde03164a9706d828a6bafa25ce d65ced0d5e5993b9201a4c9de10c0520b683136b tree b8704a76001cc6b29536845c7520669d43592569 parent d65ced0d5e5993b9201a4c9de10c0520b683136b author Jonas Fonseca 1157922815 +0200 committer Jonas Fonseca 1157922815 +0200 Fix default keybinding clash for 'n' between find-next and toggle-lineno The toggle-lineno is now bound to '.' by default. commit d65ced0d5e5993b9201a4c9de10c0520b683136b 699ae55b3872f063678d534707da052741ac8385 tree e1a117b92bf098485195066dbe450a4a04655e92 parent 699ae55b3872f063678d534707da052741ac8385 author Jonas Fonseca 1157921788 +0200 committer Jonas Fonseca 1157921788 +0200 Use size_t instead of int for string_* functions commit 699ae55b3872f063678d534707da052741ac8385 33c4f9ea1de94641094993578a789d12ab2d95e9 tree 46b951f3b3a61367ec5d728ea28f530833e99c2b parent 33c4f9ea1de94641094993578a789d12ab2d95e9 author Jonas Fonseca 1157918079 +0200 committer Jonas Fonseca 1157918079 +0200 Reintroduce foreach_view and use it to fix background loading Like the main view, when you after start-up switches to the tree view. Also spreads some more asserts to verify guard that no view other than those being displayed updates their screen. commit 33c4f9ea1de94641094993578a789d12ab2d95e9 e733ee54428dadd0566f81150423735f50da711a tree de5feb608c62ad590d1caaa9e8999583cc1fc58c parent e733ee54428dadd0566f81150423735f50da711a author Jonas Fonseca 1157913737 +0200 committer Jonas Fonseca 1157913737 +0200 Rename foreach_view to foreach_displayed_view commit e733ee54428dadd0566f81150423735f50da711a a389e9442c5877daf3570df75d8b188cf23679ee tree f16ae22f3322bbf2a132a6b83b66cf8936d48bc3 parent a389e9442c5877daf3570df75d8b188cf23679ee author Jonas Fonseca 1157903358 +0200 committer Jonas Fonseca 1157903358 +0200 Add support for tree and blob view No command line options have been added to directly enter the tree/blob views, since that would require a much more complex option parsing because it would no longer be possible to rely on git's option parsing. Default keybindings are: 't' show tree view 'b' show blob view commit a389e9442c5877daf3570df75d8b188cf23679ee 92d30f5c42a6f87d3f332797b866d369e2a2d117 tree 9a67d671635ecca01b8e471708ac418bc5b4c1a0 parent 92d30f5c42a6f87d3f332797b866d369e2a2d117 author Jonas Fonseca 1157832907 +0200 committer Jonas Fonseca 1157832907 +0200 tig(1): Do not differentiate between git (show|log|diff) options ... they all basically use the same option parser, so ... commit 92d30f5c42a6f87d3f332797b866d369e2a2d117 4af34daadbabfb7f2cfa279b79d6cbc50551ffba tree fe4ab47c01ed421277713be3bfc71c4d05957fec parent 4af34daadbabfb7f2cfa279b79d6cbc50551ffba author Jonas Fonseca 1157832566 +0200 committer Jonas Fonseca 1157832566 +0200 Reformat the state variable list (opt_*) commit 4af34daadbabfb7f2cfa279b79d6cbc50551ffba 1d754561072b1e73f82098cf0265159a7fce495e tree 24fd3b2b18f095595a3c277e823fe6c3637d47fa parent 1d754561072b1e73f82098cf0265159a7fce495e author Jonas Fonseca 1157832276 +0200 committer Jonas Fonseca 1157832341 +0200 Add support for searching using regex For commits the title, author, and displayed date string is searchable. Search text is not highlighted, the current line is simply used to jump around and show which line matched. Default keybindings: '/' search forward '?' search backward 'n' find next 'N' find previous Note, this means that '?' no longer displays the help view, just use 'h'. commit 1d754561072b1e73f82098cf0265159a7fce495e 9e21ce5c3b27e32aec6bbb9ecb41cb3a55e30838 tree 125222b273bf013e6edc9ff29c1e4cda2db161a1 parent 9e21ce5c3b27e32aec6bbb9ecb41cb3a55e30838 author Jonas Fonseca 1157735095 +0200 committer Jonas Fonseca 1157735244 +0200 Replace screen-update action with noop action named "none" Promote it as a way to unbind built-in default key bindings. commit 9e21ce5c3b27e32aec6bbb9ecb41cb3a55e30838 cb9e48c17bd6ab31a03b73951cb74383d7f9d572 tree a23d822cd3f89e5699bef0b4a65086260b760e90 parent cb9e48c17bd6ab31a03b73951cb74383d7f9d572 author Jonas Fonseca 1157733716 +0200 committer Jonas Fonseca 1157733716 +0200 read_prompt: return static allocated buffer; move out exec mode setup commit cb9e48c17bd6ab31a03b73951cb74383d7f9d572 17482b11c82e46956d017922e1c2ba367cf514e6 tree 874bb25ca046b9fdf8b80edf4480807d8fe689ab parent 17482b11c82e46956d017922e1c2ba367cf514e6 author Jonas Fonseca 1157732503 +0200 committer Jonas Fonseca 1157733009 +0200 read_prompt: take prompt 'name' as arg commit 17482b11c82e46956d017922e1c2ba367cf514e6 dc23c0e307351a6e48025026ad9545936e90507c tree 42930555c9643af697d37850624fbdcc4e59ec0e parent dc23c0e307351a6e48025026ad9545936e90507c author Jonas Fonseca 1157732830 +0200 committer Jonas Fonseca 1157732999 +0200 SIZEOF_STR: introduced and use instead of 1024, also replaces SIZEOF_CMD commit dc23c0e307351a6e48025026ad9545936e90507c c9ca1ec34b48072886183a80442b1e5f2614a46d tree b12925bf534217b74d39b6cb034b813449eee91e parent c9ca1ec34b48072886183a80442b1e5f2614a46d author Jonas Fonseca 1157664533 +0200 committer Jonas Fonseca 1157664561 +0200 Add poor man's "show most recent tag" by using git-describe In the diff view, the "Refs:" lines will now sport the output of git-describe by appending it as the last reference to the line. Now, it should probably be optional and I mostly added it because I wanted to do a little tig hacking. Anyway, let's hope it will be useful. commit c9ca1ec34b48072886183a80442b1e5f2614a46d cb1be74d6d5e19c23ae0ec920741818d7e112807 tree b86b65d160f69ee071dfb262a4f503f21c2520b2 parent cb1be74d6d5e19c23ae0ec920741818d7e112807 author Jonas Fonseca 1157661167 +0200 committer Jonas Fonseca 1157661167 +0200 add_pager_refs: rename local line data pointer to commit_id commit cb1be74d6d5e19c23ae0ec920741818d7e112807 efa092c4e4286943b2c4270624ee5c4331006312 tree 4d054e06dbf19371af31d191a0c4f2b0626d6e30 parent efa092c4e4286943b2c4270624ee5c4331006312 author Jonas Fonseca 1157412494 +0200 committer Jonas Fonseca 1157412494 +0200 Add .gitignore file commit 2c14847eb7c6155f2bf3980159c5dc6525e2d072 c0b25a413f6d670ede018ac46a101992853c20ff tree 808e733da904b0c86c6d65befc8e35251de80a26 parent c0b25a413f6d670ede018ac46a101992853c20ff author Jonas Fonseca 1157313985 +0200 committer Jonas Fonseca 1157313985 +0200 Sync docs commit c0b25a413f6d670ede018ac46a101992853c20ff 5c09dc14e50588285efa6919afca6d95470438ba efa092c4e4286943b2c4270624ee5c4331006312 tree ac35ef7635db61552845ab4fcc69385da989503a parent 5c09dc14e50588285efa6919afca6d95470438ba parent efa092c4e4286943b2c4270624ee5c4331006312 author Jonas Fonseca 1157313865 +0200 committer Jonas Fonseca 1157313865 +0200 Merge with master commit efa092c4e4286943b2c4270624ee5c4331006312 6b68fd246a4f99039948a73e92f003393cf33ec4 tree ffdfb8456177659cbfd727ac443f360fc39df081 parent 6b68fd246a4f99039948a73e92f003393cf33ec4 author Jonas Fonseca 1157313655 +0200 committer Jonas Fonseca 1157313837 +0200 prompt: make ':show ' use the diff view Being able to have the same diff open twice is not very useful. commit 6b68fd246a4f99039948a73e92f003393cf33ec4 73fb51d547de503a6c58f20507ee9017bf29ce97 tree dfd75cd9feb7b317cc2771ec9547ef5a4fa52618 parent 73fb51d547de503a6c58f20507ee9017bf29ce97 author Jonas Fonseca 1157312338 +0200 committer Jonas Fonseca Madsen 1157312338 +0200 Add support for converting from git encoding to locale encoding commit 73fb51d547de503a6c58f20507ee9017bf29ce97 8fee6614be3b0fe4b1f65e5746be05b67737a22a tree eedfc0533dc8ff9f20d8cad2bb72f77ea5aa6431 parent 8fee6614be3b0fe4b1f65e5746be05b67737a22a author Jonas Fonseca 1157287823 +0200 committer Jonas Fonseca 1157287823 +0200 Pass --root to git-show so the diff command will show the initial commit commit 8fee6614be3b0fe4b1f65e5746be05b67737a22a cbbf2d1be57f0bbd9eda37f3d5ab7e30d3ae179b tree 41097514ae7d5b97db202abb740a25b61f49b5cf parent cbbf2d1be57f0bbd9eda37f3d5ab7e30d3ae179b author Jonas Fonseca 1156284777 +0200 committer Jonas Fonseca Madsen 1156284777 +0200 Silence stderr for all view commands When quickly scrolling through commits with the split diff view, they was spewing 'Broken pipe' messages onto the screen. commit cbbf2d1be57f0bbd9eda37f3d5ab7e30d3ae179b d441a715b86de79204ba065469a65308bcda5f40 tree fa2bb86088d9bceaee56ec05ddb08a69db3096ab parent d441a715b86de79204ba065469a65308bcda5f40 author Jonas Fonseca 1156284306 +0200 committer Jonas Fonseca 1156284306 +0200 Improve handling of 'bogus' author lines If no author name is in the ident line fall-back to use the author email. Set to "Unknown" if neither is found. commit d441a715b86de79204ba065469a65308bcda5f40 e6f606748a384c5681985ec063f976520e93156a tree fb6765a53c0939f1032a9d519c496db4211fe953 parent e6f606748a384c5681985ec063f976520e93156a author Jonas Fonseca 1153777293 +0200 committer Jonas Fonseca 1153777293 +0200 Create directories during make install "In install there should be also mkdir -p $(DESTDIR)$(bindir)." --witekfl. commit e6f606748a384c5681985ec063f976520e93156a fa187d6c87100b0c5d626eceb4369eef79176138 tree 4c8f3916bed4ad3b755ba23f34a0c26c046c00f1 parent fa187d6c87100b0c5d626eceb4369eef79176138 author Jonas Fonseca 1153776941 +0200 committer Jonas Fonseca 1153776941 +0200 Check the value returned by fopen() during display initialization 12:12 < kahmalo> Opening /dev/tty may fail; what does newterm do then? 20:15 < Miciah> fonseca: You always gotta check the return value of fopen. Silly head. commit fa187d6c87100b0c5d626eceb4369eef79176138 0f11e3a9f4d936964061dd9106652167c7cb0cba tree fc5295d9efb260e55e2e70160391b671642f2325 parent 0f11e3a9f4d936964061dd9106652167c7cb0cba author Jonas Fonseca 1152736809 +0200 committer Jonas Fonseca 1152736809 +0200 No need to use --stat for the default TIG_MAIN_CMD My plans to use it to add special categorization/highlighting to commits never became interesting. Now the complete history of the grafted ELinks' repo loads in 4 seconds instead of some 240 seconds. commit 0f11e3a9f4d936964061dd9106652167c7cb0cba 30f15e31dcd7510241f3fd23b61d441122390a87 tree 6156ff52a5b5dc1580d71656b58b0531e5796038 parent 30f15e31dcd7510241f3fd23b61d441122390a87 author Jonas Fonseca 1152736522 +0200 committer Jonas Fonseca 1152736522 +0200 tig-0.4.git A little late updating of the VERSION symbol. commit 30f15e31dcd7510241f3fd23b61d441122390a87 de8f9b2bb255e6f167b1bfd073e9c240e51bbdbd 765595f37491a695dd46e74970327213011cbbc0 tree 944f91e79b5ea302700771ef43e77d92e3eac8dd parent de8f9b2bb255e6f167b1bfd073e9c240e51bbdbd parent 765595f37491a695dd46e74970327213011cbbc0 author Jonas Fonseca 1152736280 +0200 committer Jonas Fonseca 1152736280 +0200 Merge with ssh://brok.diku.dk/~/tig commit 765595f37491a695dd46e74970327213011cbbc0 f8a36a6b36fc62d41cca33659f85b7737311e592 tree d22e8bbb5567fa9c9f6c5f51180fe58879cc0094 parent f8a36a6b36fc62d41cca33659f85b7737311e592 author Jonas Fonseca 1152736152 +0200 committer Jonas Fonseca Madsen 1152736152 +0200 tigrc(5): Fix keybinding headers commit de8f9b2bb255e6f167b1bfd073e9c240e51bbdbd 604da3b78777bf69d01d214f203f3be8ee258f67 tree 13a2389382169a086e9f4fba611e86b8ffbf1e45 parent 604da3b78777bf69d01d214f203f3be8ee258f67 author Jonas Fonseca 1150329188 +0200 committer Jonas Fonseca 1150329188 +0200 Use docbook to build manual.pdf; clean *.xml files commit 5c09dc14e50588285efa6919afca6d95470438ba 0c1745a4c8711bb021921e8446113e366901fc37 tree 6e614c845eda739becdf60d73841578e59c8c6d5 parent 0c1745a4c8711bb021921e8446113e366901fc37 author Jonas Fonseca 1150327705 +0200 committer Jonas Fonseca 1150327705 +0200 Sync docs commit 0c1745a4c8711bb021921e8446113e366901fc37 c3a4b3e0104b32beb965e913543affef86b583be 604da3b78777bf69d01d214f203f3be8ee258f67 tree ff1eb5257fa84ece6ebdfd859981f37bb848072f parent c3a4b3e0104b32beb965e913543affef86b583be parent 604da3b78777bf69d01d214f203f3be8ee258f67 author Jonas Fonseca 1150327695 +0200 committer Jonas Fonseca 1150327695 +0200 Merge with master commit 604da3b78777bf69d01d214f203f3be8ee258f67 03e8d89193be9ec7f8d61d035746bccbfd881223 tree 3127da940f20862c60dbc68f6dae5314e991c653 parent 03e8d89193be9ec7f8d61d035746bccbfd881223 author Jonas Fonseca 1150327561 +0200 committer Jonas Fonseca 1150327684 +0200 Add sync-docs rule to update docs in the release branch commit 03e8d89193be9ec7f8d61d035746bccbfd881223 e664e2605eeec5da7ef094e875fe479ee30b5fbb tree 66b1b49aabd4c242e5dfb02bd975a6a8ae4787f5 parent e664e2605eeec5da7ef094e875fe479ee30b5fbb author Jonas Fonseca 1150326832 +0200 committer Jonas Fonseca 1150326832 +0200 Manual: fix page up keys commit e664e2605eeec5da7ef094e875fe479ee30b5fbb f8a36a6b36fc62d41cca33659f85b7737311e592 tree 11e98c32418070f59b9f7ee563f1de0dfa6a89a8 parent f8a36a6b36fc62d41cca33659f85b7737311e592 author Jonas Fonseca 1150326086 +0200 committer Jonas Fonseca 1150326086 +0200 Add manual link to SITES; improve/fix SEE ALSO sections commit c3a4b3e0104b32beb965e913543affef86b583be 6650347d7629076210c4736f744be98664b09047 tree 288f2ac25df52e7034d720c6a83357d453685bf0 parent 6650347d7629076210c4736f744be98664b09047 author Jonas Fonseca 1150320568 +0200 committer Jonas Fonseca 1150320568 +0200 Sync docs commit 6650347d7629076210c4736f744be98664b09047 b484cbc84ae8fc3d2241e56c0048de9d99d650b8 f8a36a6b36fc62d41cca33659f85b7737311e592 tree 65c08272ec9ee95e210063a1a424dd4ded04dff8 parent b484cbc84ae8fc3d2241e56c0048de9d99d650b8 parent f8a36a6b36fc62d41cca33659f85b7737311e592 author Jonas Fonseca 1150320515 +0200 committer Jonas Fonseca 1150320515 +0200 Merge with master commit f8a36a6b36fc62d41cca33659f85b7737311e592 669b0c340bdb930d5f40ff65e09ba88c7aafff19 tree c3e608d5f9d879cecade6da3fe5ba204dd69c51d parent 669b0c340bdb930d5f40ff65e09ba88c7aafff19 author Jonas Fonseca 1150320499 +0200 committer Jonas Fonseca 1150320499 +0200 CSS fix: s/monospaced/monospace/ commit 669b0c340bdb930d5f40ff65e09ba88c7aafff19 2bc4f7bd461405083a225b7d43b1ddc947670259 tree e4782b085586f0e5823dae9a696c6861b5c9b7a5 parent 2bc4f7bd461405083a225b7d43b1ddc947670259 author Jonas Fonseca 1150320366 +0200 committer Jonas Fonseca 1150320366 +0200 Use tables for the listing of default keybindings commit b484cbc84ae8fc3d2241e56c0048de9d99d650b8 daaae1af3f1fe5a18a106e5c42ac6ef6fa4fa9d2 tree 49bf8cc2feee13ab486b78e057c89f27b5309a7a parent daaae1af3f1fe5a18a106e5c42ac6ef6fa4fa9d2 author Jonas Fonseca 1150316962 +0200 committer Jonas Fonseca 1150316962 +0200 Sync docs commit daaae1af3f1fe5a18a106e5c42ac6ef6fa4fa9d2 42afc55b25b10e3eb15a0fbdabc6fee17e2ff8fa 2bc4f7bd461405083a225b7d43b1ddc947670259 tree bf3d818cb4ec55ef2500a3c867accd4a6eb33dec parent 42afc55b25b10e3eb15a0fbdabc6fee17e2ff8fa parent 2bc4f7bd461405083a225b7d43b1ddc947670259 author Jonas Fonseca 1150316904 +0200 committer Jonas Fonseca 1150316904 +0200 Merge with master commit 2bc4f7bd461405083a225b7d43b1ddc947670259 74f83ee6af485697067aeee6392f2e45556bacee tree 5c346869e6f1612fabec8bd7779533733c6f9e7d parent 74f83ee6af485697067aeee6392f2e45556bacee author Jonas Fonseca 1150316890 +0200 committer Jonas Fonseca 1150316890 +0200 Documentation update Brings tigrc(5) into sync. A small fix in INSTALL. commit 74f83ee6af485697067aeee6392f2e45556bacee 3cc9a4d495afa80795222848b1f3941dd539f63d tree 40db7bf41a41d699550216a9e84a94d08f1aa6cc parent 3cc9a4d495afa80795222848b1f3941dd539f63d author Jonas Fonseca 1150316864 +0200 committer Jonas Fonseca 1150316864 +0200 Add "Hash" key name mapped to "#"; Don't use ";" as a comment character commit 3cc9a4d495afa80795222848b1f3941dd539f63d ef5404a435209243e0e65b0bdbb1c32f1c66b43a tree 043a4d6d9705ea5715eb0b084ace68ef2b1195d3 parent ef5404a435209243e0e65b0bdbb1c32f1c66b43a author Jonas Fonseca 1150313883 +0200 committer Jonas Fonseca 1150313988 +0200 Allow strings to be enclosed in either ' or " So now you can use both: set commit-encoding = "UTF-8" set commit-encoding = 'UTF-8' set commit-encoding = UTF-8 commit ef5404a435209243e0e65b0bdbb1c32f1c66b43a a643fbd72dc16eb863c4a564c23e7a54a5e9dd73 tree 6360ccbafd4574e589e96576e78e3843940cdeb8 parent a643fbd72dc16eb863c4a564c23e7a54a5e9dd73 author Jonas Fonseca 1149979757 +0200 committer Jonas Fonseca 1149979841 +0200 Make prompt use internal user input reader This allows it to be used while loading. Also, it will make it possible to support more advanced editing facilities like history, completion etc. needed for future search support at least. It's still very primitive ... commit a643fbd72dc16eb863c4a564c23e7a54a5e9dd73 cb7267eefe872b5f62559405ba1bda059867b776 a365336835cfcc44cb0aed20d08b2926c27ef71c tree bdbe596cbcc850d43b3ad4045bd27c268721141e parent cb7267eefe872b5f62559405ba1bda059867b776 parent a365336835cfcc44cb0aed20d08b2926c27ef71c author Jonas Fonseca 1149851707 +0200 committer Jonas Fonseca 1149851707 +0200 Merge with ssh://diku/~/tig commit a365336835cfcc44cb0aed20d08b2926c27ef71c 04e2b7b214944044250edfea5634cbf919473cf4 tree 56e5a79a9bf3c5a54b0ecc240c691bfb66d962a0 parent 04e2b7b214944044250edfea5634cbf919473cf4 author Jonas Fonseca 1149811708 +0200 committer Jonas Fonseca Madsen 1149813653 +0200 Config: improve error reporting and do a few cleanups and simplifications commit cb7267eefe872b5f62559405ba1bda059867b776 bb8afc29c6f37d7d7300669d0d24af444c34c204 tree 9bd20b12513b725ce005728cb89ac6cc5fcaeb0c parent bb8afc29c6f37d7d7300669d0d24af444c34c204 author Jonas Fonseca 1149773412 +0200 committer Jonas Fonseca 1149773412 +0200 Rename "encoding" option to "commit-encoding" commit bb8afc29c6f37d7d7300669d0d24af444c34c204 9783cb122811aef23966400e91cdab30108fc540 tree 74cd45a1be9ac615eb7074b56f2261582e8b61c4 parent 9783cb122811aef23966400e91cdab30108fc540 author Jonas Fonseca 1149733987 +0200 committer Jonas Fonseca 1149733987 +0200 Install HTML files into $(prefix)/share/doc/tig commit 9783cb122811aef23966400e91cdab30108fc540 511147de010477fc7808df7fc535a32dd59fae31 tree e02dce8a99ee30c73a47c9ac54da4590f56d2fde parent 511147de010477fc7808df7fc535a32dd59fae31 author Jonas Fonseca 1149733920 +0200 committer Jonas Fonseca 1149733920 +0200 Add ToC to the tig manual commit 511147de010477fc7808df7fc535a32dd59fae31 04e2b7b214944044250edfea5634cbf919473cf4 tree 1f3a57fda24f2657c3022fb0f49254d6228eaf56 parent 04e2b7b214944044250edfea5634cbf919473cf4 author Jonas Fonseca 1149731875 +0200 committer Jonas Fonseca 1149731875 +0200 Misc doc improvements commit 04e2b7b214944044250edfea5634cbf919473cf4 93a97d864dc8d4fa2ae51a4cb2d742e4ae9d2320 tree 286f59a0706b8e8964fd174b8e05ef21856d3b7a parent 93a97d864dc8d4fa2ae51a4cb2d742e4ae9d2320 author Jonas Fonseca 1149724996 +0200 committer Jonas Fonseca 1149724996 +0200 Add support for keybindings The syntax is bind Keybindings are resolved by first looking in the keymap of the active view, then in the generic keymap, and finally in the built-in default keybindings. Examples to put in ~/.tigrc: bind main w scroll-line-up bind main s scroll-line-down bind diff a previous bind diff d next bind diff b move-first-line bind generic g view-next commit 93a97d864dc8d4fa2ae51a4cb2d742e4ae9d2320 63dec68628922a7d17009d02018f22c0280d5a79 tree 85d8b9d9bc9addd445299e532d92ab0fa17e97ba parent 63dec68628922a7d17009d02018f22c0280d5a79 author Jonas Fonseca 1149724370 +0200 committer Jonas Fonseca 1149724370 +0200 Rename keymap to keybinding, get_request to get_keybinding commit 63dec68628922a7d17009d02018f22c0280d5a79 201f5a1823896123638678add979deb6118e1ffc tree c92102fabe0d89be9b3b9c149d458c37d96363c4 parent 201f5a1823896123638678add979deb6118e1ffc author Jonas Fonseca 1149718483 +0200 committer Jonas Fonseca 1149718483 +0200 Add default configuration file commit 201f5a1823896123638678add979deb6118e1ffc e10154d597c68456a76c4ad99665656ae2e494c3 tree 48c1a83f785a9a19d0728e5d4b2205e163c62de3 parent e10154d597c68456a76c4ad99665656ae2e494c3 author Jonas Fonseca 1149717955 +0200 committer Jonas Fonseca 1149717955 +0200 Add special string comparer for gracefully parsing ~/.tigrc identifiers commit e10154d597c68456a76c4ad99665656ae2e494c3 79d445cab240fe5bea55bfe22c12b5ee67b074a6 tree a36b7f5427277f96ce1f0e4418ee798c437193ba parent 79d445cab240fe5bea55bfe22c12b5ee67b074a6 author Jonas Fonseca 1149638867 +0200 committer Jonas Fonseca Madsen 1149638867 +0200 Establish "Open view" section commit 79d445cab240fe5bea55bfe22c12b5ee67b074a6 37157fa02cba62a642d0ff66cc0318858daf757a tree 7710e879d3eb7c81ec4bc551cfeaaf23408d51cd parent 37157fa02cba62a642d0ff66cc0318858daf757a author Jonas Fonseca 1149638761 +0200 committer Jonas Fonseca Madsen 1149638761 +0200 Rename load_help_page to open_help_view and move it up Also use view->ops->read() instead of pager_read(). commit 37157fa02cba62a642d0ff66cc0318858daf757a 5bfd96c7f51d98de066a3b29c86b52062a7825b8 tree b642a603c8476c28921fb1656f0ba26f5d64085b parent 5bfd96c7f51d98de066a3b29c86b52062a7825b8 author Jonas Fonseca 1149638110 +0200 committer Jonas Fonseca Madsen 1149638110 +0200 Move keybinding stuff up after line stuff commit 5bfd96c7f51d98de066a3b29c86b52062a7825b8 9256ab05bce5d697132c62a1e2ceb82bb73f2d26 tree 6706c697814fc1ad669023efe0cd15c42efcb66f parent 9256ab05bce5d697132c62a1e2ceb82bb73f2d26 author Jonas Fonseca 1149637791 +0200 committer Jonas Fonseca Madsen 1149637791 +0200 Support set command in ~/.tigrc; allows a few options to be configured commit 9256ab05bce5d697132c62a1e2ceb82bb73f2d26 bca8fcaa2052031f0275622a2712e6d6d317a862 tree 3f6e3090c4279877198be6db418149444649a127 parent bca8fcaa2052031f0275622a2712e6d6d317a862 author Jonas Fonseca 1149635746 +0200 committer Jonas Fonseca Madsen 1149635746 +0200 Simplify the option value tokenization by doing it one place commit bca8fcaa2052031f0275622a2712e6d6d317a862 e2da526db9f410194cbb67a8ec207545879939b5 tree 4874397b04fb6be6cfd21b839e98edaf3812efcb parent e2da526db9f410194cbb67a8ec207545879939b5 author Jonas Fonseca 1149633804 +0200 committer Jonas Fonseca Madsen 1149633804 +0200 Factor out set_option_color from set_option commit e2da526db9f410194cbb67a8ec207545879939b5 bf174187d0f6a7957908ab94983f0699e7d356e2 tree 9e3e78c792a1cb32d6e71f144247910391380592 parent bf174187d0f6a7957908ab94983f0699e7d356e2 author Jonas Fonseca 1149632787 +0200 committer Jonas Fonseca Madsen 1149632787 +0200 Make declaration of die() specify the __NORETURN attribute Avoids warnings with gcc 3.3.5. commit 42afc55b25b10e3eb15a0fbdabc6fee17e2ff8fa cdfc29adc50d13fc90b21eda3ce4795513a42f8f tree 6b070d67b996be99f4e1d795ce35988c323e21ba parent cdfc29adc50d13fc90b21eda3ce4795513a42f8f author Jonas Fonseca 1149595038 +0200 committer Jonas Fonseca 1149595038 +0200 Sync docs commit cdfc29adc50d13fc90b21eda3ce4795513a42f8f 3ad8214b4550de574f6ffab4a3c49578ef0f5893 bf174187d0f6a7957908ab94983f0699e7d356e2 tree 84fb03a910e32be0b0acead39203947b273c009f parent 3ad8214b4550de574f6ffab4a3c49578ef0f5893 parent bf174187d0f6a7957908ab94983f0699e7d356e2 author Jonas Fonseca 1149594907 +0200 committer Jonas Fonseca 1149594907 +0200 Merge with master commit bf174187d0f6a7957908ab94983f0699e7d356e2 2d35aabef724a4145cf9dc16e516a2647c2747df tree 1a41fe2e006d689bf3008bde5c6633481fe989d6 parent 2d35aabef724a4145cf9dc16e516a2647c2747df author Jonas Fonseca 1149593725 +0200 committer Jonas Fonseca 1149593725 +0200 Improve error reporting for unknown options It will now also show usage help. commit 2d35aabef724a4145cf9dc16e516a2647c2747df 5f7b975a9f65386462b97de55f519fa3e4640cbf tree ba280a6493ba15ac2ffca0d9dfdc82f7868741eb parent 5f7b975a9f65386462b97de55f519fa3e4640cbf author Jonas Fonseca 1149546562 +0200 committer Jonas Fonseca 1149546562 +0200 Add feature request for showing nearest branch heads or tags for a commit Requested by Junio. commit 5f7b975a9f65386462b97de55f519fa3e4640cbf 6d9c07af4db59e73d6f434f1ade4da919601f96c tree b0a6778bc0094df5b4fa073a3559f80a4a9c1e45 parent 6d9c07af4db59e73d6f434f1ade4da919601f96c author Junio C Hamano 1149466265 +0200 committer Jonas Fonseca 1149466265 +0200 Makefile: make customization of installation locations easier Signed-off-by: Junio C Hamano Signed-off-by: Jonas F Madsen commit 6d9c07af4db59e73d6f434f1ade4da919601f96c 54efb62b1e6a270db94f9395e9934aec002eee3e tree 0b92215ac42637d8189be14319dccc997d3b82c6 parent 54efb62b1e6a270db94f9395e9934aec002eee3e author Jonas Fonseca 1149381990 +0200 committer Jonas Fonseca Madsen 1149381990 +0200 Make the view title show percentage shown like less The cursor position is already summoned up as "line x of X". commit 54efb62b1e6a270db94f9395e9934aec002eee3e 0e92d312229bfb25760fecfeb1a4d49035159157 tree 68b5a293b2a6414f22e57e6a0998ddfd846658e7 parent 0e92d312229bfb25760fecfeb1a4d49035159157 author Jonas Fonseca 1149378812 +0200 committer Jonas Fonseca Madsen 1149378812 +0200 Implement the basic controlling of revision graph visualization It is toggleable via 'g', on by default, and restricted to max being 19 chars wide. Note, it still only shows just the left tee. commit 0e92d312229bfb25760fecfeb1a4d49035159157 2509b112f48d935a7130d041b69d248ee91b7e31 tree fca8348b063b4285de750f0be9da76d8836f6cd2 parent 2509b112f48d935a7130d041b69d248ee91b7e31 author Jonas Fonseca 1149374498 +0200 committer Jonas Fonseca Madsen 1149374558 +0200 Add strip rule commit 2509b112f48d935a7130d041b69d248ee91b7e31 5dc795f2a5fb4ba44345f26293b50564356bc8dc tree fd3425cc9f9fc65513ec54e3e8f716bbeabc8d95 parent 5dc795f2a5fb4ba44345f26293b50564356bc8dc author Jonas Fonseca 1149130112 +0200 committer Jonas Fonseca 1149130112 +0200 Don't begin any update for the built-in help page commit 5dc795f2a5fb4ba44345f26293b50564356bc8dc 8b0297aeccd27008c3e0c4e9b3d30808a0c89c2b tree 77bd81eaf8ef180ddfba63c0e84888c67226010b parent 8b0297aeccd27008c3e0c4e9b3d30808a0c89c2b author Jonas Fonseca 1149127968 +0200 committer Jonas Fonseca 1149127968 +0200 More color and attribute maps closer to the users commit 8b0297aeccd27008c3e0c4e9b3d30808a0c89c2b 22913179d3d02d5b6cc9a69e0fdc0e5575b8ce13 tree 303ab72321fb0a16910caef44f376caf2e1abcb2 parent 22913179d3d02d5b6cc9a69e0fdc0e5575b8ce13 author Jonas Fonseca 1149127724 +0200 committer Jonas Fonseca 1149127724 +0200 Simplify detection of tag commits via ^{} commit 22913179d3d02d5b6cc9a69e0fdc0e5575b8ce13 6dbf6c1970e2a1b31244ff0426aa87321aba9b6e tree c30ccba27239773cf0bbcd17865bc3716ab49f9f parent 6dbf6c1970e2a1b31244ff0426aa87321aba9b6e author Jonas Fonseca 1149127502 +0200 committer Jonas Fonseca 1149127502 +0200 Minor tidyup commit 6dbf6c1970e2a1b31244ff0426aa87321aba9b6e 8eb627705bcfb8aa2079d3c553621aa024d79819 tree 7f4b30b4ded100928bbc669dd1a9e0e67731b533 parent 8eb627705bcfb8aa2079d3c553621aa024d79819 author Jonas Fonseca 1149125795 +0200 committer Jonas Fonseca 1149125795 +0200 Generalize the option parsing commit 8eb627705bcfb8aa2079d3c553621aa024d79819 fff1780fa68424dc1fcc8a44d6a2091a8a7b6f1e tree 32e171825711893b03f5c018a1d2096363eab1ce parent fff1780fa68424dc1fcc8a44d6a2091a8a7b6f1e author Jonas Fonseca 1149120976 +0200 committer Jonas Fonseca 1149120976 +0200 Move tig(1) material to tig.1.txt commit fff1780fa68424dc1fcc8a44d6a2091a8a7b6f1e 701e4f5dc83fb7f9a9c2c57d1634c213ec588c01 tree be3cfd7d968d8093f8d0b86d22868d99e575a09e parent 701e4f5dc83fb7f9a9c2c57d1634c213ec588c01 author Jonas Fonseca 1149118912 +0200 committer Jonas Fonseca 1149118912 +0200 Correct error checking Fixes: cc2d13642a837163fb0e35d87a51ff96b7bf3cb0 commit 701e4f5dc83fb7f9a9c2c57d1634c213ec588c01 cc2d13642a837163fb0e35d87a51ff96b7bf3cb0 tree d1a6086c732d2ec38f9a49d5d26b79bc23f2bf67 parent cc2d13642a837163fb0e35d87a51ff96b7bf3cb0 author Jonas Fonseca 1149118650 +0200 committer Jonas Fonseca 1149118650 +0200 Remove prev arg to view->ops->read() commit cc2d13642a837163fb0e35d87a51ff96b7bf3cb0 7b99a34c5ae8dd2ebd08dd6fe19c024a0a93fa4b tree 80a63e1a7a2ada521b21b512eac7cf4778e9e5ee parent 7b99a34c5ae8dd2ebd08dd6fe19c024a0a93fa4b author Jonas Fonseca 1149110198 +0200 committer Jonas Fonseca 1149110198 +0200 Wrap all snprintf usage to simplify error handling commit 7b99a34c5ae8dd2ebd08dd6fe19c024a0a93fa4b e2c016172ea5201961edec7dca2821cbf71255d2 tree beb9d009e618a49c3b3041d4b561c9e4a73c927e parent e2c016172ea5201961edec7dca2821cbf71255d2 author Jonas Fonseca 1149108466 +0200 committer Jonas Fonseca 1149108466 +0200 Add support for showing tags and other repo refs in the diff and log view commit e2c016172ea5201961edec7dca2821cbf71255d2 24b5b3e07ce10436d3aefb02bc7e66dc59fd09a6 tree 19471c9377bb61acec427cdaf729a61413cb2808 parent 24b5b3e07ce10436d3aefb02bc7e66dc59fd09a6 author Jonas Fonseca 1149106474 +0200 committer Jonas Fonseca 1149106474 +0200 Refactor view->line reallocation commit 24b5b3e07ce10436d3aefb02bc7e66dc59fd09a6 c92615b1b3fa6c3cbc54278a9af52df58fcc2a29 tree e32740bcf6a8ae56857fcffe374783552b8e3692 parent c92615b1b3fa6c3cbc54278a9af52df58fcc2a29 author Jonas Fonseca 1149102433 +0200 committer Jonas Fonseca 1149102433 +0200 Make 'h' and '?' show built-in key binding quick reference commit c92615b1b3fa6c3cbc54278a9af52df58fcc2a29 5976048600791033f3f9dc559fc2ee0d4e43bf1e tree d89e7c98d32535fd7568fd7c9204c060f706c341 parent 5976048600791033f3f9dc559fc2ee0d4e43bf1e author Jonas Fonseca 1149030276 +0200 committer Jonas Fonseca 1149030276 +0200 Rename documentation build rules using s/docs/doc/; more like git commit 5976048600791033f3f9dc559fc2ee0d4e43bf1e 8d741c0664539caf54cb9004151bf8f72517df06 tree 5e288043d13094ca8ee45f7c9cff070e3a7bb06b parent 8d741c0664539caf54cb9004151bf8f72517df06 author Jonas Fonseca 1148995399 +0200 committer Jonas Fonseca 1148995399 +0200 Add COPYING file commit 8d741c0664539caf54cb9004151bf8f72517df06 32f6387bc269f9683aea7532fe713b68f65a8f75 tree 487e52e7e9f89a114ab138625ce4cdfeca86946d parent 32f6387bc269f9683aea7532fe713b68f65a8f75 author Jonas Fonseca 1148938178 +0200 committer Jonas Fonseca 1148938178 +0200 Fix segfault where current_view would become >= sizeof(display) Hard code current_view indexes for split screen setup. Reported-by: Dennis (dst_) on #git commit 3ad8214b4550de574f6ffab4a3c49578ef0f5893 097d926a004c84858dbf81c05247491dc2870b68 tree 22d29e99ab10e24593752dd71374541186ad0fe1 parent 097d926a004c84858dbf81c05247491dc2870b68 author Jonas Fonseca 1148932016 +0200 committer Jonas Fonseca 1148932016 +0200 Sync docs commit 097d926a004c84858dbf81c05247491dc2870b68 ffe3a8da376de11ea0f719ce31df3f97f2b96ec1 32f6387bc269f9683aea7532fe713b68f65a8f75 tree 974858e01aeff09eefdcf9b409ed01ed732d7df4 parent ffe3a8da376de11ea0f719ce31df3f97f2b96ec1 parent 32f6387bc269f9683aea7532fe713b68f65a8f75 author Jonas Fonseca 1148931661 +0200 committer Jonas Fonseca 1148931661 +0200 Merge with master commit 32f6387bc269f9683aea7532fe713b68f65a8f75 d839253b7aa9ce121b56a92b05b69ba75cfc34e8 tree 1de0ffc6af75c193c8e5b3a6d1855552750a68bd parent d839253b7aa9ce121b56a92b05b69ba75cfc34e8 author Jonas Fonseca 1148931444 +0200 committer Jonas Fonseca 1148931444 +0200 Remove SITES title so it is more adaptive to where it is included commit d839253b7aa9ce121b56a92b05b69ba75cfc34e8 ae3f2323332abb452c395f2e887b6edb81b11728 tree 899c7e7fc86913a6899d1e3ce66c1bbec3625f11 parent ae3f2323332abb452c395f2e887b6edb81b11728 author Jonas Fonseca 1148931417 +0200 committer Jonas Fonseca 1148931417 +0200 Split out manual material to separate file commit ae3f2323332abb452c395f2e887b6edb81b11728 f4657f001d454c5e467debc9df490936b8fbe0e5 tree c6af027c37a52ce6cedf41ca7d1bf79ff5ddb814 parent f4657f001d454c5e467debc9df490936b8fbe0e5 author Jonas Fonseca 1148866056 +0200 committer Jonas Fonseca 1148866056 +0200 List SITES in tig(1) commit f4657f001d454c5e467debc9df490936b8fbe0e5 e34f45d4dddeb070a83e40b9959a2344295af1bc tree a904d2d35b82af4fdad2d75d15820bd23cb57d30 parent e34f45d4dddeb070a83e40b9959a2344295af1bc author Jonas Fonseca 1148865943 +0200 committer Jonas Fonseca 1148865943 +0200 Move stuff to SITES and INSTALL files commit e34f45d4dddeb070a83e40b9959a2344295af1bc cb7f42cdc1a07d0f88b8af211d214da5febd6223 tree 98c64c318cacb8fcb4531e74f9227ac28ec5ed5f parent cb7f42cdc1a07d0f88b8af211d214da5febd6223 author Jonas Fonseca 1148865556 +0200 committer Jonas Fonseca 1148865556 +0200 Move stuff to BUGS and TODO files; only show BUGS in tig(1) commit cb7f42cdc1a07d0f88b8af211d214da5febd6223 3df9850aa21a39e42ed4e720ad08c98610166a28 tree 4cf0847a36a0312750eaf65fdc0739f80dd231d1 parent 3df9850aa21a39e42ed4e720ad08c98610166a28 author Jonas Fonseca 1148865320 +0200 committer Jonas Fonseca 1148865320 +0200 Move ~/.tigrc documentation into it's own man page, tigrc(5) commit 3df9850aa21a39e42ed4e720ad08c98610166a28 965537fa357e94c1fe6fda5cf26a93c1b06e9d3a tree 6ae8e5140a667faeef7041b34357ac3c4c8de1ea parent 965537fa357e94c1fe6fda5cf26a93c1b06e9d3a author Jonas Fonseca 1148864487 +0200 committer Jonas Fonseca 1148864487 +0200 Use ~/.tigrc for user configuration rather than ~/.tig commit 965537fa357e94c1fe6fda5cf26a93c1b06e9d3a 3c3801c277397ae02c052a4c9c0a604e0d469e86 tree 68be7b37d81a555e574cb13a3e1b07b473b46bb2 parent 3c3801c277397ae02c052a4c9c0a604e0d469e86 author Jonas Fonseca 1148853108 +0200 committer Jonas Fonseca 1148853108 +0200 Add TODO about keybinding cheat sheet Requested by gitster on IRC. commit 3c3801c277397ae02c052a4c9c0a604e0d469e86 1899507caece024f4d1022501435264bfe69b8a7 tree eeabeda140e404b991324334fd5cba6cf9256af2 parent 1899507caece024f4d1022501435264bfe69b8a7 author Jonas Fonseca 1148842771 +0200 committer Jonas Fonseca 1148842771 +0200 Emit more informative error messages when loading ~/.tig commit 1899507caece024f4d1022501435264bfe69b8a7 bec81df939d86351dbf008444799e759722df3b6 tree 956aadb2c5d3d7c126b306c46e52fee57a7d8f5b parent bec81df939d86351dbf008444799e759722df3b6 author Jonas Fonseca 1148840372 +0200 committer Jonas Fonseca 1148840422 +0200 Only touch the option strings if necessary commit bec81df939d86351dbf008444799e759722df3b6 660e09ad0123e5c31bfca8ce0e7d1df835786232 tree 2d8c40cf8f5df83fa66a06d92b27b6dcff63fc1e parent 660e09ad0123e5c31bfca8ce0e7d1df835786232 author Jonas Fonseca 1148839907 +0200 committer Jonas Fonseca 1148840311 +0200 Improve color documentation commit 660e09ad0123e5c31bfca8ce0e7d1df835786232 4a63c884c2b116c3ea57487bc93bafda0d1993e7 tree 2eecfad530fc363f91e56cb609d8d67a0bac1a2c parent 4a63c884c2b116c3ea57487bc93bafda0d1993e7 author Jonas Fonseca 1148827112 +0200 committer Jonas Fonseca 1148827112 +0200 Add support for setting color options in the ~/.tig user configuration file Now you can put stuff like this in ~/.tig: # Diff colors color diff-header yellow default color diff-index blue default color diff-chunk magenta default # UI colors color title-blur white blue color title-focus white blue bold commit 4a63c884c2b116c3ea57487bc93bafda0d1993e7 b3c965c9d8bbfde4b99b02376b535976e1a3f48e tree 2ba3a0d4b002718441aca9ee2529b951f30b7b55 parent b3c965c9d8bbfde4b99b02376b535976e1a3f48e author Jonas Fonseca 1148786632 +0200 committer Jonas Fonseca 1148786632 +0200 Make read_properties take several separator characters; chomp name & value This concludes the fundation for using read_properties to read options from a config file. commit b3c965c9d8bbfde4b99b02376b535976e1a3f48e 14c778a692e4964286a3a640de07dac9a846b67c tree 152842cef9702257ba12b09a5810216176de5b14 parent 14c778a692e4964286a3a640de07dac9a846b67c author Jonas Fonseca 1148783794 +0200 committer Jonas Fonseca 1148784763 +0200 Oops, fix short help wrt tab size short option commit 14c778a692e4964286a3a640de07dac9a846b67c 667497239e41d710f092b44efc7ce82bb57cd825 tree af79d7cf95b4cafac51cbfbe6dc1754224455c58 parent 667497239e41d710f092b44efc7ce82bb57cd825 author Jonas Fonseca 1148783385 +0200 committer Jonas Fonseca 1148784715 +0200 Rename repo config loaders using s/config/repo_config/ load_config -> load_repo_config read_config_option -> read_repo_config_option commit 667497239e41d710f092b44efc7ce82bb57cd825 9a66631561319b86f54f20346d953070238cc346 tree 5aa6fbeb072747d829ff2df33f2d54156f971a41 parent 9a66631561319b86f54f20346d953070238cc346 author Jonas Fonseca 1148782786 +0200 committer Jonas Fonseca 1148782900 +0200 Make read_properties() take FILE *pipe instead of command line commit 9a66631561319b86f54f20346d953070238cc346 59a45d3a5f03158e2b9b143886cdaff6da527d0c tree 55a144a1dfab87b64301b9eebfc8a15b348c1537 parent 59a45d3a5f03158e2b9b143886cdaff6da527d0c author Jonas Fonseca 1148782748 +0200 committer Jonas Fonseca 1148782748 +0200 Document the loading time displayed in the title window after 3 seconds commit 59a45d3a5f03158e2b9b143886cdaff6da527d0c 6a7bb912e604ba64776ee45363d112e110366707 tree b3dde808f2be559a39e6cd5f24739da668d5b065 parent 6a7bb912e604ba64776ee45363d112e110366707 author Jonas Fonseca 1148781331 +0200 committer Jonas Fonseca 1148781331 +0200 Make the stop all loading request stop all loading commit 6a7bb912e604ba64776ee45363d112e110366707 380ec161ae41e781c46510e9a2bc4b770f0e677f tree d96a8201a3e536a09cb8231e9d65deef39e52966 parent 380ec161ae41e781c46510e9a2bc4b770f0e677f author Jonas Fonseca 1148781113 +0200 committer Jonas Fonseca 1148781113 +0200 Notify that the prompt is unusable while loading List it as a bug. commit 380ec161ae41e781c46510e9a2bc4b770f0e677f 2fcf54018eb1bd8b9e177e322f5d833fa53107ff tree 38892b0b89ea9515dc0e127ca6523d38bcbfbf28 parent 2fcf54018eb1bd8b9e177e322f5d833fa53107ff author Jonas Fonseca 1148778139 +0200 committer Jonas Fonseca 1148778139 +0200 Tab size short option changes from -t to -b commit 2fcf54018eb1bd8b9e177e322f5d833fa53107ff 55565c5117dd5fc90ad05574f983ed64b21636ae tree f6032d019f1be787890b0837e64b5aa07c890833 parent 55565c5117dd5fc90ad05574f983ed64b21636ae author Jonas Fonseca 1148770684 +0200 committer Jonas Fonseca 1148770684 +0200 Minor usability fix: when closing never switch to an already closed view commit 55565c5117dd5fc90ad05574f983ed64b21636ae 5cfbde75ef8043ad834c3d0576b018b62bfeba55 tree e4cbdc78f14c6b041a9b21260fc4696edc8b3d8a parent 5cfbde75ef8043ad834c3d0576b018b62bfeba55 author Jonas Fonseca 1148764888 +0200 committer Jonas Fonseca 1148764888 +0200 "View commands" section becomes "History commands". commit 5cfbde75ef8043ad834c3d0576b018b62bfeba55 a2db68496bd6270b4a0e731963a7db7745f36c11 tree 42857a6653b4a324b03f775b149bcd223a717d0a parent a2db68496bd6270b4a0e731963a7db7745f36c11 author Jonas Fonseca 1148680043 +0200 committer Jonas Fonseca 1148680043 +0200 License revisited: it's GPLv2 or later commit a2db68496bd6270b4a0e731963a7db7745f36c11 976447f81b0594d9e6ff43772dab533b208a8bad tree 9f41ada652a2413deb8772f2079b4e0ff4b94f3f parent 976447f81b0594d9e6ff43772dab533b208a8bad author Jonas Fonseca 1148675192 +0200 committer Jonas Fonseca 1148675192 +0200 Fix off by one error; makes tags visible again Fixes: d0cea5f929be563d049bc5205fb8de08fd080c32 commit 976447f81b0594d9e6ff43772dab533b208a8bad 85af62849a84b08f783c70d6e3f25b5175188d68 tree 95c9ace3291000188e76a1c2cbc69790243c03f4 parent 85af62849a84b08f783c70d6e3f25b5175188d68 author Jonas Fonseca 1148674190 +0200 committer Jonas Fonseca 1148674190 +0200 When updating the title window, move the cursor to the end of line This way the cursor (hopefully) won't feel so jumpy. commit 85af62849a84b08f783c70d6e3f25b5175188d68 9b995f0cb21bf274f151f51f3974dabf66f1d354 tree c36405dd13315877f2a0f2695cbe2ab865a8cd41 parent 9b995f0cb21bf274f151f51f3974dabf66f1d354 author Jonas Fonseca 1148674086 +0200 committer Jonas Fonseca 1148674086 +0200 Factor out cursor moving commit 9b995f0cb21bf274f151f51f3974dabf66f1d354 9f396969d5163421c4ceb9628aa1ed63878d94ac tree 60a7395cef0e88f0dfeff1256ef471dfd835192e parent 9f396969d5163421c4ceb9628aa1ed63878d94ac author Jonas Fonseca 1148670763 +0200 committer Jonas Fonseca 1148670763 +0200 Make window switching smother; fix blurring of previous view when switching Don't refresh after a resize, since it causes the previous content to be shortly displayed. We now simply resize and clear and waits for the first read to start displaying the new content. commit 9f396969d5163421c4ceb9628aa1ed63878d94ac 9d82d824733b042765bc00b30c8fd6b3fd67564a tree 4dd7a0b980c407619b536fd7fc44ca93ab82ab19 parent 9d82d824733b042765bc00b30c8fd6b3fd67564a author Jonas Fonseca 1148666521 +0200 committer Jonas Fonseca 1148666521 +0200 Never close backgrounded loads; only clear window when starting to update Before windows was cleared each time open_view maximized for example the main view when it was still loading. commit 9d82d824733b042765bc00b30c8fd6b3fd67564a d0cea5f929be563d049bc5205fb8de08fd080c32 tree fd6b48e2645d991d1b853a640827d269004ee389 parent d0cea5f929be563d049bc5205fb8de08fd080c32 author Jonas Fonseca 1148510513 +0200 committer Jonas Fonseca 1148510513 +0200 Only pass on properies with non-zero length names commit d0cea5f929be563d049bc5205fb8de08fd080c32 afdc35b3c4038d52405302058e70a78e88f01c89 tree 4634a6f9d7a97e16f56bdbd441688871318940e9 parent afdc35b3c4038d52405302058e70a78e88f01c89 author Jonas Fonseca 1148507872 +0200 committer Jonas Fonseca 1148507872 +0200 Refactor reading of properties from pipes commit afdc35b3c4038d52405302058e70a78e88f01c89 9989bf60292d8a42b07a416aaf62839f6b069953 tree 9055660fc51c1773b75411cc7e7a7eaec453d2d5 parent 9989bf60292d8a42b07a416aaf62839f6b069953 author Jonas Fonseca 1148505148 +0200 committer Jonas Fonseca 1148505148 +0200 Load config before parsing command line options so they can override commit 9989bf60292d8a42b07a416aaf62839f6b069953 4670cf89d55d2520d4e66aacbea38e20296e672f tree 6fa2296439f1f6f932f909d62e96733408f3c347 parent 4670cf89d55d2520d4e66aacbea38e20296e672f author Jonas Fonseca 1148504291 +0200 committer Jonas Fonseca 1148504291 +0200 Make UTF-8 handling optional but still default Handling of output encoding still missing. commit 4670cf89d55d2520d4e66aacbea38e20296e672f f84f9d2821ce744592a40caebc0a9337dba794ec tree 1ae4f8a78c591adeb74da755ed65483b95c0b431 parent f84f9d2821ce744592a40caebc0a9337dba794ec author Jonas Fonseca 1148493071 +0200 committer Jonas Fonseca 1148493071 +0200 Add support for loading repo config Test it by storing i18n.commitencoding, soon to be uesd. commit f84f9d2821ce744592a40caebc0a9337dba794ec 219ee52a04d3b9d46f5d8165a9d61ee12e67bd01 tree 358c9ca1ae6e373c10315c2792db7f041ed656b2 parent 219ee52a04d3b9d46f5d8165a9d61ee12e67bd01 author Jonas Fonseca 1148483913 +0200 committer Jonas Fonseca 1148483913 +0200 Cleanup see also section commit 219ee52a04d3b9d46f5d8165a9d61ee12e67bd01 192d9a603dbac2cabf2cce1ff5a7eacf9c3dc6b7 tree 96c661822456c220738253ff9ed78d45d7b19166 parent 192d9a603dbac2cabf2cce1ff5a7eacf9c3dc6b7 author Jonas Fonseca 1148483801 +0200 committer Jonas Fonseca 1148483801 +0200 Move env handling up below option handling commit 192d9a603dbac2cabf2cce1ff5a7eacf9c3dc6b7 9fbbd28f0bf6c5e0d401d3ba21cf65d3f43b0019 tree 619cb8976b80f117783b728a381d8dcd0dca7ec8 parent 9fbbd28f0bf6c5e0d401d3ba21cf65d3f43b0019 author Jonas Fonseca 1148482876 +0200 committer Jonas Fonseca 1148482876 +0200 Put license also in the program header commit 9fbbd28f0bf6c5e0d401d3ba21cf65d3f43b0019 67d3beabc5bf6fb7dc61351363ab3a0e8bbba35c tree 8d71b557035838a3a81e4d50ed6a9c408ea0605d parent 67d3beabc5bf6fb7dc61351363ab3a0e8bbba35c author Jonas Fonseca 1148482612 +0200 committer Jonas Fonseca 1148482612 +0200 Rearrange pager_enter logic commit 67d3beabc5bf6fb7dc61351363ab3a0e8bbba35c fe7233c345eda374fa33c3225b652dd5b76faebf tree 7d2da5cd2059647dd11234e81078477bc97d0278 parent fe7233c345eda374fa33c3225b652dd5b76faebf author Jonas Fonseca 1148437956 +0200 committer Jonas Fonseca 1148437956 +0200 Update README; set a less ugly font-family commit fe7233c345eda374fa33c3225b652dd5b76faebf c19f8017cc2dd8753f92f9952e65cfad28acbbe0 tree 20803b9dcbc9e6ae772d8d44ba7a3e93fbbd4c08 parent c19f8017cc2dd8753f92f9952e65cfad28acbbe0 author Jonas Fonseca 1148433823 +0200 committer Jonas Fonseca 1148434238 +0200 Introduce struct line and use it for view->line Somewhat experimental. This will call get_line_type() on every read line. commit c19f8017cc2dd8753f92f9952e65cfad28acbbe0 f97f4012315074190e64aa558c04d1659ec6d622 tree 78ff0cea0e77744beb85832038d1ff76d1654a1f parent f97f4012315074190e64aa558c04d1659ec6d622 author Jonas Fonseca 1148423364 +0200 committer Jonas Fonseca 1148423442 +0200 Improve title updating and remove flickering - Show line info even if no lines has been loaded, so less has to be redrawn. - Don't make the view window one line bigger causing the title window to be overwritten. This reinstates the bug in last line drawing. commit f97f4012315074190e64aa558c04d1659ec6d622 6e950a52a17e6fc8a86e3189c81cbfd341024bfe tree 558998487e1dabe38fe3c3442272abc191b85e74 parent 6e950a52a17e6fc8a86e3189c81cbfd341024bfe author Jonas Fonseca 1148421295 +0200 committer Jonas Fonseca 1148421295 +0200 Make update reporting less verbose It got too annoying when browsing through the split main/diff screen. Instead put the update timer in the title window if it grows beyond 2 seconds. commit 6e950a52a17e6fc8a86e3189c81cbfd341024bfe 9f41488f71c085b91416d768f1aec803f936ada6 tree 968545ff8acdcaacd60b1679649268a5f65944c2 parent 9f41488f71c085b91416d768f1aec803f936ada6 author Jonas Fonseca 1148336367 +0200 committer Jonas Fonseca 1148336367 +0200 Fix spurious resizing of the display (take 2) commit 9f41488f71c085b91416d768f1aec803f936ada6 a006db634ffcbb1c3fa7e9a5f109b162d72aeea6 tree 7ed4318963a9bc305be557a33eee416935cfe9cc parent a006db634ffcbb1c3fa7e9a5f109b162d72aeea6 author Jonas Fonseca 1148335691 +0200 committer Jonas Fonseca 1148335691 +0200 Add macro for getting number of displayed views commit a006db634ffcbb1c3fa7e9a5f109b162d72aeea6 f0b3ab80bf9ea3d4be57e85b41736e3e73544f64 tree db44ce71dd00b171fd03efdb3a4892c4e88beb71 parent f0b3ab80bf9ea3d4be57e85b41736e3e73544f64 author Jonas Fonseca 1148253982 +0200 committer Jonas Fonseca 1148253982 +0200 Only resize the display when actually required commit f0b3ab80bf9ea3d4be57e85b41736e3e73544f64 199d1288c79737afd64ec60e4e1b1fa1dc7046c2 tree cc3112e121d3acab52f010457244e6fdaafc5278 parent 199d1288c79737afd64ec60e4e1b1fa1dc7046c2 author Jonas Fonseca 1148253493 +0200 committer Jonas Fonseca 1148253493 +0200 Fix updating of the main view title when the screen isn't split commit 199d1288c79737afd64ec60e4e1b1fa1dc7046c2 b3a54cba6627f5562702e4bf4d8f904e724da745 tree 2335b54e6a89728a92808e628436ecc34458e235 parent b3a54cba6627f5562702e4bf4d8f904e724da745 author Jonas Fonseca 1148252689 +0200 committer Jonas Fonseca 1148252689 +0200 End the current update before begining a new one; fixes CPU hogging commit ffe3a8da376de11ea0f719ce31df3f97f2b96ec1 c03eff69f9e4cf0cfea0e62f9774e9176f8eb8c8 tree 831dde386cc24db44022149e2c6cd64533b9b2c5 parent c03eff69f9e4cf0cfea0e62f9774e9176f8eb8c8 author Jonas Fonseca 1148180780 +0200 committer Jonas Fonseca 1148180780 +0200 Sync docs commit c03eff69f9e4cf0cfea0e62f9774e9176f8eb8c8 e7a724d902feb81f1cb009d48316aac6de2b5cf8 b3a54cba6627f5562702e4bf4d8f904e724da745 tree 93e548d709483e325452c35b896900850c912de3 parent e7a724d902feb81f1cb009d48316aac6de2b5cf8 parent b3a54cba6627f5562702e4bf4d8f904e724da745 author Jonas Fonseca 1148180715 +0200 committer Jonas Fonseca 1148180715 +0200 Merge with master commit b3a54cba6627f5562702e4bf4d8f904e724da745 ff26aa294779c69563bb7d92c6e08f5a7128b074 tree cdb1ec613049f1c258a09edcb6b12228cd6be93d parent ff26aa294779c69563bb7d92c6e08f5a7128b074 author Jonas Fonseca 1148179448 +0200 committer Jonas Fonseca 1148180676 +0200 Bind 'j'/'k' to moving up/down; add next/previous requests bound to Down/Up This adds support for using these next/previous requests for changing the current commit in the main view from the diff view, if the diff view has the main view as it's parent. Works for both split- and full-screen diff views by making redrawing conditional when moving (and doing the lowlevel scrolling). Replaces REQ_MOVE_{UP,DOWN}_ENTER. commit ff26aa294779c69563bb7d92c6e08f5a7128b074 900666fca5a86675cb35ffa3f710837b197c480e tree 2130345fabaab66bfe625c71740c0b99567caf47 parent 900666fca5a86675cb35ffa3f710837b197c480e author Jonas Fonseca 1148177332 +0200 committer Jonas Fonseca 1148177332 +0200 Move struct commit to appear just above the main view backend commit 900666fca5a86675cb35ffa3f710837b197c480e 1307df1af77c922db546e9743bf0839de55f676a tree 751f4afdb66f795e1bb10085477f881b9d1c4782 parent 1307df1af77c922db546e9743bf0839de55f676a author Jonas Fonseca 1148174359 +0200 committer Jonas Fonseca 1148174359 +0200 Add -O2 to CFLAGS to get more warnings commit 1307df1af77c922db546e9743bf0839de55f676a 7bb55251674b42b4a0dc91a8072fbd1000306628 tree aed5cb8a29e7dd6d0eb6366e9019a7d3158f225e parent 7bb55251674b42b4a0dc91a8072fbd1000306628 author Jonas Fonseca 1148174336 +0200 committer Jonas Fonseca 1148174336 +0200 Cache all queries for refs based on ID At least then they won't appear as a source of leaking and in the future the main view can be reloaded without having to deal freeing them. commit 7bb55251674b42b4a0dc91a8072fbd1000306628 415de53cef9d8477e97fbee65403932cd45ed042 tree 1cfc733e4d51a5341f2d967a9207b2c5d91c02ed parent 415de53cef9d8477e97fbee65403932cd45ed042 author Jonas Fonseca 1148152064 +0200 committer Jonas Fonseca 1148152064 +0200 Move git directory assertion to main; don't require .git repo in pager mode commit 415de53cef9d8477e97fbee65403932cd45ed042 4f774851c65e0660b48ba639b47262e6283fe497 tree 483228457d863c6f73ea6cdd5022097877ab538e parent 4f774851c65e0660b48ba639b47262e6283fe497 author Jonas Fonseca 1148143346 +0200 committer Jonas Fonseca 1148143346 +0200 In pager mode, fix entering commit lines from log and pager view commit 4f774851c65e0660b48ba639b47262e6283fe497 f6da0b665fac0054d7fb7861247e23738478fcc5 tree b7072f96a5ece37725ddf994730369f97016038a parent f6da0b665fac0054d7fb7861247e23738478fcc5 author Jonas Fonseca 1148140570 +0200 committer Jonas Fonseca 1148140570 +0200 Remove old window cycling code from before enter request appeared commit f6da0b665fac0054d7fb7861247e23738478fcc5 95d7ddcdaaff5fd6f0a05e3d515c436d9a3605e3 tree b749ad265e577b8c8c9e472ced49a02b71a5ae59 parent 95d7ddcdaaff5fd6f0a05e3d515c436d9a3605e3 author Jonas Fonseca 1148139565 +0200 committer Jonas Fonseca 1148139565 +0200 Add simple window stack, tracking view relation ship via parent member This makes it possible to easily switch back to the main (or log) view by closing the diff view, regardless of whether it is split or full-screen. Requested-by: Aneesh Kumar Signed-off-by: Jonas Fonseca commit 95d7ddcdaaff5fd6f0a05e3d515c436d9a3605e3 91e8e27718fa765eb09e85374c225136c0b836c6 tree fde970f6b95420c4329747d1da561bb2e6f94dda parent 91e8e27718fa765eb09e85374c225136c0b836c6 author Jonas Fonseca 1148134215 +0200 committer Jonas Fonseca 1148134215 +0200 Remove objsize member from struct commit It is unused. commit 91e8e27718fa765eb09e85374c225136c0b836c6 9074d9b648a57d65dbcfc4ba05b69ca437699329 tree ab9524321492ca3deb2ea4390fe2075a025b3b79 parent 9074d9b648a57d65dbcfc4ba05b69ca437699329 author Jonas Fonseca 1148131348 +0200 committer Jonas Fonseca 1148131348 +0200 Make Enter in the pager view always scroll It will still split to diff view if a commit line is detected. commit 9074d9b648a57d65dbcfc4ba05b69ca437699329 68b6e0eb4fb5becfdbc8be67b06c9bffc21bf04c tree ee6235de53f4bba1c77c0d15281d30aac051557d parent 68b6e0eb4fb5becfdbc8be67b06c9bffc21bf04c author Jonas Fonseca 1148129243 +0200 committer Jonas Fonseca 1148129243 +0200 Record builds with dirty working tree by appending -dirty to the version commit 68b6e0eb4fb5becfdbc8be67b06c9bffc21bf04c 4b8c01a390e2118e6a1c8fc0c50a3be09787166f tree 863caf57f8b4857e771416ecb0ecb709d7082743 parent 4b8c01a390e2118e6a1c8fc0c50a3be09787166f author Jonas Fonseca 1148128651 +0200 committer Jonas Fonseca 1148128651 +0200 Remove trailing space; make cursed global static commit 4b8c01a390e2118e6a1c8fc0c50a3be09787166f 0df811cbad68f83d17fc30af977948fe95a516ee tree 7600551e08cfbdf956e782d0f612730139c7910f parent 0df811cbad68f83d17fc30af977948fe95a516ee author Jonas Fonseca 1148093122 +0200 committer Jonas Fonseca 1148093740 +0200 Make -h and --help options ouput a help message commit 0df811cbad68f83d17fc30af977948fe95a516ee 6cb291b793ec51232396303bcb3c461650fe511f tree 4b3ef7058c876d08b62cb6b2c176f56439f03f0d parent 6cb291b793ec51232396303bcb3c461650fe511f author Jonas Fonseca 1148089147 +0200 committer Jonas Fonseca 1148091701 +0200 Bind '-' to PageUp; raises Mutt compatibility Requested-by: Aneesh Kumar Signed-off-by: Jonas Fonseca commit 6cb291b793ec51232396303bcb3c461650fe511f 89e4aafd17b2b16687555045201e38f23fc9a21f tree a9bb756fafe7ed14737aa954a95c0eced05d0510 parent 89e4aafd17b2b16687555045201e38f23fc9a21f author Jonas Fonseca 1148091293 +0200 committer Jonas Fonseca 1148091293 +0200 Streamline version displaying and show built date commit 89e4aafd17b2b16687555045201e38f23fc9a21f 10e290ee83f985e0e44932889bee655e6dea1088 tree 0df21df496ffc079fd2d5ed7cf22b68827167f92 parent 10e290ee83f985e0e44932889bee655e6dea1088 author Jonas Fonseca 1148089147 +0200 committer Jonas Fonseca 1148089147 +0200 Make Enter in the main view switch to the split diff view This way, holding down Enter will open the commit diff and start scrolling much like Mutt behaves. Requested-by: Aneesh Kumar Signed-off-by: Jonas Fonseca commit 10e290ee83f985e0e44932889bee655e6dea1088 4f9b667ad30556aa9754c92973f9b801c62e3456 tree 6bfab4ef1d22deaf14645f94a5b4f7484f2ac058 parent 4f9b667ad30556aa9754c92973f9b801c62e3456 author Jonas Fonseca 1148088641 +0200 committer Jonas Fonseca 1148088641 +0200 Add preliminary support for UTF-8 handling in the main view It is very simple but fixes the issue with unaligned drawing of the line between the author and log title columns. commit 4f9b667ad30556aa9754c92973f9b801c62e3456 d9d1c722565aea84915579328307dd3be1f046c6 tree f7b293d6ebe1df0440a4ca4cd587be2721b6c863 parent d9d1c722565aea84915579328307dd3be1f046c6 author Jonas Fonseca 1148069959 +0200 committer Jonas Fonseca 1148069959 +0200 Add close view request; bound to 'q' by default If only one view is open it will quit. More compatible with Mutt behavior. Based on patch by Aneesh Kumar commit d9d1c722565aea84915579328307dd3be1f046c6 19f862bdd79fbdba6c857713425e91f8190dadc5 tree 483dc1f76838782de4dbe4baccab363c8cd302f0 parent 19f862bdd79fbdba6c857713425e91f8190dadc5 author Jonas Fonseca 1148068248 +0200 committer Jonas Fonseca 1148068248 +0200 Bind quit to 'Q' commit 19f862bdd79fbdba6c857713425e91f8190dadc5 67e48ac5f5b8a2333710625cb782f840dba27079 tree 59a5392549d7db3d46247217ab85a2d42eaddc3c parent 67e48ac5f5b8a2333710625cb782f840dba27079 author Jonas Fonseca 1148066735 +0200 committer Jonas Fonseca 1148066735 +0200 Add -Werror to the cc debug flags commit 67e48ac5f5b8a2333710625cb782f840dba27079 c2124ccd4959e597f6954a21901086c5e2a7cd04 tree ff4c2b06080f452f8008e5db2321d009d4959848 parent c2124ccd4959e597f6954a21901086c5e2a7cd04 author Jonas Fonseca 1147940109 +0200 committer Jonas Fonseca 1147940109 +0200 Pressing Enter in the diff view will now scroll it one line down Make tig more compatible with Mutt behavior. Requested-by: Aneesh Kumar commit c2124ccd4959e597f6954a21901086c5e2a7cd04 c622eefaa485995320bc743431bae0d497b1d875 tree d9db3fe400951a3a17fd53564b17d57082f4dd72 parent c622eefaa485995320bc743431bae0d497b1d875 author Jonas Fonseca 1147939562 +0200 committer Jonas Fonseca 1147939562 +0200 Rearrange things in the start of the viewer commit c622eefaa485995320bc743431bae0d497b1d875 4d55caff4cc89335192f3e566004b4ceef572521 tree 5395b1ade1aad5c16668e865286fb7517fcb9c03 parent 4d55caff4cc89335192f3e566004b4ceef572521 author Kristian Høgsberg 1147904421 +0200 committer Jonas Fonseca 1147904421 +0200 Bind 'b' to Page Up, and Space to Page Down Makes tig more compatible with less and other pagers. Signed-off-by: Jonas Fonseca commit 4d55caff4cc89335192f3e566004b4ceef572521 81030ec8e1d89c873a102558730ff7306a8ae12e tree f64b65355e8385577b12deaddcd4679e6abe6c66 parent 81030ec8e1d89c873a102558730ff7306a8ae12e author Jonas Fonseca 1147902765 +0200 committer Jonas Fonseca 1147902765 +0200 Make sense of the comment about view->win height commit 81030ec8e1d89c873a102558730ff7306a8ae12e 20bb5e18fe8c0e215514448a5e82c93964d85cf9 tree 06055dd4359a8e3efc999bff7bf57f0101d74cd4 parent 20bb5e18fe8c0e215514448a5e82c93964d85cf9 author Jonas Fonseca 1147902202 +0200 committer Jonas Fonseca 1147902202 +0200 Group display functions at the bottom commit 20bb5e18fe8c0e215514448a5e82c93964d85cf9 c760e6bab6c1a6f2646127c9743bcbdd94043e0a tree d4f671f933e543e72200c8fc86290992cd2d1b11 parent c760e6bab6c1a6f2646127c9743bcbdd94043e0a author Jonas Fonseca 1147901979 +0200 committer Jonas Fonseca 1147901979 +0200 Redraw the whole display after toggling line number commit c760e6bab6c1a6f2646127c9743bcbdd94043e0a a9274b95c642f101382a4b617de2e9dadf5f5ec8 tree 8f30087b2e95450dc37f5ec94cab092275cbded6 parent a9274b95c642f101382a4b617de2e9dadf5f5ec8 author Jonas Fonseca 1147901815 +0200 committer Jonas Fonseca 1147901815 +0200 Minor documentation updates commit e7a724d902feb81f1cb009d48316aac6de2b5cf8 0847af4b4e35bc5564bc9efed7774ed6edfbec18 tree 1aaa21bca269ffb8b75b2562f8a11e1ed0597f97 parent 0847af4b4e35bc5564bc9efed7774ed6edfbec18 author Jonas Fonseca 1147882257 +0200 committer Jonas Fonseca 1147882257 +0200 Sync docs commit 0847af4b4e35bc5564bc9efed7774ed6edfbec18 61fa407fbb1c7bd7482172ed22e2fc220021b130 a9274b95c642f101382a4b617de2e9dadf5f5ec8 tree 8eaa92f59cccdb158cf08061c62e34e99ac8a432 parent 61fa407fbb1c7bd7482172ed22e2fc220021b130 parent a9274b95c642f101382a4b617de2e9dadf5f5ec8 author Jonas Fonseca 1147882232 +0200 committer Jonas Fonseca 1147882232 +0200 Merge with master commit a9274b95c642f101382a4b617de2e9dadf5f5ec8 c9a2f7844c345f48c33c06969514ae6746074abd tree 9392ed044dd2ec5c0ff4fcfb0b02d4921eda462b parent c9a2f7844c345f48c33c06969514ae6746074abd author Sir Raorn 1147882192 +0200 committer Jonas Fonseca 1147882192 +0200 Fix warnings tig.c: In function 'sq_quote': tig.c:190: warning: value computed is not used tig.c:193: warning: value computed is not used Signed-off-by: Sir Raorn Signed-off-by: Jonas Fonseca commit c9a2f7844c345f48c33c06969514ae6746074abd c6704a4ec7f96749cbef736fa24c6b90e35f7689 tree 6bdd69c5596512f5354204f79b433bcdcbee3cff parent c6704a4ec7f96749cbef736fa24c6b90e35f7689 author Sir Raorn 1147882111 +0200 committer Jonas Fonseca 1147882111 +0200 Fix linking with --as-needed ld(1) option. Signed-off-by: Sir Raorn Signed-off-by: Jonas Fonseca commit c6704a4ec7f96749cbef736fa24c6b90e35f7689 b5c9e67f19d607d0540404fc8de463a7a3801f0a tree 2b75c9bc9651d7880604420f7261a2949fa384b3 parent b5c9e67f19d607d0540404fc8de463a7a3801f0a author Jonas Fonseca 1147881534 +0200 committer Jonas Fonseca 1147881843 +0200 Minor doc and coding style fixes commit b5c9e67f19d607d0540404fc8de463a7a3801f0a 4685845eb36bd61faa643707afa0a0065701c903 tree 00108afc045893aaed9cbf42980658d5e8372a73 parent 4685845eb36bd61faa643707afa0a0065701c903 author Timo Hirvonen 1147881434 +0200 committer Jonas Fonseca 1147881835 +0200 Mark quit() and die() __noreturn Fixes tig.c|898| warning: 'steps' may be used uninitialized in this function commit 4685845eb36bd61faa643707afa0a0065701c903 8c11094f0b8ae9b82b1a3c44e6588e496214866b tree aede452305d7fb136c7e073ebe49fd016bef4c4c parent 8c11094f0b8ae9b82b1a3c44e6588e496214866b author Timo Hirvonen 1147881383 +0200 committer Jonas Fonseca 1147881812 +0200 Make some strings "const" commit 61fa407fbb1c7bd7482172ed22e2fc220021b130 562355762b4c6fd37e5a8c2383278587efa447d6 8c11094f0b8ae9b82b1a3c44e6588e496214866b tree d339492fe7df42e54dc69a59cf9ac95079906066 parent 562355762b4c6fd37e5a8c2383278587efa447d6 parent 8c11094f0b8ae9b82b1a3c44e6588e496214866b author Jonas Fonseca 1147866680 +0200 committer Jonas Fonseca 1147866680 +0200 Merge with master commit 8c11094f0b8ae9b82b1a3c44e6588e496214866b 1b4b0bd954a244084627341abc811fbda07d8663 tree 50e1a025b9b4b156e49e3e8c5a4cebc7a3fdc8ba parent 1b4b0bd954a244084627341abc811fbda07d8663 author Jonas Fonseca 1147866639 +0200 committer Jonas Fonseca 1147866639 +0200 tig version 0.3 commit 562355762b4c6fd37e5a8c2383278587efa447d6 9c0c0f26b0be0e2768b22f8aec28dd62068e5f4e tree 7afe92361126ed0da398a2031fdef7e7c1352aff parent 9c0c0f26b0be0e2768b22f8aec28dd62068e5f4e author Jonas Fonseca 1147863269 +0200 committer Jonas Fonseca 1147863269 +0200 Sync docs commit 9c0c0f26b0be0e2768b22f8aec28dd62068e5f4e 395d626e537970a6c5bbc3c07dc0d50ed491d473 1b4b0bd954a244084627341abc811fbda07d8663 tree 27486f8f1cec3d7a769174f178b5c7767006be40 parent 395d626e537970a6c5bbc3c07dc0d50ed491d473 parent 1b4b0bd954a244084627341abc811fbda07d8663 author Jonas Fonseca 1147861945 +0200 committer Jonas Fonseca 1147861945 +0200 Merge with master commit 1b4b0bd954a244084627341abc811fbda07d8663 3a11b38fa08e19807305317e59e7187a5dca21a5 tree 3987b49b532a47b4f913c277e9135356c44bcc14 parent 3a11b38fa08e19807305317e59e7187a5dca21a5 author Jonas Fonseca 1147861901 +0200 committer Jonas Fonseca 1147861901 +0200 Minor documentation fixes; nothing from git-ls-remote means no git repo commit 395d626e537970a6c5bbc3c07dc0d50ed491d473 11c9cad0dd844a76d03fdd16ea47fb28b6e87b57 tree e36bf9126d0db461ae8633a7f43c6f144b274f9a parent 11c9cad0dd844a76d03fdd16ea47fb28b6e87b57 author Jonas Fonseca 1147803093 +0200 committer Jonas Fonseca 1147803093 +0200 Sync docs commit 11c9cad0dd844a76d03fdd16ea47fb28b6e87b57 a22e09e523efbb7e683ed3c1311ab610984adfe0 3a11b38fa08e19807305317e59e7187a5dca21a5 tree 864e5672ba5f8c0e88dad0f80bad8db381b2fc29 parent a22e09e523efbb7e683ed3c1311ab610984adfe0 parent 3a11b38fa08e19807305317e59e7187a5dca21a5 author Jonas Fonseca 1147803042 +0200 committer Jonas Fonseca 1147803042 +0200 Merge with master commit 3a11b38fa08e19807305317e59e7187a5dca21a5 3a91b75ea0be7e8771ad076f63f011cea0a6cc05 tree 35d5af9cce64522b79e203d80bc35810d37a3838 parent 3a91b75ea0be7e8771ad076f63f011cea0a6cc05 author Jonas Fonseca 1147801855 +0200 committer Jonas Fonseca 1147801855 +0200 After seeing Linus' mail further improve revision specification section commit 3a91b75ea0be7e8771ad076f63f011cea0a6cc05 424aff35dbb21dd92c4b7b72d2e3f8257ce4856b tree 93c231f2c1a15e7749d698a06e40b54c2c5ef1c7 parent 424aff35dbb21dd92c4b7b72d2e3f8257ce4856b author Jonas Fonseca 1147796728 +0200 committer Jonas Fonseca 1147796728 +0200 Make the last variables static commit a22e09e523efbb7e683ed3c1311ab610984adfe0 48b43c1418ca9fbd29398be9c28c286dd9404b47 tree 253efb562e418be36d1cd320fb46123cc9cc3798 parent 48b43c1418ca9fbd29398be9c28c286dd9404b47 author Jonas Fonseca 1147794888 +0200 committer Jonas Fonseca 1147794888 +0200 Fix File history section commit 48b43c1418ca9fbd29398be9c28c286dd9404b47 a96039c1e57085528bae8c5bbd043c85d9d92e16 424aff35dbb21dd92c4b7b72d2e3f8257ce4856b tree 8b80ff729351acd4c75640a44eecb59ed57e3fd1 parent a96039c1e57085528bae8c5bbd043c85d9d92e16 parent 424aff35dbb21dd92c4b7b72d2e3f8257ce4856b author Jonas Fonseca 1147794623 +0200 committer Jonas Fonseca 1147794623 +0200 Merge with master commit 424aff35dbb21dd92c4b7b72d2e3f8257ce4856b e271cee02f3ec06d2b3a89b1a25911fc982e37b2 tree 2e2b33f71cde8965f2fa2c28f3840e5634a92dca parent e271cee02f3ec06d2b3a89b1a25911fc982e37b2 author Jonas Fonseca 1147794545 +0200 committer Jonas Fonseca 1147794545 +0200 Fix File history section number commit a96039c1e57085528bae8c5bbd043c85d9d92e16 603d57502c06f675d48002ca08aa5963e977ee7a tree e1669074252d47dd63ea492a713d6806d7235ba6 parent 603d57502c06f675d48002ca08aa5963e977ee7a author Jonas Fonseca 1147794443 +0200 committer Jonas Fonseca 1147794443 +0200 Update generated docs commit 603d57502c06f675d48002ca08aa5963e977ee7a 55ad1bc42bc736a7710c1cd2088b691ad5f588dc e271cee02f3ec06d2b3a89b1a25911fc982e37b2 tree d4a8edc9bbd50d39e9dfb10fcab7984adf60ce53 parent 55ad1bc42bc736a7710c1cd2088b691ad5f588dc parent e271cee02f3ec06d2b3a89b1a25911fc982e37b2 author Jonas Fonseca 1147794423 +0200 committer Jonas Fonseca 1147794423 +0200 Merge with master commit e271cee02f3ec06d2b3a89b1a25911fc982e37b2 06f9a9e16041b1fc89a024ffd7bf1dd5119ee2ce tree 36f008cd73f531d1ffa184823117030dc9b00649 parent 06f9a9e16041b1fc89a024ffd7bf1dd5119ee2ce author Jonas Fonseca 1147794383 +0200 committer Jonas Fonseca 1147794383 +0200 Minor fixes commit 55ad1bc42bc736a7710c1cd2088b691ad5f588dc 53b90d52aa36051fcbb16775016c8649828b97ea 06f9a9e16041b1fc89a024ffd7bf1dd5119ee2ce tree 7b0645d7b25237b852aca82c572421239791c7b4 parent 53b90d52aa36051fcbb16775016c8649828b97ea parent 06f9a9e16041b1fc89a024ffd7bf1dd5119ee2ce author Jonas Fonseca 1147793815 +0200 committer Jonas Fonseca 1147793815 +0200 Merge with master commit 06f9a9e16041b1fc89a024ffd7bf1dd5119ee2ce e2beda1801cd1be8aa8588b168750b7d85e8c87f tree ffd574bc724bff1bb6f132f6bfd477c92d31438c parent e2beda1801cd1be8aa8588b168750b7d85e8c87f author Jonas Fonseca 1147793803 +0200 committer Jonas Fonseca 1147793803 +0200 Only tig(1) is required by the help view commit 53b90d52aa36051fcbb16775016c8649828b97ea 78dd873628206446d41ec47b4b67ad5a0d181d24 e2beda1801cd1be8aa8588b168750b7d85e8c87f tree 5603f55c5c28ebc4c7628197509142a56acda710 parent 78dd873628206446d41ec47b4b67ad5a0d181d24 parent e2beda1801cd1be8aa8588b168750b7d85e8c87f author Jonas Fonseca 1147793580 +0200 committer Jonas Fonseca 1147793580 +0200 Merge with master commit e2beda1801cd1be8aa8588b168750b7d85e8c87f b5eeff5aca19d4ddcaa4a1cdd427e9eb7d86c6a4 tree 96a66b45c12e42b8c08f3349e01ab2d0ac64c747 parent b5eeff5aca19d4ddcaa4a1cdd427e9eb7d86c6a4 author Jonas Fonseca 1147793544 +0200 committer Jonas Fonseca 1147793544 +0200 Only set VERSION to git-describe if .git is available commit 78dd873628206446d41ec47b4b67ad5a0d181d24 735275bf085d76309df1aeb91a74c15379784d1e tree b2f69af58e7bd9a8d91bc08ede983a64ec328ed0 parent 735275bf085d76309df1aeb91a74c15379784d1e author Jonas Fonseca 1147792907 +0200 committer Jonas Fonseca 1147793030 +0200 Put documentation in a branch named release commit 735275bf085d76309df1aeb91a74c15379784d1e fdcf8ca721aebceef3531e8558e6bf09f5e5549a b5eeff5aca19d4ddcaa4a1cdd427e9eb7d86c6a4 tree 71d38a8939ded33b45acbea4a8be9aa71a83d3f3 parent fdcf8ca721aebceef3531e8558e6bf09f5e5549a parent b5eeff5aca19d4ddcaa4a1cdd427e9eb7d86c6a4 author Jonas Fonseca 1147793009 +0200 committer Jonas Fonseca 1147793009 +0200 Merge with master commit b5eeff5aca19d4ddcaa4a1cdd427e9eb7d86c6a4 b8ae93466d333ed4f0016842a7d6355f71e195fd tree d90007f79c3b5218e9b3a7cea86624c28f9b047d parent b8ae93466d333ed4f0016842a7d6355f71e195fd author Jonas Fonseca 1147792907 +0200 committer Jonas Fonseca 1147792974 +0200 Put documentation in a branch named release commit fdcf8ca721aebceef3531e8558e6bf09f5e5549a 24bd80d642da4c0cddc30e0ef05ab84e0f0bcf8a tree df29d6daf961e5236edaaf9e1129123a0cb0dbb4 parent 24bd80d642da4c0cddc30e0ef05ab84e0f0bcf8a author Jonas Fonseca 1147792828 +0200 committer Jonas Fonseca 1147792828 +0200 Add README.html commit 24bd80d642da4c0cddc30e0ef05ab84e0f0bcf8a 2b9c2ad0cb752490823c2e0ac11a70547103cda3 b8ae93466d333ed4f0016842a7d6355f71e195fd tree fe3d2aef68a0a44f1cc6d090054613adb3172622 parent 2b9c2ad0cb752490823c2e0ac11a70547103cda3 parent b8ae93466d333ed4f0016842a7d6355f71e195fd author Jonas Fonseca 1147792754 +0200 committer Jonas Fonseca 1147792754 +0200 Merge with master commit b8ae93466d333ed4f0016842a7d6355f71e195fd ab46037d90fb55f34bbf2db9e0bde4c6ee54df78 tree 8324d01b715a723cf4dec550de3853857cffb3d3 parent ab46037d90fb55f34bbf2db9e0bde4c6ee54df78 author Jonas Fonseca 1147792725 +0200 committer Jonas Fonseca 1147792725 +0200 You gotta have a README file commit 2b9c2ad0cb752490823c2e0ac11a70547103cda3 ab46037d90fb55f34bbf2db9e0bde4c6ee54df78 tree 54b8e41905311f3ec9500152463cf40220957e13 parent ab46037d90fb55f34bbf2db9e0bde4c6ee54df78 author Jonas Fonseca 1147787497 +0200 committer Jonas Fonseca 1147787497 +0200 Create documentation branch commit ab46037d90fb55f34bbf2db9e0bde4c6ee54df78 0721c53a06190932e1660250d5d1f89784a19424 tree 8e39d2ecf20c50a4ac23ba6cd7d8522a5ab30abb parent 0721c53a06190932e1660250d5d1f89784a19424 author Jonas Fonseca 1147787065 +0200 committer Jonas Fonseca 1147787065 +0200 Document file history rev limiting commit 0721c53a06190932e1660250d5d1f89784a19424 57bdf034274cc555b39220fe206124a217f7d1d3 tree 8e06c949b1b7100956859537e09bec23b398a0de parent 57bdf034274cc555b39220fe206124a217f7d1d3 author Jonas Fonseca 1147739628 +0200 committer Jonas Fonseca 1147739628 +0200 ... and yet more doc ups commit 57bdf034274cc555b39220fe206124a217f7d1d3 d44f34bfa910a7b131394d144061e4e43100ccae tree 8cc993d787963e7ba30ac254a6629964eb0c3730 parent d44f34bfa910a7b131394d144061e4e43100ccae author Jonas Fonseca 1147737610 +0200 committer Jonas Fonseca 1147737610 +0200 Check spelling commit d44f34bfa910a7b131394d144061e4e43100ccae 468876c9ed00a4d31ce2dca57e7c66dbfbd9c5f3 tree cddac847679da23f43de805c2500d16fee21b902 parent 468876c9ed00a4d31ce2dca57e7c66dbfbd9c5f3 author Jonas Fonseca 1147736888 +0200 committer Jonas Fonseca 1147736888 +0200 Further improve documentation commit 468876c9ed00a4d31ce2dca57e7c66dbfbd9c5f3 6706b2ba1d81bd757263292174f830abe791e68a tree 7e9adf0dc0e19dc55266c0d274427b28f6824b8a parent 6706b2ba1d81bd757263292174f830abe791e68a author Jonas Fonseca 1147736340 +0200 committer Jonas Fonseca 1147736340 +0200 Lots of documentation improvements commit 6706b2ba1d81bd757263292174f830abe791e68a 6734f6b9e09780a9cbe482749134826fde51feb2 tree fb2e3e1992370fe745754548b583a326636ebd7b parent 6734f6b9e09780a9cbe482749134826fde51feb2 author Jonas Fonseca 1147657832 +0200 committer Jonas Fonseca 1147657832 +0200 Improve documentation; optional tab size; move up/down + enter req; fix wrapping commit 6734f6b9e09780a9cbe482749134826fde51feb2 3af8774ea2ab5d8754b454942f421fe037c959d7 tree 41d7a80e544c0d72ba6727a560882806b96eee95 parent 3af8774ea2ab5d8754b454942f421fe037c959d7 author Jonas Fonseca 1147591424 +0200 committer Jonas Fonseca 1147591424 +0200 Only save commit tag refs; move line type info to view->ops; switch silently commit 3af8774ea2ab5d8754b454942f421fe037c959d7 c34d9c9f0e09a3ec6e990294a7baceaf4d940259 tree ef9d7bc0a84d328829b59d13b2eb5e7a2f0ca209 parent c34d9c9f0e09a3ec6e990294a7baceaf4d940259 author Jonas Fonseca 1147587781 +0200 committer Jonas Fonseca 1147587781 +0200 Fix file mode diff header handling; fix repo refs commit c34d9c9f0e09a3ec6e990294a7baceaf4d940259 cfc6fa71c81e66c653fe83763d262c948b87731c tree a971c4b37ff6fd8640dc9d5e99b8fd7e692b1ca2 parent cfc6fa71c81e66c653fe83763d262c948b87731c author Jonas Fonseca 1147586380 +0200 committer Jonas Fonseca 1147586380 +0200 Add support for repository references commit cfc6fa71c81e66c653fe83763d262c948b87731c 4b76734f232087eeb057fcd4a64f7c13b7980cf6 tree b22a2ff08d13d0759f81661dd719bac698693072 parent 4b76734f232087eeb057fcd4a64f7c13b7980cf6 author Jonas Fonseca 1147577353 +0200 committer Jonas Fonseca 1147577353 +0200 Oops, no need to #include commit 4b76734f232087eeb057fcd4a64f7c13b7980cf6 fac7db6cc6c5bd2f036921d2f27faecfffa14acf tree beb988dcf6ea1299d3e12ead67770320b895f86f parent fac7db6cc6c5bd2f036921d2f27faecfffa14acf author Jonas Fonseca 1147576401 +0200 committer Jonas Fonseca 1147576401 +0200 Try to improve report("") commit fac7db6cc6c5bd2f036921d2f27faecfffa14acf 1ba2ae4b8fd3dde128469739384332d15184dab9 tree 6094153afc06bd9ce23faa64c448e8f97cd9179b parent 1ba2ae4b8fd3dde128469739384332d15184dab9 author Jonas Fonseca 1147575006 +0200 committer Jonas Fonseca 1147575006 +0200 Implement support for terminal resizing commit 1ba2ae4b8fd3dde128469739384332d15184dab9 80ce96ead7f77187d2b05cc91851fce87eb812a9 tree e360d12554c20cc71d743d3214dec340a880f6ef parent 80ce96ead7f77187d2b05cc91851fce87eb812a9 author Jonas Fonseca 1147565885 +0200 committer Jonas Fonseca 1147565885 +0200 Take commands from the environment commit 80ce96ead7f77187d2b05cc91851fce87eb812a9 eb98559e080270280433264730741369ebea9501 tree 502a6434d76a3c33d4dbde68dee53dd411ea7868 parent eb98559e080270280433264730741369ebea9501 author Jonas Fonseca 1147556661 +0200 committer Jonas Fonseca 1147556661 +0200 Use --topo-order; fclose(stdin); space cleanup commit eb98559e080270280433264730741369ebea9501 a8891802e6ca2f483c6dccb20718555bf87abff6 tree 394956b9a326f4a4334cd77e741d402a5dccde43 parent a8891802e6ca2f483c6dccb20718555bf87abff6 author Jonas Fonseca 1147431964 +0200 committer Jonas Fonseca 1147431964 +0200 Fix title in split view; scroll/move reporting; ... commit a8891802e6ca2f483c6dccb20718555bf87abff6 8855ada4ae068bc5d8746f125747a678975180d9 tree 968e83ecc2f410e0a19f3fd3d214d7f1ce919d0c parent 8855ada4ae068bc5d8746f125747a678975180d9 author Jonas Fonseca 1147429942 +0200 committer Jonas Fonseca 1147429942 +0200 Fix scrolling when current line is outside of splitted view commit 8855ada4ae068bc5d8746f125747a678975180d9 889cb462dd376de682f9f6e160b8eb6f6665435c tree 4a7b4062500504fb000589194b17454f7715b2f0 parent 889cb462dd376de682f9f6e160b8eb6f6665435c author Jonas Fonseca 1147429732 +0200 committer Jonas Fonseca 1147429732 +0200 Support for show commit 889cb462dd376de682f9f6e160b8eb6f6665435c 49f2b43f1ad2b29dea90f8478120a0fafcb587e0 tree 51af115a0ee57768a2d2faee5387451023661a3c parent 49f2b43f1ad2b29dea90f8478120a0fafcb587e0 author Jonas Fonseca 1147309167 +0200 committer Jonas Fonseca 1147309167 +0200 Improve documentation commit 49f2b43f1ad2b29dea90f8478120a0fafcb587e0 6908bdbdb5996f30f7dcb5e2dd71f8c8bbbab8a3 tree d5be0174720f4a5ccb7ac80b0af69c241e08aad0 parent 6908bdbdb5996f30f7dcb5e2dd71f8c8bbbab8a3 author Jonas Fonseca 1147308092 +0200 committer Jonas Fonseca 1147308092 +0200 Fix ref navigation bug; make internal command line work; cleanups commit 6908bdbdb5996f30f7dcb5e2dd71f8c8bbbab8a3 03a93dbb1eb5bcd84333f58ae577b9cdab62936e tree 18544c4dab9cfe4e663eb0f7bcc61a39167d6272 parent 03a93dbb1eb5bcd84333f58ae577b9cdab62936e author Jonas Fonseca 1147302524 +0200 committer Jonas Fonseca 1147302524 +0200 Add support for pager view commit 03a93dbb1eb5bcd84333f58ae577b9cdab62936e 6b161b31fbea574bc35f2a42ae910b38207122cd tree feacde1afde73404c010c807e515b21f3ad2a31e parent 6b161b31fbea574bc35f2a42ae910b38207122cd author Jonas Fonseca 1147292204 +0200 committer Jonas Fonseca 1147292204 +0200 Add support for git log / git diff options commit 6b161b31fbea574bc35f2a42ae910b38207122cd a28bcc222c080a22e9796df4eb4050122b74b1fd tree 644d973b53bbce5350643dab2c5d94ea23049243 parent a28bcc222c080a22e9796df4eb4050122b74b1fd author Jonas Fonseca 1147202746 +0200 committer Jonas Fonseca 1147202746 +0200 Lots of small improvements commit a28bcc222c080a22e9796df4eb4050122b74b1fd 2e8488b4e70d3d6ebffd9afd0b801ea6ae21ae11 tree b4c9a773005ad11726617bfb6920262f34817199 parent 2e8488b4e70d3d6ebffd9afd0b801ea6ae21ae11 author Jonas Fonseca 1146602210 +0200 committer Jonas Fonseca 1146602210 +0200 Meep commit 2e8488b4e70d3d6ebffd9afd0b801ea6ae21ae11 4a2909a74c83f6cc5b11e5317a8af1d1fd97f26a tree 9f2592f1af3712060beb03b1c8f3fba83debbf9a parent 4a2909a74c83f6cc5b11e5317a8af1d1fd97f26a author Jonas Fonseca 1146455087 +0200 committer Jonas Fonseca 1146455087 +0200 Lots of cleanups and improvements; speed up attr access commit 4a2909a74c83f6cc5b11e5317a8af1d1fd97f26a 9d3f58347a98736609f5bc80d0daee154c27bfb4 tree 044f0e19af4dd7c7f4dc700844c4123ab8c2c298 parent 9d3f58347a98736609f5bc80d0daee154c27bfb4 author Jonas Fonseca 1146442355 +0200 committer Jonas Fonseca 1146442355 +0200 Heavy renaming and code recomposition commit 9d3f58347a98736609f5bc80d0daee154c27bfb4 82e78006b9dab594f1549d5ead524dfa8295c530 tree 2c87fceb919870b7d0a7d7ca59fbf1d780c29047 parent 82e78006b9dab594f1549d5ead524dfa8295c530 author Jonas Fonseca 1146433075 +0200 committer Jonas Fonseca 1146433075 +0200 Lots of minor UI improvements commit 82e78006b9dab594f1549d5ead524dfa8295c530 4c6fabc213355ec6a575d36d53baf661704c4056 tree 03956443741e320583c6816baa447deb4fdf7940 parent 4c6fabc213355ec6a575d36d53baf661704c4056 author Jonas Fonseca 1146362045 +0200 committer Jonas Fonseca 1146362045 +0200 Lot's of cleanups and fixes commit 4c6fabc213355ec6a575d36d53baf661704c4056 b76c2afc7513ecf74694a73bf004bfb4315758f6 tree 04126ff2d4798aa935c2a061a4c19bb77e320cd7 parent b76c2afc7513ecf74694a73bf004bfb4315758f6 author Jonas Fonseca 1146343046 +0200 committer Jonas Fonseca 1146343046 +0200 TODO's and TODON'T's ... commit b76c2afc7513ecf74694a73bf004bfb4315758f6 78c70acd38e7ee323bbaef48291594b2c9328874 tree 099c634a21146f82af9198ef4a64296858b8fcde parent 78c70acd38e7ee323bbaef48291594b2c9328874 author Jonas Fonseca 1146272659 +0200 committer Jonas Fonseca 1146272659 +0200 Primitive option parsing; rendering generalizations commit 78c70acd38e7ee323bbaef48291594b2c9328874 22f66b0a477377479e44364713f0564a3160c4d4 tree f920ddee57ab0eb3a540bd877fa46e6fc8be56b8 parent 22f66b0a477377479e44364713f0564a3160c4d4 author Jonas Fonseca 1146192530 +0200 committer Jonas Fonseca 1146192530 +0200 Cleanup line matching commit 22f66b0a477377479e44364713f0564a3160c4d4 fd85fef107ee3fc93666b03f51736f88c8f9b111 tree b3a35f00bfe2a2c2fd06252f933a087ada855210 parent fd85fef107ee3fc93666b03f51736f88c8f9b111 author Jonas Fonseca 1146129665 +0200 committer Jonas Fonseca 1146129665 +0200 Started on the main view commit fd85fef107ee3fc93666b03f51736f88c8f9b111 bde3653aaa9b1b2b34945eb0b8986799b694afe2 tree 8da43406d5bb83c22a779fdda14a175dc7c91177 parent bde3653aaa9b1b2b34945eb0b8986799b694afe2 author Jonas Fonseca 1146123645 +0200 committer Jonas Fonseca 1146123645 +0200 Sync. Home/End seems to finally work. commit bde3653aaa9b1b2b34945eb0b8986799b694afe2 b801d8b2bc1a6aac6b9744f21f7a10a51e16c53e tree dbd862ef215ae90fcc5c8fbd8111c8b95d2133e7 parent b801d8b2bc1a6aac6b9744f21f7a10a51e16c53e author Jonas Fonseca 1146094207 +0200 committer Jonas Fonseca 1146094207 +0200 Possible simplification commit b801d8b2bc1a6aac6b9744f21f7a10a51e16c53e a7bc4b1447f974fbbe400c3657d9ec3d0fda133e tree bd3f41e534fcde7e68b14685de3d8252ae420310 parent a7bc4b1447f974fbbe400c3657d9ec3d0fda133e author Jonas Fonseca 1146094073 +0200 committer Jonas Fonseca 1146094073 +0200 The pager is begining to work. :) commit a7bc4b1447f974fbbe400c3657d9ec3d0fda133e a74fa1900a65384bc4140fe45a55877bc981b185 tree fa8a26a5db669ab00b4adbf88c6c9ed1fcf4a504 parent a74fa1900a65384bc4140fe45a55877bc981b185 author Jonas Fonseca 1145734773 +0200 committer Jonas Fonseca 1145734773 +0200 Exploration commit a74fa1900a65384bc4140fe45a55877bc981b185 e3e7b9fc863fba8a601274db585b530d069288d4 tree 39536f4434dd7ac5935b1c64fc1e947544d4f436 parent e3e7b9fc863fba8a601274db585b530d069288d4 author Jonas Fonseca 1145394741 +0200 committer Jonas Fonseca 1145394741 +0200 Misc cleanups commit e3e7b9fc863fba8a601274db585b530d069288d4 67392cc46c61bba11049781e78240130c6f66fc7 tree 28089c6e671605a64a4bc6611879b95a52e4158d parent 67392cc46c61bba11049781e78240130c6f66fc7 author Jonas Fonseca 1145062507 +0200 committer Jonas Fonseca 1145062507 +0200 Misc cleanups and improvements commit 67392cc46c61bba11049781e78240130c6f66fc7 4c084378ddbf82fd858aaa21b740518de5632682 tree 555a8f4d8f447051e74ec11293fad58a44e0dac7 parent 4c084378ddbf82fd858aaa21b740518de5632682 author Jonas Fonseca 1144715728 +0200 committer Jonas Fonseca 1144715728 +0200 Show root; blast raw diff lines commit 4c084378ddbf82fd858aaa21b740518de5632682 05f1685b4ce49e79cbe632a6779556a42263be2f tree b5223cd24ffc248bc63b09c936ff2abad7a19142 parent 05f1685b4ce49e79cbe632a6779556a42263be2f author Jonas Fonseca 1144715374 +0200 committer Jonas Fonseca 1144715374 +0200 No binaries commit 05f1685b4ce49e79cbe632a6779556a42263be2f 800a900c3eb2df114a30417537e7f3e9e47d5ad7 tree 5c76a09f805772711255f22dcab618b2fa82bd22 parent 800a900c3eb2df114a30417537e7f3e9e47d5ad7 author Jonas Fonseca 1144715354 +0200 committer Jonas Fonseca 1144715354 +0200 Half working prototype commit 800a900c3eb2df114a30417537e7f3e9e47d5ad7 tree 71441889b47d529ac28c463807d7fd9e156294f0 author Jonas Fonseca 1144687141 +0200 committer Jonas Fonseca 1144687141 +0200 Initial commit tig-2.0.2/test/test-graph-samples/tig-all-long.out000066400000000000000000002455661233303337700220420ustar00rootroot00000000000000â— Fix stupid bug I introduced │ â—─╮ On redo-next-row: segfault stuff │ │ â— index on redo-next-row: ff10e74 Change some memory management stuff │ â—─╯ Change some memory management stuff ◠│ One more fix ◠│ Another fix ◠│ Use pre-generated next row â—─╯ Add function to pre-generate next row â— A little more broken to make it better â— Always insert extra columns at the end â— Works for first test case â— Better, but missing some lines still â— A little better at the top, a little worse at the bottom â— Fix reloading diffs of staged and unstaged changes â— Fix map size assertion in parse_enum │ â— Move view draw methods to draw module │ â— Move option handling code to options.c │ â— Move option declarations to separate files │ â— Use symbols to track diff and log argument formatting │ â— Group environment-based options │ â— Move refs helpers to refs module │ â— Move repository information to repo.[ch] │ â— Add tool to generate doc from data structures │ â— Move view declarations to view.h │ â— Move keybinding and run requests to keys.[ch] │ â— Move line and color code to line.c │ â— Move line definitions to line.h │ â— Move request handling code to request.c │ â— Move request definitions to request.h │ â— Move view macro to tig.h │ â— Move enums and various utility methods to util module â—─╯ Refactor defined enum maps to contain size information â— Detect renames when generating the announcement â— Fix warning about uninitialized lineno variable â— Set the commit reference when opening the blame view from the blob view â— Fix clean rule to remove DocBook XML files in doc/ â— Fix and improve inter-document linking â— Rename README, INSTALL, and NEWS to end in .adoc â— Use .adoc as the extension for AsciiDoc files in doc/ â— Merge the content of BUGS into the README file â— Fix regression in add_line_at making line numbers start atf 0 instead of 1 â— Fix regression in diff_get_lineno â— Fix regression making diff parsing fail when opening the blame view â— Make blame_draw check if the filename is NULL instead of empty â— Handle diffs with no newline at end of file â— Add support for splitting chunks in the stage view â— Add common utility for parsing chunk headers â— Introduce a path cache and use it for the blame view â— Fix blame_go_back to copy the whole file path â— Fix handling of combining characters in utf8_length() when reserve==TRUE. â— Implement navigating back to previous view state in the blame view â— Create a commit view history API based on the tree view stack â— Free all cached list of reference when reloading the references â— Move warn and die to the util module â— Move error messages to new util module â— Move get_temp_dir to io module â— Move encoding utilities to the io module â— Fix regression making the status view inaccessible for new repositories â— Fix `make dist` to support versions with more than 2 digit groups â— tig(1): document the Git commands supported by the pager mode â— Load main view from any --pretty=raw output given on stdin â— Refactor the pager mode handling â— Simplify checking of --stdin argument â— Generalize and move parsing of reflog info into main_read â— Use memset to clear the format buffer â— Add toggling for display of files in untracked directories â— Improve option toggling to update all displayed view â— Pass CFLAGS to linker â— Move release scripts, test programs and maintainer files to new tools directory â— Switch to automatically generate dependencies â— Disabled colors last when passing user supplied arguments to Git â— Optionally load HEAD when loading references â— Load HEAD ID and symbolic name as part of the repo info â— Add auto-configuration for Cygwin â— Rewrite the toggle menu setup macro code to fix compile error â— Fix stash diff display after deleting a stash â— Make digit counting reusable â— Make the prompt for user-defined commands tell when Tig will exit â— User-defined commands no longer need to be prefixed with '!' â— tigrc(5): rework the keybinding section â— tig-1.2.1 â— Use capitalized Git and Tig when talking about the systems in general â— Simplify the install goal and rename $(PROGS) to $(EXE) â— Fix regression that skipped commits with no messages â— Remove the dont_free line struct flag in favor of custom help_done â— Free graph symbols when reloading the main view â— Bypass all graph calls and memory allocations when the graph is disabled â— Postpone ref list lookup to the draw phase â— Dynamically allocate commit titles to reduce memory usage â— Ignore generated HTML files in the whole tree â— Show blob sizes in the tree view â— Improve the installation instructions â— Add work-around for building manpages with Homebrew-based xmlto â— Ignore *.swp files and restrict to only ignore top-level config.make â— Fix HTML doc installation â— Fix path to sysconfdir-based gitconfig in tig(1) â— Fix submodule-related setup to properly check setenv return value â— Rework README to include the list of online resources â— Fix man page install â— Move documentation to doc directory │ â— Update for version tig-1.2 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-1.2 ◠│ Remove release-docs/ during distclean ◠│ Only warn about missing curses configuration once ◠│ remove useless call to strdup() in get_temp_dir() ◠│ Move all checks for the log view commit context to log_select ◠│ Fix %(prompt) variable formatting ◠│ Revert "Scroll diff with arrow keys in log view" ◠│ Display correct diff the context in split log view ◠│ Add log_select function to find commit from context in log view ◠│ Provide proper work-around for missing setenv() ◠│ Provide mkstemps() work-around for platforms lacking it ◠│ Add example showing how to show display submodule log in diffs ◠│ Fix %(commit) assignment in the diff view ◠│ Add utility method to help copy commit ID to revision buffer ◠│ stash: Highlight the diffstat of combined diffs ◠│ stash: Ensure that the whole stash@{_} text is shown ◠│ stash: Refactor ID drawing method ◠│ stash: Use main view infrastructure for the stash view ◠│ iconv: Consolidate convert methods into one single backend ◠│ iconv: Remove unnecessary length argument to encoding_iconv ◠│ iconv: Convert characters before trimming text before rendering ◠│ iconv: Move draw_chars encoding code to IO module ◠│ iconv: Ignore unrepresentable characters when transliterating ◠│ Only set LINES and COLUMNS environment variables for external commands ◠│ Crop text when title-overflow is enabled ◠│ Scroll diff with arrow keys in log view ◠│ Prepend the path to the repository root when editing a diff file ◠│ Introduce the stash view ◠│ Open editor at selected line also for multi-file diffs in the stage view ◠│ Fix regression when running tig with no arguments and custom encoding ◠│ Fix unicode_width for combining characters ◠│ Enable tilde expansion in ~/.tigrc "source" commands ◠│ Fix blame and status to work from within directories starting with a dot ◠│ Reenable the log view from the command line ◠│ Do not apply diff styling to untracked files in the stage view ◠│ Fix regexec() error checking in grep_text() and grep_refs() ◠│ Pass terminal dimensions to git by setting COLUMNS and LINES ◠│ Do not expand the graph for merges already aligned to the left ◠│ Use TMPDIR for temporary files ◠│ Create temporary file with name as suffix ◠│ Improve invalidation during reload of references ◠│ Set the reference list ID during creation ◠│ Fix rendering glitch for branch names ◠│ Fix display of all branches labels in repos with short branch names â—─│─╮ Merge pull request #143 from bbolli/clang-warning │ │ â— Eliminate a constant expression ◠│ │ tigrc(5): document how to use Ctrl in key bindings â—─│─╯ Show line numbers in the branch view ◠│ Fix formatting of revargs ◠│ Fix half cooked patch tweaks ◠│ Cancel quitting after answering no to a prompt ◠│ Fix regression causing incorect coloring of the commit title ◠│ Show diff stats as wide as the terminal ◠│ Introduce format_context struct to simplify argument passing ◠│ Append the argument in format_expand_arg ◠│ Rename format_arg => format_expand_arg ◠│ Format diff and blame arguments ◠│ Move argument formatting to separate function ◠│ Add a ".." entry if tig is used on an empty path in tree view. ◠│ Build with curses.h when using the default Mac OS X make configuration ◠│ Update documentation as regards color specification using bare numbers ◠│ Fix diff title overflow rendering to use view specific flag ◠│ [#102] Revert 40868f7 which breaks blame and pickaxe support for follow ◠│ Add +ESC key binding ◠│ Highlight commit title overflow in the diff view ◠│ Rename the title-overflow color to overflow ◠│ Refactor commit title drawing to expand text and make it reusable ◠│ main: add toggle for commit title overflow ◠│ Link to stackoverflow.com/questions/tagged/tig for Q and A ◠│ Catch SIGQUIT and gracefully exit tig ◠│ Restore default signal handlers ◠│ Add toggle-files to disable file filtering for the diff and main views ◠│ Add example user-defined commands to the manual ◠│ tigrc(5): document show-line-numbers ◠│ Detect errors and allow editor line number to be disabled ◠│ Stage view: open untracked file at selected line ◠│ Blob view: open editor at selected line ◠│ Add a line number argument to open_editor ◠│ [#116] Add vim mode lines and machinery for updating C file headers ◠│ test-graph: show usage string when no input is given on stdin ◠│ [#115] Add toggles for showing author email or email user names ◠│ Fix manual keybinging for stage-single-line ◠│ Update NEWS ◠│ Document the ability to bind internal commands ◠│ Key bindings which execute tig prompt commands ◠│ Return a request from open_run_request() ◠│ After setting an option, refresh the view if possible ◠│ Support refreshing the diff view by reloading the data ◠│ Refactor the prompt command handling into a separate function ◠│ Allow overwriting of a previously set "argv" option ◠│ Add a diff-options config, similar to blame-options ◠│ Main view: fix diff view display for staged/unstaged changes ◠│ Added configure ◠│ Report toggled option *after* refreshing/reloading the view ◠│ Don't clear the status/report line when finishing a piped update ◠│ Reload current branch name when reloading the stage view. ◠│ Don't call string_copy_rev() on empty string ◠│ autogen.sh: Set WARNINGS in a more portable fashion ◠│ [GH #93] Fix compile errors reported on old Solaris systems ◠│ [GH #93] Reload the current branch name when reloading the status view ◠│ Fix diff display when using --follow by marking it as a rev flag ◠│ Remove unneeded git update-index call │ â— Update for version tig-1.1 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-1.1 ◠│ [GH #91] Allow to open blob related with added content in a diff │ │ â— [GH #72] Convert output to ASCII//TRANSLIT unless using ncursesw â—─│─╯ Fix status view to show section-level changes in non-lazy navigation mode ◠│ Fix lazy navigation mode to allow opening the parent tree ◠│ Do not show deleted branch when reloading the branch view ◠│ Enable lazy navigation mode for the status view ◠│ Refactor stage view title formatting ◠│ [GH #83] WIP: main view lazy navigation mode prototype ◠│ Read commit IDs from stdin when opened with --stdin ◠│ Try to automatically re-run configure script when appropriate ◠│ Work around a bug in autoreconf 2.61 ◠│ Use the right Emacs mode for config.make.in ◠│ Add "show-deps" make target; rearrange existing dependencies to match output ◠│ When using autoconf, *all* of our .o files depend on config.h ◠│ Tweak Emacs' syntax highlighting of configure.ac ◠│ Make sure that our .m4 file gets included ◠│ Run autoupdate(1) on to get rid of autoconf warnings ◠│ Replace strndup(3) usage with malloc + strncpy ◠│ Handle wrapping of the first line of a view ◠│ Fix invalid memory access bug in pager line wrapping ◠│ Properly initialize variable in diff_get_pathname ◠│ [GH #62] Make the use of encoding arguments optional ◠│ Change diff-context setting to have a minimum value of 0 ◠│ diff: get pathname of combined diff headers ◠│ [GH #65] Support binding more advanced external commands ◠│ Correctly report allocation failure in argv_append ◠│ tigrc(5): improve documentation of git configuration usage ◠│ Do not include merges in the announcement's change log â—─│─╮ Merge pull request #81 from esc/fix/reading_git_colors_256 â—─│─│─╮ Merge pull request #80 from esc/fix/option_name_mismatch ◠│ │ │ Reenable copy/rename detection in the status view │ │ │ â— fix: the manpage says 'read-git-colors' │ │ ◠│ fix: reading git colors in rang 0 255 â—─│─┴─╯ Remove enforced diff move/copy detection ◠│ Optionally show commit IDs for branches and tree entries ◠│ [GH #77] Add options for displaying commit IDs in the main view ◠│ Sanitize the width argument to draw_field to not include padding ◠│ Rename all column variables to end with _width ◠│ [GH #78] tig.spec: add man7 directory to RPM package ◠│ [GH #76] Add option to split views vertically ◠│ Move horizontal split calculation to separate function ◠│ [GH #25] Allow to build on Mac OS 10.7 without the configure script ◠│ [GH #70] Fix parent blaming when tig is launched in subdirectory ◠│ [GH #66] Allow run requests to exit tig after execution ◠│ [GH #39] Add note for packagers to avoid building ncurses --with-shared ◠│ [DEB-682766] Improve tigrc(5) documentation ◠│ Documentation typo and grammar fixes ◠│ Allow people to still build without autotools ◠│ Update AX_WITH_CURSES to build under Cygwin ◠│ diff: support editing changed files ◠│ diff: fix and improve detection of filename ◠│ Fixing documentation for maximize keybinding ◠│ Get rid of printf format warnings with size_t arguments ◠│ Reload colors when typed in prompt ◠│ Support tig config options in prompt ◠│ Extend prompt functionalities ◠│ Remove trailing whitespace ◠│ [GH #54] Reorder chdir checks for submodules ◠│ Annotate printf-like methods and fix warnings reported by GCC ◠│ [GH #2] Add basic support for wrapping pager-based views ◠│ Only show changes commits for the current branch ◠│ Rework custom line tracking to allow custom lines at any place ◠│ Refactor line allocation to avoid memory leaks ◠│ Introduce struct to store state during reading of the main view ◠│ Allow case-insensitive searches - implement ignore-case option. ◠│ Add files generated by cscope and ctags to .gitignore ◠│ [GH #53] Revert 73bee5e which breaks the graph when path spec is specified ◠│ Fix opening the pager view from the command prompt ◠│ Show formatted run request argv when prompting ◠│ Add support to confirm the execution of a binding ◠│ Change run request to use flags for passing silent and force options ◠│ Introduce argv_to_string function in the IO library ◠│ Simplify add_pager_refs interface to expect the commit ID ◠│ Use const char pointers for common pager and diff read functions ◠│ Add script to prepare documentation for http://jonas.nitro.dk/tig │ â— Update for version tig-1.0 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-1.0 │ â— Update for version tig-0.18-138-g4bfaaa2 │ â—─╮ Merge branch 'master' into release â—─│─╯ Rework the VERSION mangling in the make dist rule ◠│ [GH #49] Increase the author auto-abbreviation threshold to 10 ◠│ [GH #50] Make relative dates show number of years ago for old commits ◠│ Update the index before showing staged/unstaged changes in the main view ◠│ Do not count the first line and parent accessor lines in the tree view ◠│ Do not count the All branches line in the branch view ◠│ Do not count the unstaged/staged commit lines in the main view ◠│ Fix diff stat for files where the path separator is not shown ◠│ Use git log format to simplify commit title parsing ◠│ Show the file name of the current position in the diff status ◠│ Show the title of the last commit in the branch view ◠│ Fix regression to not handle non-symbolic-ref during rebase action ◠│ Enable diff stat navigation for the staged changes views ◠│ Fix jumping when the diff stat contains a file with no changes ◠│ Add macro to check if a view line is in range ◠│ Do not show empty trees for staged and unstaged commit entries ◠│ Update copyright notices to include 2012 ◠│ Define manpage:[] AsciiDoc macro to fix manpage links ◠│ Move fall-back version string to Makefile ◠│ Move TODO items to the github issue tracker ◠│ Fix diff stat navigation for unmodified renamed files â—─│─╮ Merge pull request #43 from Oblomov/master │ │ â— prompt_menu: protect against programming error │ │ â— Suppress clang warning │ │ â— read_ref: use string_ncopy_do directly â—─│─╯ Fix compile warnings for an unused variable and return values ◠│ [GH #41] Clear newly allocated memory in allocators ◠│ Fix status view position restoration regression from recent refactorings ◠│ Move error logic to the respective view open handlers ◠│ Refactor view loading to allow open methods to abort ◠│ Move open view error reporting down into the view handlers ◠│ Simplify code in status_open ◠│ Move split_view and maximize_view to the open view section ◠│ Move refs code to separate file ◠│ Move keymap to view ops and change to use a struct ◠│ Rework the help view to not use line->other ◠│ Refactor setup of built-in run requests ◠│ Minor improvement of status view restoration ◠│ Store all restore information in view.prev_pos ◠│ Move navigation state to struct position ◠│ Fix refs reloading by not assuming that they are alphabetically sorted ◠│ Add small tracing utility for monitoring executed commands ◠│ Force load the branch view log data ◠│ Fix default commit order to be that of git-log(1) ◠│ Switch to use git-log(s) default commit ordering ◠│ [GH #23] Add %(prompt) variable ◠│ [GH #30] Enable notes by default ◠│ [GH #38] Do not pass navigation requests to the branch view when the main view is maximized ◠│ Fix build dependencies ◠│ Limit the number of allocated color pairs ◠│ Parse commit title correctly in presence of mergetag object ◠│ [GH #8] Read git's color settings ◠│ Show uncommitted changes in the main view as virtual staged and unstaged commits ◠│ Refactor main_add_commit from main_read ◠│ Add status staged and unstaged commands to git.h ◠│ Add blame diff commands to git.h ◠│ Move git diff command argv arrays to git.h ◠│ Allow the command status to be accessed after io_done ◠│ Fix diff command for staged files before initial commit ◠│ Only show the external group title once in the help view ◠│ User-defined commands prefixed with '@' are run with no console output ◠│ 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 │ │ â— Reload the view on a diff-like option change │ │ â— Doc typo â—─│─╯ 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 ◠│ Move checking for line number display to draw_lineno ◠│ tigrc.5.txt: fix a typo ("changes are ignore") ◠│ Offload commit encoding entirely to git ◠│ Add support for using path encoding from git attributes ◠│ Extract encoding conversion to encoding_convert ◠│ Add interface for managing encodings ◠│ Refactor parsing of encoding options ◠│ Enable toggling of all diff ignore space options ◠│ Allow space to be ignored in the stage view and blame diffs ◠│ Use toggle_option infrastructure to change the ignore space option ◠│ Toggle to ignore all whitespace changes in diffs; bound to W ◠│ Add completion for the different .git/*_HEAD files ◠│ [GH #29] Change references section title to 'see also' ◠│ Minor simplification in add_keybinding ◠│ Rename get_key to get_view_key ◠│ Simplify view request declaration ◠│ Simplify view_ops pre-declaration ◠│ Simplify view declaration ◠│ Add draw_formatted ◠│ Change git_dir boolean to become a view flag ◠│ Replace view type enum with a view flag enum ◠│ Add source command for loading separate config file from ~/.tigrc ◠│ [GH #21] Bind single line staging to '1' by default ◠│ Move truncation logic to FORMAT_BUFFER │ │ â—Ž Created gh-pages branch via GitHub ◠│ manual: Fix the references section title ◠│ Do not allow single line staging for new files (untracked or added) ◠│ Fix setup of the iconv input filter ◠│ Do not read configuration from stdin ◠│ Correct typos in documentation ◠│ "make clean" should remove $(TESTS) targets ◠│ Ensure \0 terminated input for iconv() ◠│ Add "//TRANSLIT" for iconv encoding ◠│ Introduce define for the UTF-8 encoding string ◠│ [GH #21] Fix single line updating to support unstaging ◠│ [GH #21] Support staging of single lines ◠│ Refactor diff chunk header parsing ◠│ Introduce io_printf function ◠│ Introduce macro for wrapping calls to vsnprintf ◠│ [GH #22] Add + improvement to NEWS ◠│ tig.c: compare_refs: fix comparing by ref->ltag ◠│ Make git://github.com/jonas/tig.git repo the master ◠│ fixed compile issue: NCURSES_OPAQUE on OSX 10.6.8 ◠│ fixed isnumber error (OSX 10.6.8) â—─│─╮ Merge pull request #22 from tsibley/open-at-line-number │ │ â— Support opening the initial view at an arbitrary line number │ │ â— Unify the parsing of blame options and other view options │ │ â— Simplify parse_options by offloading more to filter_options â—─│─╯ [GH #19] Show filename column when blaming with copy detection enabled ◠│ Move stage chunk to private data ◠│ Introduce private view data and use it for all reading state ◠│ [GH #15] Fix diff-header colorization by ensuring color IDs are >= 1 ◠│ Fix off-by-one error introduced in off-by-one error fix ◠│ [GH #12] Support multi-arg editor strings ◠│ [GH #16] Support custom colorization of lines matching a string prefix ◠│ [GH #17] Properly color binary diffstat lines ◠│ Show branches/refs which names are a substring of the current branch ◠│ Update NEWS ◠│ Fix off-by-one error in the diff stat jump feature ◠│ Create and use dup() of STDIN_FILENO instead of STDIN_FILENO itself ◠│ Add show-notes tigrc option ◠│ Support jumping to commit in the branch view ◠│ Add internal JUMP_COMMIT request and view specific logic to main_request ◠│ Find TOC sections based on 4 tildes or hyphens ◠│ Support jumping to specific SHAs in the main view ◠│ tree_compare: handle author == NULL gracefully when sorting ◠│ Decorate replaced commits ◠│ Display line numbers in main view │ â— Update for version tig-0.18 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.18 ◠│ Update the view title status after jumping to file diff ◠│ [LP-694780][DEB-635546] Expand browsing state variables for prompt commands ◠│ Promote view_open to pager_open ◠│ rename graph-line to palette ◠│ Jump to a file's diff when enter is pressed on a diff stat file line ◠│ Use erasechar() to check for the correct backspace character ◠│ Minor cleanup in blame diff opening ◠│ Use view->parent to access status view from the stage view ◠│ Naïvely color blame IDs to distinguish lines ◠│ Sort references so that remotes comes last in the branch view ◠│ Restore the help view after collapsing/expanding a keybinding group ◠│ Improve the selection of the line blamed from a diff ◠│ Make it possible to change the diff context in the diff view ◠│ Add support for blaming diff lines ◠│ Move blame parsing code to backend utility area ◠│ Refactor blame output parsing ◠│ Rename stage_diff_find to find_prev_line_by_type_ ◠│ Add option to control the diff context ◠│ Move stage open logic to stage_open ◠│ Regroup default keybindings ◠│ Show remotes in branch view ◠│ Split out function to get line type from ref ◠│ Sort "All branches" to the top and prevent segfault â—─│─╮ Merge pull request #9 from tokkee/sh/next │ │ â— Use error codes when checking parse_int() return value │ │ â— Colorize merge commit diffs as well â—─│─╯ get_author_initials: various fixes ◠│ Use locale-unaware methods for case conversion ◠│ Revert change to put %(ref):%(file) in the blame view title ◠│ Simplify blame argv formatting ◠│ Reload the blame view when changing the ref and file variables ◠│ Use mkauthor in grep functions ◠│ Fix problem with empty space when the author field is disabled ◠│ Unify enum map declarations through a common utility ◠│ Accept 'utf-8' for the line-graphics option as indicated in the docs ◠│ Fix regression where new content in the stage view does not reset the position ◠│ Refactor mkmode from draw_mode ◠│ Refactor mkauthor from draw_author ◠│ Refactor draw_refs out from main_draw ◠│ Merge prepare_update into open_argv; make open_file call open_argv ◠│ Use begin_update to load data in the tree and branch views ◠│ Fix blame view regression ◠│ io_run: make it possible to open file ◠│ Simplify format_argv to always replace ◠│ Rename prepare_io to prepare_update and make it more specialized ◠│ Move view splitting code to separate split_view ◠│ open_view: Use maximize_view to prepare non-split displays ◠│ open_view: gather split view code in the same branch ◠│ Introduce refresh_view based on load_view ◠│ Refactor view loading from open_view into load_view ◠│ Add open_argv and open_file to wrap update preparation and open_view call ◠│ Enhance prepare_update_file to add support for refreshable file IO ◠│ Simplify draw_author and draw_date logic ◠│ Make the low-level drawing functions update the view column ◠│ Add specialized open methods for each view ◠│ Convert tree_prepare to tree_open ◠│ Convert begin_update to act as a view_ops open function ◠│ Extend open() view ops to accept the open flags as an argument ◠│ Add VIEW_MAX_LEN macro to aid when drawing ◠│ Remove support for the deprecated TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD env vars ◠│ Do not install test-graph ◠│ Improve parsing of the set command and variable arguments options ◠│ [GH-6] Make blame configurable via options from ~/.tigrc and the command line ◠│ tigrc(5): sort options alphabetically ◠│ Update and fix a few NEWS entries ◠│ [GH-3] Expand %(directory) to . for the root directory │ â— Update for version tig-0.17 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.17 ◠│ Rewrite the revision graph renderer ◠│ Move IO API to src/io.[ch] ◠│ Move includes, macros and core utilities to tig.h ◠│ Initialise views and screens with nonzero size. ◠│ Remove draw_text()s trim parameter ◠│ Remove unnecessary braces ◠│ Reduce the number of windows to max two by sharing them between all views ◠│ Use AX_WITH_CURSES from GNU autoconf archive to detect ncurses ◠│ configure.ac: Set value-if-not-found, don't check for program 'false' ◠│ Unify option toggling ◠│ Refactor option parsing error handling to use error codes ◠│ Add possiblity to pass data to io_load property reader ◠│ Rename opt_*_args to opt_*_argv ◠│ Improve viewing of diffs when browsing branches │ â— Update for version tig-0.16.2 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.16.2 ◠│ Fix 'tig show ' fix which causes empty tree views ◠│ Check the ncurses version before using set_tabsize │ â— Update for version tig-0.16.1 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.16.1 ◠│ Fix tig show by replacing %(commit) with %(revargs) on first display ◠│ Use function set_tabsize() ◠│ Don't show out-of-sight tildes ◠│ Add an option to ignore unknown directories contents in the status view ◠│ Remove remains from the obsoleted toggle-date-short action ◠│ Actually add the ^D binding to move-page-down ◠│ Add a scroll-first-col command ◠│ Add vi-like ^ bindings ◠│ Allow tig to parse control-modified chars in tigrc ◠│ Fix segfault when starting tig in pager mode ◠│ Fall back to retry if no diff will be shown ◠│ Refactor argv_size out from argv_append │ â— Update for version tig-0.16 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.16 ◠│ Fix missing ID reference ◠│ Rename {diff,file,rev}-args to {diff,file,rev}args ◠│ Load diff arguments from TIG_DIFF_OPTS if defined and no diff args was passed ◠│ Move application of string_expand to draw_text ◠│ Improve parent blame to handle line-jumping for renames better ◠│ Improve parent blame to detect renames by using the previous information ◠│ Free blame view data when reloading view ◠│ Fix clearing of the loading flag in the input select loop ◠│ Deprecate use of TIG_{MAIN,DIFF,LOG,TREE,BLOB}_CMD environment variables ◠│ Add support for splitting command line arguments ◠│ Make the branch view always prepare how the main view is loaded ◠│ Cleanup initialization of built-in run requests ◠│ Make view and run request argv members flexible and allocated ◠│ Further cleanup IO startup and initialization; fix io_run_append ◠│ Cleanup IO struct initialization ◠│ Make argv_copy always allocate its members ◠│ Move struct io's argv and dir members to struct view ◠│ Remove format_flags enum and its companion format_argv forward declaration ◠│ Move and rewrite io_format to become prepare_io ◠│ Make argv_copy support allocating argv members ◠│ Plug another memory leak and cleanup update start code while at it ◠│ Mark the argument array as freed in argv_free ◠│ Refactor io_complete into a single backend for {back,fore}ground and append IO ◠│ Introduce io_prepare as a fix to plug memory leaks related to argv formatting ◠│ Internalize format flags in the IO layer ◠│ Make the blame view format its own command arguments ◠│ Use view_request to unconditionally refresh views after run requests ◠│ Add view_request to call the view request method ◠│ Move and rename free_argv to argv_free ◠│ Make open_blob_editor use its own argv show and take blob ID as an argument ◠│ Use view_is_displayed when figuring setting up the open flags ◠│ Restructure option management code to separate section ◠│ Only update status view at EOF for displayed views ◠│ fix off-by-one on parent selection ◠│ Simplify handling of REQ_NEXT/REQ_PREVIOUS by using view->parent ◠│ Add view->prev to track history leaving view->parent for split views ◠│ Color 'Reviewed-by' and 'Tested-by' lines ◠│ When adding a keybinding check if the key is already bound ◠│ Allow built-in run requests to be unbound ◠│ Fix set_keymap to error when resolving an unknown keymap ◠│ Added support for displaying dates in localtime. ◠│ Fixed parse_timezone to correctly calculate the offset in seconds. ◠│ tigrc(5): fix typo ◠│ Fix unbind behavoir ◠│ Introduce view->type member ◠│ Use foreach_view for the stop loading action ◠│ Remove unused VIEW_REQ() macro ◠│ Add view flag with information about whether the view supports refreshing ◠│ argv: remove now unused FORMAT_DASH ◠│ argv: make prepare_update use FORMAT_NONE ◠│ Branch view: add %(branch) variable tracking currently selected branch ◠│ argv: move report call to format_arg method ◠│ argv: refactor argv_from_env to return an error state ◠│ utf8: move unicode related functions below the string helpers ◠│ utf8: make utf8_to_unicode return 0 when encountering invalid symbols ◠│ io: consolidate formatting into io_format ◠│ io: set io->error when syscalls fail and remove calls to report and die ◠│ io: rename IO methods to have io_ prefix ◠│ io: fix comment in io struct ◠│ Rename string_date to mkdate and add incorporate common checks ◠│ Move nodelay logic to the get_input read loop ◠│ Mark detached heads with [HEAD]; replace opt_head_rev with a struct ref ◠│ opt_codeset is only use in main, so make it local ◠│ Make utf8_length take opt_tab_size as a parameter ◠│ Remove line_graphic enum ◠│ Silence warning about unused computed value ◠│ Update copyrights ◠│ Only draw dates with non-zero seconds ◠│ Fix the display of relative date by storing the time zone information ◠│ Fix author abbreviation to handle multi-byte and multi-column characters ◠│ Use FALSE marco instead of C++ false value ◠│ prepare_update_file: assume file is relative to root directory ◠│ Status view: limit untracked file by the prefix/subdirectory ◠│ open_editor: always open path relative to the repository root directory ◠│ get_author_initials: improve and fix to not read outside of name string ◠│ Abbreviation of author names is now configurable and toggleable ◠│ Refactor format variable lookup and expansion ◠│ Oops, fix enum_equals ◠│ Make return value of string_date const ◠│ Simplify enum name comparison with enum_equals macro ◠│ Define date values in DATE_INFO macro ◠│ Refactor toggle_date_option into a generic enum_map based toggler ◠│ Introduce parse_enum and use it to parse the show-date option ◠│ Refactor help_name into enum_name ◠│ Fix parsing of boolean show-date values ◠│ toggle_date_option: use passed date argument instead of opt_date ◠│ Fix usage of the status view from a sub directory ◠│ Encode everything internally as UTF-8 ◠│ Branch view: support browsing --all branches ◠│ Cleanup bluring of the previous view's title bar ◠│ foreach_ref: make ref argument const ◠│ Status view: update the file variable when a line is selected ◠│ TODO: line wrapping ◠│ Fix install-release-doc make rules to use origin/release ◠│ Add make rules to install documentation from the release branch │ â— Update for version tig-0.15 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.15 ◠│ Makefile: Fix typo in 157ebf54 ◠│ Status view: special case revert of unmerged entries with no physical file ◠│ io_open: take path as a vararg format ◠│ run_io_rd_dir: obsolete by switching call sites to run_io_rd_dir ◠│ run_io_dir: take dir argument ◠│ begin_update: simplify control flow ◠│ Remove build dependency on git from the configure script ◠│ tigmanual(7): provide the manual as a man page ◠│ Update asciidoc table syntax to the one supported by version 8.4.4 ◠│ NEWS: Improve bug fix description ◠│ Fix loading of blame data when opened from the tree view ◠│ Fix draw_date to not format anything when time arg is NULL ◠│ Fix whitespace ◠│ Add support for displaying relative dates ◠│ NEWS: Mention date-shorten feature â—─│─╮ Merge remote branch 'samb/short-dates' ◠│ │ Show the active (instead of the default) keybindings in the help view │ │ â— Add an option (and toggle) for shortening the date column by skipping the time. â—─│─╯ Build with asciidoc-8.4.5 ◠│ Fixed some uninitialized variable warnings ◠│ Allow multiple text attributes for color commands ◠│ Remove macros which are only used for default option values ◠│ Make height of split view configurable ◠│ Manual: document that : jumps to the line number ◠│ Fix memory allocation check in open_commit_parent_menu ◠│ Use menus with the commit subject to present selectable commit parents ◠│ Add simple support for showing menues and use it for showing option menu ◠│ Restore the branch view position after refreshing ◠│ Fix reloading of references to not cause access to freed memory ◠│ Predefined external command: git commit ◠│ Fix previous/next with branch+main view ◠│ Add support for sorting branch entries by name, date and author ◠│ Add support for sorting tree entries by name, date or author ◠│ Branch view: fix loading to handle when two branches have same commit ◠│ Use temporary variable in refs loop in main_draw ◠│ Minor fix to always sort even if allocation fails in get_refs ◠│ Add primitive branch view ◠│ Add missing NULL in blame_grep ◠│ Fix a potential problem with reading tokens larger then BUFSIZ ◠│ Update the current branch information when reloading all references ◠│ Define an allocator for run requests ◠│ Remove the need for alloc variables ◠│ Make the granular allocators more customizable using macros ◠│ Define a tree_grep and fixing searching ◠│ Simplify searching in view lines by defining grep_text utility ◠│ Reduce memory and startup time by storing author times as time_t ◠│ Add small cache for author names to reduce memory foot-print │ â— Update for version tig-0.14.1 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.14.1 ◠│ Remove unneeded doupdate from view_driver ◠│ Keep the cursor fixed while initial stage progress is reported ◠│ Fix draw_lineno to always set the static format buffer ◠│ Fix bug in draw_space to not access memory outside the space buffer ◠│ Refactor draw_lineno to use draw_graphic ◠│ Fix horizontal scrolling ◠│ Remove limitation of horizontal scrolling ◠│ tigrc(5): suggest git aliases for external commands requiring shell ops ◠│ Fix the view clearing to only be effective for displayed views ◠│ Make behavior of horizontal scrolling configurable ◠│ Fix handling of quoted strings in the config file ◠│ tigrc(5): fix error in examples for the set command ◠│ Tree view: draw submodule entry modes as "m---------" ◠│ Status view: report failures to update a file ◠│ Ignore broken pipe signals ◠│ Use putenv instead of setenv ◠│ manual: Correct the keys to move the cursor one line up/down ◠│ Status view: upon failure to open a file show error message ◠│ Refactor and share view maximization code from view-close handling ◠│ Fix io_strerror return type ◠│ Add support for handling core.worktree ◠│ Optimize read_repo_config_option to reduce string comparisons ◠│ Move setting of remote branch from repo config to separate function ◠│ Mark enum_maps and other data tables as const ◠│ Use check_blame_commit when handling REQ_ENTER ◠│ NEWS: Mention Jeff's uninitialized variable bug fix ◠│ Handle blaming beyond the creation of file more gracefully ◠│ Blame view: add guesstimation of line number when blaming parent commit ◠│ Use file and line number information when loading blame for commit ◠│ Make the blame view expand tabs at drawing time ◠│ Introduce common view position update helper ◠│ Improve restoring of the view position to bound the offset ◠│ Jump to line when a number is entered in the prompt ◠│ Warn users about integers in ~/.tigrc being out of bound ◠│ Fix uninitialized variable in string_expand_length ◠│ Add support for 256 colors by allowing "colorN" names similar to Mutt ◠│ Improve on branch information in the status view ◠│ Simplify setting the default for the system configuration file ◠│ Refactor and unify timezone parsing ◠│ Remove the need for the OPEN_NOMAXIMIZE flag ◠│ Remove unused OPEN_BACKGROUNDED flag ◠│ Use enum_map for handling obsolete color names ◠│ Use enum_map for handling obsolete request names ◠│ Refactor the int_map interface into new enum_map interface ◠│ Cleanup and simplify option file parsing │ â— Update for version tig-0.14 │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.14 ◠│ Read tigrc(5) options from git configuration files ◠│ tig(1): correct info on tree view related environment variables ◠│ Add release script documenting the release procedure ◠│ Spell check all text files and add dictionary to speed it up ◠│ tigrc(5): document the tree view colors ◠│ Refactor file mode drawing; rename tree-mode color to mode ◠│ Replace usage of the main-author color with the author color ◠│ Move usage string near parse_options ◠│ Tree view: improve handling of empty trees ◠│ Fix reverting of unmerged status entries ◠│ Add support for horizontal scrolling ◠│ Expand tabs in displayed lines to not rely on ncurses to expand them ◠│ Treat empty '/' as "find next" ◠│ TODO: elaborate and regroup into 'before tig-1.0' and 'long term goals' ◠│ Move initial view setup into parse_options ◠│ Move parse_option so it has access to view definitions ◠│ Remove parsing of deprecated option -S and subcommands log and diff ◠│ Rename & move read_properties and git_properties ◠│ Use warn() for warnings emitted during config file loading ◠│ Fix scrolling bugs in gnome-terminal and (u)xterm ◠│ BUGS: document problem with scrolling in (u)xterm ◠│ Tune the view clearing to wait until 2 seconds has passed ◠│ Handle all cursor positioning in get_input ◠│ Optimize drawing by updating the screen in one go ◠│ Abbreviate author names to initials when author-width < 6 ◠│ Refactor author drawing into draw_author ◠│ Fix tokenizing when parsing ~/.tigrc ◠│ Workaround bug exposed by the redrawwin removal in do_scroll_view ◠│ Make cursor updating when resizing the display and loading a view ◠│ Change scrollok strategy to leave it off unless when calling wscrl ◠│ Initialize status_empty flag to FALSE ◠│ Eliminate unneeded calls to redrawwin ◠│ TODO: a small commit cache should be employed at some point ◠│ Help view: show the action name similar as in Mutt's help view ◠│ Remove preallocation of view lines in help_open ◠│ corrected doubly used ID view-manipulation in manual.txt ◠│ tigrc(5) & manual: move view specific actions out of the misc group ◠│ Add support for loading blame for parent commits ◠│ Refactor prompting for user input ◠│ Rename tree-parent action to parent ◠│ Minor cleanup of the tree view code; fix enter on the first line ◠│ TODO: remove resolved item ◠│ Tree view: improve to look less like plumbing ◠│ Refactor main_read to create parse_author_line ◠│ update_view: remove an unneeded goto ◠│ Fix floating point bug in the blame reporting ◠│ Also call end_update for views with custom open function ◠│ Add -O0 to the debug flags ◠│ Rectify arg indexes changes in blame --no-color fix ◠│ Fix status loading of unmerged entries to avoid access to freed memory ◠│ Fix kill_io() to only call kill(2) when pid is non-zero ◠│ Blame view: fix reloading of the diff view for changes not yet committed ◠│ Oops, always specify --no-color when using git diff ◠│ Blame view: fix diffing of lines marked as not yet committed ◠│ Add support for restoring the view position in reloadable views ◠│ Fix status_exists to be consistent with data displayed in the stage view ◠│ Make it possible to call select_view_line for non-displayed views ◠│ Refactor find_next_line into select_view_line ◠│ Refactor user input handling into separate function ◠│ Add support for opening any blob in an editor ◠│ Prefer werase to wclear when possible to reduce flickering ◠│ Cleanup and improve option toggling actions to include help message ◠│ Fix stage reloading to not close when staging chunks from group diff ◠│ Do not terminate the update when switching back to a loading view ◠│ Fix regression of main view drawing ◠│ Cleanup update_view's read loop ◠│ Fix regression in handling of data for non-UTF-8 locales ◠│ Fix another regression from the dirty flag changes causing flickering ◠│ Fix serious bug where a stack allocated variable was returned ◠│ Improve messages when preparing to load blame commits ◠│ Fix regressions introduced in the last few dirty flag changes ◠│ Tree view: make drawing more smooth by using the dirty flag ◠│ Cleanup redrawing of views when updating by using the dirty flag ◠│ Cleanup the tree_read sorting loop ◠│ Fix memory corruption bug in tree_read when sorting the entries ◠│ Cleanup and simplify the code by introducing add_line_format ◠│ Cleanup the code by calling realloc_lines in add_line_data │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.13 ◠│ Launch mergetool from the project root directory ◠│ Clear the view after 1 second during updates where reading takes long ◠│ IO API: use select(2) to check if pipe is readable when updating a view ◠│ IO API: reindent status_run main loop after the rewrite ◠│ IO API: replace io_gets with helper for scanning buffers ◠│ IO API: use fork+exec ◠│ IO API: use argv internally ◠│ IO API: use file descriptor internally ◠│ IO API: replace init_io_fd with io_open which calls fopen(3) ◠│ IO API: use in the status view ◠│ IO API: use when loading repository properties ◠│ IO API: use in the stage view ◠│ IO API: obsolete opt_pipe ◠│ IO API: obsolete opt_cmd by using prepare_update in status_enter ◠│ IO API: use prepare_update when parsing command line arguments ◠│ IO API: use in add_describe_ref ◠│ IO API: use in the blame view ◠│ IO API: unify tree view and the default path in begin_update ◠│ IO API: use for the main, log, diff, tree and blob views ◠│ IO API: use when preparing to run commands from the prompt ◠│ IO API: convert status checkout/revert support ◠│ IO API: use when running external commands ◠│ IO API: refactor the run request command formatter ◠│ IO API: add small library for reading files and running programs ◠│ Blame: do to not reload the diff view for same commits ◠│ Blame: update blame to selected commit when pressing 'B' ◠│ Blame: remove unused member of struct blame ◠│ Add setup_update for initialize incremental view updates ◠│ Slightly reduce memory usage for keybindings ◠│ Move formatting of blame --incremental command to blame_read_file ◠│ Minor simplification of blame_open ◠│ Don't use view->cmd to share state in the blame view ◠│ Fix drawing loading views that are not displayed. ◠│ Add support for launching the editor from the tree view ◠│ Replace opt_no_head with opt_head_rev in order to save the HEAD rev ◠│ Use switch statement in tree_request ◠│ Refuse to open blame view for all non-file entries in the tree view ◠│ Refuse to open deleted files from the status and stage views ◠│ tigrc(5): minor fixes and improvements from wip/run-command ◠│ Refuse to open a directory in the status and stage view ◠│ Fix waiting for input after executing a run request in pager mode ◠│ update_view: Check the pipes and call end_update() before redrawing ◠│ Use "--" to separate file argument to git-checkout ◠│ Cleanup and fix the main loop to make view point to the current view │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ Update and improve the manual ◠│ Remove documentation relicts from before the option parsing was changed ◠│ Introduce prefixcmp macro to reduce code verbosity ◠│ Separate blame revision and file argument by "--" to avoid problems ◠│ Add bash completion for the blame subcommand ◠│ Remove outdated comment ◠│ Make more strings const ◠│ Sort references in the order: tags, heads, tracked remotes, remotes │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.12.1 ◠│ Rename checkout to revert and support individual diff chunks reverts ◠│ Avoid triggering assertion failure when reloading the status view ◠│ Consolidate and share view resetting via new reset_view() ◠│ Help view: move requests from the Misc group into separate groups ◠│ Help view: use "(no key)" instead of "'?'" to not confuse unbound actions ◠│ Clear the status line when closing a view ◠│ Fix bug introduced in commit for using --exclude-standard flag ◠│ Add support for refreshing the log view ◠│ Make OPEN_REFRESH imply OPEN_NOMAXIMIZE ◠│ Simplify view refreshing by adding new OPEN_REFRESH flag for open_view ◠│ Show complete shortlog for small releases ◠│ Improve checkout error reporting ◠│ Cleanup and make option argument strings const ◠│ Improve handling of unmatched quotes in ~/.tigrc ◠│ Make GIT_CONFIG only contain the config subcommand ◠│ Reload repository references when refreshing the main view ◠│ Avoid refreshing views when checkout is canceled by user ◠│ Also allow files to be checked out from stage view ◠│ Cleanup exclude rule setup by using ls-files --exclude-standard flag ◠│ Main: use --topo-order when arguments are given on the command line ◠│ main: automatically refresh after run requests ◠│ status: add support for checking out files with unstaged changes ◠│ TODO: support for jumping to parents' blame in the blame view ◠│ Add script for preparing release announcements │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.12 ◠│ Do not show boundary commits by default ◠│ main: implement refreshing by just rerunning the original command ◠│ Continue updates when pipe read has errno "Success" │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ Clean up incomplete commits from main view listed for --no-walk ◠│ Remove the global opt_request variable ◠│ TODO: Option for abbreviating author names using just the initials ◠│ Gracefully ignore negative values given to options in ~/.tigrc ◠│ Add option 'author-width' to consumize the width of the author column ◠│ INSTALL: Mention the release notes in the NEWS file ◠│ Update NEWS ◠│ Remove useless check in blame_read_file() ◠│ Rename the gitlink:[] AsciiDoc macro to manpage:[] ◠│ Fix reopening blame view when it is already loading ◠│ Fix the view notification of end of reading ◠│ Makefile: remove bashism from distclean rule ◠│ Add stage-next action to jump to next diff chunk that can be staged ◠│ Make configure check for ncurses header files ◠│ Drop use of $(...) for popen() and system() calls │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ Add NEWS file ◠│ Fix warnings emitted with -pedantic ◠│ Refactor management of the current draw column and max draw width ◠│ Use draw_field() for the author field ◠│ Introduce draw_field() helper for drawing main and blame fields ◠│ Refactor revgraph drawing into draw_graphic() ◠│ blame: simplify handling of incomplete commit information ◠│ Simplify line attribute handling ◠│ Keep line graphics characters in a table initialized on startup ◠│ Add line-graphics option to disable graphics characters for line drawing ◠│ Search checks reference names too ◠│ Document the main-commit colour option ◠│ Let ncurses take care of expanding tabs by setting its TABSIZE variable ◠│ Refreshing the current view when F5 is pressed (like gitk) ◠│ Fix regression from "Improve staging of diff chunks" ◠│ Do not reload status and stage views on errors ◠│ Fix AsciiDoc replacing -- in --with-libiconv ◠│ Squelsh output of update-index when loading the status view (part II) ◠│ Rebind the maximize action to 'O' instead of 'M' │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.11 ◠│ Use sans-serif font for the README page ◠│ Update copyright notice for the manual ◠│ Remove unused blame line attributes ◠│ Use tables for listing the UI colors ◠│ Minor cleanup in blame_draw ◠│ Setup colors for the selected line in draw_view_line() ◠│ Make the main and blame view share date drawing and date colors ◠│ Squelsh output of update-index when loading the status view ◠│ Avoid splitting the view when navigating stage view in full screen ◠│ Use 3 as the minimum width of formatted line numbers ◠│ Revert "When toggling options redraw the view instead of the whole display" ◠│ Fix compatibility for git rev-parse without --symbolic-full-name ◠│ Error out when starting up in empty main or blame view ◠│ Improve staging of diff chunks ◠│ Reload the status and stage views after a run request has been handled ◠│ Add support for refreshing of the stage view ◠│ When toggling options redraw the view instead of the whole display ◠│ Use werase() instead of wclear() when reloading a view ◠│ Share the line number colors between blame view and others ◠│ Rename load_repo_config() to load_git_config() ◠│ Do not load repository references when acting as a pager â—─│─╮ Merge branch 'master' of remote-server:src/tig │ │ â— status: use draw_text completely ◠│ │ Make local tags and normal branches use normal font-weight ◠│ │ Show the tracked remote branch with bold text │ │ â— Add draw_lineno() and use when drawing the blame and pager view │ │ â— Add action to maximize the current view; bound to M by default â—─│─╯ Disable opening views that require a git directory when in pager mode ◠│ Fix pager mode by always doing the isatty() ◠│ stage: disable whitespace warnings from git apply when staging updates ◠│ Improve perfomance and usability when updating many files ◠│ Fix and improve status refreshing after updating ◠│ Fix uninitialized variable warning ◠│ Output extra \n on tig -h ◠│ Avoid reloading the status view when nothing was updated ◠│ Oops, fix delimiter documentation ◠│ Add support for preparing the initial commit in the status view ◠│ Rename "main-delim" color to the more generic "delimiter" ◠│ Show the current branch in the status view ◠│ Save current branch from rev-parse output and highlight it ◠│ blame: Fix opening from subdirectory and consecutive invokations ◠│ Remove deprecated options and cleanup option parsing ◠│ More blame view fixes ◠│ Various fixes and improvements of the new blame view ◠│ Add blame view ◠│ Add hack to allow view loading to have multiple phases ◠│ Simplify subcommand option parsing by moving it out of the loop ◠│ draw_text: remove unused col argument ◠│ Use rewritten parent info from --parents to simplify the revgraph ◠│ Move unrelated UTF-8 setup code out of parse_options ◠│ tigrc(5): Improve documentation of new show-* options ◠│ configure: test for git binary and improve config subcommand test ◠│ Call realloc() less often because it is potentially slow. ◠│ New config options show-author, show-date, show-refs, show-line-numbers. ◠│ Fixed displaying local tags. ◠│ New actions toggle-date, toggle-author, and toggle-refs. ◠│ Fix index refreshing into separate call so diff-files is always run ◠│ draw_text: reduce indentation level ◠│ draw_text: minor cleanup to use fewer local variables ◠│ utf8_length: add reserve flag for reserving a trailing character ◠│ TODO: --boundary flag is already used ◠│ 0.11.git │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.10.1 ◠│ More verbose diff headers (including dates and committer) ◠│ Fix drawing "outside" the screen in the status and pager views ◠│ Fixed handling of UTF8 tag names and commit messages. ◠│ Make configure search for the ncursesw library first ◠│ Fix compiler warnings: pointer of type ‘void *’ used in arithmetic ◠│ Fix signed char comparison where char is unsigned by default ◠│ Fixed spurious "/bin/sh: --list: command not found" error │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ Refresh the index when opening the status view to avoid "empty diffs" ◠│ Add rename support to the status view ◠│ Make it more clear that use of configure (and autoreconf) is optional ◠│ Replace SYSCONFDIR value in distributed documentation distributed ◠│ tig-0.10.1.git │ â— Sync docs │ â—─╮ Merge branch 'master' into release │ │ â— Replace SYSCONFDIR value in distributed documentation distributed │ ◠│ Sync docs │ â—─│─╮ Merge branch 'master' into release â—─│─┴─╯ tig-0.10 ◠│ Make command line parsing more compatible with gitk ◠│ Add system-wide configuration file and new config file environment vars ◠│ Make it possible to overwrite the default (terminal) colors ◠│ Add support for showing boundary commits in the main view ◠│ Drop -B from diff options ◠│ Simplify documentation building and fix asciidoc.conf dependency ◠│ Replace the manpage XSL workarounds with AsciiDoc conf workarounds ◠│ INSTALL: Document the optional documentation tools ◠│ Update manpages to not contain contain so many formatting workarounds ◠│ Added examples to tig(1) manpage ◠│ TODO: Mention tig.c splitting and revgraph rewrite ◠│ Install manpages in $(prefix)/share/man ◠│ Updated .gitignore ◠│ Removed trailing whitespace. ◠│ Added action tree-parent and bound it to backspace by default. ◠│ Added color option main-revgraph to color the revision graph. ◠│ Add documentation for undocumented color options. ◠│ Minor formatting and spelling fixes. ◠│ Ignore HTML files in general ◠│ manual: remove section on porcelains ◠│ Makefile: add ASCIIDOC_FLAGS ◠│ Avoid using git-diff since it might run external diff drivers ◠│ Use --no-color option when calling git-log and git-diff ◠│ Rearrange the order of option parsing ◠│ Fix crash when opening mergetool for lines that are not unmerged ◠│ Use get_key_name() in get_key() ◠│ Add missing = for comparison in obsolete actions check ◠│ Collect remaining string in last entry when parsing config file lines ◠│ Improve sanity check error messages ◠│ Obsolete the cherry-pick action and define as builtin external command ◠│ Add support binding keys to running external commands ◠│ Unify REQ_NONE and REQ_UNKNOWN by moving REQ_NONE to be the last request ◠│ tig-0.10.git │ â— Sync docs │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.9.1 ◠│ SITES: 'Tarballs' is a bit more telling than 'Releases' ◠│ Cleanup status_request to make it reload the status view by default ◠│ Add support for launching git-mergetool from the status view ◠│ Refactor code to open_external_viewer ◠│ Detect working trees and disable the status view when it is missing ◠│ Document the refresh request ◠│ Ignore REQ_NONE in the help view and improve unbound request handling ◠│ Never put the release number in the tarball name for tagged versions ◠│ Also ignore generated .md5 files for tarballs ◠│ Add support for refreshing/reloading the status view ◠│ Remove unused 'view' argument from open_editor ◠│ Include autoconf file for 'make dist' ◠│ Fix the clean rule to never remove generated doc files ◠│ Fix out-of-range lineno when reloading the status view ◠│ Fix open_editor to make the file path relative to the project root ◠│ Handle REQ_NONE upfront in view_driver ◠│ Support cherry-picking commits in main view to current branch ◠│ Oops, always ensure that ICONV_CONST is defined ◠│ Use the more advanced iconv.m4 script from ELinks ◠│ tig-0.9.1.git │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.9 ◠│ Change the default styles for the status view ◠│ Update documentation │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ Force adding of doc files in the release-doc rule ◠│ Fix INSTALL ◠│ Build intermediate tig.o file to fix tig dependency on config.h ◠│ Ensure ICONV_INBUF_TYPE is always defined; fix GIT_CONFIG define ◠│ Guard config.h include with HAVE_CONFIG_H ◠│ Define TIG_VERSION as intended when autoconf was introduced ◠│ Change last commit to make tig depend on config.h ◠│ Make tig.c depend on config.h when using configure ◠│ Add CC to the list of expanded symbols by configure ◠│ Allow LDLIBS to be overriden by configure ◠│ Fix warning from blob_read returning pointer instead of bool ◠│ stage: add request handler supporting file edits and chunk staging ◠│ Add stage view, which is used for showing status changes ◠│ autoconf: check for the AsciiDoc and XmlTo document tools ◠│ autoconf: check whether to use git-config or git-repo-config ◠│ Add autoconf-based build infrastructure for tig ◠│ tree: use simple stack to remember the previous subtree line numbers ◠│ Only show the command being loaded from for the pager view ◠│ TODO: tig now has a status view ◠│ Make it possible to browse all status changes once the diff view is open ◠│ Fix handling of REQ_NEXT/REQ_PREVIOUS ◠│ Fix updating of the view title to show the current position in the view ◠│ Warn about nothing to enter if REQ_ENTER reaches the view_driver switch ◠│ status: implement support for opening files in editor ◠│ status: cleanup status_request by resurrection status_enter ◠│ status: "wire" REQ_STATUS_UPDATE handling through status_request ◠│ Add view request operation for handling view specific requests ◠│ status: fix switching to the main view when starting in status view ◠│ status: improve title and report messages ◠│ status: make it possible to batch updates by pressing on the section line ◠│ status: assert that there are always view lines in the status view ◠│ status: make it possible to see all changes for a status section ◠│ status window: mention 'u' instead of Enter ◠│ Add support for showing staged/unstaged changes and untracked files ◠│ Introduce status-update action bound to 'u' by default ◠│ Avoid flickering when moving past the main view's first and last line ◠│ Ignore generated HTML pages ◠│ Ignore generated manpages. ◠│ Include the tig bash completion script as documentation ◠│ Rename contrib/tig-completion.sh to contrib/tig-completion.bash ◠│ Fix a few typos in the bash completion ◠│ Simplify naming (versioning) of non-release tig tarball and rpm file ◠│ Move tig.spec.in to the contrib area ◠│ Move tigrc to the contrib area ◠│ Add tig bash completion script ◠│ Delete the old VERSION file before appending the new one in make dist ◠│ Use $(MAKE) instead of 'make' and 'git *' instead of 'git-*' ◠│ tig-0.8.git │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.8 ◠│ Fix pager mode regressions ◠│ Fix (another) integer type mismatch on 64-bit systems ◠│ Fix integer type mismatch on 64-bit systems ◠│ Add TODO about using non-blocking I/O for incremental view loading ◠│ Only emit one "Not a git repository" error message ◠│ Allow CFLAGS to be overridden while preserving VERSION ◠│ Grab path to the git directory; use it when listing untracked files ◠│ read_properties: use size_t instead of int for callback ◠│ Fix wrong uses of string_copy() with pointer instead of buffer ◠│ Fix use of the status view from subdirectories ◠│ Fix string_copy macro to use sizeof(src) for the source buffer â—─│─╮ Merge branch 'jn/rpm-updates' │ │ â— Refresh VERSION file when building distribution tarball in "make dist" │ │ â— Include documentation sources for rpmbuild with '--without docs' │ │ â— Remove PDF version of manual from being build and installed ◠│ │ Make dist rule more robust using '&&'; create .tar.gz.md5 file â—─│─╯ Fix typo the INSTALL file ◠│ Supply explicit permission bits to 'install' ◠│ tig-0.7.git │ â— Sync docs │ â—─╮ Merge branch 'master' into release â—─│─╯ tig-0.7 ◠│ Rename sync-docs to release-doc; add release-dist rule ◠│ Various random Makefile cleanups │ â—─╮ Merge branch 'master' into release â—─│─╯ Update sync-docs target to use git porcelain instead of cogito ◠│ Infrastructure for tig rpm builds ◠│ Move "static" version info to VERSION file ◠│ Add version information to man pages ◠│ Add manpage XSL from git and enhance with literallayout fixes ◠│ Add status view ◠│ main_read: cleanup and simplify ◠│ Refactor add_line_text parts into add_line_data; use it in main_read ◠│ Add open method to view_ops ◠│ Add notice about empty pager view ◠│ Add notice about empty pager view ◠│ Make keybinding reference more dynamic ◠│ Move space separator from get_key to formatting in open_help_view ◠│ Improve managment of view->ref and the title line ◠│ Be more paranoid about paths when updating the tree view ◠│ move_view: fix view->offset overflow bug ◠│ Introduce add_line_text to simplify pager based rendering ◠│ Fix revision graph visualization during incremental updating ◠│ Add TODO item about diff chunk staging/unstaging ◠│ Make it possible to install man pages and html files separately │ â— Fix synced docs ... stupid Mac OS X sed ;) │ â— Sync docs │ â—─╮ Merge with tig-0.6 ◠│ │ tig-0.6.git â—─│─╯ Bump the version number to 0.6 ◠│ Oops, remove -liconv from LDFLAGS ◠│ Disable show-rev-graph by default â—─│─╮ Merge with master │ │ â— Improve handling of remotes │ │ â— TODO: use autoconf to detect newer git and git-config availability │ │ â— Make tig handle GIT_DIR better │ │ â— Drop --stat usage from the main command assembled during option parsing │ │ â— Add note about using autoconf to detect iconv(3) presence in libc │ │ â— Fix parameter warning for iconv(3) │ │ â— Fix SITES URLs; promote git://repo.or.cz/tig.git mirror more │ │ â— Discard error messages from git-describe │ │ â— Fix commit author line parsing for when the name is empty â—─│─│─╮ Merge with master │ │ â—─╯ Never split the tree view when opening another tree view │ │ â— Cast second arg to iconv to remove warning │ │ â— main_read: handle titles that start with whitespace │ │ â— Increase commit.title size from 75 to 128 │ │ â— Hardwire ERR to mean REQ_NONE in the main loop │ │ â— add_keybinding: always allocate the new keybinding │ │ â— tig-0.5.git │ ◠│ Sync docs │ â—─│─╮ Merge with master │ │ â—─╯ SITES: Point to pasky's git proxy repo.or.cz │ │ â— INSTALL: mention possible iconv problems and workarounds │ │ â— manual: document the tree/blob environment variables │ ◠│ Sync docs │ â—─│─╮ Merge with master │ │ â—─╯ Always clear the status window after prompting │ │ â— Oops, check log, diff, and show before options │ │ â— Use wclrtoeol instead of werase │ │ â— Fix clearing of the status window after prompting │ │ â— parse_option: check for '-' first and break if it is not an option │ │ â— Improve the "input mode" so the cursor is correctly positioned │ │ â— add_keybinding: plug memory leak │ │ â— TODO: repository status view, better text-input support │ │ â— tigrc(5): mention tree/blob view actions; use dash in favour of underscore │ │ â— Run the documentation through aspell ◠│ │ push_rev_graph: iterate all graph revs when looking for duplicates │ │ â— BUGS: Merge locale support with utf8-only bug, add horizontal scrolling â—─│─│─╮ Merge with master │ │ â—─╯ Abbreviate the view reference in the view title for small widths │ │ â— update_view_title: format load seconds as part of the state string │ │ â— update_view_title: use string_format_from instead of wprintw │ │ â— A simple fix of the bad wrapping bugs │ │ â— update_display_cursor: take view as arg ◠│ │ Make the rev graph visualization have a one rev look-ahead ◠│ │ update_rev_graph: move code to prepare_rev_graph ◠│ │ Allow view readers to 'finalize' by calling with NULL line before closing ◠│ │ append_to_rev_graph: use local variable ◠│ │ Always draw the space between end of rev graph and start of commit title ◠│ │ Refactor (separator, line) chtype management to use 'fillers' ◠│ │ More graph_parent_is_merge usage ◠│ │ draw_rev_graph: refactor stuff to get_rev_graph_symbol ◠│ │ Improve comments ◠│ │ Use 'graph' instead of 'stack' in the rev graph code ◠│ │ Move rev graph code to own section ◠│ │ Move stuff to reset_rev_graph and rename it to done_rev_graph ◠│ │ Simplify the update_rev_graph end-game ◠│ │ Add graph_parent_is_merge ◠│ │ Now it actually starts looking like something ◠│ │ Refactor graph drawing ◠│ │ Remove fprintf stuff ◠│ │ More cleanups ◠│ │ Refector stuff into draw_rev_graph ◠│ │ Some more refactoring and cleanups ◠│ │ Cracking ◠│ │ Minor cleanups ◠│ │ Version 1 â—─│─╯ SIZEOF_REV introduced: 41 bytes of pure madness! ◠│ Minor cleanups ◠│ Oops, always update the tree view ref ◠│ Fix updating of the blob ref and the blob view ref ◠│ Also color Acked-by lines ◠│ Fix redrawing of old current line ◠│ Only split the tree view when the tree view is visible ◠│ move_view: drop redraw arg and handle backgrounded moves ◠│ do_scroll_view: drop redraw arg ◠│ do_scroll_view: minor refactoring of the current line updating ◠│ search_view: use opt_search directly instead of through an argument ◠│ Remove some old cruft that was clearing hidden lines at the end ◠│ Introduce selected flag and use it for refacter wclrtoeol usage ◠│ Add selected arg to the view draw operation ◠│ Refactor current line activation to new select view operation ◠│ Fix tree viewing again; introduced by string safety patch ◠│ Make view->regex into a pointer ◠│ Fix git-describe reference adding when there are no tags and thus no output ◠│ Improve string buffer copy safety ◠│ Hrmpf, fix one more default keybinding clash, this time the blob view ◠│ Review all string_format users and use string_format instead of snprintf ◠│ Move the current line to the first entry in the tree view ◠│ Use ICONV_NONE instead of (iconv_t) -1 ◠│ Remove redundant ending ';' ◠│ manual: mention the tree/blob views ◠│ Fix default keybinding clash for 'n' between find-next and toggle-lineno ◠│ Use size_t instead of int for string_* functions ◠│ Reintroduce foreach_view and use it to fix background loading ◠│ Rename foreach_view to foreach_displayed_view ◠│ Add support for tree and blob view ◠│ tig(1): Do not differentiate between git (show|log|diff) options ◠│ Reformat the state variable list (opt_*) ◠│ Add support for searching using regex ◠│ Replace screen-update action with noop action named "none" ◠│ read_prompt: return static allocated buffer; move out exec mode setup ◠│ read_prompt: take prompt 'name' as arg ◠│ SIZEOF_STR: introduced and use instead of 1024, also replaces SIZEOF_CMD ◠│ Add poor man's "show most recent tag" by using git-describe ◠│ add_pager_refs: rename local line data pointer to commit_id ◠│ Add .gitignore file │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ prompt: make ':show ' use the diff view ◠│ Add support for converting from git encoding to locale encoding ◠│ Pass --root to git-show so the diff command will show the initial commit ◠│ Silence stderr for all view commands ◠│ Improve handling of 'bogus' author lines ◠│ Create directories during make install ◠│ Check the value returned by fopen() during display initialization ◠│ No need to use --stat for the default TIG_MAIN_CMD ◠│ tig-0.4.git â—─│─╮ Merge with ssh://brok.diku.dk/~/tig │ │ â— tigrc(5): Fix keybinding headers ◠│ │ Use docbook to build manual.pdf; clean *.xml files │ ◠│ Sync docs │ â—─│─╮ Merge with master â—─│─│─╯ Add sync-docs rule to update docs in the release branch ◠│ │ Manual: fix page up keys ◠│ │ Add manual link to SITES; improve/fix SEE ALSO sections │ ◠│ Sync docs │ â—─│─╮ Merge with master â—─│─┴─╯ CSS fix: s/monospaced/monospace/ ◠│ Use tables for the listing of default keybindings │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ Documentation update ◠│ Add "Hash" key name mapped to "#"; Don't use ";" as a comment character ◠│ Allow strings to be enclosed in either ' or " ◠│ Make prompt use internal user input reader â—─│─╮ Merge with ssh://diku/~/tig │ │ â— Config: improve error reporting and do a few cleanups and simplifications ◠│ │ Rename "encoding" option to "commit-encoding" ◠│ │ Install HTML files into $(prefix)/share/doc/tig ◠│ │ Add ToC to the tig manual ◠│ │ Misc doc improvements â—─│─╯ Add support for keybindings ◠│ Rename keymap to keybinding, get_request to get_keybinding ◠│ Add default configuration file ◠│ Add special string comparer for gracefully parsing ~/.tigrc identifiers ◠│ Establish "Open view" section ◠│ Rename load_help_page to open_help_view and move it up ◠│ Move keybinding stuff up after line stuff ◠│ Support set command in ~/.tigrc; allows a few options to be configured ◠│ Simplify the option value tokenization by doing it one place ◠│ Factor out set_option_color from set_option ◠│ Make declaration of die() specify the __NORETURN attribute │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ Improve error reporting for unknown options ◠│ Add feature request for showing nearest branch heads or tags for a commit ◠│ Makefile: make customization of installation locations easier ◠│ Make the view title show percentage shown like less ◠│ Implement the basic controlling of revision graph visualization ◠│ Add strip rule ◠│ Don't begin any update for the built-in help page ◠│ More color and attribute maps closer to the users ◠│ Simplify detection of tag commits via ^{} ◠│ Minor tidyup ◠│ Generalize the option parsing ◠│ Move tig(1) material to tig.1.txt ◠│ Correct error checking ◠│ Remove prev arg to view->ops->read() ◠│ Wrap all snprintf usage to simplify error handling ◠│ Add support for showing tags and other repo refs in the diff and log view ◠│ Refactor view->line reallocation ◠│ Make 'h' and '?' show built-in key binding quick reference ◠│ Rename documentation build rules using s/docs/doc/; more like git ◠│ Add COPYING file ◠│ Fix segfault where current_view would become >= sizeof(display) │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ Remove SITES title so it is more adaptive to where it is included ◠│ Split out manual material to separate file ◠│ List SITES in tig(1) ◠│ Move stuff to SITES and INSTALL files ◠│ Move stuff to BUGS and TODO files; only show BUGS in tig(1) ◠│ Move ~/.tigrc documentation into it's own man page, tigrc(5) ◠│ Use ~/.tigrc for user configuration rather than ~/.tig ◠│ Add TODO about keybinding cheat sheet ◠│ Emit more informative error messages when loading ~/.tig ◠│ Only touch the option strings if necessary ◠│ Improve color documentation ◠│ Add support for setting color options in the ~/.tig user configuration file ◠│ Make read_properties take several separator characters; chomp name & value ◠│ Oops, fix short help wrt tab size short option ◠│ Rename repo config loaders using s/config/repo_config/ ◠│ Make read_properties() take FILE *pipe instead of command line ◠│ Document the loading time displayed in the title window after 3 seconds ◠│ Make the stop all loading request stop all loading ◠│ Notify that the prompt is unusable while loading ◠│ Tab size short option changes from -t to -b ◠│ Minor usability fix: when closing never switch to an already closed view ◠│ "View commands" section becomes "History commands". ◠│ License revisited: it's GPLv2 or later ◠│ Fix off by one error; makes tags visible again ◠│ When updating the title window, move the cursor to the end of line ◠│ Factor out cursor moving ◠│ Make window switching smother; fix blurring of previous view when switching ◠│ Never close backgrounded loads; only clear window when starting to update ◠│ Only pass on properies with non-zero length names ◠│ Refactor reading of properties from pipes ◠│ Load config before parsing command line options so they can override ◠│ Make UTF-8 handling optional but still default ◠│ Add support for loading repo config ◠│ Cleanup see also section ◠│ Move env handling up below option handling ◠│ Put license also in the program header ◠│ Rearrange pager_enter logic ◠│ Update README; set a less ugly font-family ◠│ Introduce struct line and use it for view->line ◠│ Improve title updating and remove flickering ◠│ Make update reporting less verbose ◠│ Fix spurious resizing of the display (take 2) ◠│ Add macro for getting number of displayed views ◠│ Only resize the display when actually required ◠│ Fix updating of the main view title when the screen isn't split ◠│ End the current update before begining a new one; fixes CPU hogging │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ Bind 'j'/'k' to moving up/down; add next/previous requests bound to Down/Up ◠│ Move struct commit to appear just above the main view backend ◠│ Add -O2 to CFLAGS to get more warnings ◠│ Cache all queries for refs based on ID ◠│ Move git directory assertion to main; don't require .git repo in pager mode ◠│ In pager mode, fix entering commit lines from log and pager view ◠│ Remove old window cycling code from before enter request appeared ◠│ Add simple window stack, tracking view relation ship via parent member ◠│ Remove objsize member from struct commit ◠│ Make Enter in the pager view always scroll ◠│ Record builds with dirty working tree by appending -dirty to the version ◠│ Remove trailing space; make cursed global static ◠│ Make -h and --help options ouput a help message ◠│ Bind '-' to PageUp; raises Mutt compatibility ◠│ Streamline version displaying and show built date ◠│ Make Enter in the main view switch to the split diff view ◠│ Add preliminary support for UTF-8 handling in the main view ◠│ Add close view request; bound to 'q' by default ◠│ Bind quit to 'Q' ◠│ Add -Werror to the cc debug flags ◠│ Pressing Enter in the diff view will now scroll it one line down ◠│ Rearrange things in the start of the viewer ◠│ Bind 'b' to Page Up, and Space to Page Down ◠│ Make sense of the comment about view->win height ◠│ Group display functions at the bottom ◠│ Redraw the whole display after toggling line number ◠│ Minor documentation updates │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ Fix warnings ◠│ Fix linking with --as-needed ld(1) option. ◠│ Minor doc and coding style fixes ◠│ Mark quit() and die() __noreturn ◠│ Make some strings "const" │ â—─╮ Merge with master â—─│─╯ tig version 0.3 │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ Minor documentation fixes; nothing from git-ls-remote means no git repo │ â— Sync docs │ â—─╮ Merge with master â—─│─╯ After seeing Linus' mail further improve revision specification section ◠│ Make the last variables static │ â— Fix File history section │ â—─╮ Merge with master â—─│─╯ Fix File history section number │ â— Update generated docs │ â—─╮ Merge with master â—─│─╯ Minor fixes │ â—─╮ Merge with master â—─│─╯ Only tig(1) is required by the help view │ â—─╮ Merge with master â—─│─╯ Only set VERSION to git-describe if .git is available │ â— Put documentation in a branch named release │ â—─╮ Merge with master â—─│─╯ Put documentation in a branch named release │ â— Add README.html │ â—─╮ Merge with master â—─│─╯ You gotta have a README file │ â— Create documentation branch â—─╯ Document file history rev limiting â— ... and yet more doc ups â— Check spelling â— Further improve documentation â— Lots of documentation improvements â— Improve documentation; optional tab size; move up/down + enter req; fix wrapping â— Only save commit tag refs; move line type info to view->ops; switch silently â— Fix file mode diff header handling; fix repo refs â— Add support for repository references â— Oops, no need to #include â— Try to improve report("") â— Implement support for terminal resizing â— Take commands from the environment â— Use --topo-order; fclose(stdin); space cleanup â— Fix title in split view; scroll/move reporting; ... â— Fix scrolling when current line is outside of splitted view â— Support for show â— Improve documentation â— Fix ref navigation bug; make internal command line work; cleanups â— Add support for pager view â— Add support for git log / git diff options â— Lots of small improvements â— Meep â— Lots of cleanups and improvements; speed up attr access â— Heavy renaming and code recomposition â— Lots of minor UI improvements â— Lot's of cleanups and fixes â— TODO's and TODON'T's ... â— Primitive option parsing; rendering generalizations â— Cleanup line matching â— Started on the main view â— Sync. Home/End seems to finally work. â— Possible simplification â— The pager is begining to work. :) â— Exploration â— Misc cleanups â— Misc cleanups and improvements â— Show root; blast raw diff lines â— No binaries â— Half working prototype â—Ž Initial commit tig-2.0.2/test/test-graph-samples/tig-all.in000066400000000000000000000303121233303337700206610ustar00rootroot00000000000000commit 9ba5aa1e29924175e52b79e8b255f1903aa73833 85e82d060ce75a840f84cd53259413461633aaa5 210fe58ba8f4aeb35ddfdae052cf8f0fc4f54ff2 tree fc9515a1d77204f13690e8a646ab56ec87466736 parent 85e82d060ce75a840f84cd53259413461633aaa5 parent 210fe58ba8f4aeb35ddfdae052cf8f0fc4f54ff2 author Benjamin Bergman 1383861571 -0600 committer Benjamin Bergman 1383861571 -0600 On fix-graph: debug printout stuff commit 210fe58ba8f4aeb35ddfdae052cf8f0fc4f54ff2 85e82d060ce75a840f84cd53259413461633aaa5 tree 0751a22a3cfde6d0c3fad0910c77664b0e9dfd1c parent 85e82d060ce75a840f84cd53259413461633aaa5 author Benjamin Bergman 1383861571 -0600 committer Benjamin Bergman 1383861571 -0600 index on fix-graph: 85e82d0 One more fix commit 85e82d060ce75a840f84cd53259413461633aaa5 3c5321af10963dedb71361173e17fea5fddbcd09 tree 0751a22a3cfde6d0c3fad0910c77664b0e9dfd1c parent 3c5321af10963dedb71361173e17fea5fddbcd09 author Benjamin Bergman 1382970000 -0500 committer Benjamin Bergman 1382970000 -0500 One more fix commit 3c5321af10963dedb71361173e17fea5fddbcd09 fa53fb34d6bed0444dfc65254dfccf5ec27fb5a8 tree 91c965c280d9b6faa89ce6fe648d8676e8233b2a parent fa53fb34d6bed0444dfc65254dfccf5ec27fb5a8 author Benjamin Bergman 1382968508 -0500 committer Benjamin Bergman 1382968508 -0500 Another fix commit fa53fb34d6bed0444dfc65254dfccf5ec27fb5a8 48a6ca25bd8c018117f9cd752cd8acf962d90060 tree badae0344d4e7e59357a2905442aa2ed04505dbf parent 48a6ca25bd8c018117f9cd752cd8acf962d90060 author Benjamin Bergman 1382935317 -0500 committer Benjamin Bergman 1382935317 -0500 Use pre-generated next row commit 48a6ca25bd8c018117f9cd752cd8acf962d90060 5a0a8ed21bcf5be036fe66479f2be89d32e4c214 tree 0579c24b661ed3863bbcc1c6cddafd0a13b9d7fd parent 5a0a8ed21bcf5be036fe66479f2be89d32e4c214 author Benjamin Bergman 1382933509 -0500 committer Benjamin Bergman 1382933509 -0500 Add function to pre-generate next row commit 5a0a8ed21bcf5be036fe66479f2be89d32e4c214 2696d90c257f97226447bac12dfa9ec266b1221d tree 01d6e82f68c014dd7bf9f3539b7738531ee005cb parent 2696d90c257f97226447bac12dfa9ec266b1221d author Benjamin Bergman 1382906024 -0500 committer Benjamin Bergman 1382906024 -0500 A little more broken to make it better commit 2696d90c257f97226447bac12dfa9ec266b1221d c445378c6aef243a63c805bb1da7afba9821dd07 tree 3e8dc50a65b9e3a95a128aa65b6a804e2b479e57 parent c445378c6aef243a63c805bb1da7afba9821dd07 author Benjamin Bergman 1382852608 -0500 committer Benjamin Bergman 1382852608 -0500 Always insert extra columns at the end commit c445378c6aef243a63c805bb1da7afba9821dd07 02cb3450c52aff5f9daafd479e97a52d01edaf2f tree ac394f2b65aee9be50ce61eab2c9db6865640777 parent 02cb3450c52aff5f9daafd479e97a52d01edaf2f author Benjamin Bergman 1382772930 -0500 committer Benjamin Bergman 1382772930 -0500 Works for first test case commit 02cb3450c52aff5f9daafd479e97a52d01edaf2f 05927494e74b8ddcebfe9163338bf1e6ddb899d5 tree 0f0513ed6df99f7db29b7b821660636af9f5410b parent 05927494e74b8ddcebfe9163338bf1e6ddb899d5 author Benjamin Bergman 1382768031 -0500 committer Benjamin Bergman 1382768031 -0500 Better, but missing some lines still commit 05927494e74b8ddcebfe9163338bf1e6ddb899d5 bc911786d75680d0fa28ac81c846775f6a7c894f tree e83f2f19de9422f1a4ba24e406e7daf43b3781bd parent bc911786d75680d0fa28ac81c846775f6a7c894f author Benjamin Bergman 1382764756 -0500 committer Benjamin Bergman 1382764756 -0500 A little better at the top, a little worse at the bottom commit bc911786d75680d0fa28ac81c846775f6a7c894f 7088a1081ba353bd0bb8f3d38426d24861c694c2 tree 10db6fa2507bd3fa59b3cb6f9701fa48a453d968 parent 7088a1081ba353bd0bb8f3d38426d24861c694c2 author Jonas Fonseca 1382580247 -0700 committer Jonas Fonseca 1382580247 -0700 Fix reloading diffs of staged and unstaged changes commit 7088a1081ba353bd0bb8f3d38426d24861c694c2 7c949baaf493b812702ec78b087d2540e8827bf3 tree 19bbb16e4b01bcc7de1412563ca3bf3f5b1c819d parent 7c949baaf493b812702ec78b087d2540e8827bf3 author Jonas Fonseca 1382578049 -0700 committer Jonas Fonseca 1382578049 -0700 Fix map size assertion in parse_enum commit fc602a04798a0f1fcb6aa71e9613b0c0acbb7e2f 2be80ae3bc7f056ad88ba71acc47ab99e9dd0166 tree 82e24ccb2d2cc98fe9e6ebd3464a9ebc31af9863 parent 2be80ae3bc7f056ad88ba71acc47ab99e9dd0166 author Jonas Fonseca 1377865223 -0400 committer Jonas Fonseca 1382248987 -0400 Move view draw methods to draw module commit 2be80ae3bc7f056ad88ba71acc47ab99e9dd0166 2a45940e80b5326a5fc1b7bbb7d8e1719cf5634d tree f2a5888a534af6e521dfd1f9d4820d7a363b08ed parent 2a45940e80b5326a5fc1b7bbb7d8e1719cf5634d author Jonas Fonseca 1377825820 -0400 committer Jonas Fonseca 1382248987 -0400 Move option handling code to options.c commit 2a45940e80b5326a5fc1b7bbb7d8e1719cf5634d 5fc7c50410bcc61bc0dc89a8e2c354444e0e3fad tree deafe0b382f3cfb977dc659366648ab5fde465f4 parent 5fc7c50410bcc61bc0dc89a8e2c354444e0e3fad author Jonas Fonseca 1377823028 -0400 committer Jonas Fonseca 1382248987 -0400 Move option declarations to separate files commit 5fc7c50410bcc61bc0dc89a8e2c354444e0e3fad 7ecc9fb460c833fa6f669ef2e81b804441b00b95 tree 1e2eaf1d68d0663d9018c38b960f8b55fd7b6399 parent 7ecc9fb460c833fa6f669ef2e81b804441b00b95 author Jonas Fonseca 1377822278 -0400 committer Jonas Fonseca 1382248987 -0400 Use symbols to track diff and log argument formatting commit 7ecc9fb460c833fa6f669ef2e81b804441b00b95 aa2eabbb7879cabe87b2fa22d186848ebf51497d tree d83e96ffc715863c88b2906b1256040fcd74c206 parent aa2eabbb7879cabe87b2fa22d186848ebf51497d author Jonas Fonseca 1377821969 -0400 committer Jonas Fonseca 1382248986 -0400 Group environment-based options commit aa2eabbb7879cabe87b2fa22d186848ebf51497d 951666702f8705388fc3b980ce09ad4be069fe30 tree b9bae82e2fcacff2c65a6d8ca0ac18abf2d4b1b5 parent 951666702f8705388fc3b980ce09ad4be069fe30 author Jonas Fonseca 1378434482 -0400 committer Jonas Fonseca 1382248986 -0400 Move refs helpers to refs module commit 951666702f8705388fc3b980ce09ad4be069fe30 d9c8a7473f3c81957316998910305b8bc346ee89 tree 2390627cd8caf71626ef73c602338479ad33db00 parent d9c8a7473f3c81957316998910305b8bc346ee89 author Jonas Fonseca 1377821898 -0400 committer Jonas Fonseca 1382248986 -0400 Move repository information to repo.[ch] commit d9c8a7473f3c81957316998910305b8bc346ee89 c531bcde787601952c018551f27f27a4d07afb24 tree 5de054e17653f35c549d3d0f422c928f63a82264 parent c531bcde787601952c018551f27f27a4d07afb24 author Jonas Fonseca 1377735198 -0400 committer Jonas Fonseca 1382248986 -0400 Add tool to generate doc from data structures commit c531bcde787601952c018551f27f27a4d07afb24 f0161de385a0f3240d0a7d11c7ff582a83759942 tree 92b1bbcf2eb25fd558d5cad43f22c2090e9d455a parent f0161de385a0f3240d0a7d11c7ff582a83759942 author Jonas Fonseca 1377609285 -0400 committer Jonas Fonseca 1382248986 -0400 Move view declarations to view.h commit f0161de385a0f3240d0a7d11c7ff582a83759942 9abb2ac9aa375f0794ee84a5d258128f1258dd0b tree 5e0f47015f82a8f48db7c88dffd587c93b5fb239 parent 9abb2ac9aa375f0794ee84a5d258128f1258dd0b author Jonas Fonseca 1377609022 -0400 committer Jonas Fonseca 1382248986 -0400 Move keybinding and run requests to keys.[ch] commit 9abb2ac9aa375f0794ee84a5d258128f1258dd0b 31331173eadd9efaba2f7044e4e141127ad98ee9 tree e6c0d0f4b379efa1ffc8bc0aabcef7308ba4521c parent 31331173eadd9efaba2f7044e4e141127ad98ee9 author Jonas Fonseca 1379026390 -0400 committer Jonas Fonseca 1382248985 -0400 Move line and color code to line.c commit 31331173eadd9efaba2f7044e4e141127ad98ee9 d1cc009c134f143befffcff148ff33e12f3fc06b tree a596ed1293fc493f8005f42e2a4db7ab13b69900 parent d1cc009c134f143befffcff148ff33e12f3fc06b author Jonas Fonseca 1349143875 -0400 committer Jonas Fonseca 1382248985 -0400 Move line definitions to line.h commit d1cc009c134f143befffcff148ff33e12f3fc06b 1569d15bf38d0a15683b5a73c51763871225e9b9 tree af32e5ba3a47a44893a8eb631cb033174e632089 parent 1569d15bf38d0a15683b5a73c51763871225e9b9 author Jonas Fonseca 1377607388 -0400 committer Jonas Fonseca 1382248985 -0400 Move request handling code to request.c commit 1569d15bf38d0a15683b5a73c51763871225e9b9 a48b0f5dd687202110498d1775edcc6a3bdf6c72 tree 14afa84fea795fac6beec02db5b1953c8ea98269 parent a48b0f5dd687202110498d1775edcc6a3bdf6c72 author Jonas Fonseca 1377607333 -0400 committer Jonas Fonseca 1382248985 -0400 Move request definitions to request.h commit a48b0f5dd687202110498d1775edcc6a3bdf6c72 0db5d56c7a0c1e74a481387dd22e0da603be902f tree 929ddd7ba53bb299fe99ef9ce5ee43c9650ab42e parent 0db5d56c7a0c1e74a481387dd22e0da603be902f author Jonas Fonseca 1349143750 -0400 committer Jonas Fonseca 1382248985 -0400 Move view macro to tig.h commit 0db5d56c7a0c1e74a481387dd22e0da603be902f 7c949baaf493b812702ec78b087d2540e8827bf3 tree 29917131dafd0d1041c80141b7396e28e28a648f parent 7c949baaf493b812702ec78b087d2540e8827bf3 author Jonas Fonseca 1377864465 -0400 committer Jonas Fonseca 1382248985 -0400 Move enums and various utility methods to util module commit 7c949baaf493b812702ec78b087d2540e8827bf3 536d565fcd789a2ea9dda43b3ae989e9d651af55 tree 93d3104b94f044a1c7772ca60a63ef4b5ee83b66 parent 536d565fcd789a2ea9dda43b3ae989e9d651af55 author Jonas Fonseca 1382226054 -0400 committer Jonas Fonseca 1382248932 -0400 Refactor defined enum maps to contain size information The existing struct enum_map is renamed to enum_map_entry. commit 536d565fcd789a2ea9dda43b3ae989e9d651af55 57787a3668d28808764dd1525a1157e3564d9b46 tree a679b29f2740f740b826d89f82c049b04bc99cb0 parent 57787a3668d28808764dd1525a1157e3564d9b46 author Jonas Fonseca 1382229219 -0400 committer Jonas Fonseca 1382248932 -0400 Detect renames when generating the announcement commit 57787a3668d28808764dd1525a1157e3564d9b46 0d68e41d80c642af766fe5adb320a9cc204f56dc tree be39dfa48d4c43f7a0667700b230d8fe312e0c96 parent 0d68e41d80c642af766fe5adb320a9cc204f56dc author Jonas Fonseca 1382225913 -0400 committer Jonas Fonseca 1382225929 -0400 Fix warning about uninitialized lineno variable commit 0d68e41d80c642af766fe5adb320a9cc204f56dc c14792afc41efcb1126ca0ab896eac6d1a12e580 tree 5879870a174f110d6ee8facae1e92ff032ccd048 parent c14792afc41efcb1126ca0ab896eac6d1a12e580 author Jonas Fonseca 1382133286 -0400 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. commit c14792afc41efcb1126ca0ab896eac6d1a12e580 bf740aa9b7afc29a05f2bc6a8b44035e639fda0e tree 838f1135838567884b2c6c02a428542c6e3c1995 parent bf740aa9b7afc29a05f2bc6a8b44035e639fda0e author Jonas Fonseca 1381192201 -0400 committer Jonas Fonseca 1381192201 -0400 Fix clean rule to remove DocBook XML files in doc/ commit bf740aa9b7afc29a05f2bc6a8b44035e639fda0e f9399028a8ecdd7342bc977b7334fc76a902d3a7 tree 7d2442e3ecdba05ef9746ded3d8e38ff299bb89e parent f9399028a8ecdd7342bc977b7334fc76a902d3a7 author Jonas Fonseca 1381189194 -0400 committer Jonas Fonseca 1381189194 -0400 Fix and improve inter-document linking tig-2.0.2/test/test-graph-samples/tig-all.out000066400000000000000000000031241233303337700210630ustar00rootroot00000000000000â—─╮ On fix-graph: debug printout stuff │ â— index on fix-graph: 85e82d0 One more fix â—─╯ One more fix â— Another fix â— Use pre-generated next row â— Add function to pre-generate next row â— A little more broken to make it better â— Always insert extra columns at the end â— Works for first test case â— Better, but missing some lines still â— A little better at the top, a little worse at the bottom â— Fix reloading diffs of staged and unstaged changes â— Fix map size assertion in parse_enum │ â— Move view draw methods to draw module │ â— Move option handling code to options.c │ â— Move option declarations to separate files │ â— Use symbols to track diff and log argument formatting │ â— Group environment-based options │ â— Move refs helpers to refs module │ â— Move repository information to repo.[ch] │ â— Add tool to generate doc from data structures │ â— Move view declarations to view.h │ â— Move keybinding and run requests to keys.[ch] │ â— Move line and color code to line.c │ â— Move line definitions to line.h │ â— Move request handling code to request.c │ â— Move request definitions to request.h │ â— Move view macro to tig.h │ â— Move enums and various utility methods to util module â—─╯ Refactor defined enum maps to contain size information â— Detect renames when generating the announcement â— Fix warning about uninitialized lineno variable â— Set the commit reference when opening the blame view from the blob view â— Fix clean rule to remove DocBook XML files in doc/ â— Fix and improve inter-document linking tig-2.0.2/test/test-graph-samples/tig.in000066400000000000000000000023421233303337700201150ustar00rootroot00000000000000commit i h Do not include merges in the announcement's change log commit h g d Merge pull request #81 from esc/fix/reading_git_colors_256 commit g f e Merge pull request #80 from esc/fix/option_name_mismatch commit f c Reenable copy/rename detection in the status view commit e c fix: the manpage says 'read-git-colors' commit d c fix: reading git colors in rang 0 255 commit c b Remove enforced diff move/copy detection commit b a Optionally show commit IDs for branches and tree entries * d10dcd8 (HEAD) Do not include merges in the announcement's change log * 7cdab00 Merge pull request #81 from esc/fix/reading_git_colors_256 |\ | * 54e8c4d fix: reading git colors in rang 0 255 * | 7368b5b Merge pull request #80 from esc/fix/option_name_mismatch |\ \ | * | 0431cd2 fix: the manpage says 'read-git-colors' | |/ * | 82458a4 Reenable copy/rename detection in the status view |/ * 6d276a6 Remove enforced diff move/copy detection * c5aaa84 Optionally show commit IDs for branches and tree entries tig-2.0.2/test/test-graph-samples/tig.out000066400000000000000000000007431233303337700203210ustar00rootroot00000000000000â— Do not include merges in the announcement's change log â—─╮ Merge pull request #81 from esc/fix/reading_git_colors_256 â—─│─╮ Merge pull request #80 from esc/fix/option_name_mismatch ◠│ │ Reenable copy/rename detection in the status view │ │ â— fix: the manpage says 'read-git-colors' │ ◠│ fix: reading git colors in rang 0 255 â—─┴─╯ Remove enforced diff move/copy detection â— Optionally show commit IDs for branches and tree entries tig-2.0.2/test/test-graph.c000066400000000000000000000046371233303337700155150ustar00rootroot00000000000000/* 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. */ #include "tig/tig.h" #include "tig/util.h" #include "tig/io.h" #include "tig/graph.h" #define USAGE \ "test-graph [--ascii]\n" \ "\n" \ "Example usage:\n" \ " # git log --pretty=raw --parents | ./test-graph\n" \ " # git log --pretty=raw --parents | ./test-graph --ascii" struct commit { char id[SIZEOF_REV]; struct graph_canvas canvas; }; DEFINE_ALLOCATOR(realloc_commits, struct commit *, 8) int main(int argc, const char *argv[]) { struct graph graph = { }; struct io io = { }; struct buffer buf; struct commit **commits = NULL; size_t ncommits = 0; struct commit *commit = NULL; bool is_boundary; const char *(*graph_fn)(struct graph_symbol *) = graph_symbol_to_utf8; if (argc > 1 && !strcmp(argv[1], "--ascii")) graph_fn = graph_symbol_to_ascii; if (isatty(STDIN_FILENO)) { die(USAGE); } if (!io_open(&io, "%s", "")) die("IO"); while (!io_eof(&io)) { bool can_read = io_can_read(&io, TRUE); for (; io_get(&io, &buf, '\n', can_read); can_read = FALSE) { char *line = buf.data; if (!prefixcmp(line, "commit ")) { line += STRING_SIZE("commit "); is_boundary = *line == '-'; if (is_boundary) line++; if (!realloc_commits(&commits, ncommits, 1)) die("Commits"); commit = calloc(1, sizeof(*commit)); if (!commit) die("Commit"); commits[ncommits++] = commit; string_copy_rev(commit->id, line); graph_add_commit(&graph, &commit->canvas, commit->id, line, is_boundary); graph_render_parents(&graph); } else if (!prefixcmp(line, " ")) { int i; if (!commit) continue; for (i = 0; i < commit->canvas.size; i++) { struct graph_symbol *symbol = &commit->canvas.symbols[i]; const char *chars = graph_fn(symbol); printf("%s", chars + (i == 0)); } printf("%s\n", line + 3); commit = NULL; } } } return 0; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/test/unit-test-graph.sh000077500000000000000000000006551233303337700166610ustar00rootroot00000000000000#!/bin/bash result=0 for in_file in test/test-graph-samples/*.in do out_file="${in_file%.*}.out" diff_output=$(diff -C 1 "$out_file" <(cat $in_file | test/test-graph 2> /dev/null)) if [ $? == 0 ] then echo "ok - Graph generated by $in_file matches $out_file" else echo "not ok - Graph generated by $in_file does not match $out_file" echo "$diff_output" | sed "s/^/# /" result=$(($result+1)) fi done exit $result tig-2.0.2/tig.1000066400000000000000000000162321233303337700131530ustar00rootroot00000000000000'\" t .\" Title: tig .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 08/10/2013 .\" Manual: Tig Manual .\" Source: Tig 1.2 .\" Language: English .\" .TH "TIG" "1" "08/10/2013" "Tig 1\&.2" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tig \- text\-mode interface for git .SH "SYNOPSIS" .sp .nf tig [options] [revisions] [\-\-] [paths] tig log [options] [revisions] [\-\-] [paths] tig show [options] [revisions] [\-\-] [paths] tig blame [options] [rev] [\-\-] path tig stash tig status tig < [git command output] .fi .sp .SH "DESCRIPTION" .sp Browse changes in a git repository\&. Additionally, tig(1) can also act as a pager for output of various git commands\&. .sp When browsing repositories, tig(1) uses the underlying git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff\&. .sp Using tig(1) as a pager, it will display input from stdin and try to colorize it\&. .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 following options will be passed untouched to the underlying git command\&. .PP show .RS 4 Open diff view using the given git\-show(1) options\&. .RE .PP blame .RS 4 Show given file annotated by commits\&. Takes zero or more git\-blame(1) options\&. Optionally limited from given revision\&. .RE .PP status .RS 4 Start up in status view\&. .RE .PP log .RS 4 Start up in log view, displaying git\-log(1) output\&. .RE .PP + .RS 4 Show the first view with line visible and selected\&. .RE .PP \-v, \-\-version .RS 4 Show version and exit\&. .RE .PP \-h, \-\-help .RS 4 Show help message and exit\&. .RE .SH "EXAMPLES" .sp Display the current branch: .sp .if n \{\ .RS 4 .\} .nf $ tig .fi .if n \{\ .RE .\} .sp .sp Display one or more specific branches: .sp .if n \{\ .RS 4 .\} .nf $ tig test master .fi .if n \{\ .RE .\} .sp .sp Display all branches: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-all .fi .if n \{\ .RE .\} .sp .sp Display differences between two branches: .sp .if n \{\ .RS 4 .\} .nf $ tig test\&.\&.master .fi .if n \{\ .RE .\} .sp .sp Display changes for sub\-module versions: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-submodule .fi .if n \{\ .RE .\} .sp .sp Display changes for a single file: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\- README .fi .if n \{\ .RE .\} .sp .sp Display contents of the README file in a specific revision: .sp .if n \{\ .RS 4 .\} .nf $ tig show tig\-0\&.8:README .fi .if n \{\ .RE .\} .sp .sp Display revisions between two dates for a specific file: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-after="2004\-01\-01" \-\-before="2006\-05\-16" \-\- README .fi .if n \{\ .RE .\} .sp .sp Blame file with copy detection enabled: .sp .if n \{\ .RS 4 .\} .nf $ tig blame \-C README .fi .if n \{\ .RE .\} .sp .sp Display the list of stashes: .sp .if n \{\ .RS 4 .\} .nf $ tig stash .fi .if n \{\ .RE .\} .sp .SH "ENVIRONMENT VARIABLES" .sp In addition to environment variables used by git (e\&.g\&. GIT_DIR), tig defines the ones below\&. The command related environment variables have access to the internal state of tig via replacement variables, such as %(commit) and %(blob)\&. See \fBtigrc\fR(5) for a full list\&. .PP TIGRC_USER .RS 4 Path of the user configuration file (defaults to ~/\&.tigrc)\&. .RE .PP TIGRC_SYSTEM .RS 4 Path of the system wide configuration file (defaults to {sysconfdir}/tigrc)\&. .RE .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)\&. .RE .PP TIG_DIFF_OPTS .RS 4 The diff options to use in the diff view\&. The diff view uses git\-show(1) for formatting and always passes \-\-patch\-with\-stat\&. You may also set the diff\-options setting in your \fBtigrc\fR(5)\&. .RE .PP TIG_TRACE .RS 4 Path for trace file where information about git commands are logged\&. .RE .SH "FILES" .PP \fI~/\&.tigrc\fR .RS 4 User configuration file\&. See \fBtigrc\fR(5) for examples\&. .RE .PP \fI++SYSCONFDIR++/tigrc\fR .RS 4 System wide configuration file\&. .RE .PP \fI$GIT_DIR/config\fR, \*(Aq~/\&.gitconfig, \*(Aq++SYSCONFDIR++/etc/gitconfig .RS 4 Git configuration files\&. Read on start\-up with the help of git\-config(1)\&. .RE .SH "BUGS" .sp Bugs and feature requests can be reported using the issue tracker at \m[blue]\fBhttps://github\&.com/jonas/tig/issues\fR\m[] 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: \m[blue]\fBhttp://stackoverflow\&.com/questions/tagged/tig\fR\m[]\&. .SH "COPYRIGHT" .sp Copyright (c) 2006\-2012 Jonas Fonseca <\m[blue]\fBfonseca@diku\&.dk\fR\m[]\&\s-2\u[1]\d\s+2> .sp 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\&. .SH "SEE ALSO" .sp \fBtigrc\fR(5), \fBtigmanual\fR(7), git(7), gitk(1) .sp Online resources: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Homepage: \m[blue]\fBhttp://jonas\&.nitro\&.dk/tig/\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Manual: \m[blue]\fBhttp://jonas\&.nitro\&.dk/tig/manual\&.html\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Tarballs: \m[blue]\fBhttp://jonas\&.nitro\&.dk/tig/releases/\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Git URL: git://github\&.com/jonas/tig\&.git (master) or git://repo\&.or\&.cz/tig\&.git (mirror) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Gitweb: \m[blue]\fBhttp://repo\&.or\&.cz/w/tig\&.git\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Q&A: \m[blue]\fBhttp://stackoverflow\&.com/questions/tagged/tig\fR\m[] .RE .SH "NOTES" .IP " 1." 4 fonseca@diku.dk .RS 4 \%mailto:fonseca@diku.dk .RE tig-2.0.2/tig.1.html000066400000000000000000000530101233303337700141110ustar00rootroot00000000000000 tig(1)

SYNOPSIS

tig        [options] [revisions] [--] [paths]
tig log    [options] [revisions] [--] [paths]
tig show   [options] [revisions] [--] [paths]
tig blame  [options] [rev] [--] path
tig stash
tig status
tig <      [git command output]

DESCRIPTION

Browse changes in a git repository. Additionally, tig(1) can also act as a pager for output of various git commands.

When browsing repositories, tig(1) uses the underlying git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff.

Using tig(1) as a pager, it will display input from stdin and try to colorize it.

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 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 following options will be passed untouched to the underlying git command.

show

Open diff view using the given git-show(1) options.

blame

Show given file annotated by commits. Takes zero or more git-blame(1) options. Optionally limited from given revision.

status

Start up in status view.

log

Start up in log view, displaying git-log(1) output.

+<number>

Show the first view with line <number> visible and selected.

-v, --version

Show version and exit.

-h, --help

Show help message and exit.

EXAMPLES

Display the current branch:

$ tig

Display one or more specific branches:

$ tig test master

Display all branches:

$ tig --all

Display differences between two branches:

$ tig test..master

Display changes for sub-module versions:

$ tig --submodule

Display changes for a single file:

$ tig -- README

Display contents of the README file in a specific revision:

$ tig show tig-0.8:README

Display revisions between two dates for a specific file:

$ tig --after="2004-01-01" --before="2006-05-16" -- README

Blame file with copy detection enabled:

$ tig blame -C README

Display the list of stashes:

$ tig stash

ENVIRONMENT VARIABLES

In addition to environment variables used by git (e.g. GIT_DIR), tig defines the ones below. The command related environment variables have access to the internal state of tig via replacement variables, such as %(commit) and %(blob). See tigrc(5) for a full list.

TIGRC_USER

Path of the user configuration file (defaults to ~/.tigrc).

TIGRC_SYSTEM

Path of the system wide configuration file (defaults to {sysconfdir}/tigrc).

TIG_LS_REMOTE

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

TIG_DIFF_OPTS

The diff options to use in the diff view. The diff view uses git-show(1) for formatting and always passes --patch-with-stat. You may also set the diff-options setting in your tigrc(5).

TIG_TRACE

Path for trace file where information about git commands are logged.

FILES

~/.tigrc

User configuration file. See tigrc(5) for examples.

++SYSCONFDIR++/tigrc

System wide configuration file.

$GIT_DIR/config
'~/.gitconfig
'++SYSCONFDIR++/etc/gitconfig

Git configuration files. Read on start-up with the help of git-config(1).

BUGS

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.

Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>

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.

SEE ALSO

tigrc(5), tigmanual(7), git(7), gitk(1)

Online resources:


tig-2.0.2/tigmanual.7000066400000000000000000000565311233303337700143650ustar00rootroot00000000000000'\" t .\" Title: tigmanual .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 08/10/2013 .\" Manual: Tig Manual .\" Source: Tig 1.2 .\" Language: English .\" .TH "TIGMANUAL" "7" "08/10/2013" "Tig 1\&.2" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tigmanual \- text\-mode interface for git .SH "SYNOPSIS" .sp .nf tig [options] [revisions] [\-\-] [paths] tig show [options] [revisions] [\-\-] [paths] tig blame [options] [rev] [\-\-] path tig status tig < [git command output] .fi .sp .SH "DESCRIPTION" .sp This is the manual for tig, the ncurses\-based text\-mode interface for git\&. Tig allows you to browse changes in a git repository and can additionally act as a pager for output of various git commands\&. When used as a pager, it will display input from stdin and colorize it\&. .sp When browsing repositories, tig uses the underlying git commands to present the user with various views, such as summarized commit log and showing the commit with the log message, diffstat, and the diff\&. .SH "CALLING CONVENTIONS" .SS "Pager Mode" .sp If stdin is a pipe, any log or diff options will be ignored and the pager view will be opened loading data from stdin\&. The pager mode can be used for colorizing output from various git commands\&. .sp Example on how to colorize the output of git\-show(1): .sp .if n \{\ .RS 4 .\} .nf $ git show | tig .fi .if n \{\ .RE .\} .sp .SS "Git Command Options" .sp All git command options specified on the command line will be passed to the given command and all will be shell quoted before they are passed to the shell\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp If you specify options for the main view, you should not use the \-\-pretty option as this option will be set automatically to the format expected by the main view\&. .sp .5v .RE .sp Example on how to view a commit and show both author and committer information: .sp .if n \{\ .RS 4 .\} .nf $ tig show \-\-pretty=fuller .fi .if n \{\ .RE .\} .sp .sp See the section on specifying revisions for an introduction to revision options supported by the git commands\&. For details on specific git command options, refer to the man page of the command in question\&. .SH "THE VIEWER" .sp The display consists of a status window on the last line of the screen and one or more views\&. The default is to only show one view at a time but it is possible to split both the main and log view to also show the commit diff\&. .sp If you are in the log view and press \fIEnter\fR when the current line is a commit line, such as: .sp .if n \{\ .RS 4 .\} .nf commit 4d55caff4cc89335192f3e566004b4ceef572521 .fi .if n \{\ .RE .\} .sp .sp You will split the view so that the log view is displayed in the top window and the diff view in the bottom window\&. You can switch between the two views by pressing \fITab\fR\&. To maximize the log view again, simply press \fIl\fR\&. .SS "Views" .sp Various \fIviews\fR of a repository are presented\&. Each view is based on output from an external command, most often \fIgit log\fR, \fIgit diff\fR, or \fIgit show\fR\&. .PP The main view .RS 4 Is the default view, and it shows a one line summary of each commit in the chosen list of revisions\&. The summary includes commit date, author, and the first line of the log message\&. Additionally, any repository references, such as tags, will be shown\&. .RE .PP The log view .RS 4 Presents a more rich view of the revision log showing the whole log message and the diffstat\&. .RE .PP The diff view .RS 4 Shows either the diff of the current working tree, that is, what has changed since the last commit, or the commit diff complete with log message, diffstat and diff\&. .RE .PP The tree view .RS 4 Lists directory trees associated with the current revision allowing subdirectories to be descended or ascended and file blobs to be viewed\&. .RE .PP The blob view .RS 4 Displays the file content or "blob" of data associated with a file name\&. .RE .PP The blame view .RS 4 Displays the file content annotated or blamed by commits\&. .RE .PP The branch view .RS 4 Displays the branches in the repository\&. .RE .PP The status view .RS 4 Displays status of files in the working tree and allows changes to be staged/unstaged as well as adding of untracked files\&. .RE .PP The stage view .RS 4 Displays diff changes for staged or unstaged files being tracked or file content of untracked files\&. .RE .PP The stash view .RS 4 Displays the list of stashes in the repository\&. .RE .PP The pager view .RS 4 Is used for displaying both input from stdin and output from git commands entered in the internal prompt\&. .RE .PP The help view .RS 4 Displays a quick reference of key bindings\&. .RE .SS "Browsing State and User\-defined Commands" .sp The viewer keeps track of both what head and commit ID you are currently viewing\&. The commit ID will follow the cursor line and change every time you highlight a different commit\&. Whenever you reopen the diff view it will be reloaded, if the commit ID changed\&. The head ID is used when opening the main and log view to indicate from what revision to show history\&. .sp Some of the commands used or provided by tig can be configured\&. This goes for some of the environment variables as well as the external commands\&. These user\-defined commands can use arguments that refer to the current browsing state by using one of the following variables\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&Browsing state variables .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp %(head) T}:T{ .sp The currently viewed \fIhead\fR ID\&. Defaults to HEAD T} T{ .sp %(commit) T}:T{ .sp The currently selected commit ID\&. T} T{ .sp %(blob) T}:T{ .sp The currently selected blob ID\&. T} T{ .sp %(branch) T}:T{ .sp The currently selected branch name\&. T} T{ .sp %(stash) T}:T{ .sp The currently selected stash name\&. T} T{ .sp %(directory) T}:T{ .sp The current directory path in the tree view; empty for the root directory\&. T} T{ .sp %(file) T}:T{ .sp The currently selected file\&. T} T{ .sp %(ref) T}:T{ .sp The reference given to blame or HEAD if undefined\&. T} T{ .sp %(revargs) T}:T{ .sp The revision arguments passed on the command line\&. T} T{ .sp %(fileargs) T}:T{ .sp The file arguments passed on the command line\&. T} T{ .sp %(diffargs) T}:T{ .sp The diff options passed on the command line\&. T} T{ .sp %(prompt) T}:T{ .sp Prompt for the argument value\&. T} .TE .sp 1 .sp Example user\-defined commands: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Allow to amend the last commit: .sp .if n \{\ .RS 4 .\} .nf bind generic + !git commit \-\-amend .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Copy commit ID to clipboard: .sp .if n \{\ .RS 4 .\} .nf bind generic 9 !@sh \-c "echo \-n %(commit) | xclip \-selection c" .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Add/edit notes for the current commit used during a review: .sp .if n \{\ .RS 4 .\} .nf bind generic T !git notes edit %(commit) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Enter git\(cqs interactive add for fine\-grained staging of file content: .sp .if n \{\ .RS 4 .\} .nf bind generic I !git add \-i %(file) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Rebase current branch on top of the selected branch: .sp .if n \{\ .RS 4 .\} .nf bind branch 3 !git rebase \-i %(branch) .fi .if n \{\ .RE .\} .RE .SS "Title Windows" .sp Each view has a title window which shows the name of the view, current commit ID if available, and where the view is positioned: .sp .if n \{\ .RS 4 .\} .nf [main] c622eefaa485995320bc743431bae0d497b1d875 \- commit 1 of 61 (1%) .fi .if n \{\ .RE .\} .sp .sp By default, the title of the current view is highlighted using bold font\&. For long loading views (taking over 3 seconds) the time since loading started will be appended: .sp .if n \{\ .RS 4 .\} .nf [main] 77d9e40fbcea3238015aea403e06f61542df9a31 \- commit 1 of 779 (0%) 5s .fi .if n \{\ .RE .\} .sp .SH "ENVIRONMENT VARIABLES" .sp 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: .PP TIGRC_USER .RS 4 Path of the user configuration file\&. .RE .PP TIGRC_SYSTEM .RS 4 Path of the system wide configuration file\&. .RE .SS "Repository References" .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 .if n \{\ .RS 4 .\} .nf 2006\-03\-26 19:42 Petr Baudis | [cogito\-0\&.17\&.1] Cogito 0\&.17\&.1 .fi .if n \{\ .RE .\} .sp .sp If you want to limit what branches are shown, say only show branches named master or those which start with the jf/ prefix, you can do it by setting the following variable: .sp .if n \{\ .RS 4 .\} .nf $ TIG_LS_REMOTE="git ls\-remote \&. master jf/*" tig .fi .if n \{\ .RE .\} .sp .sp Or set the variable permanently in your environment\&. .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: .RE .sp .if n \{\ .RS 4 .\} .nf git ls\-remote \&. .fi .if n \{\ .RE .\} .sp .SS "Diff options" .sp 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: .sp .if n \{\ .RS 4 .\} .nf $ TIG_DIFF_OPTS="\-\-relative\-date" tig .fi .if n \{\ .RE .\} .sp .sp Or set the variable permanently in your environment\&. .SH "DEFAULT KEYBINDINGS" .sp Below the default key bindings are shown\&. .SS "View Switching" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp m T}:T{ .sp Switch to main view\&. T} T{ .sp d T}:T{ .sp Switch to diff view\&. T} T{ .sp l T}:T{ .sp Switch to log view\&. T} T{ .sp p T}:T{ .sp Switch to pager view\&. T} T{ .sp t T}:T{ .sp Switch to (directory) tree view\&. T} T{ .sp f T}:T{ .sp Switch to (file) blob view\&. T} T{ .sp B T}:T{ .sp Switch to blame view\&. T} T{ .sp H T}:T{ .sp Switch to branch view\&. T} T{ .sp y T}:T{ .sp Switch to stash view\&. T} T{ .sp h T}:T{ .sp Switch to help view T} T{ .sp S T}:T{ .sp Switch to status view T} T{ .sp c T}:T{ .sp Switch to stage view T} .TE .sp 1 .SS "View Manipulation" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp q T}:T{ .sp Close view, if multiple views are open it will jump back to the previous view in the view stack\&. If it is the last open view it will quit\&. Use \fIQ\fR to quit all views at once\&. T} T{ .sp Enter T}:T{ .sp This key is "context sensitive" depending on what view you are currently in\&. When in log view on a commit line or in the main view, split the view and show the commit diff\&. In the diff view pressing Enter will simply scroll the view one line down\&. T} T{ .sp Tab T}:T{ .sp Switch to next view\&. T} T{ .sp R T}:T{ .sp Reload and refresh the current view\&. T} T{ .sp O T}:T{ .sp Maximize the current view to fill the whole display\&. T} T{ .sp 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\&. T} T{ .sp Down T}:T{ .sp Similar to \fIUp\fR but will move down\&. T} T{ .sp , T}:T{ .sp 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 commit\&. For merges the parent is queried\&. T} .TE .sp 1 .SS "View Specific Actions" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp u T}:T{ .sp Update status of file\&. In the status view, this allows you to add an untracked file or stage changes to a file for next commit (similar to running git\-add )\&. In the stage view, when pressing this on a diff chunk line stages only that chunk for next commit, when not on a diff chunk line all changes in the displayed diff are staged\&. T} T{ .sp M T}:T{ .sp 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)\&. T} T{ .sp ! T}:T{ .sp Checkout file with unstaged changes\&. This will reset the file to contain the content it had at last commit\&. T} T{ .sp 1 T}:T{ .sp Stage single diff line\&. T} T{ .sp @ T}:T{ .sp Move to next chunk in the stage view\&. T} T{ .sp ] T}:T{ .sp Increase the diff context\&. T} T{ .sp [ T}:T{ .sp Decrease the diff context\&. T} .TE .sp 1 .SS "Cursor Navigation" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp k T}:T{ .sp Move cursor one line up\&. T} T{ .sp j T}:T{ .sp Move cursor one line down\&. T} T{ .sp PgUp,\-,a T}:T{ .sp Move cursor one page up\&. T} T{ .sp PgDown, Space T}:T{ .sp Move cursor one page down\&. T} T{ .sp End T}:T{ .sp Jump to last line\&. T} T{ .sp Home T}:T{ .sp Jump to first line\&. T} .TE .sp 1 .SS "Scrolling" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Insert T}:T{ .sp Scroll view one line up\&. T} T{ .sp Delete T}:T{ .sp Scroll view one line down\&. T} T{ .sp w T}:T{ .sp Scroll view one page up\&. T} T{ .sp s T}:T{ .sp Scroll view one page down\&. T} T{ .sp Left T}:T{ .sp Scroll view one column left\&. T} T{ .sp Right T}:T{ .sp Scroll view one column right\&. T} T{ .sp | T}:T{ .sp Scroll view to the first column\&. T} .TE .sp 1 .SS "Searching" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt. T{ .sp / T}:T{ .sp Search the view\&. Opens a prompt for entering search regexp to use\&. T} T{ .sp ? T}:T{ .sp Search backwards in the view\&. Also prompts for regexp\&. T} T{ .sp n T}:T{ .sp Find next match for the current search regexp\&. T} T{ .sp N T}:T{ .sp Find previous match for the current search regexp\&. T} .TE .sp 1 .SS "Misc" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Q T}:T{ .sp Quit\&. T} T{ .sp r T}:T{ .sp Redraw screen\&. T} T{ .sp z T}:T{ .sp Stop all background loading\&. This can be useful if you use tig in a repository with a long history without limiting the revision log\&. T} T{ .sp v T}:T{ .sp Show version\&. T} T{ .sp o T}:T{ .sp Open option menu T} T{ .sp \&. T}:T{ .sp Toggle line numbers on/off\&. T} T{ .sp D T}:T{ .sp Toggle date display on/off/short/relative/local\&. T} T{ .sp A T}:T{ .sp Toggle author display on/off/abbreviated/email/email user name\&. T} T{ .sp g T}:T{ .sp Toggle revision graph visualization on/off\&. T} T{ .sp ~ T}:T{ .sp Toggle (line) graphics mode T} T{ .sp F T}:T{ .sp Toggle reference display on/off (tag and branch names)\&. T} T{ .sp W T}:T{ .sp Toggle ignoring whitespace on/off for diffs T} T{ .sp X T}:T{ .sp Toggle commit ID display on/off T} T{ .sp % T}:T{ .sp Toggle file filtering in order to see the full diff instead of only the diff concerning the currently selected file\&. T} T{ .sp $ T}:T{ .sp Toggle highlighting of commit title overflow\&. T} T{ .sp : T}:T{ .sp Open prompt\&. This allows you to specify what command to run\&. T} T{ .sp e T}:T{ .sp Open file in editor\&. T} .TE .sp 1 .SS "Prompt" .TS tab(:); ltB ltB. T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt lt. T{ .sp : T}:T{ .sp Jump to the specific line number, e\&.g\&. :80\&. T} T{ .sp : T}:T{ .sp Jump to a specific commit, e\&.g\&. :2f12bcc\&. T} T{ .sp : T}:T{ .sp Execute the corresponding key binding, e\&.g\&. :q\&. T} T{ .sp :! T}:T{ .sp Execute a system command in a pager, e\&.g\&. :!git log \-p\&. T} T{ .sp : T}:T{ .sp Execute a tig command, e\&.g\&. :edit\&. T} .TE .sp 1 .SS "External Commands" .sp For more custom needs, external commands provide a way to easily execute a script or program\&. They are bound to keys and use information from the current browsing state, such as the current commit ID\&. Tig comes with the following built\-in external commands: .TS tab(:); ltB ltB ltB. T{ Keymap T}:T{ Key T}:T{ Action T} .T& lt lt lt lt lt lt lt lt lt. T{ .sp main T}:T{ .sp C T}:T{ .sp git cherry\-pick %(commit) T} T{ .sp status T}:T{ .sp C T}:T{ .sp git commit T} T{ .sp generic T}:T{ .sp G T}:T{ .sp git gc T} .TE .sp 1 .SH "REVISION SPECIFICATION" .sp This section describes various ways to specify what revisions to display or otherwise limit the view to\&. Tig does not itself parse the described revision options so refer to the relevant git man pages for further information\&. Relevant man pages besides git\-log(1) are git\-diff(1) and git\-rev\-list(1)\&. .sp You can tune the interaction with git by making use of the options explained in this section\&. For example, by configuring the environment variable described in the section on diff options\&. .SS "Limit by Path Name" .sp If you are interested only in those revisions that made changes to a specific file (or even several files) list the files like this: .sp .if n \{\ .RS 4 .\} .nf $ tig Makefile README .fi .if n \{\ .RE .\} .sp .sp To avoid ambiguity with tig\(cqs subcommands or repository references such as tag names, be sure to separate file names from other git options using "\-\-"\&. So if you have a file named \fIstatus\fR it will clash with the \fIstatus\fR subcommand, and thus you will have to use: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\- status .fi .if n \{\ .RE .\} .sp .SS "Limit by Date or Number" .sp To speed up interaction with git, you can limit the amount of commits to show both for the log and main view\&. Either limit by date using e\&.g\&. \-\-since=1\&.month or limit by the number of commits using \-n400\&. .sp If you are only interested in changes that happened between two dates you can use: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-after="May 5th" \-\-before="2006\-05\-16 15:44" .fi .if n \{\ .RE .\} .sp .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp If you want to avoid having to quote dates containing spaces you can use "\&." instead, e\&.g\&. \-\-after=May\&.5th\&. .sp .5v .RE .SS "Limiting by Commit Ranges" .sp Alternatively, commits can be limited to a specific range, such as "all commits between \fItag\-1\&.0\fR and \fItag\-2\&.0\fR"\&. For example: .sp .if n \{\ .RS 4 .\} .nf $ tig tag\-1\&.0\&.\&.tag\-2\&.0 .fi .if n \{\ .RE .\} .sp .sp This way of commit limiting makes it trivial to only browse the commits which haven\(cqt been pushed to a remote branch\&. Assuming \fIorigin\fR is your upstream remote branch, using: .sp .if n \{\ .RS 4 .\} .nf $ tig origin\&.\&.HEAD .fi .if n \{\ .RE .\} .sp .sp will list what will be pushed to the remote branch\&. Optionally, the ending \fIHEAD\fR can be left out since it is implied\&. .SS "Limiting by Reachability" .sp Git interprets the range specifier "tag\-1\&.0\&.\&.tag\-2\&.0" as "all commits reachable from \fItag\-2\&.0\fR but not from \fItag\-1\&.0\fR"\&. Where reachability refers to what commits are ancestors (or part of the history) of the branch or tagged revision in question\&. .sp If you prefer to specify which commit to preview in this way use the following: .sp .if n \{\ .RS 4 .\} .nf $ tig tag\-2\&.0 ^tag\-1\&.0 .fi .if n \{\ .RE .\} .sp .sp You can think of \fI^\fR as a negation operator\&. Using this alternate syntax, it is possible to further prune commits by specifying multiple branch cut offs\&. .SS "Combining Revisions Specification" .sp Revision options can to some degree be combined, which makes it possible to say "show at most 20 commits from within the last month that changed files under the Documentation/ directory\&." .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-since=1\&.month \-n20 \-\- Documentation/ .fi .if n \{\ .RE .\} .sp .SS "Examining All Repository References" .sp In some cases, it can be useful to query changes across all references in a repository\&. An example is to ask "did any line of development in this repository change a particular file within the last week"\&. This can be accomplished using: .sp .if n \{\ .RS 4 .\} .nf $ tig \-\-all \-\-since=1\&.week \-\- Makefile .fi .if n \{\ .RE .\} .sp .SH "BUGS" .sp Bugs and feature requests can be reported using the issue tracker at \m[blue]\fBhttps://github\&.com/jonas/tig/issues\fR\m[] 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: \m[blue]\fBhttp://stackoverflow\&.com/questions/tagged/tig\fR\m[]\&. .SH "COPYRIGHT" .sp Copyright (c) 2006\-2012 Jonas Fonseca <\m[blue]\fBfonseca@diku\&.dk\fR\m[]\&\s-2\u[1]\d\s+2> .sp 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\&. .SH "SEE ALSO" .sp Manpages: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBtig\fR(1) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBtigrc\fR(5) .RE .sp Online resources: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Homepage: \m[blue]\fBhttp://jonas\&.nitro\&.dk/tig/\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Manual: \m[blue]\fBhttp://jonas\&.nitro\&.dk/tig/manual\&.html\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Tarballs: \m[blue]\fBhttp://jonas\&.nitro\&.dk/tig/releases/\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Git URL: git://github\&.com/jonas/tig\&.git (master) or git://repo\&.or\&.cz/tig\&.git (mirror) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Gitweb: \m[blue]\fBhttp://repo\&.or\&.cz/w/tig\&.git\fR\m[] .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Q&A: \m[blue]\fBhttp://stackoverflow\&.com/questions/tagged/tig\fR\m[] .RE .SH "NOTES" .IP " 1." 4 fonseca@diku.dk .RS 4 \%mailto:fonseca@diku.dk .RE tig-2.0.2/tigrc000066400000000000000000000344141233303337700133430ustar00rootroot00000000000000# Tig default configuration # # Please see 'man tigrc' for a complete reference. # Settings # -------- # Most of these settings can be toggleable, either via the toggle-* # actions or via the option menu (bound to `o` by default). # View settings # # Supported column types and their options: # # author # - display (enum) [no|full|abbreviated|email|email-user] # : Show author information? # commit-title # - display (bool) : Show the commit title? # - graph (bool) : Show the commit revision graph? (main view only) # - refs (bool) : Show branches, tags and remotes? (main view only) # - overflow (boolint) : Highlight overflows? Default to 50 when enabled. # # date # - display (enum) [no|default|local|relative|short] # : Show dates? # file-name # - display (enum) [no|always|auto] : Show file names? # # file-size # - display (enum) [no|default|units] : Show file sizes? # # id # - display (bool) : Show commit/tree ID? # # line-number # - display (bool) : Show line numbers? # - interval (int) : Interval between line numbers # # mode # - display (bool) : Show file modes? # # status # - display (enum) [no|short|long] : Show status label? # # text # - display (bool) : Show text? # - commit-title-overflow (boolint) : Highlight overflow in log and diff view? # # All columns also support a width option to configure the max width of # the column. Use zero (the default value) to auto-size the column based # on the content. set blame-view = date:default author:full file-name:auto id:yes,color line-number:no,interval=5 text set grep-view = file-name:no line-number:yes,interval=1 text set main-view = line-number:no,interval=5 id:no date:default author:full commit-title:yes,graph,refs,overflow=no set refs-view = date:default author:full ref commit-title set stash-view = line-number:no,interval=5 id:no date:default author:full commit-title set status-view = line-number:no,interval=5 status:short file-name set tree-view = line-number:no,interval=5 mode author:full file-size date:default id:no file-name # Pager based views set pager-view = line-number:no,interval=5 text set stage-view = line-number:no,interval=5 text set log-view = line-number:no,interval=5 text set blob-view = line-number:no,interval=5 text set diff-view = line-number:no,interval=5 text:yes,commit-title-overflow=no # UI display settings set show-changes = yes # Show changes commits in the main view? set wrap-lines = no # Wrap long lines in pager views? set tab-size = 8 # Number of spaces to use when expanding tabs set line-graphics = default # Enum: ascii, default, utf-8 # Format reference names based on type. # - head : The current HEAD. # - tag : A signed tag. # - local-tag : An unsigned tag. # - remote : A remote. # - tracked-remote : The remote tracked by current HEAD. # - replace : A replaced reference. # - branch : Any other reference. # If no format is defined for `local-tag` then the one for `tag` is used. # Similarly, `remote` is used if no `tracked-remote` format exists. # Prefix with `hide:` to not show that reference type, e.g. `hide:remote`. # Expects a space separated list of format strings. set reference-format = [branch] {remote} ~replace~ # Settings controlling how content is read from Git set commit-order = default # Enum: default, topo, date, reverse (main) set status-untracked-dirs = yes # Show files in untracked directories? (status) 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` (diff) #set blame-options = -C -C -C # User-defined options for `tig blame` (blame) # 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 focus-child = yes # Move focus to child view when opened? set horizontal-scroll = 50% # Number of columns to scroll as % of width set split-view-height = 67% # Number of lines for bottom view as % of height set vertical-split = auto # Enum: horizontal, vertical, auto; Use auto to # switch to horizontal split when width allows it set editor-line-number = yes # Automatically pass line number to editor? Used # for opening file at specific line e.g. from a diff set mouse = no # Enable mouse support? set mouse-scroll = 3 # Number of lines to scroll via the mouse # User-defined commands # --------------------- # These commands allow to run shell commands directly from within Tig. # Unless otherwise specified, commands are run in the foreground with # their console output shown (as if '!' was specified). When multiple # command options are specified their behavior are combined, e.g. "? enter # Enter and open selected entry bind generic back # Go back to the previous view state bind generic next # Move to next bind generic next bind generic previous # Move to previous bind generic previous bind generic , parent # Move to parent bind generic view-next # Move focus to the next view bind generic R refresh # Reload and refresh view bind generic refresh 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 # View specific bind status u status-update # Stage/unstage changes in file bind status ! status-revert # Revert changes in file bind status M status-merge # Open git-mergetool(1) #bind status ??? :toggle status # Show short or long status labels bind stage u status-update # Stage/unstage current diff (c)hunk bind stage 1 stage-update-line # Stage/unstage current line 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 # Increase the diff context bind diff @ :/^@@ # Jump to next (c)hunk bind diff [ :toggle diff-context -1 bind diff ] :toggle diff-context +1 bind main G :toggle commit-title-graph # Toggle revision graph visualization bind main F :toggle commit-title-refs # Toggle reference display (tags/branches) # Cursor navigation bind generic k move-up bind generic j move-down 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 # Scrolling bind generic | scroll-first-col bind generic scroll-left bind generic scroll-right bind generic scroll-line-up bind generic scroll-line-up bind generic scroll-line-down bind generic scroll-line-down bind generic scroll-page-up bind generic scroll-page-down # Searching bind generic / search bind generic ? search-back bind generic n find-next bind generic N find-prev # Option manipulation bind generic o options # Open the options menu # Bindings for toggling settings bind generic I :toggle sort-order # Toggle ascending/descending sort order bind generic i :toggle sort-field # Toggle field to sort by bind generic :toggle line-number # Toggle line numbers bind generic D :toggle date # Toggle date display bind generic A :toggle author # Toggle author display bind generic ~ :toggle line-graphics # Toggle (line) graphics mode bind generic F :toggle file-name # Toggle file name display # bind generic ??? :toogle show-changes # Toggle local changes display in the main view bind generic W :toggle ignore-space # Toggle ignoring whitespace in diffs # bind generic ? :toggle commit-order # Toggle commit ordering bind generic X :toggle id # Toggle commit ID display bind generic $ :toggle commit-title-overflow # 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 # Toggle display of file in untracked directories # bind generic ??? :toggle vertical-split # Toggle vertical split bind generic % :toggle file-filter # Misc bind generic e edit # Open in editor bind generic : prompt # Open the prompt bind generic screen-redraw # Redraw the screen bind generic z stop-loading # Stop all loading views bind generic v show-version # Show Tig version # Colors # ------ # The colors in the UI can be customized. In addition to the colors used # for the UI you can also define new colors to use in the pager, blob, # diff, and stage views by placing the text to match for in quotes. # # Prefix the name of a view to set a color only for that view, e.g. # # color grep.file blue default # # As an example, this setting will to color Signed-off-by lines with a # yellow foreground color and use the default background color. # # color " Signed-off-by" yellow default # # Note the four leading spaces in the string to match. This is because # Git automatically indents commit messages by four spaces. color "diff --" yellow default color "@@" magenta default color "+" green default color " +" green default color "-" red default color " -" red default color "index " blue default color "old file mode " yellow default color "new file mode " yellow default color "deleted file mode " yellow default color "copy from " yellow default color "copy to " yellow default color "rename from " yellow default color "rename to " yellow default color "similarity " yellow default color "dissimilarity " yellow default color "diff-tree " blue default color "Author: " cyan default color "Commit: " magenta default color "Tagger: " magenta default color "Merge: " blue default color "Date: " yellow default color "AuthorDate: " yellow default color "CommitDate: " yellow default color "TaggerDate: " yellow default color "Refs: " red default color "Reflog: " red default color "Reflog message: " yellow default color "stash@{" magenta default color "commit " green default color "parent " blue default color "tree " blue default color "author " green default color "committer " magenta default color " Signed-off-by" yellow default color " Acked-by" yellow default color " Tested-by" yellow default color " Reviewed-by" yellow default color default default default normal color cursor white green bold color status green default color delimiter magenta default color date blue default color mode cyan default color id magenta default color overflow red default color header yellow default color section cyan default color directory yellow default color file default default color grep.file blue default color file-size default default color line-number cyan default color title-blur white blue color title-focus white blue bold color main-commit default default color main-tag magenta default bold color main-local-tag magenta default color main-remote yellow default color main-replace cyan default color main-tracked yellow default bold color main-ref cyan default color main-head cyan default bold color stat-none default default color stat-staged magenta default color stat-unstaged magenta default color stat-untracked magenta default color help-group blue default color help-action yellow default color diff-stat blue default color palette-0 magenta default color palette-1 yellow default color palette-2 cyan default color palette-3 green default color palette-4 default default color palette-5 white default color palette-6 red default color graph-commit blue default # Mappings for colors read from git configuration. # Set to "no" to disable. set git-colors = \ branch.current=main-head \ branch.local=main-ref \ branch.plain=main-ref \ branch.remote=main-remote \ \ diff.meta=diff-header \ diff.meta=diff-index \ diff.meta=diff-oldmode \ diff.meta=diff-newmode \ diff.frag=diff-chunk \ diff.old=diff-del \ diff.new=diff-add \ \ grep.filename=grep.file \ grep.linenumber=grep.line-number \ grep.separator=grep.delimiter \ \ status.branch=status.header \ status.added=stat-staged \ status.updated=stat-staged \ status.changed=stat-unstaged \ status.untracked=stat-untracked tig-2.0.2/tigrc.5000066400000000000000000000710251233303337700135050ustar00rootroot00000000000000'\" t .\" Title: tigrc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 08/10/2013 .\" Manual: Tig Manual .\" Source: Tig 1.2 .\" Language: English .\" .TH "TIGRC" "5" "08/10/2013" "Tig 1\&.2" "Tig Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" tigrc \- tig configuration file .SH "SYNOPSIS" .sp .nf \fBset\fR \fIvariable\fR \fB=\fR \fIvalue\fR \fBbind\fR \fIkeymap\fR \fIkey\fR \fIaction\fR \fBcolor\fR \fIarea\fR \fIfgcolor\fR \fIbgcolor\fR \fI[attributes]\fR \fBsource\fR \fIpath\fR .fi .sp .SH "DESCRIPTION" .sp You can permanently set an option by putting it in the ~/\&.tigrc file\&. The file consists of a series of \fIcommands\fR\&. Each line of the file may contain only one command\&. .sp 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\&. .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\&. .sp .if n \{\ .RS 4 .\} .nf [tig] show\-rev\-graph = true [tig "color"] cursor = yellow red bold [tig "bind"] generic = P parent .fi .if n \{\ .RE .\} .sp .sp In addition to tig\-specific options, the following git options are read from the git configuration: .PP \fIcolor\&.*\fR .RS 4 Colors for the various UI types\&. Can be completely disabled by setting \fIread\-git\-colors\fR\&. .RE .PP \fIcore\&.abbrev\fR .RS 4 The width of the commit ID\&. See also \fIid\-width\fR option\&. .RE .PP \fIcore\&.editor\fR .RS 4 The editor command\&. Can be overridden by setting GIT_EDITOR\&. .RE .PP \fIcore\&.worktree\fR .RS 4 The path to the root of the working tree\&. .RE .PP \fIgui\&.encoding\fR .RS 4 The encoding to use for displaying of file content\&. .RE .PP \fIi18n\&.commitencoding\fR .RS 4 The encoding used for commits\&. The default is UTF\-8\&. .RE .SH "SET COMMAND" .sp A few selective variables can be configured via the set command\&. The syntax is: .sp .if n \{\ .RS 4 .\} .nf \fBset\fR variables \fB=\fR value .fi .if n \{\ .RE .\} .sp .sp Examples: .sp .if n \{\ .RS 4 .\} .nf set show\-author = abbreviated # Show abbreviated author names\&. set show\-date = relative # Show relative commit date\&. set show\-rev\-graph = yes # Show revision graph? set show\-refs = yes # Show references? set commit\-order = topo # Order commits topologically set read\-git\-colors = no # Do not read git\*(Aqs color settings\&. set show\-line\-numbers = no # Show line numbers? set line\-number\-interval = 5 # Interval between line numbers set horizontal\-scroll = 33% # Scroll 33% of the view width set blame\-options = \-C \-C \-C # Blame lines from other files .fi .if n \{\ .RE .\} .sp .sp Or in the git configuration files: .sp .if n \{\ .RS 4 .\} .nf [tig] show\-date = yes # Show commit date? author\-width = 10 # Set width of the author column line\-graphics = no # Disable graphics characters tab\-size = 8 # Number of spaces per tab .fi .if n \{\ .RE .\} .sp .sp The type of variables is either bool, int, string, or mixed\&. .PP Valid bool values .RS 4 To set a bool variable to true use either "1", "true", or "yes"\&. Any other value will set the variable to false\&. .RE .PP Valid int values .RS 4 A non\-negative integer\&. .RE .PP Valid string values .RS 4 A string of characters\&. Optionally, use either \*(Aq or " as delimiters\&. .RE .PP Valid mixed values .RS 4 These values are composites of the above types\&. The valid values are specified in the description\&. .RE .SS "Variables" .sp The following variables can be set: .PP \fIauthor\-width\fR (int) .RS 4 Width of the author column\&. When set to 5 or below, the author name will be abbreviated to the author\(cqs initials\&. .RE .PP \fIfilename\-width\fR (int) .RS 4 Width of the filename column\&. .RE .PP \fIid\-width\fR (int) .RS 4 Width of the commit ID\&. When unset tig will use the value of \fIcore\&.abbrev\fR if found or default to 7\&. See git\-config(1) on how to set \fIcore\&.abbrev\fR\&. .RE .PP \fIdiff\-options\fR (string) .RS 4 A space separate 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 extra blame options\&. Can be used for telling git\-blame(1) how to detect the origin of lines\&. The value is ignored when tig is started in blame mode and given blame options on the command line\&. .RE .PP \fIline\-graphics\fR (mixed) [ "ascii" | "default" | "utf\-8" | bool] .RS 4 What type of character graphics for line drawing\&. .RE .PP \fIline\-number\-interval\fR (int) .RS 4 Interval between line numbers\&. Note, you have to toggle on line numbering with "\&."\&. The default is to number every fifth line\&. .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\&. \fI5\fR, or as a percentage of the view width, e\&.g\&. \fI33%\fR, where the maximum is 100%\&. For percentages it is always ensured that at least one column is scrolled\&. The default is to scroll \fI50%\fR of the view width\&. .RE .PP \fIread\-git\-colors\fR (bool) .RS 4 Whether to read git\(cqs color settings\&. True by default\&. .RE .PP \fIshow\-author\fR (mixed) ["full", "abbreviated" | "email" | "email\-user" | bool] .RS 4 How to display author names\&. If set to "abbreviated" author initials will be shown\&. Can be toggled\&. .RE .PP \fIshow\-filename\fR (mixed) ["auto" | "always" | bool] .RS 4 When to display file names\&. If set to "auto" file names are shown only when needed, e\&.g\&. when running: tig blame \-C \&. .RE .PP \fIshow\-date\fR (mixed) ["relative" | "short" | "default" | "local" | bool] .RS 4 Whether and how to show date\&. If set to "relative" a relative date will be used, e\&.g\&. "2 minutes ago"\&. If set to "short" no time information is shown\&. If set to "local", localtime(3) is used\&. Can be toggled\&. .RE .PP \fIshow\-notes\fR (mixed) [note reference | bool] .RS 4 Whether to show notes for a commit\&. When set to a note reference the reference is passed to git show \-\-notes=\&. Notes are enabled by default\&. .RE .PP \fIshow\-refs\fR (bool) .RS 4 Whether to show references (branches, tags, and remotes) in the main view on start\-up\&. Can be toggled\&. .RE .PP \fIshow\-id\fR (bool) .RS 4 Whether to show commit IDs in the main view\&. Disabled by default\&. Can be toggled\&. See also \fIid\-width\fR option\&. .RE .PP \fItitle\-overflow\fR (mixed) [bool | int] .RS 4 Whether to highlight text in commit titles exceeding a given width\&. When set to a boolean, it enables/disables the highlighting using the default width of 50 character\&. When set to an int, the assigned value is used as the maximum character width\&. .RE .PP \fIshow\-rev\-graph\fR (bool) .RS 4 Whether to show revision graph in the main view on start\-up\&. Can be toggled\&. See also line\-graphics options\&. .RE .PP \fIshow\-changes\fR (bool) .RS 4 Whether to show staged and unstaged changes in the main view\&. Can be toggled\&. .RE .PP \fIshow\-line\-numbers\fR (bool) .RS 4 Whether to show line numbers\&. Can be toggled\&. .RE .PP \fIvertical\-split\fR (bool) .RS 4 Whether to split the view horizontally or vertically\&. .RE .PP \fIsplit\-view\-height\fR (mixed) .RS 4 Height of the lower view in a split view\&. Can be specified either as the number of rows, e\&.g\&. \fI5\fR, or as a percentage of the view height, e\&.g\&. \fI80%\fR, where the maximum is 100%\&. It is always ensured that the smaller of the views is at least four rows high\&. The default is a view height of \fI66%\fR\&. .RE .PP \fIstatus\-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 \fItab\-size\fR (int) .RS 4 Number of spaces per tab\&. The default is 8 spaces\&. .RE .PP \fIdiff\-context\fR (int) .RS 4 Number of context lines to show for diffs\&. .RE .PP \fIignore\-space\fR (mixed) ["no" | "all" | "some" | "at\-eol" | bool] .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\&. .RE .PP \fIcommit\-order\fR (mixed) ["default" | "topo" | "date" | "reverse" | bool] .RS 4 Commit ordering using the default (chronological reverse) order, topological order, date order or reverse order\&. The default order is used when the option is set to false, and topo order when set to true\&. .RE .PP \fIignore\-case\fR (bool) .RS 4 Ignore case in searches\&. By default, the search is case sensitive\&. .RE .PP \fIwrap\-lines\fR (bool) .RS 4 Wrap long lines\&. By default, lines are not wrapped\&. Not compatible with line numbers enabled\&. .RE .PP \fIfocus\-child\fR (bool) .RS 4 Whether to focus the child view when it is opened\&. When disabled the focus will remain in the parent view, avoiding reloads of the child view when navigating the parent view\&. True by default\&. .RE .PP \fIeditor\-line\-number\fR (bool) .RS 4 Whether to pass the selected line number to the editor command\&. The line number is passed as + in front of the file name\&. Example: vim +10 tig\&.c .RE .SH "BIND COMMAND" .sp Using bind commands keys can be mapped to an action when pressed in a given key map\&. The syntax is: .sp .if n \{\ .RS 4 .\} .nf \fBbind\fR \fIkeymap\fR \fIkey\fR \fIaction\fR .fi .if n \{\ .RE .\} .sp .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # A few keybindings bind main w scroll\-line\-up bind main s scroll\-line\-down bind main space enter bind diff a previous bind diff d next bind diff b move\-first\-line # An external command to update from upstream bind generic F !git fetch .fi .if n \{\ .RE .\} .sp .sp Or in the git configuration files: .sp .if n \{\ .RS 4 .\} .nf [tig "bind"] # \*(Aqunbind\*(Aq the default quit key binding main = Q none # Cherry\-pick current commit onto current branch generic = C !git cherry\-pick %(commit) .fi .if n \{\ .RE .\} .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 shadow the generic keybindings which Shadow the built\-in keybindings\&. .PP Keymaps .RS 4 Valid keymaps are: \fBmain\fR, \fBdiff\fR, \fBlog\fR, \fBhelp\fR, \fBpager\fR, \fBstatus\fR, \fBstage\fR, \fBtree\fR, \fBblob\fR, \fBblame\fR, \fBbranch\fR, and \fBgeneric\fR\&. Use \fBgeneric\fR to set key mapping in all keymaps\&. .RE .PP Key values .RS 4 Key values should never be quoted\&. Use either the ASCII value or one of the following symbolic key names\&. Symbolic key names are case insensitive, Use \fBHash\fR to bind to the # key, since the hash mark is used as a comment character\&. .RE .sp \fBEnter\fR, \fBSpace\fR, \fBBackspace\fR, \fBTab\fR, \fBEscape\fR, \fBLeft\fR, \fBRight\fR, \fBUp\fR, \fBDown\fR, \fBInsert\fR, \fBDelete\fR, \fBHash\fR, \fBHome\fR, \fBEnd\fR, \fBPageUp\fR, \fBPageDown\fR, \fBF1\fR, \fBF2\fR, \fBF3\fR, \fBF4\fR, \fBF5\fR, \fBF6\fR, \fBF7\fR, \fBF8\fR, \fBF9\fR, \fBF10\fR, \fBF11\fR, \fBF12\fR\&. .sp To add a key mapping that uses the Ctrl key, use a ^ prefix in your mapping\&. For example, Ctrl\-f could be mapped to \fBscroll\-page\-down\fR with the following line: .sp bind main ^f scroll\-page\-down .PP Action names .RS 4 Valid action names are described below\&. Note, all names are case\-insensitive, and you may use \fI\-\fR, \fI_\fR, and \fI\&.\fR interchangeably, e\&.g\&. "view\-main", "View\&.Main", and "VIEW_MAIN" are the same\&. .RE .SS "Actions" .sp Apart from the action names listed below, all actions starting with a \fI!\fR or \fI:\fR are treated specially\&. .sp Actions beginning with a \fI:\fR will run an internal tig command\&. These internal commands are those which you put in a configuration file or type at the tig prompt\&. As an example, "bind generic S :source \&.tigrc" will source a \&.tigrc file in the current directory when \fIS\fR is pressed\&. .sp Actions beginning with a \fI!\fR will be available as an external command\&. External commands can contain variable names that will be substituted before the command is run\&. Valid variable names are: .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&Browsing state variables .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp %(head) T}:T{ .sp The currently viewed \fIhead\fR ID\&. Defaults to HEAD T} T{ .sp %(commit) T}:T{ .sp The currently selected commit ID\&. T} T{ .sp %(blob) T}:T{ .sp The currently selected blob ID\&. T} T{ .sp %(branch) T}:T{ .sp The currently selected branch name\&. T} T{ .sp %(stash) T}:T{ .sp The currently selected stash name\&. T} T{ .sp %(directory) T}:T{ .sp The current directory path in the tree view; empty for the root directory\&. T} T{ .sp %(file) T}:T{ .sp The currently selected file\&. T} T{ .sp %(ref) T}:T{ .sp The reference given to blame or HEAD if undefined\&. T} T{ .sp %(revargs) T}:T{ .sp The revision arguments passed on the command line\&. T} T{ .sp %(fileargs) T}:T{ .sp The file arguments passed on the command line\&. T} T{ .sp %(diffargs) T}:T{ .sp The diff options passed on the command line\&. T} T{ .sp %(prompt) T}:T{ .sp Prompt for the argument value\&. T} .TE .sp 1 .sp As an example, the following external command will save the current commit as a patch file: "!git format\-patch \-1 %(commit)"\&. If your external command requires use of dynamic features, such as subshells, expansion of environment variables and process control, this can be achieved by using a shell command: .PP \fBExample\ \&1.\ \&Configure a binding in ~/.tigrc to put a commit ID in the clipboard.\fR .sp .if n \{\ .RS 4 .\} .nf bind generic I !@sh \-c "echo \-n %(commit) | xclip \-selection c" .fi .if n \{\ .RE .\} .sp .sp Or by using a combination of git aliases and tig external commands\&. The following example entries can be put in either the \&.gitconfig or \&.git/config file: .PP \fBExample\ \&2.\ \&Git configuration which binds tig keys to git command aliases.\fR .sp .if n \{\ .RS 4 .\} .nf [alias] gitk\-bg = !"gitk HEAD \-\-not $(git rev\-parse \-\-remotes) &" publish = !"for i in origin public; do git push $i; done" [tig "bind"] # @\-prefix means that the console output will not be shown\&. generic = V !@git gitk\-bg generic = > !git publish .fi .if n \{\ .RE .\} .sp .sp By default, commands are run in the foreground with their console output shown\&. For different behavior, commands can be prefixed with one or more of the following control flags to specify how it should be executed: .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&2.\ \&External command control flags .TS tab(:); lt lt lt lt lt lt. T{ .sp @ T}:T{ .sp Run the command in the background with no output\&. T} T{ .sp ? T}:T{ .sp Prompt the user before executing the command\&. T} T{ .sp < T}:T{ .sp Exit tig after executing the command\&. T} .TE .sp 1 .sp Control flags can be combined, e\&.g\&. "!? .sp 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\&. .SH "SEE ALSO" .sp \fBtig\fR(1), \fBtigmanual\fR(7), git\-config(1), and the \m[blue]\fBtig manual\fR\m[]\&\s-2\u[2]\d\s+2\&. .SH "NOTES" .IP " 1." 4 fonseca@diku.dk .RS 4 \%mailto:fonseca@diku.dk .RE .IP " 2." 4 tig manual .RS 4 \%http://jonas.nitro.dk/tig/manual.html .RE tig-2.0.2/tigrc.5.html000066400000000000000000001677461233303337700144700ustar00rootroot00000000000000 tigrc(5)

SYNOPSIS

set   variable = value
bind  keymap key action
color area fgcolor bgcolor [attributes]
source path

DESCRIPTION

You can permanently set an option by putting it in the ~/.tigrc file. The file consists of a series of commands. Each line of the file may contain only one command.

The hash mark (#) is used as a comment character. All text after the comment character to the end of the line is ignored. You can use comments to annotate your initialization file.

Git configuration

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 git-config(1) for which files to use. The following example show the basic syntax to use for settings, bindings and colors.

[tig] show-rev-graph = true
[tig "color"] cursor = yellow red bold
[tig "bind"] generic = P parent

In addition to tig-specific options, the following git options are read from the git configuration:

color.*

Colors for the various UI types. Can be completely disabled by setting read-git-colors.

core.abbrev

The width of the commit ID. See also id-width option.

core.editor

The editor command. Can be overridden by setting GIT_EDITOR.

core.worktree

The path to the root of the working tree.

gui.encoding

The encoding to use for displaying of file content.

i18n.commitencoding

The encoding used for commits. The default is UTF-8.

Set command

A few selective variables can be configured via the set command. The syntax is:

set variables = value

Examples:

set show-author = abbreviated   # Show abbreviated author names.
set show-date = relative        # Show relative commit date.
set show-rev-graph = yes        # Show revision graph?
set show-refs = yes             # Show references?
set commit-order = topo         # Order commits topologically
set read-git-colors = no        # Do not read git's color settings.
set show-line-numbers = no      # Show line numbers?
set line-number-interval = 5    # Interval between line numbers
set horizontal-scroll = 33%     # Scroll 33% of the view width
set blame-options = -C -C -C    # Blame lines from other files

Or in the git configuration files:

[tig]
        show-date = yes         # Show commit date?
        author-width = 10       # Set width of the author column
        line-graphics = no      # Disable graphics characters
        tab-size = 8            # Number of spaces per tab

The type of variables is either bool, int, string, or mixed.

Valid bool values

To set a bool variable to true use either "1", "true", or "yes". Any other value will set the variable to false.

Valid int values

A non-negative integer.

Valid string values

A string of characters. Optionally, use either ' or " as delimiters.

Valid mixed values

These values are composites of the above types. The valid values are specified in the description.

Variables

The following variables can be set:

author-width (int)

Width of the author column. When set to 5 or below, the author name will be abbreviated to the author’s initials.

filename-width (int)

Width of the filename column.

id-width (int)

Width of the commit ID. When unset tig will use the value of core.abbrev if found or default to 7. See git-config(1) on how to set core.abbrev.

diff-options (string)

A space separate 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 overridden by diff flags given on the command line invocation.

blame-options (string)

A space separated string of extra blame options. Can be used for telling git-blame(1) how to detect the origin of lines. The value is ignored when tig is started in blame mode and given blame options on the command line.

line-graphics (mixed) [ "ascii" | "default" | "utf-8" | bool]

What type of character graphics for line drawing.

line-number-interval (int)

Interval between line numbers. Note, you have to toggle on line numbering with ".". The default is to number every fifth line.

horizontal-scroll (mixed)

Interval to scroll horizontally in each step. Can be specified either as the number of columns, e.g. 5, or as a percentage of the view width, e.g. 33%, where the maximum is 100%. For percentages it is always ensured that at least one column is scrolled. The default is to scroll 50% of the view width.

read-git-colors (bool)

Whether to read git’s color settings. True by default.

show-author (mixed) ["full", "abbreviated" | "email" | "email-user" | bool]

How to display author names. If set to "abbreviated" author initials will be shown. Can be toggled.

show-filename (mixed) ["auto" | "always" | bool]

When to display file names. If set to "auto" file names are shown only when needed, e.g. when running: tig blame -C <file>.

show-date (mixed) ["relative" | "short" | "default" | "local" | bool]

Whether and how to show date. If set to "relative" a relative date will be used, e.g. "2 minutes ago". If set to "short" no time information is shown. If set to "local", localtime(3) is used. Can be toggled.

show-notes (mixed) [note reference | bool]

Whether to show notes for a commit. When set to a note reference the reference is passed to git show --notes=. Notes are enabled by default.

show-refs (bool)

Whether to show references (branches, tags, and remotes) in the main view on start-up. Can be toggled.

show-id (bool)

Whether to show commit IDs in the main view. Disabled by default. Can be toggled. See also id-width option.

title-overflow (mixed) [bool | int]

Whether to highlight text in commit titles exceeding a given width. When set to a boolean, it enables/disables the highlighting using the default width of 50 character. When set to an int, the assigned value is used as the maximum character width.

show-rev-graph (bool)

Whether to show revision graph in the main view on start-up. Can be toggled. See also line-graphics options.

show-changes (bool)

Whether to show staged and unstaged changes in the main view. Can be toggled.

show-line-numbers (bool)

Whether to show line numbers. Can be toggled.

vertical-split (bool)

Whether to split the view horizontally or vertically.

split-view-height (mixed)

Height of the lower view in a split view. Can be specified either as the number of rows, e.g. 5, or as a percentage of the view height, e.g. 80%, where the maximum is 100%. It is always ensured that the smaller of the views is at least four rows high. The default is a view height of 66%.

status-untracked-dirs (bool)

Show untracked directories contents in the status view (analog to git ls-files --directory option). On by default.

tab-size (int)

Number of spaces per tab. The default is 8 spaces.

diff-context (int)

Number of context lines to show for diffs.

ignore-space (mixed) ["no" | "all" | "some" | "at-eol" | bool]

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.

commit-order (mixed) ["default" | "topo" | "date" | "reverse" | bool]

Commit ordering using the default (chronological reverse) order, topological order, date order or reverse order. The default order is used when the option is set to false, and topo order when set to true.

ignore-case (bool)

Ignore case in searches. By default, the search is case sensitive.

wrap-lines (bool)

Wrap long lines. By default, lines are not wrapped. Not compatible with line numbers enabled.

focus-child (bool)

Whether to focus the child view when it is opened. When disabled the focus will remain in the parent view, avoiding reloads of the child view when navigating the parent view. True by default.

editor-line-number (bool)

Whether to pass the selected line number to the editor command. The line number is passed as +<line-number> in front of the file name. Example: vim +10 tig.c

Bind command

Using bind commands keys can be mapped to an action when pressed in a given key map. The syntax is:

bind keymap key action

Examples:

# A few keybindings
bind main w scroll-line-up
bind main s scroll-line-down
bind main space enter
bind diff a previous
bind diff d next
bind diff b move-first-line
# An external command to update from upstream
bind generic F !git fetch

Or in the git configuration files:

[tig "bind"]
        # 'unbind' the default quit key binding
        main = Q none
        # Cherry-pick current commit onto current branch
        generic = C !git cherry-pick %(commit)

Keys are mapped by first searching the keybindings for the current view, then the keybindings for the generic keymap, and last the default keybindings. Thus, the view keybindings shadow the generic keybindings which Shadow the built-in keybindings.

Keymaps

Valid keymaps are: main, diff, log, help, pager, status, stage, tree, blob, blame, branch, and generic. Use generic to set key mapping in all keymaps.

Key values

Key values should never be quoted. Use either the ASCII value or one of the following symbolic key names. Symbolic key names are case insensitive, Use Hash to bind to the # key, since the hash mark is used as a comment character.

Enter, Space, Backspace, Tab, Escape, Left, Right, Up, Down, Insert, Delete, Hash, Home, End, PageUp, PageDown, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12.

To add a key mapping that uses the Ctrl key, use a ^ prefix in your mapping. For example, Ctrl-f could be mapped to scroll-page-down with the following line:

bind main ^f scroll-page-down

Action names

Valid action names are described below. Note, all names are case-insensitive, and you may use -, _, and . interchangeably, e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.

Actions

Apart from the action names listed below, all actions starting with a ! or : are treated specially.

Actions beginning with a : will run an internal tig command. These internal commands are those which you put in a configuration file or type at the tig prompt. As an example, "bind generic S :source .tigrc" will source a .tigrc file in the current directory when S is pressed.

Actions beginning with a ! will be available as an external command. External commands can contain variable names that will be substituted before the command is run. Valid variable names are:

Table 1. Browsing state variables

%(head)

The currently viewed head ID. Defaults to HEAD

%(commit)

The currently selected commit ID.

%(blob)

The currently selected blob ID.

%(branch)

The currently selected branch name.

%(stash)

The currently selected stash name.

%(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.

%(revargs)

The revision arguments passed on the command line.

%(fileargs)

The file arguments passed on the command line.

%(diffargs)

The diff options passed on the command line.

%(prompt)

Prompt for the argument value.

As an example, the following external command will save the current commit as a patch file: "!git format-patch -1 %(commit)". If your external command requires use of dynamic features, such as subshells, expansion of environment variables and process control, this can be achieved by using a shell command:

Configure a binding in ~/.tigrc to put a commit ID in the clipboard.
bind generic I !@sh -c "echo -n %(commit) | xclip -selection c"

Or by using a combination of git aliases and tig external commands. The following example entries can be put in either the .gitconfig or .git/config file:

Git configuration which binds tig keys to git command aliases.
[alias]
        gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
        publish = !"for i in origin public; do git push $i; done"
[tig "bind"]
        # @-prefix means that the console output will not be shown.
        generic = V !@git gitk-bg
        generic = > !git publish

By default, commands are run in the foreground with their console output shown. For different behavior, commands can be prefixed with one or more of the following control flags to specify how it should be executed:

Table 2. External command control flags

@

Run the command in the background with no output.

?

Prompt the user before executing the command.

<

Exit tig after executing the command.

Control flags can be combined, e.g. "!?<git commit" will prompt whether to execute the command and will exit tig after completion.

Table 3. View switching

view-main

Show main view

view-diff

Show diff view

view-log

Show log view

view-tree

Show tree view

view-blob

Show blob view

view-blame

Show blame view

view-branch

Show branch view

view-status

Show status view

view-stage

Show stage view

view-pager

Show pager view

view-help

Show help page

Table 4. View manipulation

enter

Enter current line and scroll

next

Move to next

previous

Move to previous

parent

Move to parent

view-next

Move focus to next view

refresh

Reload and refresh view

maximize

Maximize the current view

view-close

Close the current view

quit

Close all views and quit

Table 5. View specific actions

status-update

Update file status

status-merge

Resolve unmerged file

stage-update-line

Stage single line

stage-next

Find next chunk to stage

diff-context-up

Increase the diff context

diff-context-down

Decrease the diff context

Table 6. Cursor navigation

move-up

Move cursor one line up

move-down

Move cursor one line down

move-page-down

Move cursor one page down

move-page-up

Move cursor one page up

move-first-line

Move cursor to first line

move-last-line

Move cursor to last line

Table 7. 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 column

scroll-left

Scroll one column left

scroll-right

Scroll one column right

Table 8. Searching

search

Search the view

search-back

Search backwards in the view

find-next

Find next search match

find-prev

Find previous search match

Table 9. Misc

prompt

Bring up the prompt

screen-redraw

Redraw the screen

screen-resize

Resize the screen

show-version

Show version information

stop-loading

Stop all loading views

options

Open options menu

toggle-lineno

Toggle line numbers

toggle-date

Toggle date display

toggle-author

Toggle author display

toggle-filename

Toggle file name display

toggle-rev-graph

Toggle revision graph visualization

toggle-graphic

Toggle (line) graphics mode

toggle-refs

Toggle reference display

toggle-files

Toggle file filtering for the diff and main views

edit

Open in editor

none

Do nothing

Color command

Color commands control highlighting and the user interface styles. If your terminal supports color, these commands can be used to assign foreground and background combinations to certain areas. Optionally, an attribute can be given as the last parameter. The syntax is:

color area fgcolor bgcolor [attributes]

Examples:

# Override the default terminal colors to white on black.
color default           white   black
# Diff colors
color diff-header       yellow  default
color diff-index        blue    default
color diff-chunk        magenta default
color "Reported-by:"    green   default

Or in the git configuration files:

[tig "color"]
        # A strange looking cursor line
        cursor          red     default underline
        # UI colors
        title-blur      white   blue
        title-focus     white   blue    bold
Area names

Can be either a built-in area name or a custom quoted string. The latter allows custom color rules to be added for lines matching a quoted string. Valid built-in area names are described below. Note, all names are case-insensitive, and you may use -, _, and . interchangeably, e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.

Color names

Valid colors include: white, black, green, magenta, blue, cyan, yellow, red, default. Use default to refer to the default terminal colors, for example, to keep the background transparent when you are using a terminal with a transparent background.

Colors can also be specified using the keywords color0, color1, …, colorN-1 (where N is the number of colors supported by your terminal). This is useful when you remap the colors for your display or want to enable colors supported by 88-color and 256-color terminals. Note that the color prefix is optional. If you prefer, you can specify colors directly by their numbers 0, 1, …, N-1 instead, just like in the configuration file of Git.

Attribute names

Valid attributes include: normal, blink, bold, dim, reverse, standout, and underline. Note, not all attributes may be supported by the terminal.

UI colors

The colors and attributes to be used for the text that is not highlighted or that specify the use of the default terminal colors can be controlled by setting the default color option.

Table 10. General

default

Override default terminal colors (see above).

cursor

The cursor line.

status

The status window showing info messages.

title-focus

The title window for the current view.

title-blur

The title window of any backgrounded view.

delimiter

Delimiter shown for truncated lines.

line-number

Line numbers.

id

The commit ID.

date

The commit date.

author

The commit author.

mode

The file mode holding the permissions and type.

Table 11. Main view colors

graph-commit

The commit dot in the revision graph.

palette-[0-6]

7 different colors, used for distinguishing branches or commits. example: palette-0 = red

main-commit

The commit comment.

main-head

Label of the current branch.

main-remote

Label of a remote.

main-tracked

Label of the remote tracked by the current branch.

main-tag

Label of a signed tag.

main-local-tag

Label of a local tag.

main-ref

Label of any other reference.

Table 12. Status view

stat-head

The "On branch"-line.

stat-section

Status section titles,

stat-staged

Status flag of staged files.

stat-unstaged

Status flag of unstaged files.

stat-untracked

Status flag of untracked files.

Table 13. Tree view

tree-head

The "Directory /"-line

tree-dir

The directory name.

tree-file

The file name.

Highlighting

Diff markup

Options concerning diff start, chunks and lines added and deleted.

diff-header, diff-chunk, diff-add, diff-del

Enhanced git diff markup

Extra diff information emitted by the git diff machinery, such as mode changes, rename detection, and similarity.

diff-oldmode, diff-newmode, diff-copy-from, diff-copy-to, diff-rename-from, diff-rename-to, diff-deleted-file-mode, diff-similarity, diff-dissimilarity diff-tree, diff-index, diff-stat

Pretty print commit headers

Commit diffs and the revision logs are usually formatted using pretty printed headers , unless --pretty=raw was given. This includes lines, such as merge info, commit ID, and author and committer date.

pp-author, pp-commit, pp-merge, pp-date, pp-adate, pp-cdate, pp-refs

Raw commit header

Usually shown when --pretty=raw is given, however commit is pretty much omnipresent.

commit, parent, tree, author, committer

Commit message

Signed-off-by, Acked-by, Reviewed-by and Tested-by lines are colorized. Characters in the commit title exceeding a predefined width can be highlighted.

signoff, acked, reviewed, tested, overflow

Tree markup

Colors for information of the tree view.

tree-dir, tree-file

Source command

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:

source path

Examples:

source ~/.tig/colorscheme.tigrc
source ~/.tig/keybindings.tigrc

Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>

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.

SEE ALSO

tig(1), tigmanual(7), git-config(1), and the tig manual.


tig-2.0.2/tools/000077500000000000000000000000001233303337700134425ustar00rootroot00000000000000tig-2.0.2/tools/announcement.sh000077500000000000000000000025041233303337700164740ustar00rootroot00000000000000#!/bin/sh # # Prepare the content of the next tig release announcement. # Usage: $0 [revision] # # Copyright (c) 2008-2014 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. root="$(git rev-parse --show-cdup)" NEWS="${root}NEWS.adoc" README="${root}README.adoc" from="$(sed -n '7,/^tig-/p' < "$NEWS" | tail -n 1 | cut -d' ' -f 1)" to="${1-HEAD}" short= test -n "$(git rev-list --skip=50 $from..$to)" && short=-s cat <. dnl dnl Taken from http://git.savannah.gnu.org/cgit/readline.git/tree/examples/autoconf/ dnl commit 835a39225c6bd4784c0d7f775b0cd44dd7c57f35 (Readline 6.3, version 2.73) dnl dnl Configuration of --with-readline and result check at EOF. AC_DEFUN([BASH_CHECK_LIB_TERMCAP], [ # save cpp and ld options _save_CFLAGS="$CFLAGS" _save_LDFLAGS="$LDFLAGS" _save_LIBS="$LIBS" if test "X$bash_cv_termcap_lib" = "X"; then _bash_needmsg=yes else AC_MSG_CHECKING(which library has the termcap functions) _bash_needmsg= 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)] elif test "$ax_cv_curses_which" = "ncurses"; then [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses)] elif test "$ax_cv_curses_which" = "plaincurses"; then [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses)] fi )])])]) if test "X$_bash_needmsg" = "Xyes"; then AC_MSG_CHECKING(which library has the termcap functions) fi AC_MSG_RESULT(using $bash_cv_termcap_lib) if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then 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 TERMCAP_LIB=-ltermcap TERMCAP_DEP= elif test $bash_cv_termcap_lib = libtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncursesw; then TERMCAP_LIB=-lncursesw TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= elif test $bash_cv_termcap_lib = libc; then TERMCAP_LIB= TERMCAP_DEP= else TERMCAP_LIB=-lcurses TERMCAP_DEP= fi CFLAGS="$_save_CFLAGS" LDFLAGS="$_save_LDFLAGS" LIBS="$_save_LIBS" ]) AC_DEFUN([RL_LIB_READLINE_VERSION], [ AC_REQUIRE([BASH_CHECK_LIB_TERMCAP]) AC_MSG_CHECKING([version of installed readline library]) # What a pain in the ass this is. # save cpp and ld options _save_CFLAGS="$CFLAGS" _save_LDFLAGS="$LDFLAGS" _save_LIBS="$LIBS" # Don't set ac_cv_rl_prefix if the caller has already assigned a value. This # allows the caller to do something like $_rl_prefix=$withval if the user # specifies --with-installed-readline=PREFIX as an argument to configure if test -z "$ac_cv_rl_prefix"; then test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix} fi eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib LIBS="$LIBS -lreadline ${TERMCAP_LIB}" CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" AC_CACHE_VAL(ac_cv_rl_version, [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include extern int rl_gnu_readline_p; main() { FILE *fp; fp = fopen("conftest.rlv", "w"); if (fp == 0) exit(1); if (rl_gnu_readline_p != 1) fprintf(fp, "0.0\n"); else fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); fclose(fp); exit(0); } ]])], ac_cv_rl_version=`cat conftest.rlv`, ac_cv_rl_version='0.0', ac_cv_rl_version='4.2')]) CFLAGS="$_save_CFLAGS" LDFLAGS="$_save_LDFLAGS" LIBS="$_save_LIBS" RL_MAJOR=0 RL_MINOR=0 # ( case "$ac_cv_rl_version" in 2*|3*|4*|5*|6*|7*|8*|9*) RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'` ;; esac # ((( case $RL_MAJOR in [[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;; [[0-9]]) _RL_MAJOR=0$RL_MAJOR ;; *) _RL_MAJOR=00 ;; esac # ((( case $RL_MINOR in [[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;; [[0-9]]) _RL_MINOR=0$RL_MINOR ;; *) _RL_MINOR=00 ;; esac RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}" # Readline versions greater than 4.2 have these defines in readline.h if test $ac_cv_rl_version = '0.0' ; then AC_MSG_RESULT([none]) AC_MSG_WARN([Could not test version of installed readline library.]) elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then # set these for use by the caller RL_PREFIX=$ac_cv_rl_prefix RL_LIBDIR=$ac_cv_rl_libdir RL_INCLUDEDIR=$ac_cv_rl_includedir AC_MSG_RESULT($ac_cv_rl_version) else AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library]) AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library]) AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library]) AC_SUBST(RL_VERSION) AC_SUBST(RL_MAJOR) AC_SUBST(RL_MINOR) # set these for use by the caller RL_PREFIX=$ac_cv_rl_prefix RL_LIBDIR=$ac_cv_rl_libdir RL_INCLUDEDIR=$ac_cv_rl_includedir AC_MSG_RESULT($ac_cv_rl_version) fi ]) AC_DEFUN([AX_LIB_READLINE], [ RL_VERSION_REQUIRED="$1" RL_MAJOR_REQUIRED="$(echo "$1" | sed -n 's/\([[]0-9[]]*\)[[].[]]\([[]0-9[]]*\)/\1/p')" RL_MINOR_REQUIRED="$(echo "$1" | sed -n 's/\([[]0-9[]]*\)[[].[]]\([[]0-9[]]*\)/\2/p')" RL_MAJOR=0 RL_MINOR=0 AC_ARG_WITH([readline], [AS_HELP_STRING([--with-readline=DIR], [search for readline in DIR/include and DIR/lib])], [ac_cv_rl_prefix=$with_readline]) AC_CHECK_HEADERS([readline/readline.h], [ AC_CHECK_HEADERS([readline/history.h], [ RL_LIB_READLINE_VERSION ]) ]) if test $RL_MAJOR -ge $RL_MAJOR_REQUIRED || { test $RL_MAJOR = $RL_MAJOR_REQUIRED && test $RL_MINOR -ge $RL_MINOR_REQUIRED ; } ; then LIBS="$LIBS -lreadline ${TERMCAP_LIB}" CFLAGS="$CFLAGS -I${RL_INCLUDEDIR}" LDFLAGS="$LDFLAGS -L${RL_LIBDIR}" AC_DEFINE(HAVE_READLINE, 1, [Define if you have a GNU readline compatible library]) elif test -n "$ac_cv_rl_prefix"; then AC_MSG_WARN([Minimum required version of readline is $RL_VERSION_REQUIRED]) fi ]) tig-2.0.2/tools/ax_with_curses.m4000066400000000000000000000607331233303337700167440ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_with_curses.html # =========================================================================== # # SYNOPSIS # # AX_WITH_CURSES # # DESCRIPTION # # This macro checks whether a SysV or X/Open-compatible Curses library is # 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. # # The following options are understood: --with-ncursesw, --with-ncurses, # --without-ncursesw, --without-ncurses. The "--with" options force the # macro to use that particular library, terminating with an error if not # found. The "--without" options simply skip the check for that library. # The effect on the search pattern is: # # (no options) - NcursesW, Ncurses, Curses # --with-ncurses --with-ncursesw - NcursesW only [*] # --without-ncurses --with-ncursesw - NcursesW only [*] # --with-ncursesw - NcursesW only [*] # --with-ncurses --without-ncursesw - Ncurses only [*] # --with-ncurses - NcursesW, Ncurses [**] # --without-ncurses --without-ncursesw - Curses only # --without-ncursesw - Ncurses, Curses # --without-ncurses - NcursesW, Curses # # [*] If the library is not found, abort the configure script. # # [**] If the second library (Ncurses) is not found, abort configure. # # The following preprocessor symbols may be defined by this macro if the # appropriate conditions are met: # # HAVE_CURSES - if any SysV or X/Open Curses library found # HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions # HAVE_CURSES_COLOR - if library supports color (enhanced functions) # HAVE_CURSES_OBSOLETE - if library supports certain obsolete features # HAVE_NCURSESW - if NcursesW (wide char) library is to be used # HAVE_NCURSES - if the Ncurses library is to be used # # HAVE_CURSES_H - if is present and should be used # HAVE_NCURSESW_H - if should be used # HAVE_NCURSES_H - if should be used # HAVE_NCURSESW_CURSES_H - if should be used # HAVE_NCURSES_CURSES_H - if should be used # # (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: # # CURSES_LIB - library to add to xxx_LDADD # # 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. # # The following shell variables may be defined by this macro: # # ax_cv_curses - set to "yes" if any Curses library found # ax_cv_curses_enhanced - set to "yes" if Enhanced functions present # ax_cv_curses_color - set to "yes" if color functions present # ax_cv_curses_obsolete - set to "yes" if obsolete features present # # ax_cv_ncursesw - set to "yes" if NcursesW library found # ax_cv_ncurses - set to "yes" if Ncurses library found # ax_cv_plaincurses - set to "yes" if plain Curses library found # ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" # # These variables can be used in your configure.ac to determine the level # of support you need from the Curses library. For example, if you must # have either Ncurses or NcursesW, you could include: # # 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]) # fi # # If any Curses library will do (but one must be present and must support # color), you could use: # # AX_WITH_CURSES # if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then # AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) # fi # # Certain preprocessor symbols and shell variables defined by this macro # can be used to determine various features of the Curses library. In # particular, HAVE_CURSES and ax_cv_curses are defined if the Curses # library found conforms to the traditional SysV and/or X/Open Base Curses # definition. Any working Curses library conforms to this level. # # HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the # library supports the X/Open Enhanced Curses definition. In particular, # the wide-character types attr_t, cchar_t and wint_t, the functions # wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES # are checked. The Ncurses library does NOT conform to this definition, # although NcursesW does. # # HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library # supports color functions and macros such as COLOR_PAIR, A_COLOR, # COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the # X/Open Base Curses definition, but are part of the Enhanced set of # functions. The Ncurses library DOES support these functions, as does # NcursesW. # # HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the # library supports certain features present in SysV and BSD Curses but not # defined in the X/Open definition. In particular, the functions # getattrs(), getcurx() and getmaxx() are checked. # # To use the HAVE_xxx_H preprocessor symbols, insert the following into # your system.h (or equivalent) header file: # # #if defined HAVE_NCURSESW_CURSES_H # # include # #elif defined HAVE_NCURSESW_H # # include # #elif defined HAVE_NCURSES_CURSES_H # # include # #elif defined HAVE_NCURSES_H # # include # #elif defined HAVE_CURSES_H # # include # #else # # error "SysV or X/Open-compatible Curses header file required" # #endif # # For previous users of this macro: you should not need to change anything # in your configure.ac or Makefile.am, as the previous (serial 10) # semantics are still valid. However, you should update your system.h (or # equivalent) header file to the fragment shown above. You are encouraged # also to make use of the extended functionality provided by this version # of AX_WITH_CURSES, as well as in the additional macros # AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. # # LICENSE # # Copyright (c) 2009 Mark Pulford # Copyright (c) 2009 Damian Pietras # Copyright (c) 2012 Reuben Thomas # Copyright (c) 2011 John Zaitseff # # 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 3 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. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # 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 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_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], [force the use of Ncurses or NcursesW])], [], [with_ncurses=check]) AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw], [do not use NcursesW (wide character support)])], [], [with_ncursesw=check]) ax_saved_LIBS=$LIBS 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_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]) ]) AS_IF([test "x$ax_cv_ncursesw" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncursesw CURSES_LIB="-lncursesw" 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]) AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncursesw_curses_h=yes], [ax_cv_header_ncursesw_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if is present]) ]) AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncursesw_h=yes], [ax_cv_header_ncursesw_h=no]) ]) AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) ]) AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncurses_h_with_ncursesw=yes], [ax_cv_header_ncurses_h_with_ncursesw=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) ]) AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [ AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h]) ]) ]) ]) # Test for 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]) ]) AS_IF([test "x$ax_cv_ncurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncurses CURSES_LIB="-lncurses" 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]) AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_header_ncurses_curses_h=yes], [ax_cv_header_ncurses_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [ ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if is present]) ]) AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_header_ncurses_h=yes], [ax_cv_header_ncurses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [ ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h]) ]) ]) ]) # Test for plain Curses (or if CURSES_LIB 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" ], [ LIBS="$ax_saved_LIBS -lcurses" ]) AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no]) ]) 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" ]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) # Check for base conformance (and header file) AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; initscr(); ]])], [ax_cv_header_curses_h=yes], [ax_cv_header_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_curses_h" = xyes], [ AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if is present]) # Check for X/Open Enhanced conformance AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include @%:@ifndef _XOPEN_CURSES @%:@error "this Curses library is not enhanced" "this Curses library is not enhanced" @%:@endif ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_plaincurses_enhanced=yes], [ax_cv_plaincurses_enhanced=no]) ]) AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) ]) # Check for color functions AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_plaincurses_color=yes], [ax_cv_plaincurses_color=no]) ]) AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [ ax_cv_curses_color=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) ]) # Check for obsolete functions AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); ]])], [ax_cv_plaincurses_obsolete=yes], [ax_cv_plaincurses_obsolete=no]) ]) AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [ ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) ]) ]) AS_IF([test "x$ax_cv_header_curses_h" = xno], [ AC_MSG_WARN([could not find a working curses.h]) ]) ]) ]) AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no]) AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no]) AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no]) AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no]) LIBS=$ax_saved_LIBS ])dnl tig-2.0.2/tools/doc-gen.c000066400000000000000000000036131233303337700151250ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ #include "tig/tig.h" #include "tig/request.h" #include "tig/util.h" struct doc_action_iterator { bool end_group; const char *group; }; static void doc_action_group_name_print(const char *group) { printf("%s\n", group); while (*group++) printf("^"); printf("\n\n"); } static void doc_action_table_print(bool start) { if (start) printf("[frame=\"none\",grid=\"none\",cols=\"25group != group) { if (iterator->end_group) { doc_action_table_print(FALSE); printf("\n"); } doc_action_group_name_print(group); doc_action_table_print(TRUE); iterator->group = group; iterator->end_group = TRUE; } printf("|%-24s|%s\n", enum_name(req_info->name), req_info->help); return TRUE; } static void doc_actions_print(void) { struct doc_action_iterator iterator = { FALSE }; foreach_request(doc_action_print, &iterator); doc_action_table_print(FALSE); } int main(int argc, const char *argv[]) { int i; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "actions")) doc_actions_print(); } return EXIT_SUCCESS; } /* vim: set ts=8 sw=8 noexpandtab: */ tig-2.0.2/tools/header.h000066400000000000000000000010771233303337700150500ustar00rootroot00000000000000/* Copyright (c) 2006-2014 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. */ tig-2.0.2/tools/install.sh000077500000000000000000000020371233303337700154510ustar00rootroot00000000000000#!/bin/sh # # Install data or executable file. # # Usage: $0 {data|bin} src dest # # Copyright (c) 2014 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. set -e data="$1" src="$2" dest="$3" mode=0755 trash= case "$data" in data) mode=0644 esac mkdir -p "$dest" if [ "$V" = "@" ]; then echo "$src -> $dest" fi # Replace fake /etc-path case "$src" in doc/*) dest="$dest/$(basename "$src")" sed "s#++SYSCONFDIR++#${sysconfdir}#" < "$src" > "$src+" trash="$src+" src="$src+" esac install -p -m "$mode" "$src" "$dest" if [ -n "$trash" ]; then rm -f "$trash" fi tig-2.0.2/tools/make-builtin-config.sh000077500000000000000000000020471233303337700176300ustar00rootroot00000000000000#!/bin/sh # # Generate code for including a copy of the default tigrc inside the # binary. # # Usage: $0 /path/to/tigrc # # Copyright (c) 2014 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. TIGRC="${1:-tigrc}" read_tigrc() { if test -z "$NO_BUILTIN_TIGRC"; then sed 's/\s*#.*//' "$TIGRC" | sed 's,\\,\\\\\\\\,g' | sed 's,",\\\\",g' | sed 's/ \+/ /g' else echo '#' fi } echo "/* Generated by $0 on $(date) */" echo "const char *builtin_config =" read_tigrc | while read line; do case "$line" in "") : ignore ;; *) printf ' "%s\\n"\n' "$line" esac done echo ";" tig-2.0.2/tools/release.sh000077500000000000000000000037021233303337700154230ustar00rootroot00000000000000#!/bin/sh # # Script for preparing a release or updating the release branch. # Usage: $0 version # # Copyright (c) 2009-2014 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. set -e set -x VERSION="$1" TAG="tig-$VERSION" TITLE="$TAG\n$(echo "$TAG" | sed 's/./-/g')" NEWS="NEWS.adoc" # Require a clean repository. git update-index --refresh git diff-index --quiet HEAD if test -n "$VERSION"; then # Get a sane starting point. test "$(git symbolic-ref HEAD)" = "refs/heads/master" || git checkout master # Update files which should reference the version. sed -i "s/VERSION\s=\s[0-9]\+\([.][0-9]\+\)\+/VERSION = $VERSION/" Makefile perl -pi -e 's/^tig master.*/@@TITLE@@/ms' "$NEWS" perl -pi -e "s/^@@TITLE@@.*/$TITLE/" "$NEWS" # Check for typos. make spell-check # Last review. $EDITOR "$NEWS" # Create release commit and tag. git commit -a -m "$TAG" git tag -s -m "tig version $VERSION" "$TAG" # Prepare release announcement file. ./tools/announcement.sh "$TAG" > "$TAG.txt" # Set version for the Makefile export DIST_VERSION="$VERSION" else # Get meaningful version for the update message. TAG="$(git describe)" fi # Update the release branch. git checkout release HEAD="$(git rev-parse release)" git merge master if test -n "$(git rev-list -1 release ^$HEAD)"; then make distclean doc-man doc-html sysconfdir=++SYSCONFDIR++ git commit -a -m "Update for version $TAG" fi if test -n "$VERSION"; then # Create the tarball. make dist fi # Done. git checkout master tig-2.0.2/tools/update-release-docs.sh000077500000000000000000000026301233303337700176300ustar00rootroot00000000000000#!/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 tig-2.0.2/Makefile0000644000076500000000000002275012333033402014531 0ustar00fonsecawheel00000000000000## Makefile for tig # 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.0.2 all: # Include kernel specific configuration kernel_name := $(shell sh -c 'uname -s 2>/dev/null || echo unknown') -include contrib/config.make-$(kernel_name) # Include setting from the configure script -include config.make prefix ?= $(HOME) bindir ?= $(prefix)/bin datarootdir ?= $(prefix)/share sysconfdir ?= $(prefix)/etc docdir ?= $(datarootdir)/doc mandir ?= $(datarootdir)/man # DESTDIR= ifneq (,$(wildcard .git)) GITDESC = $(subst tig-,,$(shell git describe 2>/dev/null)) COMMIT := $(if $(GITDESC),$(GITDESC),$(VERSION)-g$(shell git describe --always)) WTDIRTY = $(if $(shell git diff-index HEAD 2>/dev/null),-dirty) VERSION = $(COMMIT)$(WTDIRTY) endif ifdef DIST_VERSION VERSION = $(DIST_VERSION) endif # Split the version "TAG-OFFSET-gSHA1-DIRTY" into "TAG OFFSET" # and append 0 as a fallback offset for "exact" tagged versions. RPM_VERLIST = $(filter-out g% dirty,$(subst -, ,$(VERSION))) 0 RPM_VERSION = $(word 1,$(RPM_VERLIST)) RPM_RELEASE = $(word 2,$(RPM_VERLIST))$(if $(WTDIRTY),.dirty) LDLIBS ?= -lcurses CFLAGS ?= -Wall -O2 DFLAGS = -g -DDEBUG -Werror -O0 EXE = src/tig TOOLS = test/test-graph tools/doc-gen TXTDOC = doc/tig.1.adoc doc/tigrc.5.adoc doc/manual.adoc NEWS.adoc README.adoc INSTALL.adoc MANDOC = doc/tig.1 doc/tigrc.5 doc/tigmanual.7 HTMLDOC = doc/tig.1.html doc/tigrc.5.html doc/manual.html README.html INSTALL.html NEWS.html ALLDOC = $(MANDOC) $(HTMLDOC) doc/manual.html-chunked doc/manual.pdf # Never include the release number in the tarname for tagged # versions. ifneq ($(if $(DIST_VERSION),$(words $(RPM_VERLIST))),2) TARNAME = tig-$(RPM_VERSION)-$(RPM_RELEASE) else TARNAME = tig-$(RPM_VERSION) endif override CPPFLAGS += '-DTIG_VERSION="$(VERSION)"' override CPPFLAGS += '-DSYSCONFDIR="$(sysconfdir)"' ASCIIDOC ?= asciidoc ASCIIDOC_FLAGS = -aversion=$(VERSION) -asysconfdir=$(sysconfdir) -f doc/asciidoc.conf XMLTO ?= xmlto DOCBOOK2PDF ?= docbook2pdf all: $(EXE) $(TOOLS) all-debug: $(EXE) $(TOOLS) all-debug: CFLAGS += $(DFLAGS) doc: $(ALLDOC) doc-man: $(MANDOC) doc-html: $(HTMLDOC) export sysconfdir install: all $(QUIET_INSTALL)tools/install.sh bin $(EXE) "$(DESTDIR)$(bindir)" $(QUIET_INSTALL)tools/install.sh data tigrc "$(DESTDIR)$(sysconfdir)" install-doc-man: doc-man $(Q)$(foreach doc, $(filter %.1, $(MANDOC)), \ $(QUIET_INSTALL_EACH)tools/install.sh data $(doc) "$(DESTDIR)$(mandir)/man1";) $(Q)$(foreach doc, $(filter %.5, $(MANDOC)), \ $(QUIET_INSTALL_EACH)tools/install.sh data $(doc) "$(DESTDIR)$(mandir)/man5";) $(Q)$(foreach doc, $(filter %.7, $(MANDOC)), \ $(QUIET_INSTALL_EACH)tools/install.sh data $(doc) "$(DESTDIR)$(mandir)/man7";) install-release-doc-man: GIT_INDEX_FILE=.tmp-doc-index git read-tree origin/release GIT_INDEX_FILE=.tmp-doc-index git checkout-index -f --prefix=./ $(MANDOC) rm -f .tmp-doc-index $(MAKE) install-doc-man install-doc-html: doc-html $(Q)$(foreach doc, $(HTMLDOC), \ $(QUIET_INSTALL_EACH)tools/install.sh data $(doc) "$(DESTDIR)$(docdir)/tig";) install-release-doc-html: GIT_INDEX_FILE=.tmp-doc-index git read-tree origin/release GIT_INDEX_FILE=.tmp-doc-index git checkout-index -f --prefix=./ $(HTMLDOC) rm -f .tmp-doc-index $(MAKE) install-doc-html install-doc: install-doc-man install-doc-html install-release-doc: install-release-doc-man install-release-doc-html clean: $(RM) -r $(TARNAME) *.spec tig-*.tar.gz tig-*.tar.gz.md5 .deps $(RM) $(EXE) $(TOOLS) $(OBJS) core doc/*.xml src/builtin-config.c distclean: clean $(RM) -r doc/manual.html-chunked autom4te.cache release-docs $(RM) doc/*.toc $(ALLDOC) aclocal.m4 configure $(RM) config.h config.log config.make config.status config.h.in spell-check: for file in $(TXTDOC) src/tig.c; do \ aspell --lang=en --dont-backup \ --personal=./tools/aspell.dict check $$file; \ done strip: $(EXE) strip $(EXE) update-headers: @for file in include/*.h src/*.c tools/*.c; do \ grep -q '/* Copyright' "$$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"; \ rm "$$file.tmp"; \ echo "Updated $$file"; \ done update-docs: tools/doc-gen doc="doc/tigrc.5.adoc"; \ 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" ; \ 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 git archive --format=tar --prefix=$(TARNAME)/ HEAD | \ tar --delete $(TARNAME)/Makefile > $(TARNAME).tar && \ tar rf $(TARNAME).tar `find $(TARNAME)/*` && \ gzip -f -9 $(TARNAME).tar && \ md5sum $(TARNAME).tar.gz > $(TARNAME).tar.gz.md5 $(Q)$(RM) -r $(TARNAME) rpm: dist rpmbuild -ta $(TARNAME).tar.gz test: $(TOOLS) test/unit-test-graph.sh test/builtin-config.sh # 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 ./autogen.sh .PHONY: all all-debug doc doc-man doc-html install install-doc \ install-doc-man install-doc-html clean spell-check dist rpm test ifdef NO_MKSTEMPS COMPAT_CPPFLAGS += -DNO_MKSTEMPS COMPAT_OBJS += compat/mkstemps.o endif ifdef NO_SETENV COMPAT_CPPFLAGS += -DNO_SETENV COMPAT_OBJS += compat/setenv.o endif ifdef NO_STRNDUP COMPAT_CPPFLAGS += -DNO_STRNDUP COMPAT_OBJS += compat/strndup.o endif COMPAT_OBJS += compat/hashtab.o override CPPFLAGS += $(COMPAT_CPPFLAGS) TIG_OBJS = \ src/tig.o \ src/types.o \ src/string.o \ src/util.o \ src/argv.o \ src/io.o \ src/graph.o \ src/refdb.o \ src/builtin-config.o \ src/request.o \ src/line.o \ src/keys.o \ src/repo.o \ src/options.o \ src/draw.o \ src/prompt.o \ src/display.o \ src/view.o \ src/parse.o \ src/watch.o \ src/pager.o \ src/log.o \ src/diff.o \ src/help.o \ src/tree.o \ src/blob.o \ src/blame.o \ src/refs.o \ src/status.o \ src/stage.o \ src/main.o \ src/stash.o \ src/grep.o \ $(COMPAT_OBJS) src/tig: $(TIG_OBJS) TEST_GRAPH_OBJS = test/test-graph.o src/string.o src/util.o src/io.o src/graph.o $(COMPAT_OBJS) test/test-graph: $(TEST_GRAPH_OBJS) DOC_GEN_OBJS = tools/doc-gen.o src/string.o src/types.o src/util.o src/request.o tools/doc-gen: $(DOC_GEN_OBJS) OBJS = $(sort $(TIG_OBJS) $(TEST_GRAPH_OBJS) $(DOC_GEN_OBJS)) DEPS_CFLAGS ?= -MMD -MP -MF .deps/$*.d %: %.o $(QUIET_LINK)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ %.o: %.c $(CONFIG_H) @mkdir -p $(abspath .deps/$(*D)) $(QUIET_CC)$(CC) -I. -Iinclude $(CFLAGS) $(DEPS_CFLAGS) $(CPPFLAGS) -c -o $@ $< -include $(OBJS:%.o=.deps/%.d) src/builtin-config.c: tigrc tools/make-builtin-config.sh $(QUIET_GEN)tools/make-builtin-config.sh $< > $@ tig.spec: contrib/tig.spec.in $(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 \ case "$$line" in \ "----"*) echo ". <<$$ref>>"; ref= ;; \ "~~~~"*) echo "- <<$$ref>>"; ref= ;; \ "[["*"]]") ref="$$line" ;; \ *) ref="$$ref, $$line" ;; \ esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@ README.html: README.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article -a readme $< INSTALL.html: INSTALL.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article $< NEWS.html: NEWS.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article $< doc/tigmanual.7: doc/manual.adoc %.1.html : %.1.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d manpage $< %.1.xml : %.1.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b docbook -d manpage $< %.5.html : %.5.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d manpage $< %.5.xml : %.5.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b docbook -d manpage $< %.7.xml : %.7.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b docbook -d manpage $< %.html: ASCIIDOC_FLAGS += -adocext=html %.html : %.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b xhtml11 -d article -n $< %.xml : %.adoc doc/asciidoc.conf $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_FLAGS) -b docbook -d article $< % : %.xml $(QUIET_XMLTO)$(XMLTO) man -o doc $< %.html-chunked : %.xml $(QUIET_XMLTO)$(XMLTO) html -o $@ $< %.pdf : %.xml $(QUIET_DB2PDF)$(DOCBOOK2PDF) -o doc $< ############################################################################# # Quiet make ############################################################################# ifneq ($(findstring $(MAKEFLAGS),s),s) V = @ Q = $(V:1=) QUIET_CC = $(Q:@=@echo ' CC '$@;) QUIET_LINK = $(Q:@=@echo ' LINK '$@;) QUIET_GEN = $(Q:@=@echo ' GEN '$@;) QUIET_ASCIIDOC = $(Q:@=@echo ' ASCIIDOC '$@;) QUIET_XMLTO = $(Q:@=@echo ' XMLTO '$@;) QUIET_DB2PDF = $(Q:@=@echo ' DB2PDF '$@;) # tools/install.sh will print 'file -> $install_dir/file' QUIET_INSTALL = $(Q:@=@printf ' INSTALL ';) QUIET_INSTALL_EACH = $(Q:@=printf ' INSTALL ';) export V endif tig-2.0.2/aclocal.m40000644000076500000000000000140012333033402014716 0ustar00fonsecawheel00000000000000# generated automatically by aclocal 1.14 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_include([tools/ax_lib_readline.m4]) m4_include([tools/ax_with_curses.m4]) m4_include([acinclude.m4]) tig-2.0.2/config.h.in0000644000076500000000000000667612333033402015125 0ustar00fonsecawheel00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if a SysV or X/Open compatible Curses library is present */ #undef HAVE_CURSES /* Define to 1 if library supports color (enhanced functions) */ #undef HAVE_CURSES_COLOR /* Define to 1 if library supports X/Open Enhanced functions */ #undef HAVE_CURSES_ENHANCED /* Define to 1 if is present */ #undef HAVE_CURSES_H /* Define to 1 if library supports certain obsolete features */ #undef HAVE_CURSES_OBSOLETE /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #undef HAVE_DECL_ENVIRON /* Define to 1 if you have the declaration of `errno', and to 0 if you don't. */ #undef HAVE_DECL_ERRNO /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkstemps' function. */ #undef HAVE_MKSTEMPS /* Define to 1 if the Ncurses library is present */ #undef HAVE_NCURSES /* Define to 1 if the NcursesW library is present */ #undef HAVE_NCURSESW /* Define to 1 if is present */ #undef HAVE_NCURSESW_CURSES_H /* Define to 1 if is present */ #undef HAVE_NCURSESW_H /* Define to 1 if is present */ #undef HAVE_NCURSES_CURSES_H /* Define to 1 if is present */ #undef HAVE_NCURSES_H /* Define if you have a GNU readline compatible library */ #undef HAVE_READLINE /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* encoded version of the installed readline library */ #undef RL_READLINE_VERSION /* major version of installed readline library */ #undef RL_VERSION_MAJOR /* minor version of installed readline library */ #undef RL_VERSION_MINOR /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS tig-2.0.2/configure0000755000076500000000000053112512333033402015001 0ustar00fonsecawheel00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for tig 0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: jonas.fonseca@gmail.com about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tig' PACKAGE_TARNAME='tig' PACKAGE_VERSION='0' PACKAGE_STRING='tig 0' PACKAGE_BUGREPORT='jonas.fonseca@gmail.com' PACKAGE_URL='' ac_unique_file="src" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS DOCBOOK2PDF XMLTO ASCIIDOC RL_MINOR RL_MAJOR RL_VERSION CURSES_LIB NO_STRNDUP NO_SETENV NO_MKSTEMPS EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_ncurses with_ncursesw with_readline with_libiconv ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CURSES_LIB' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures tig 0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/tig] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tig 0:";; esac cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-ncurses force the use of Ncurses or NcursesW --without-ncursesw do not use NcursesW (wide character support) --with-readline=DIR search for readline in DIR/include and DIR/lib --with-libiconv=DIR search for libiconv in DIR/include and DIR/lib Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l 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 Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF tig configure 0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------------- ## ## Report this to jonas.fonseca@gmail.com ## ## -------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tig $as_me 0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; 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_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_prog_CC="${ac_tool_prefix}gcc" $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 fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; 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_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_prog_ac_ct_CC="gcc" $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 fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; 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_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_prog_CC="${ac_tool_prefix}cc" $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 fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; 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_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; 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_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_prog_CC="$ac_tool_prefix$ac_prog" $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 fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; 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_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_prog_ac_ct_CC="$ac_prog" $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 fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.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" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF fi done ac_fn_c_check_decl "$LINENO" "environ" "ac_cv_have_decl_environ" "$ac_includes_default" if test "x$ac_cv_have_decl_environ" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ENVIRON $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "errno" "ac_cv_have_decl_errno" "#include " if test "x$ac_cv_have_decl_errno" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ERRNO $ac_have_decl _ACEOF for ac_func in mkstemps do : ac_fn_c_check_func "$LINENO" "mkstemps" "ac_cv_func_mkstemps" if test "x$ac_cv_func_mkstemps" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MKSTEMPS 1 _ACEOF NO_MKSTEMPS="#" fi done for ac_func in setenv do : ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" if test "x$ac_cv_func_setenv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETENV 1 _ACEOF NO_SETENV="#" fi done for ac_func in strndup do : ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRNDUP 1 _ACEOF NO_STRNDUP="#" fi done # Check whether --with-ncurses was given. if test "${with_ncurses+set}" = set; then : withval=$with_ncurses; else with_ncurses=check fi # Check whether --with-ncursesw was given. if test "${with_ncursesw+set}" = set; then : withval=$with_ncursesw; else with_ncursesw=check fi ax_saved_LIBS=$LIBS if test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes; then : ax_with_plaincurses=no else ax_with_plaincurses=check fi ax_cv_curses_which=no # Test for NcursesW if test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno; then : LIBS="$ax_saved_LIBS -lncursesw" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NcursesW wide-character library" >&5 $as_echo_n "checking for NcursesW wide-character library... " >&6; } if ${ax_cv_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else 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 initscr (); int main () { return initscr (); ; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ncursesw" >&5 $as_echo "$ax_cv_ncursesw" >&6; } 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 fi if test "x$ax_cv_ncursesw" = xyes; then : ax_cv_curses=yes ax_cv_curses_which=ncursesw CURSES_LIB="-lncursesw" $as_echo "#define HAVE_NCURSESW 1" >>confdefs.h $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncursesw/curses.h" >&5 $as_echo_n "checking for working ncursesw/curses.h... " >&6; } if ${ax_cv_header_ncursesw_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncursesw_curses_h=yes else ax_cv_header_ncursesw_curses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncursesw_curses_h" >&5 $as_echo "$ax_cv_header_ncursesw_curses_h" >&6; } if test "x$ax_cv_header_ncursesw_curses_h" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSESW_CURSES_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncursesw.h" >&5 $as_echo_n "checking for working ncursesw.h... " >&6; } if ${ax_cv_header_ncursesw_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncursesw_h=yes else ax_cv_header_ncursesw_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncursesw_h" >&5 $as_echo "$ax_cv_header_ncursesw_h" >&6; } if test "x$ax_cv_header_ncursesw_h" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSESW_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses.h" >&5 $as_echo_n "checking for working ncurses.h... " >&6; } if ${ax_cv_header_ncurses_h_with_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncurses_h_with_ncursesw=yes else ax_cv_header_ncurses_h_with_ncursesw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncurses_h_with_ncursesw" >&5 $as_echo "$ax_cv_header_ncurses_h_with_ncursesw" >&6; } if test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h fi if test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h" >&5 $as_echo "$as_me: WARNING: could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h" >&2;} fi fi fi # Test for Ncurses 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 ${ax_cv_ncurses+:} false; then : $as_echo_n "(cached) " >&6 else 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 initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_ncurses=yes else ax_cv_ncurses=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ncurses" >&5 $as_echo "$ax_cv_ncurses" >&6; } 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 fi if test "x$ax_cv_ncurses" = xyes; then : ax_cv_curses=yes ax_cv_curses_which=ncurses CURSES_LIB="-lncurses" $as_echo "#define HAVE_NCURSES 1" >>confdefs.h $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses/curses.h" >&5 $as_echo_n "checking for working ncurses/curses.h... " >&6; } if ${ax_cv_header_ncurses_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncurses_curses_h=yes else ax_cv_header_ncurses_curses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncurses_curses_h" >&5 $as_echo "$ax_cv_header_ncurses_curses_h" >&6; } if test "x$ax_cv_header_ncurses_curses_h" = xyes; then : ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSES_CURSES_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses.h" >&5 $as_echo_n "checking for working ncurses.h... " >&6; } if ${ax_cv_header_ncurses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncurses_h=yes else ax_cv_header_ncurses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncurses_h" >&5 $as_echo "$ax_cv_header_ncurses_h" >&6; } if test "x$ax_cv_header_ncurses_h" = xyes; then : ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h fi if test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a working ncurses/curses.h or ncurses.h" >&5 $as_echo "$as_me: WARNING: could not find a working ncurses/curses.h or ncurses.h" >&2;} fi fi fi # Test for plain Curses (or if CURSES_LIB 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 : LIBS="$ax_saved_LIBS $CURSES_LIB" else LIBS="$ax_saved_LIBS -lcurses" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Curses library" >&5 $as_echo_n "checking for Curses library... " >&6; } if ${ax_cv_plaincurses+:} false; then : $as_echo_n "(cached) " >&6 else 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 initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses=yes else ax_cv_plaincurses=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses" >&5 $as_echo "$ax_cv_plaincurses" >&6; } if test "x$ax_cv_plaincurses" = xyes; then : ax_cv_curses=yes ax_cv_curses_which=plaincurses if test "x$CURSES_LIB" = x; then : CURSES_LIB="-lcurses" fi $as_echo "#define HAVE_CURSES 1" >>confdefs.h # Check for base conformance (and header file) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working curses.h" >&5 $as_echo_n "checking for working curses.h... " >&6; } if ${ax_cv_header_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; initscr(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_curses_h=yes else ax_cv_header_curses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_curses_h" >&5 $as_echo "$ax_cv_header_curses_h" >&6; } if test "x$ax_cv_header_curses_h" = xyes; then : $as_echo "#define HAVE_CURSES_H 1" >>confdefs.h # Check for X/Open Enhanced conformance { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X/Open Enhanced Curses conformance" >&5 $as_echo_n "checking for X/Open Enhanced Curses conformance... " >&6; } if ${ax_cv_plaincurses_enhanced+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifndef _XOPEN_CURSES #error "this Curses library is not enhanced" "this Curses library is not enhanced" #endif int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses_enhanced=yes else ax_cv_plaincurses_enhanced=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses_enhanced" >&5 $as_echo "$ax_cv_plaincurses_enhanced" >&6; } if test "x$ax_cv_plaincurses_enhanced" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h fi # Check for color functions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Curses color functions" >&5 $as_echo_n "checking for Curses color functions... " >&6; } if ${ax_cv_plaincurses_color+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses_color=yes else ax_cv_plaincurses_color=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses_color" >&5 $as_echo "$ax_cv_plaincurses_color" >&6; } if test "x$ax_cv_plaincurses_color" = xyes; then : ax_cv_curses_color=yes $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h fi # Check for obsolete functions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obsolete Curses functions" >&5 $as_echo_n "checking for obsolete Curses functions... " >&6; } if ${ax_cv_plaincurses_obsolete+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses_obsolete=yes else ax_cv_plaincurses_obsolete=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses_obsolete" >&5 $as_echo "$ax_cv_plaincurses_obsolete" >&6; } if test "x$ax_cv_plaincurses_obsolete" = xyes; then : ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h fi fi if test "x$ax_cv_header_curses_h" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a working curses.h" >&5 $as_echo "$as_me: WARNING: could not find a working curses.h" >&2;} fi fi fi if test "x$ax_cv_curses" != xyes; then : ax_cv_curses=no fi if test "x$ax_cv_curses_enhanced" != xyes; then : ax_cv_curses_enhanced=no fi if test "x$ax_cv_curses_color" != xyes; then : ax_cv_curses_color=no fi if test "x$ax_cv_curses_obsolete" != xyes; then : ax_cv_curses_obsolete=no fi LIBS=$ax_saved_LIBS case "$ax_cv_ncurses" in "no") as_fn_error $? "ncurses not found" "$LINENO" 5 esac case "$ax_cv_ncursesw" in "no") { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The found ncurses library does not support wide-char." >&5 $as_echo "$as_me: WARNING: The found ncurses library does not support wide-char." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This means that tig will not correctly render UTF-8." >&5 $as_echo "$as_me: WARNING: This means that tig will not correctly render UTF-8." >&2;} esac # save cpp and ld options _save_CFLAGS="$CFLAGS" _save_LDFLAGS="$LDFLAGS" _save_LIBS="$LIBS" if test "X$bash_cv_termcap_lib" = "X"; then _bash_needmsg=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 $as_echo_n "checking which library has the termcap functions... " >&6; } _bash_needmsg= fi if ${bash_cv_termcap_lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_fn_c_check_func "$LINENO" "tgetent" "ac_cv_func_tgetent" 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 : $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 { $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="-ltinfo $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_tinfo_tgetent=yes else 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_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_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw $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_ncursesw_tgetent=yes else 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_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_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $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_ncurses_tgetent=yes else 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_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 fi elif test "$ax_cv_curses_which" = "plaincurses"; then { $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 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $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_curses_tgetent=yes else ac_cv_lib_curses_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_curses_tgetent" >&5 $as_echo "$ac_cv_lib_curses_tgetent" >&6; } if test "x$ac_cv_lib_curses_tgetent" = xyes; then : bash_cv_termcap_lib=libcurses fi fi fi fi fi fi if test "X$_bash_needmsg" = "Xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 $as_echo_n "checking which library has the termcap functions... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $bash_cv_termcap_lib" >&5 $as_echo "using $bash_cv_termcap_lib" >&6; } if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then 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 TERMCAP_LIB=-ltermcap TERMCAP_DEP= elif test $bash_cv_termcap_lib = libtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncursesw; then TERMCAP_LIB=-lncursesw TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= elif test $bash_cv_termcap_lib = libc; then TERMCAP_LIB= TERMCAP_DEP= else TERMCAP_LIB=-lcurses TERMCAP_DEP= fi CFLAGS="$_save_CFLAGS" LDFLAGS="$_save_LDFLAGS" LIBS="$_save_LIBS" RL_VERSION_REQUIRED="6.2" RL_MAJOR_REQUIRED="$(echo "6.2" | sed -n 's/\([]0-9[]*\)[].[]\([]0-9[]*\)/\1/p')" RL_MINOR_REQUIRED="$(echo "6.2" | sed -n 's/\([]0-9[]*\)[].[]\([]0-9[]*\)/\2/p')" RL_MAJOR=0 RL_MINOR=0 # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; ac_cv_rl_prefix=$with_readline fi for ac_header in readline/readline.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_readline_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_READLINE_H 1 _ACEOF for ac_header in readline/history.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" if test "x$ac_cv_header_readline_history_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_HISTORY_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of installed readline library" >&5 $as_echo_n "checking version of installed readline library... " >&6; } # What a pain in the ass this is. # save cpp and ld options _save_CFLAGS="$CFLAGS" _save_LDFLAGS="$LDFLAGS" _save_LIBS="$LIBS" # Don't set ac_cv_rl_prefix if the caller has already assigned a value. This # allows the caller to do something like $_rl_prefix=$withval if the user # specifies --with-installed-readline=PREFIX as an argument to configure if test -z "$ac_cv_rl_prefix"; then test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix} fi eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib LIBS="$LIBS -lreadline ${TERMCAP_LIB}" CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" if ${ac_cv_rl_version+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_rl_version='4.2' else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern int rl_gnu_readline_p; main() { FILE *fp; fp = fopen("conftest.rlv", "w"); if (fp == 0) exit(1); if (rl_gnu_readline_p != 1) fprintf(fp, "0.0\n"); else fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); fclose(fp); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_rl_version=`cat conftest.rlv` else ac_cv_rl_version='0.0' fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi CFLAGS="$_save_CFLAGS" LDFLAGS="$_save_LDFLAGS" LIBS="$_save_LIBS" RL_MAJOR=0 RL_MINOR=0 # ( case "$ac_cv_rl_version" in 2*|3*|4*|5*|6*|7*|8*|9*) RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[a-zA-Z]*$::'` ;; esac # ((( case $RL_MAJOR in [0-9][0-9]) _RL_MAJOR=$RL_MAJOR ;; [0-9]) _RL_MAJOR=0$RL_MAJOR ;; *) _RL_MAJOR=00 ;; esac # ((( case $RL_MINOR in [0-9][0-9]) _RL_MINOR=$RL_MINOR ;; [0-9]) _RL_MINOR=0$RL_MINOR ;; *) _RL_MINOR=00 ;; esac RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}" # Readline versions greater than 4.2 have these defines in readline.h if test $ac_cv_rl_version = '0.0' ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not test version of installed readline library." >&5 $as_echo "$as_me: WARNING: Could not test version of installed readline library." >&2;} elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then # set these for use by the caller RL_PREFIX=$ac_cv_rl_prefix RL_LIBDIR=$ac_cv_rl_libdir RL_INCLUDEDIR=$ac_cv_rl_includedir { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rl_version" >&5 $as_echo "$ac_cv_rl_version" >&6; } else cat >>confdefs.h <<_ACEOF #define RL_READLINE_VERSION $RL_VERSION _ACEOF cat >>confdefs.h <<_ACEOF #define RL_VERSION_MAJOR $RL_MAJOR _ACEOF cat >>confdefs.h <<_ACEOF #define RL_VERSION_MINOR $RL_MINOR _ACEOF # set these for use by the caller RL_PREFIX=$ac_cv_rl_prefix RL_LIBDIR=$ac_cv_rl_libdir RL_INCLUDEDIR=$ac_cv_rl_includedir { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rl_version" >&5 $as_echo "$ac_cv_rl_version" >&6; } fi fi done fi done if test $RL_MAJOR -ge $RL_MAJOR_REQUIRED || { test $RL_MAJOR = $RL_MAJOR_REQUIRED && test $RL_MINOR -ge $RL_MINOR_REQUIRED ; } ; then LIBS="$LIBS -lreadline ${TERMCAP_LIB}" CFLAGS="$CFLAGS -I${RL_INCLUDEDIR}" LDFLAGS="$LDFLAGS -L${RL_LIBDIR}" $as_echo "#define HAVE_READLINE 1" >>confdefs.h elif test -n "$ac_cv_rl_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Minimum required version of readline is $RL_VERSION_REQUIRED" >&5 $as_echo "$as_me: WARNING: Minimum required version of readline is $RL_VERSION_REQUIRED" >&2;} fi # Check whether --with-libiconv was given. if test "${with_libiconv+set}" = set; then : withval=$with_libiconv; 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #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 int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "iconv() not found. Please install libiconv and use --with-libiconv=/path/to/dir. See \`config.log' for more details" "$LINENO" 5; } fi if test "$am_cv_lib_iconv" = yes; then LIBS="$LIBS -liconv" fi for ac_prog in asciidoc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; 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_prog_ASCIIDOC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ASCIIDOC"; then ac_cv_prog_ASCIIDOC="$ASCIIDOC" # Let the user override the test. else 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_prog_ASCIIDOC="$ac_prog" $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 fi fi ASCIIDOC=$ac_cv_prog_ASCIIDOC if test -n "$ASCIIDOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASCIIDOC" >&5 $as_echo "$ASCIIDOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ASCIIDOC" && break done test -n "$ASCIIDOC" || ASCIIDOC="false" for ac_prog in xmlto do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; 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_prog_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XMLTO"; then ac_cv_prog_XMLTO="$XMLTO" # Let the user override the test. else 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_prog_XMLTO="$ac_prog" $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 fi fi XMLTO=$ac_cv_prog_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XMLTO" && break done test -n "$XMLTO" || XMLTO="false" for ac_prog in docbook2pdf do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; 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_prog_DOCBOOK2PDF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOCBOOK2PDF"; then ac_cv_prog_DOCBOOK2PDF="$DOCBOOK2PDF" # Let the user override the test. else 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_prog_DOCBOOK2PDF="$ac_prog" $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 fi fi DOCBOOK2PDF=$ac_cv_prog_DOCBOOK2PDF if test -n "$DOCBOOK2PDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK2PDF" >&5 $as_echo "$DOCBOOK2PDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DOCBOOK2PDF" && break done test -n "$DOCBOOK2PDF" || DOCBOOK2PDF="false" ac_config_files="$ac_config_files config.make" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by tig $as_me 0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ tig config.status 0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi tig-2.0.2/tig.spec0000644000076500000000000000462112333033402014525 0ustar00fonsecawheel00000000000000# -*- mode: rpm-spec-mode; encoding: utf-8; -*- # Pass '--without docs' to rpmbuild if you don't want the documentation to be build Summary: Tig: text-mode interface for git Name: tig Version: 2.0.2 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 BuildRequires: ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: git-core, ncurses %description Tig is a git repository browser that additionally can act as a pager for output from various git commands. When browsing repositories, it uses the underlying git commands to present the user with various views, such as summarized revision log and showing the commit with the log message, diffstat, and the diff. Using it as a pager, it will display input from stdin and colorize it. %prep %setup -q %build %configure CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}" %{__make} %{_smp_mflags} \ prefix=%{_prefix} \ all %{!?_without_docs: doc-man doc-html} %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}" %{__make} %{_smp_mflags} DESTDIR=$RPM_BUILD_ROOT \ prefix=%{_prefix} bindir=%{_bindir} mandir=%{_mandir} \ install %{!?_without_docs: install-doc-man} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_bindir}/* %{_sysconfdir}/* %doc README.adoc COPYING INSTALL.adoc NEWS.adoc contrib/tig-completion.bash %{!?_without_docs: %{_mandir}/man1/*.1*} %{!?_without_docs: %{_mandir}/man5/*.5*} %{!?_without_docs: %{_mandir}/man7/*.7*} %{!?_without_docs: %doc doc/*.html} %{?_without_docs: %doc doc/*.txt} %changelog * Sun 23 Feb 2014 Jonas Fonseca - Add tigrc installed in /etc * Tue Jan 8 2013 Joakim Sernbrant - Added configure * Thu Aug 16 2012 Victor Foitzik - Now also packaging man(7) pages * Sat Jun 23 2007 Jonas Fonseca - Include tig bash completion script * Fri Jun 1 2007 Jakub Narebski - Include documentation sources for --without docs - Remove PDF version of manual from being build and installed * Mon May 28 2007 Jakub Narebski - Initial tig spec file