aboutsummaryrefslogtreecommitdiff
path: root/help.h
Commit message (Collapse)AuthorAge
* help: add help_unknown_ref()Vikrant Varma2013-05-08
| | | | | | | | | | | | | | | | | | | | When the user gives an unknown string to a command that expects to get a ref, we could be more helpful than just saying "that's not a ref" and die. Add helper function help_unknown_ref() to take care of displaying an error message along with a list of suggested refs the user might have meant. An interaction with "git merge" might go like this: $ git merge foo merge: foo - not something we can merge Did you mean one of these? origin/foo upstream/foo Signed-off-by: Vikrant Varma <vikrant.varma94@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'nd/columns'Junio C Hamano2012-05-03
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of commands learn --column option to produce columnar output. By Nguyễn Thái Ngọc Duy (9) and Zbigniew Jędrzejewski-Szmek (1) * nd/columns: tag: add --column column: support piping stdout to external git-column process status: add --column branch: add --column help: reuse print_columns() for help -a column: add dense layout support t9002: work around shells that are unable to set COLUMNS to 1 column: add columnar layout Stop starting pager recursively Add column layout skeleton and git-column
| * help: reuse print_columns() for help -aNguyễn Thái Ngọc Duy2012-04-27
| | | | | | | | | | | | | | "help -a" also respects column.ui (and column.help if presents) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | help: replace underlining "help -a" headers using hyphens with a blank lineNguyễn Thái Ngọc Duy2012-04-25
|/ | | | | | | | | | | | | | | | | | | | | | | | | We used to underline a header text, like this: This is a header ---------------- content... But calculating text length so that the dashes align with the text could get complicated because the text could be in any charset in translated Git. There is no point to use this pseudo underline; simply a blank line would do and it even makes it easier to read: This is a header content... While at it, give translators more context to translate, e.g. e.g. "git commands available..." instead of "%s available..." Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin.h: Move two functions definitions to help.h.Thiago Farina2010-09-01
| | | | | | | | The two functions defined here are implemented in help.c, so makes more sense to put the definition of those in help.h instead of in builtin.h. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ar/autospell'Junio C Hamano2008-09-07
|\ | | | | | | | | | | * ar/autospell: Add help.autocorrect to enable/disable autocorrecting git wrapper: DWIM mistyped commands
| * git wrapper: DWIM mistyped commandsJohannes Schindelin2008-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a modified Damerau-Levenshtein algorithm into Git's code base, and uses it with the following penalties to show some similar commands when an unknown command was encountered: swap = 0, insertion = 1, substitution = 2, deletion = 4 A typical output would now look like this: $ git sm git: 'sm' is not a git-command. See 'git --help'. Did you mean one of these? am rm The cut-off is at similarity rating 6, which was empirically determined to give sensible results. As a convenience, if there is only one candidate, Git continues under the assumption that the user mistyped it. Example: $ git reabse WARNING: You called a Git program named 'reabse', which does not exist. Continuing under the assumption that you meant 'rebase' [...] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Remove calculation of the longest command name from where it is not usedAlex Riesen2008-08-28
|/ | | | | | | | | Just calculate it where it is needed - it is cheap and trivial, as all the lengths are already there (stored when creating the command lists). Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Builtin git-help.Miklos Vajna2008-08-02
| | | | | | | | | | | | This patch splits out git-help's functions to builtin-help.c and leaves only functions used by other builtins in help.c. First this removes git-help's functions from libgit which are not interesting for other builtins, second this makes 'git help help' work again. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-help: make some internal functions available to other builtinsMiklos Vajna2008-07-29
Make load_command_list() capable of filtering for a given prefix and loading into a pair of "struct cmdnames" supplied by the caller. Make the static add_cmdname(), exclude_cmds() and is_in_cmdlist() functions non-static. Make list_commands() accept a custom title, and work from a pair of "struct cmdnames" supplied by the caller. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>