summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-02-16Merge branch 'rs/strbuf-cleanup-in-rmdir-recursively'Libravatar Junio C Hamano1-3/+3
Code clean-up. * rs/strbuf-cleanup-in-rmdir-recursively: rm: reuse strbuf for all remove_dir_recursively() calls, again
2017-02-16Merge branch 'rs/ls-files-partial-optim'Libravatar Junio C Hamano1-10/+11
"ls-files" run with pathspec has been micro-optimized to avoid having to memmove(3) unnecessary bytes. * rs/ls-files-partial-optim: ls-files: move only kept cache entries in prune_cache() ls-files: pass prefix length explicitly to prune_cache()
2017-02-16Merge branch 'rs/cocci-check-free-only-null'Libravatar Junio C Hamano1-0/+6
A new coccinelle rule that catches a check of !pointer before the pointer is free(3)d, which most likely is a bug. * rs/cocci-check-free-only-null: cocci: detect useless free(3) calls
2017-02-16Merge branch 'ls/p4-path-encoding'Libravatar Junio C Hamano2-10/+30
When "git p4" imports changelist that removes paths, it failed to convert pathnames when the p4 used encoding different from the one used on the Git side. This has been corrected. * ls/p4-path-encoding: git-p4: fix git-p4.pathEncoding for removed files
2017-02-15A bit more for -rc2Libravatar Junio C Hamano1-0/+15
2017-02-15Merge branch 'tg/stash-doc-cleanup'Libravatar Junio C Hamano1-2/+3
The documentation explained what "git stash" does to the working tree (after stashing away the local changes) in terms of "reset --hard", which was exposing an unnecessary implementation detail. * tg/stash-doc-cleanup: Documentation/stash: remove mention of git reset --hard
2017-02-15Merge branch 'jk/doc-submodule-markup-fix'Libravatar Junio C Hamano1-3/+6
Doc markup fix. * jk/doc-submodule-markup-fix: docs/git-submodule: fix unbalanced quote
2017-02-15Merge branch 'jk/doc-remote-helpers-markup-fix'Libravatar Junio C Hamano1-3/+3
Doc markup fix. * jk/doc-remote-helpers-markup-fix: docs/gitremote-helpers: fix unbalanced quotes
2017-02-15Merge branch 'sb/doc-unify-bottom'Libravatar Junio C Hamano8-8/+8
Doc clean-up. * sb/doc-unify-bottom: Documentation: unify bottom "part of git suite" lines
2017-02-15Merge branch 'sb/push-options-via-transport'Libravatar Junio C Hamano3-0/+26
The push-options given via the "--push-options" option were not passed through to external remote helpers such as "smart HTTP" that are invoked via the transport helper. * sb/push-options-via-transport: push options: pass push options to the transport helper
2017-02-15Merge branch 'cw/completion'Libravatar Junio C Hamano1-21/+118
More command line completion (in contrib/) for recent additions. * cw/completion: completion: recognize more long-options completion: teach remote subcommands to complete options completion: teach replace to complete options completion: teach ls-remote to complete options completion: improve bash completion for git-add completion: add subcommand completion for rerere completion: teach submodule subcommands to complete options
2017-02-15Merge branch 'rs/swap'Libravatar Junio C Hamano14-65/+63
Code clean-up. * rs/swap: graph: use SWAP macro diff: use SWAP macro use SWAP macro apply: use SWAP macro add SWAP macro
2017-02-15Merge branch 'sb/submodule-doc'Libravatar Junio C Hamano1-32/+25
Doc updates. * sb/submodule-doc: submodule update documentation: don't repeat ourselves submodule documentation: add options to the subcommand
2017-02-13rm: reuse strbuf for all remove_dir_recursively() calls, againLibravatar René Scharfe1-3/+3
Don't throw the memory allocated for remove_dir_recursively() away after a single call, use it for the other entries as well instead. This change was done before in deb8e15a (rm: reuse strbuf for all remove_dir_recursively() calls), but was reverted as a side-effect of 55856a35 (rm: absorb a submodules git dir before deletion). Reinstate the optimization. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-13Documentation/stash: remove mention of git reset --hardLibravatar Thomas Gummerer1-2/+3
Don't mention git reset --hard in the documentation for git stash save. It's an implementation detail that doesn't matter to the end user and thus shouldn't be exposed to them. In addition it's not quite true for git stash -p, and will not be true when a filename argument to limit the stash to a few files is introduced. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-13docs/git-submodule: fix unbalanced quoteLibravatar Jeff King1-3/+6
The documentation gives an example of the submodule foreach command that uses both backticks and single-quotes. We stick the whole thing inside "+" markers to make it monospace, but the inside punctuation still needs escaping. We handle the backticks with "{backtick}", and use backslash-escaping for the single-quotes. But we missed the escaping on the second quote. Fortunately, asciidoc renders this unbalanced quote as we want (showing the quote), but asciidoctor does not. We could fix it by adding the missing backslash. However, let's take a step back. Even when rendered correctly, it's hard to read a long command stuck into the middle of a paragraph, and the important punctuation is hard to notice. Let's instead bump it into its own single-line code block. That makes both the source and the rendered result more readable, and as a bonus we don't have to worry about quoting at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-13docs/gitremote-helpers: fix unbalanced quotesLibravatar Jeff King1-3/+3
Each of these options is missing the closing single-quote on the option name. This understandably confuses asciidoc, which ends up rendering a stray quote, like: option cloning {'true|false} Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-13ls-files: move only kept cache entries in prune_cache()Libravatar René Scharfe1-5/+4
prune_cache() first identifies those entries at the start of the sorted array that can be discarded. Then it moves the rest of the entries up. Last it identifies the unwanted trailing entries among the moved ones and cuts them off. Change the order: Identify both start *and* end of the range to keep first and then move only those entries to the top. The resulting code is slightly shorter and a bit more efficient. Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-13ls-files: pass prefix length explicitly to prune_cache()Libravatar René Scharfe1-5/+7
The function prune_cache() relies on the fact that it is only called on max_prefix and sneakily uses the matching global variable max_prefix_len directly. Tighten its interface by passing both the string and its length as parameters. While at it move the NULL check into the function to collect all cache-pruning related logic in one place. Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-11cocci: detect useless free(3) callsLibravatar René Scharfe1-0/+6
Add a semantic patch for removing checks that cause free(3) to only be called with a NULL pointer, as that must be a programming mistake. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-10git-p4: fix git-p4.pathEncoding for removed filesLibravatar Lars Schneider2-10/+30
In a9e38359e3 we taught git-p4 a way to re-encode path names from what was used in Perforce to UTF-8. This path re-encoding worked properly for "added" paths. "Removed" paths were not re-encoded and therefore different from the "added" paths. Consequently, these files were not removed in a git-p4 cloned Git repository because the path names did not match. Fix this by moving the re-encoding to a place that affects "added" and "removed" paths. Add a test to demonstrate the issue. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Reviewed-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-10Git 2.12-rc1Libravatar Junio C Hamano2-1/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-10Merge branch 'nd/rev-list-all-includes-HEAD-doc'Libravatar Junio C Hamano1-2/+2
Doc update. * nd/rev-list-all-includes-HEAD-doc: rev-list-options.txt: update --all about HEAD
2017-02-10Merge branch 'rs/fill-directory-optim'Libravatar Junio C Hamano1-4/+3
Code clean-up. * rs/fill-directory-optim: dir: avoid allocation in fill_directory()
2017-02-10Merge branch 'jk/log-graph-name-only'Libravatar Junio C Hamano2-0/+49
"git log --graph" did not work well with "--name-only", even though other forms of "diff" output were handled correctly. * jk/log-graph-name-only: diff: print line prefix for --name-only output
2017-02-10Merge branch 'da/t7800-cleanup'Libravatar Junio C Hamano1-12/+19
Test updates. * da/t7800-cleanup: t7800: replace "wc -l" with test_line_count
2017-02-10Merge branch 'dl/difftool-doc-no-gui-option'Libravatar Junio C Hamano1-2/+3
Doc update. * dl/difftool-doc-no-gui-option: Document the --no-gui option in difftool
2017-02-10Merge branch 'js/difftool-builtin'Libravatar Junio C Hamano2-4/+16
A few hot-fixes to C-rewrite of "git difftool". * js/difftool-builtin: t7800: simplify basic usage test difftool: fix bug when printing usage
2017-02-10Merge branch 'rs/p5302-create-repositories-before-tests'Libravatar Junio C Hamano1-0/+7
Adjust a perf test to new world order where commands that do require a repository are really strict about having a repository. * rs/p5302-create-repositories-before-tests: p5302: create repositories for index-pack results explicitly
2017-02-10Merge branch 'ps/worktree-prune-help-fix'Libravatar Junio C Hamano1-2/+2
Incorrect usage help message for "git worktree prune" has been fixed. * ps/worktree-prune-help-fix: worktree: fix option descriptions for `prune`
2017-02-10Merge branch 'ew/complete-svn-authorship-options'Libravatar Junio C Hamano1-2/+2
Correct command line completion (in contrib/) on "git svn" * ew/complete-svn-authorship-options: completion: fix git svn authorship switches
2017-02-10Merge branch 'jk/reset-to-break-a-commit-doc'Libravatar Junio C Hamano1-0/+38
A minor doc update. * jk/reset-to-break-a-commit-doc: reset: add an example of how to split a commit into two
2017-02-10Merge branch 'bw/push-submodule-only'Libravatar Junio C Hamano2-7/+8
Add missing documentation update to a recent topic. * bw/push-submodule-only: completion: add completion for --recurse-submodules=only doc: add doc for git-push --recurse-submodules=only
2017-02-09Documentation: unify bottom "part of git suite" linesLibravatar Stefan Beller8-8/+8
We currently have 168 man pages that mention they are part of Git, you can check yourself easily via: $ git grep "Part of the linkgit:git\[1\] suite" |wc -l 168 However some have a trailing period, i.e. $ git grep "Part of the linkgit:git\[1\] suite." |wc -l 8 Unify the bottom line in all man pages to not end with a period. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08push options: pass push options to the transport helperLibravatar Stefan Beller3-0/+26
When using non-builtin protocols relying on a transport helper (such as http), push options are not propagated to the helper. The user could ask for push options and a push would seemingly succeed, but the push options would never be transported to the server, misleading the users expectation. Fix this by propagating the push options to the transport helper. This is only addressing the first issue of (1) the helper protocol does not propagate push-option (2) the http helper is not prepared to handle push-option Once we fix (2), the http transport helper can make use of push options as well, but that happens as a follow up. (1) is a bug fix, whereas (2) is a feature, which is why we only do (1) here. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08diff: print line prefix for --name-only outputLibravatar Jeff King2-0/+49
If you run "git log --graph --name-only", the pathnames are not indented to go along with their matching commits (unlike all of the other diff formats). We need to output the line prefix for each item before writing it. The tests cover both --name-status and --name-only. The former actually gets this right already, because it builds on the --raw format functions. It's only --name-only which uses its own code (and this fix mirrors the code in diff_flush_raw()). Note that the tests don't follow our usual style of setting up the "expect" output inside the test block. This matches the surrounding style, but more importantly it is easier to read: we don't have to worry about embedded single-quotes, and the leading indentation is more obvious. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08dir: avoid allocation in fill_directory()Libravatar René Scharfe1-4/+3
Pass the match member of the first pathspec item directly to read_directory() instead of using common_prefix() to duplicate it first, thus avoiding memory duplication, strlen(3) and free(3). Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08rev-list-options.txt: update --all about HEADLibravatar Nguyễn Thái Ngọc Duy1-2/+2
This is the document patch for f0298cf1c6 (revision walker: include a detached HEAD in --all - 2009-01-16). Even though that commit is about detached HEAD, as Jeff pointed out, always adding HEAD in that case may have subtle differences with --source or --exclude. So the document mentions nothing about the detached-ness. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08t7800: replace "wc -l" with test_line_countLibravatar David Aguilar1-12/+19
Make t7800 easier to debug by capturing output into temporary files and using test_line_count to make assertions on those files. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08Merge branch 'da/difftool-dir-diff-fix' into da/t7800-cleanupLibravatar Junio C Hamano2-3/+45
* da/difftool-dir-diff-fix: difftool: fix dir-diff index creation when in a subdirectory
2017-02-08t7800: simplify basic usage testLibravatar David Aguilar1-8/+7
Use "test_line_count" instead of "wc -l", use "git -C" instead of a subshell, and use test_expect_code when calling difftool. Ease debugging by capturing output into temporary files. Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-08Document the --no-gui option in difftoolLibravatar Denton Liu1-2/+3
Prior to this, the `--no-gui` option was not documented in the manpage. This commit introduces this into the manpage Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-06worktree: fix option descriptions for `prune`Libravatar Patrick Steinhardt1-2/+2
The `verbose` and `expire` options of the `git worktree prune` subcommand have wrong descriptions in that they pretend to relate to objects. But as the git-worktree(1) correctly states, these options have nothing to do with objects but only with worktrees. Fix the description accordingly. Signed-off-by: Patrick Steinhardt <patrick.steinhardt@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-06p5302: create repositories for index-pack results explicitlyLibravatar René Scharfe1-0/+7
Before 7176a314 (index-pack: complain when --stdin is used outside of a repo) index-pack silently created a non-existing target directory; now the command refuses to work unless it's used against a valid repository. That causes p5302 to fail, which relies on the former behavior. Fix it by setting up the destinations for its performance tests using git init. Signed-off-by: Rene Scharfe <l.s.r@web.de> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-06completion: fix git svn authorship switchesLibravatar Eric Wong1-2/+2
--add-author-from and --use-log-author are for "git svn dcommit", not "git svn (init|clone)" Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-06difftool: fix bug when printing usageLibravatar David Aguilar2-4/+17
"git difftool -h" reports an error: fatal: BUG: setup_git_env called without repository Defer repository setup so that the help option processing happens before the repository is initialized. Add tests to ensure that the basic usage works inside and outside of a repository. Signed-off-by: David Aguilar <davvid@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-03reset: add an example of how to split a commit into twoLibravatar Jacob Keller1-0/+38
It is often useful to break a commit into multiple parts that are more logical separations. This can be tricky to learn how to do without the brute-force method if re-writing code or commit messages from scratch. Add a section to the git-reset documentation which shows an example process for how to use git add -p and git commit -c HEAD@{1} to interactively break a commit apart and re-use the original commit message as a starting point when making the new commit message. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-03completion: recognize more long-optionsLibravatar Cornelius Weig1-9/+20
Command completion only recognizes a subset of the available options for the various git commands. The set of recognized options needs to balance between having all useful options and to not clutter the terminal. This commit adds all long-options that are mentioned in the man-page synopsis of the respective git command. Possibly dangerous options are not included in this set, to avoid accidental data loss. The added options are: - apply: --recount --directory= - archive: --output - branch: --column --no-column --sort= --points-at - clone: --no-single-branch --shallow-submodules - commit: --patch --short --date --allow-empty - describe: --first-parent - fetch, pull: --unshallow --update-shallow - fsck: --name-objects - grep: --break --heading --show-function --function-context --untracked --no-index - mergetool: --prompt --no-prompt - reset: --keep - revert: --strategy= --strategy-option= - shortlog: --email - tag: --merged --no-merged --create-reflog Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com> Helped-by: Johannes Sixt <j6t@kdbg.org> Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-03completion: teach remote subcommands to complete optionsLibravatar Cornelius Weig1-7/+38
Git-remote needs to complete remote names, its subcommands, and options thereof. In addition to the existing subcommand and remote name completion, do also complete the options - add: --track --master --fetch --tags --no-tags --mirror= - set-url: --push --add --delete - get-url: --push --all - prune: --dry-run Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com> Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-03completion: teach replace to complete optionsLibravatar Cornelius Weig1-0/+6
Git-replace needs to complete references and its own options. In addition to the existing references completions, do also complete the options --edit --graft --format= --list --delete. Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com> Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>