aboutsummaryrefslogtreecommitdiff
path: root/help.c
Commit message (Collapse)AuthorAge
* git-help: add "help.format" config variable.Christian Couder2007-12-14
| | | | | | | | | | | | | | | | | | | | | | | | This config variable makes it possible to choose the default format used to display help. This format will be used only if no option like -a|--all|-i|--info|-m|--man|-w|--web is passed to "git-help". The following values are possible for this variable: - "man" --> "man" program is used - "info" --> "info" program is used - "web" --> "git-browse-help" is used By default we still show help using "man". This patch also adds -m|--man command line option to use "man" to allow overriding the "help.format" configuration variable. Note that this patch also revert some recent changes in "git-browse-help" because they prevented to look for config variables in the global configuration file. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-help -i: show info documentation from matching version of gitJunio C Hamano2007-12-10
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-help -i: invoke info with document and node nameJunio C Hamano2007-12-10
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'master' into cc/helpJunio C Hamano2007-12-10
|\ | | | | | | | | This is to primarily pull in MANPATH tweak and help.txt formatting fix from the master branch.
| * Let git-help prefer man-pages installed with this version of gitSergei Organov2007-12-08
| | | | | | | | | | | | | | | | | | | | | | Prepend $(prefix)/share/man to the MANPATH environment variable before invoking 'man' from help.c:show_man_page(). There may be other git documentation in the user's MANPATH but the user is asking a specific instance of git about its own documentation, so we'd better show the documentation for _that_ instance of git. Signed-off-by: Sergei Organov <osv@javad.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-help: add -w|--web option to display html man page in a browser.Christian Couder2007-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now when using "git help -w cmd", we will try to show the HTML man page "git-cmd.html" in your prefered web browser. To do that "help.c" code will call a new shell script "git-browse-help". This currently works only if the HTML versions of the man page have been installed in $(htmldir) (typically "/usr/share/doc/git-doc"), so new target to do that is added to "Documentation/Makefile". The browser to use can be configured using the "web.browser" config variable. We try to open a new tab in an existing web browser, if possible. The code in "git-browse-help" is heavily stolen from "git-mergetool" by Theodore Y. Ts'o. Thanks. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-help: add -i|--info option to display info page.Christian Couder2007-12-03
|/ | | | | | | "git help --info subcommand" will now call "info git-subcommand". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'tt/help'Junio C Hamano2007-12-01
|\ | | | | | | | | | | * tt/help: Remove hint to use "git help -a" Make the list of common commands more exclusive
| * Remove hint to use "git help -a"Theodore Ts'o2007-11-14
| | | | | | | | | | | | | | | | | | The newbie user will run away screaming when they see all possible commands. The expert user will already know about the -a option from reading the git man page. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Move #include <sys/select.h> and <sys/ioctl.h> to git-compat-util.h.Johannes Sixt2007-11-14
|/ | | | | | | ... since all system headers are pulled in via git-compat-util.h Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Style: place opening brace of a function definition at column 1Junio C Hamano2007-11-08
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* include $PATH in generating list of commands for "help -a"Scott R Parish2007-10-29
| | | | | | | | | | | | | Git had previously been using the $PATH for scripts--a previous patch moved exec'ed commands to also use the $PATH. For consistency "help -a" should also list commands in the $PATH. The main commands are still listed from the git_exec_path(), but the $PATH is walked and other git commands (probably extensions) are listed. Signed-off-by: Scott R Parish <srp@srparish.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* list_commands(): simplify code by using chdir()Scott R Parish2007-10-29
| | | | | | | | The current code builds absolute path strings for each file to stat(), this can easily be avoided by chdir()ing into the directory. Signed-off-by: Scott R Parish <srp@srparish.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remove unused/unneeded "pattern" argument of list_commandsScott R Parish2007-10-29
| | | | | | | | | | list_commands() currently accepts and ignores a "pattern" argument, and then hard codes a prefix as well as some magic numbers. This hardcodes the prefix inside of the function and removes the magic numbers. Signed-off-by: Scott R Parish <srp@srparish.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* "git" returns 1; "git help" and "git help -a" return 0Scott R Parish2007-10-29
| | | | | Signed-off-by: Scott R Parish <srp@srparish.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* help: remove extra blank line after "See 'git --help'" messageJunio C Hamano2007-10-26
| | | | | | | | The double LF were there only because we gave a list of common commands. WIth the list gone, there is no reason to have the extra blank line. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* On error, do not list all commands, but point to --help optionJari Aalto2007-10-22
| | | | | | | | - Remove out call to list_common_cmds_help() - Send error message to stderr, not stdout. Signed-off-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* War on whitespaceJunio C Hamano2007-06-07
| | | | | | | | | This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* use xrealloc in help.cJames Bowes2007-03-27
| | | | | Signed-off-by: James Bowes <jbowes@dangerouslyinc.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* use xmalloc in git.c and help.cJames Bowes2007-03-25
| | | | | Signed-off-by: James Bowes <jbowes@dangerouslyinc.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Mechanical conversion to use prefixcmp()Junio C Hamano2007-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mechanically converts strncmp() to use prefixcmp(), but only when the parameters match specific patterns, so that they can be verified easily. Leftover from this will be fixed in a separate step, including idiotic conversions like if (!strncmp("foo", arg, 3)) => if (!(-prefixcmp(arg, "foo"))) This was done by using this script in px.perl #!/usr/bin/perl -i.bak -p if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) { s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|; } if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) { s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|; } and running: $ git grep -l strncmp -- '*.c' | xargs perl px.perl Signed-off-by: Junio C Hamano <junkio@cox.net>
* Avoid ugly linewrap in git helpRen,bi(B Scharfe2007-02-11
| | | | | | | | | | | Some of the short help texts that are shown e.g. when running 'git' without any parameters wrap on a 80-column terminal. They are just one character over the line. This patch avoids it by decreasing the number of spaces around the preceding command name from four to three (on both sides for symmetry). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* simplify inclusion of system header files.Junio C Hamano2006-12-20
| | | | | | | | | | | | | | | | | | | | This is a mechanical clean-up of the way *.c files include system header files. (1) sources under compat/, platform sha-1 implementations, and xdelta code are exempt from the following rules; (2) the first #include must be "git-compat-util.h" or one of our own header file that includes it first (e.g. config.h, builtin.h, pkt-line.h); (3) system headers that are included in "git-compat-util.h" need not be included in individual C source files. (4) "git-compat-util.h" does not have to include subsystem specific header files (e.g. expat.h). Signed-off-by: Junio C Hamano <junkio@cox.net>
* Use xmalloc instead of mallocJonas Fonseca2006-08-31
| | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* remove unnecessary initializationsDavid Rientjes2006-08-15
| | | | | | | | [jc: I needed to hand merge the changes to the updated codebase, so the result needs to be checked.] Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'mk/rename'Junio C Hamano2006-08-12
|
* Merge branch 'master' into mk/renameJunio C Hamano2006-08-10
| | | | | | | | | | | | | | | | | | | | | | | * master: git-verify-pack: no need to count errors git-verify-pack: buffer overrun paranoia git-verify-pack: free pack after use and a cleanup git-verify-pack: get rid of while loop git-verify-pack: insist on .idx extension git-verify-pack: more careful path handling git-verify-pack: show usage when no pack was specified Add has_extension() builtin-apply: remove unused increment Fix git-diff A...B combine-diff: use color git-apply: applying a patch to make a symlink shorter. allow diff.renamelimit to be set regardless of -M/-C make --find-copies-harder imply -C find_unique_abbrev() with len=0 should not abbreviate check return value from diff_setup_done() Fix tutorial-2.html Documentation: git-status takes the same options as git-commit Update git-init-db(1) and documentation of core.sharedRepository
* builtins: Makefile clean-upJunio C Hamano2006-08-04
This cleans up the build procedure for built-in commands by: - generating mostly redundant definition of BUILT_INS from BUILTIN_OBJS in the Makefile, - renaming a few files to make the above possible, and - sorting the built-in command table in git.c. It might be a good idea to binary search (or perfect hash) the built-in command table, but that can be done later when somebody feels like. Signed-off-by: Junio C Hamano <junkio@cox.net>