summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2015-12-21Merge branch 'sg/completion-no-column'Libravatar Junio C Hamano1-0/+1
The completion script (in contrib/) used to list "git column" (which is not an end-user facing command) as one of the choices * sg/completion-no-column: completion: remove 'git column' from porcelain commands
2015-12-15Merge branch 'jk/send-email-complete-aliases'Libravatar Junio C Hamano1-1/+1
A fix-up for recent topic. * jk/send-email-complete-aliases: completion: fix completing unstuck email alias arguments
2015-12-14completion: fix completing unstuck email alias argumentsLibravatar SZEDER Gábor1-1/+1
Completing unstuck form of email aliases doesn't quite work: $ git send-email --to <TAB> alice bob cecil $ git send-email --to a<TAB> alice bob cecil While listing email aliases works as expected, the second case should just complete to 'alice', but it keeps offering all email aliases instead. The cause for this behavior is that in this case we mistakenly tell __gitcomp() explicitly that the current word to be completed is empty, while in reality it is not. As a result __gitcomp() doesn't filter out non-matching aliases, so all aliases end up being offered over and over again. Fix this by not passing the current word to be completed to __gitcomp() and letting it go the default route and grab it from the '$cur' variable. Don't pass empty prefix either, because it's assumed to be empty when unspecified, so it's not necessary. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-11completion: remove 'git column' from porcelain commandsLibravatar SZEDER Gábor1-0/+1
'git column' is an internal helper, so it should not be offered on 'git <TAB>' along with porcelain commands. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-04Merge branch 'sg/bash-prompt-dirty-orphan'Libravatar Junio C Hamano1-4/+3
Produce correct "dirty" marker for shell prompts, even when we are on an orphan or an unborn branch. * sg/bash-prompt-dirty-orphan: bash prompt: indicate dirty index even on orphan branches bash prompt: remove a redundant 'git diff' option bash prompt: test dirty index and worktree while on an orphan branch
2015-12-04Merge branch 'jk/send-email-complete-aliases'Libravatar Junio C Hamano1-0/+16
Teach send-email to dump mail aliases, so that we can do tab completion on the command line. * jk/send-email-complete-aliases: completion: add support for completing email aliases sendemail: teach git-send-email to dump alias names
2015-12-01Merge branch 'dg/subtree-test-cleanup'Libravatar Jeff King3-443/+956
Test cleanups for the subtree project. * dg/subtree-test-cleanup: contrib/subtree: Handle '--prefix' argument with a slash appended contrib/subtree: Make each test self-contained contrib/subtree: Add split tests contrib/subtree: Add merge tests contrib/subtree: Add tests for subtree add contrib/subtree: Add test for missing subtree contrib/subtree: Clean and refactor test code
2015-12-01Merge branch 'maint'Libravatar Jeff King1-1/+1
* maint: http: treat config options sslCAPath and sslCAInfo as paths Documentation/diff: give --word-diff-regex=. example filter-branch: deal with object name vs. pathname ambiguity in tree-filter check-ignore: correct documentation about output git-p4: clean up after p4 submit failure git-p4: work with a detached head git-p4: add option to system() to return subshell status git-p4: add failing test for submit from detached head remote-http(s): support SOCKS proxies t5813: avoid creating urls that break on cygwin Escape Git's exec path in contrib/rerere-train.sh script allow hooks to ignore their standard input stream rebase-i-exec: Allow space in SHELL_PATH Documentation: make environment variable formatting more consistent
2015-11-24Merge branch 'fp/subtree-todo-update'Libravatar Jeff King1-2/+0
Cross completed task off of subtree project's todo list. * fp/subtree-todo-update: contrib/subtree: remove "push" command from the "todo" file
2015-11-24bash prompt: indicate dirty index even on orphan branchesLibravatar SZEDER Gábor1-3/+2
__git_ps1() doesn't indicate dirty index while on an orphan branch. To check the dirtiness of the index, __git_ps1() runs 'git diff-index --cached ... HEAD', which doesn't work on an orphan branch, because HEAD doesn't point to a valid commit. Run 'git diff ... --cached' instead, as it does the right thing both on valid and invalid HEAD, i.e. compares the index to the existing HEAD in the former case and to the empty tree in the latter. This fixes the two failing tests added in the first commit of this series. The dirtiness of the worktree is already checked with 'git diff' and is displayed correctly even on an orphan branch. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Jeff King <peff@peff.net>
2015-11-24bash prompt: remove a redundant 'git diff' optionLibravatar SZEDER Gábor1-1/+1
To get the dirty state indicator __git_ps1() runs 'git diff' with '--quiet --exit-code' options. '--quiet' already implies '--exit-code', so the latter is unnecessary and can be removed. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Jeff King <peff@peff.net>
2015-11-20completion: add support for completing email aliasesLibravatar Jacob Keller1-0/+16
Using the new --dump-aliases option from git-send-email, add completion for --to, --cc, --bcc, and --from with the available configured aliases. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2015-11-20Escape Git's exec path in contrib/rerere-train.sh scriptLibravatar Daniel Knittl-Frank1-1/+1
Whitespace can cause the source command to fail. This is usually not a problem on Unix systems, but on Windows Git is likely to be installed under "C:/Program Files/", thus rendering the script broken. Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Handle '--prefix' argument with a slash appendedLibravatar Techlive Zheng2-1/+21
'git subtree merge' will fail if the argument of '--prefix' has a slash appended. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Make each test self-containedLibravatar Techlive Zheng1-418/+840
Each test runs a full repository creation and any subtree actions needed to perform the test. Each test starts with a clean slate, making debugging and post-mortem analysis much easier. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add split testsLibravatar Techlive Zheng1-2/+15
Add tests to check various options to split. Check combinations of --prefix, --message, --annotate, --branch and --rejoin. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add merge testsLibravatar Techlive Zheng1-1/+12
Add some tests for various merge operations. Test combinations of merge with --message, --prefix and --squash. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add tests for subtree addLibravatar Techlive Zheng1-0/+19
Add some tests to check various options to subtree add. These test various combinations of --message, --prefix and --squash. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Add test for missing subtreeLibravatar Techlive Zheng1-0/+4
Test that a merge from a non-existant subtree fails. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-13contrib/subtree: Clean and refactor test codeLibravatar Techlive Zheng2-55/+79
Mostly prepare for the later tests refactoring. This moves some common code to helper functions and generally cleans things up to be more presentable. Signed-off-by: Techlive Zheng <techlivezheng@gmail.com> Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Jeff King <peff@peff.net>
2015-11-06contrib/subtree: remove "push" command from the "todo" fileLibravatar Fabio Porcedda1-2/+0
Because the "push" command is already available, remove it from the "todo" file. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16Merge branch 'pt/pull-builtin' into maintLibravatar Junio C Hamano1-1/+1
* pt/pull-builtin: pull: enclose <options> in brackets in the usage string merge: grammofix in please-commit-before-merge message
2015-10-14Merge branch 'pt/pull-builtin'Libravatar Junio C Hamano1-1/+1
* pt/pull-builtin: merge: grammofix in please-commit-before-merge message
2015-10-12git-multimail: update to release 1.2.0Libravatar Matthieu Moy9-226/+1218
The changes are described in CHANGES. Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr> Contributions-by: Elijah Newren <newren@palantir.com> Contributions-by: Edward d'Auvergne <edward@nmr-relax.com> Contributions-by: Vadim Zeitlin <vadim@zeitlins.org> Contributions-by: Paul Sokolovsky <paul.sokolovsky@linaro.org> Contributions-by: Michael Haggerty <mhagger@alum.mit.edu> Contributions-by: Elijah Newren <newren@gmail.com> Contributions-by: Richard Hansen <rhansen@rhansen.org> Contributions-by: Job Snijders <job@instituut.net> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-05Merge branch 'as/subtree-with-spaces'Libravatar Junio C Hamano2-74/+124
Update "git subtree" (in contrib/) so that it can take whitespaces in the pathnames, not only in the in-tree pathname but the name of the directory that the repository is in. * as/subtree-with-spaces: contrib/subtree: respect spaces in a repository path t7900-subtree: test the "space in a subdirectory name" case
2015-10-02merge: grammofix in please-commit-before-merge messageLibravatar Alex Henrie1-1/+1
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-14Merge branch 'js/maint-am-skip-performance-regression'Libravatar Junio C Hamano1-1/+1
Recent versions of scripted "git am" has a performance regression in "git am --skip" codepath, which no longer exists in the built-in version on the 'master' front. Fix the regression in the last scripted version that appear in 2.5.x maintenance track and older. * js/maint-am-skip-performance-regression: am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
2015-09-08contrib/subtree: respect spaces in a repository pathLibravatar Alexey Shumkin2-1/+48
Remote repository may have spaces in its path, so take it into account. Also, as far as there are no tests for the `push` command, add them. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-08t7900-subtree: test the "space in a subdirectory name" caseLibravatar Alexey Shumkin2-73/+76
In common case there can be spaces in a subdirectory name. Change tests accorgingly to this statement. Also, as far as a call to the `rejoin_msg` function (in `cmd_split`) does not take into account such a case this patch fixes commit message when `--rejoin` option is set . Besides, as `fixnl` and `multiline` functions did not take into account the "new" tested "space in a subdirectory name" case they become unused and redundant, so they are removed. Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-31Merge branch 'sg/config-name-only'Libravatar Junio C Hamano1-12/+4
"git config --list" output was hard to parse when values consist of multiple lines. "--name-only" option is added to help this. * sg/config-name-only: get_urlmatch: avoid useless strbuf write format_config: simplify buffer handling format_config: don't init strbuf config: restructure format_config() for better control flow completion: list variable names reliably with 'git config --name-only' config: add '--name-only' option to list only variable names
2015-08-26Merge branch 'ep/http-configure-ssl-version'Libravatar Junio C Hamano1-0/+1
A new configuration variable http.sslVersion can be used to specify what specific version of SSL/TLS to use to make a connection. * ep/http-configure-ssl-version: http: add support for specifying the SSL version
2015-08-25Sync with maintLibravatar Junio C Hamano1-1/+1
* maint: pull: pass upload_pack only when it was given
2015-08-19Merge branch 'tb/complete-rebase-i-edit-todo'Libravatar Junio C Hamano1-1/+4
The command-line completion script (in contrib/) has been updated. * tb/complete-rebase-i-edit-todo: completion: offer '--edit-todo' during interactive rebase
2015-08-19Merge branch 'jk/git-path'Libravatar Junio C Hamano1-2/+2
git_path() and mkpath() are handy helper functions but it is easy to misuse, as the callers need to be careful to keep the number of active results below 4. Their uses have been reduced. * jk/git-path: memoize common git-path "constant" files get_repo_path: refactor path-allocation find_hook: keep our own static buffer refs.c: remove_empty_directories can take a strbuf refs.c: avoid git_path assignment in lock_ref_sha1_basic refs.c: avoid repeated git_path calls in rename_tmp_log refs.c: simplify strbufs in reflog setup and writing path.c: drop git_path_submodule refs.c: remove extra git_path calls from read_loose_refs remote.c: drop extraneous local variable from migrate_file prefer mkpathdup to mkpath in assignments prefer git_pathdup to git_path in some possibly-dangerous cases add_to_alternates_file: don't add duplicate entries t5700: modernize style cache.h: complete set of git_path_submodule helpers cache.h: clarify documentation for git_path, et al
2015-08-19Merge branch 'mm/pull-upload-pack'Libravatar Junio C Hamano1-1/+1
"git pull" in recent releases of Git has a regression in the code that allows custom path to the --upload-pack=<program>. This has been corrected. Note that this is irrelevant for 'master' with "git pull" rewritten in C. * mm/pull-upload-pack: pull.sh: quote $upload_pack when passing it to git-fetch
2015-08-19Merge branch 'da/subtree-date-confusion' into maintLibravatar Junio C Hamano2-1/+5
"git subtree" (in contrib/) depended on "git log" output to be stable, which was a no-no. Apply a workaround to force a particular date format. * da/subtree-date-confusion: contrib/subtree: ignore log.date configuration
2015-08-17http: add support for specifying the SSL versionLibravatar Elia Pinto1-0/+1
Teach git about a new option, "http.sslVersion", which permits one to specify the SSL version to use when negotiating SSL connections. The setting can be overridden by the GIT_SSL_VERSION environment variable. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-12Merge branch 'pt/am-builtin'Libravatar Junio C Hamano1-0/+975
Rewrite "am" in "C". * pt/am-builtin: (46 commits) git-am: add am.threeWay config variable builtin-am: remove redirection to git-am.sh builtin-am: check for valid committer ident builtin-am: implement legacy -b/--binary option builtin-am: implement -i/--interactive builtin-am: support and auto-detect mercurial patches builtin-am: support and auto-detect StGit series files builtin-am: support and auto-detect StGit patches builtin-am: rerere support builtin-am: invoke post-applypatch hook builtin-am: invoke pre-applypatch hook builtin-am: invoke applypatch-msg hook builtin-am: support automatic notes copying builtin-am: invoke post-rewrite hook builtin-am: implement -S/--gpg-sign, commit.gpgsign builtin-am: implement --committer-date-is-author-date builtin-am: implement --ignore-date builtin-am: pass git-apply's options to git-apply builtin-am: implement --[no-]scissors builtin-am: support --keep-cr, am.keepcr ...
2015-08-10memoize common git-path "constant" filesLibravatar Jeff King1-2/+2
One of the most common uses of git_path() is to pass a constant, like git_path("MERGE_MSG"). This has two drawbacks: 1. The return value is a static buffer, and the lifetime is dependent on other calls to git_path, etc. 2. There's no compile-time checking of the pathname. This is OK for a one-off (after all, we have to spell it correctly at least once), but many of these constant strings appear throughout the code. This patch introduces a series of functions to "memoize" these strings, which are essentially globals for the lifetime of the program. We compute the value once, take ownership of the buffer, and return the cached value for subsequent calls. cache.h provides a helper macro for defining these functions as one-liners, and defines a few common ones for global use. Using a macro is a little bit gross, but it does nicely document the purpose of the functions. If we need to touch them all later (e.g., because we learned how to change the git_dir variable at runtime, and need to invalidate all of the stored values), it will be much easier to have the complete list. Note that the shared-global functions have separate, manual declarations. We could do something clever with the macros (e.g., expand it to a declaration in some places, and a declaration _and_ a definition in path.c). But there aren't that many, and it's probably better to stay away from too-magical macros. Likewise, if we abandon the C preprocessor in favor of generating these with a script, we could get much fancier. E.g., normalizing "FOO/BAR-BAZ" into "git_path_foo_bar_baz". But the small amount of saved typing is probably not worth the resulting confusion to readers who want to grep for the function's definition. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-10completion: list variable names reliably with 'git config --name-only'Libravatar SZEDER Gábor1-12/+3
Recenty I created a multi-line branch description with '.' and '=' characters on one of the lines, and noticed that fragments of that line show up when completing set variable names for 'git config', e.g.: $ git config --get branch.b.description Branch description to fool the completion script with a second line containing dot . and equals = characters. $ git config --unset <TAB> ... second line containing dot . and equals ... The completion script runs 'git config --list' and processes its output to strip the values and keep only the variable names. It does so by looking for lines containing '.' and '=' and outputting everything before the '=', which was fooled by my multi-line branch description. A similar issue exists with aliases and pretty format aliases with multi-line values, but in that case 'git config --get-regexp' is run and lines in its output are simply stripped after the first space, so subsequent lines don't even have to contain '.' and '=' to fool the completion script. Use the new '--name-only' option added in the previous commit to list config variable names reliably in both cases, without error-prone post processing. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-10config: add '--name-only' option to list only variable namesLibravatar SZEDER Gábor1-0/+1
'git config' can only show values or name-value pairs, so if a shell script needs the names of set config variables it has to run 'git config --list' or '--get-regexp' and parse the output to separate config variable names from their values. However, such a parsing can't cope with multi-line values. Though 'git config' can produce null-terminated output for newline-safe parsing, that's of no use in such a case, becase shells can't cope with null characters. Even our own bash completion script suffers from these issues. Help the completion script, and shell scripts in general, by introducing the '--name-only' option to modify the output of '--list' and '--get-regexp' to list only the names of config variables, so they don't have to perform error-prone post processing to separate variable names from their values anymore. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-05completion: offer '--edit-todo' during interactive rebaseLibravatar Thomas Braun1-1/+4
Helped-by: John Keeping <john@keeping.me.uk> Helped-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-04builtin-am: remove redirection to git-am.shLibravatar Paul Tan1-0/+975
At the beginning of the rewrite of git-am.sh to C, in order to not break existing test scripts that depended on a functional git-am, a redirection to git-am.sh was introduced that would activate if the environment variable _GIT_USE_BUILTIN_AM was not defined. Now that all of git-am.sh's functionality has been re-implemented in builtin/am.c, remove this redirection, and retire git-am.sh into contrib/examples/. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-03Merge branch 'da/subtree-date-confusion'Libravatar Junio C Hamano2-1/+5
"git subtree" (in contrib/) depended on "git log" output to be stable, which was a no-no. Apply a workaround to force a particular date format. * da/subtree-date-confusion: contrib/subtree: ignore log.date configuration
2015-08-03Merge branch 'sg/bash-prompt-untracked-optim'Libravatar Junio C Hamano1-1/+1
Optimize computation of untracked status indicator by bash prompt script (in contrib/). * sg/bash-prompt-untracked-optim: bash prompt: faster untracked status indicator with untracked directories bash prompt: test untracked files status indicator with untracked dirs
2015-08-03Merge branch 'pt/pull-builtin'Libravatar Junio C Hamano1-0/+381
Reimplement 'git pull' in C. * pt/pull-builtin: pull: remove redirection to git-pull.sh pull --rebase: error on no merge candidate cases pull --rebase: exit early when the working directory is dirty pull: configure --rebase via branch.<name>.rebase or pull.rebase pull: teach git pull about --rebase pull: set reflog message pull: implement pulling into an unborn branch pull: fast-forward working tree if head is updated pull: check if in unresolved merge state pull: support pull.ff config pull: error on no merge candidates pull: pass git-fetch's options to git-fetch pull: pass git-merge's options to git-merge pull: pass verbosity, --progress flags to fetch and merge pull: implement fetch + merge pull: implement skeletal builtin pull argv-array: implement argv_array_pushv() parse-options-cb: implement parse_opt_passthru_argv() parse-options-cb: implement parse_opt_passthru()
2015-08-03Merge branch 'sg/completion-commit-cleanup' into maintLibravatar Junio C Hamano1-1/+1
* sg/completion-commit-cleanup: completion: teach 'scissors' mode to 'git commit --cleanup='
2015-07-23contrib/subtree: ignore log.date configurationLibravatar David Aguilar2-1/+5
git-subtree's log format string uses "%ad" and "%cd", which respect the user's configured log.date value. This is problematic for git-subtree because it needs to use real dates so that copied commits come through unchanged. Add a test and tweak the format strings to use %aD and %cD so that the default date format is used instead. Reported-by: Bryan Jacobs <b@q3q.us> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20bash prompt: faster untracked status indicator with untracked directoriesLibravatar SZEDER Gábor1-1/+1
If the untracked status indicator is enabled, __git_ps1() looks for untracked files by running 'git ls-files'. This can be perceptibly slow in case of an untracked directory containing lot of files, because it lists all files found in the untracked directory only to be redirected into /dev/null right away (this is the actual command run by __git_ps1()): $ ls untracked-dir/ |wc -l 100000 $ time git ls-files --others --exclude-standard --error-unmatch \ -- ':/*' >/dev/null 2>/dev/null real 0m0.955s user 0m0.936s sys 0m0.016s Eliminate this delay by additionally passing the '--directory --no-empty-directory' options to 'git ls-files' to show only the name of non-empty untracked directories instead of all their content: $ time git ls-files --others --exclude-standard --directory \ --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null real 0m0.010s user 0m0.008s sys 0m0.000s This follows suit of ea95c7b8f5 (completion: improve untracked directory filtering for filename completion, 2013-09-18). Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-15Merge branch 'jc/prompt-document-ps1-state-separator' into maintLibravatar Junio C Hamano1-0/+4
Docfix. * jc/prompt-document-ps1-state-separator: git-prompt.sh: document GIT_PS1_STATESEPARATOR