tig-1.2.1/000077500000000000000000000000001220614311000122645ustar00rootroot00000000000000tig-1.2.1/.gitignore000066400000000000000000000004551220614311000142600ustar00rootroot00000000000000aclocal.m4 autom4te.cache config.h config.h.in config.log /config.make config.status configure cscope.out doc/tig.1 doc/tigmanual.7 doc/tigrc.5 doc/release-docs/ doc/manual.html-chunked doc/manual.pdf doc/manual.toc tags test-graph tig tig-*.tar.gz tig-*.tar.gz.md5 tig.spec *.html *.o *.swp *.xml *~ tig-1.2.1/BUGS000066400000000000000000000005251220614311000127510ustar00rootroot00000000000000BUGS ---- 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. tig-1.2.1/COPYING000066400000000000000000000431071220614311000133240ustar00rootroot00000000000000 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-1.2.1/INSTALL000066400000000000000000000104271220614311000133210ustar00rootroot00000000000000Installation instructions ========================= 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 Release notes documenting notable changes are available in the NEWS file. When upgrading, you are advised to read them before you install. 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 compatibility 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()`. 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 optional tools and packages are needed for creating the configure script and building documentation: [cols="2<,8<",options="header"] |============================================================================= |Tool |Description |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-1.2.1/NEWS000066400000000000000000000553211220614311000127710ustar00rootroot00000000000000Release notes ============= 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-1.2.1/README000066400000000000000000000014021220614311000131410ustar00rootroot00000000000000Tig: text-mode interface for Git ================================ 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[] Installation ------------ For installation instructions see the link:INSTALL.html[INSTALL] file. tig-1.2.1/acinclude.m4000066400000000000000000000045501220614311000144610ustar00rootroot00000000000000dnl 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-1.2.1/autogen.sh000077500000000000000000000007721220614311000142730ustar00rootroot00000000000000#!/bin/sh export WARNINGS="all" set -e # Ideally, we could just do this: # #${AUTORECONF:-autoreconf} -v -I contrib # # 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 contrib run ${AUTOCONF:-autoconf} --include=contrib run ${AUTOHEADER:-autoheader} --include=contrib tig-1.2.1/compat/000077500000000000000000000000001220614311000135475ustar00rootroot00000000000000tig-1.2.1/compat/compat.h000066400000000000000000000022651220614311000152100ustar00rootroot00000000000000/* 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_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 #endif /* vim: set ts=8 sw=8 noexpandtab: */ tig-1.2.1/compat/mkstemps.c000066400000000000000000000074541220614311000155700ustar00rootroot00000000000000/* 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-1.2.1/compat/setenv.c000066400000000000000000000110521220614311000152160ustar00rootroot00000000000000/* 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-1.2.1/config.make.in000066400000000000000000000011371220614311000147770ustar00rootroot00000000000000# -*- 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 %.o: config.h config.status: configure ./config.status --recheck config.h config.make: config.status ./config.status $@ config.make: config.make.in tig-1.2.1/configure.ac000066400000000000000000000022501220614311000145510ustar00rootroot00000000000000AC_INIT([tig],[0],[Jonas Fonseca ],[tig]) AC_LANG([C]) AC_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(tig.c) dnl Document where we keep our .m4 file. AC_CONFIG_MACRO_DIR([contrib]) dnl Make sure aclocal actually found it! m4_pattern_forbid([^AX_]) AC_PROG_CC AC_CHECK_HEADERS([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], ["#"])]) 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) 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 '(("\\_ # # 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" README="${root}README" 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 < 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-1.2.1/contrib/config.make000077500000000000000000000005131220614311000160320ustar00rootroot00000000000000# Example config.make. # Install files under /usr/local instead of under $HOME. prefix=/usr/local # Use ncursesw. LDLIBS =-lncursesw CPPFLAGS =-DHAVE_NCURSESW_CURSES_H # Uncomment to enable work-around for missing setenv(). #NO_SETENV=y # Uncomment to enable work-around for missing mkstemps(). #NO_MKSTEMPS=y # vim: ft=make: tig-1.2.1/contrib/config.make-Darwin000066400000000000000000000003231220614311000172500ustar00rootroot00000000000000# 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 # vim: ft=make: tig-1.2.1/contrib/header.h000066400000000000000000000010671220614311000153310ustar00rootroot00000000000000/* 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. */ tig-1.2.1/contrib/release.sh000077500000000000000000000036341220614311000157110ustar00rootroot00000000000000#!/bin/sh # # Script for preparing a release or updating the release branch. # Usage: $0 version # # Copyright (c) 2009-2012 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')" # 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. ./contrib/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-1.2.1/contrib/tig-completion.bash000077500000000000000000000124361220614311000175260ustar00rootroot00000000000000## # 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 $(__tig_refs)" ;; esac return fi case "$command" in blame) _tig_blame ;; show) _tig_show ;; status) ;; *) _tigcomp " $(__tig_complete_file) $(__tig_refs) " ;; esac } 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-1.2.1/contrib/tig.spec.in000066400000000000000000000044461220614311000160000ustar00rootroot00000000000000# -*- 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}/* %doc README COPYING INSTALL BUGS contrib/tigrc 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 * 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-1.2.1/contrib/tigrc000066400000000000000000000034501220614311000147610ustar00rootroot00000000000000# # Base configuration # # Syntax: set