Commit graph

45861 commits

Author SHA1 Message Date
Junio C Hamano 3e23116d1f Merge branch 'jk/doc-submodule-markup-fix'
Doc markup fix.

* jk/doc-submodule-markup-fix:
  docs/git-submodule: fix unbalanced quote
2017-02-15 14:56:40 -08:00
Junio C Hamano 8c00b7e583 Merge branch 'jk/doc-remote-helpers-markup-fix'
Doc markup fix.

* jk/doc-remote-helpers-markup-fix:
  docs/gitremote-helpers: fix unbalanced quotes
2017-02-15 14:56:40 -08:00
Junio C Hamano 153a33f98c Merge branch 'sb/doc-unify-bottom'
Doc clean-up.

* sb/doc-unify-bottom:
  Documentation: unify bottom "part of git suite" lines
2017-02-15 12:54:20 -08:00
Junio C Hamano ca3c2b85d1 Merge branch 'sb/push-options-via-transport'
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-15 12:54:19 -08:00
Junio C Hamano 3f4ccb5a57 Merge branch 'cw/completion'
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-15 12:54:19 -08:00
Junio C Hamano cbf1860d73 Merge branch 'rs/swap'
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-15 12:54:19 -08:00
Junio C Hamano 2f4e87d777 Merge branch 'sb/submodule-doc'
Doc updates.

* sb/submodule-doc:
  submodule update documentation: don't repeat ourselves
  submodule documentation: add options to the subcommand
2017-02-15 12:54:18 -08:00
Jeff King e91461b332 docs/git-submodule: fix unbalanced quote
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-13 14:05:40 -08:00
Jeff King 2aaf37b62c docs/gitremote-helpers: fix unbalanced quotes
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-13 12:55:36 -08:00
Junio C Hamano 5588dbffbd Git 2.12-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-10 12:54:23 -08:00
Junio C Hamano 653078bbdd Merge branch 'nd/rev-list-all-includes-HEAD-doc'
Doc update.

* nd/rev-list-all-includes-HEAD-doc:
  rev-list-options.txt: update --all about HEAD
2017-02-10 12:52:27 -08:00
Junio C Hamano c1462b8405 Merge branch 'rs/fill-directory-optim'
Code clean-up.

* rs/fill-directory-optim:
  dir: avoid allocation in fill_directory()
2017-02-10 12:52:27 -08:00
Junio C Hamano e53c7f8731 Merge branch 'jk/log-graph-name-only'
"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-10 12:52:27 -08:00
Junio C Hamano dd19bca827 Merge branch 'da/t7800-cleanup'
Test updates.

* da/t7800-cleanup:
  t7800: replace "wc -l" with test_line_count
2017-02-10 12:52:26 -08:00
Junio C Hamano 0ffe1c9c5f Merge branch 'dl/difftool-doc-no-gui-option'
Doc update.

* dl/difftool-doc-no-gui-option:
  Document the --no-gui option in difftool
2017-02-10 12:52:26 -08:00
Junio C Hamano 163d24dc4d Merge branch 'js/difftool-builtin'
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-10 12:52:25 -08:00
Junio C Hamano cf36a4dc35 Merge branch 'rs/p5302-create-repositories-before-tests'
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-10 12:52:25 -08:00
Junio C Hamano 65fecf0c08 Merge branch 'ps/worktree-prune-help-fix'
Incorrect usage help message for "git worktree prune" has been fixed.

* ps/worktree-prune-help-fix:
  worktree: fix option descriptions for `prune`
2017-02-10 12:52:25 -08:00
Junio C Hamano f7490fdf85 Merge branch 'ew/complete-svn-authorship-options'
Correct command line completion (in contrib/) on "git svn"

* ew/complete-svn-authorship-options:
  completion: fix git svn authorship switches
2017-02-10 12:52:24 -08:00
Junio C Hamano 5c40e9ce81 Merge branch 'jk/reset-to-break-a-commit-doc'
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-10 12:52:24 -08:00
Junio C Hamano 8e7c1f3240 Merge branch 'bw/push-submodule-only'
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-10 12:52:23 -08:00
Stefan Beller 941b9c5270 Documentation: unify bottom "part of git suite" lines
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-09 15:14:01 -08:00
Stefan Beller 438fc68462 push options: pass push options to the transport helper
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-08 15:45:01 -08:00
Jeff King f5022b5fed diff: print line prefix for --name-only output
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-08 13:39:57 -08:00
René Scharfe bec5ab8997 dir: avoid allocation in fill_directory()
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-08 13:38:41 -08:00
Nguyễn Thái Ngọc Duy 209df269a6 rev-list-options.txt: update --all about HEAD
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-08 13:37:32 -08:00
David Aguilar 1ce515f09d t7800: replace "wc -l" with test_line_count
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-08 13:36:07 -08:00
Junio C Hamano a83c2d2972 Merge branch 'da/difftool-dir-diff-fix' into da/t7800-cleanup
* da/difftool-dir-diff-fix:
  difftool: fix dir-diff index creation when in a subdirectory
2017-02-08 13:36:03 -08:00
David Aguilar e66adcadfe t7800: simplify basic usage test
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-08 13:31:20 -08:00
Denton Liu 56c2da57fe Document the --no-gui option in difftool
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-08 13:30:28 -08:00
Patrick Steinhardt 2488dcab22 worktree: fix option descriptions for prune
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-06 10:59:25 -08:00
René Scharfe c86000c1a7 p5302: create repositories for index-pack results explicitly
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-06 10:55:25 -08:00
Eric Wong 2cbad17642 completion: fix git svn authorship switches
--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-06 10:40:39 -08:00
David Aguilar d81345ce09 difftool: fix bug when printing usage
"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-06 10:13:48 -08:00
Jacob Keller 7326451bed reset: add an example of how to split a commit into two
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-03 22:31:47 -08:00
Cornelius Weig f483a0aa2a completion: recognize more long-options
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-03 22:25:46 -08:00
Cornelius Weig cac84960ea completion: teach remote subcommands to complete options
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-03 22:25:46 -08:00
Cornelius Weig 188fba1172 completion: teach replace to complete options
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>
2017-02-03 22:25:46 -08:00
Cornelius Weig 2c0f3a5314 completion: teach ls-remote to complete options
ls-remote needs to complete remote names and its own options. In
addition to the existing remote name completions, do also complete
the options --heads, --tags, --refs, --get-url, and --symref.

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-03 22:25:46 -08:00
Cornelius Weig bd9ab9dfc0 completion: improve bash completion for git-add
Command completion for git-add did not recognize some long-options.
This commits adds completion for all long-options that are mentioned in
the man-page synopsis. In addition, if the user specified `--update` or
`-u`, path completion will only suggest modified tracked files.

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-03 22:25:46 -08:00
Cornelius Weig e24a256b59 completion: add subcommand completion for rerere
Managing recorded resolutions requires command-line usage of git-rerere.
Added subcommand completion for rerere and path completion for its
subcommand forget.

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-03 22:25:46 -08:00
Cornelius Weig 65d5a1e0a5 completion: teach submodule subcommands to complete options
Each submodule subcommand has specific long-options. Therefore, teach
bash completion to support option completion based on the current
subcommand. All long-options that are mentioned in the man-page synopsis
are added.

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-03 22:25:46 -08:00
Junio C Hamano 6e3a7b3398 Git 2.12-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-03 11:29:52 -08:00
Junio C Hamano fafca0f72a Merge branch 'cw/log-updates-for-all-refs-really'
The "core.logAllRefUpdates" that used to be boolean has been
enhanced to take 'always' as well, to record ref updates to refs
other than the ones that are expected to be updated (i.e. branches,
remote-tracking branches and notes).

* cw/log-updates-for-all-refs-really:
  doc: add note about ignoring '--no-create-reflog'
  update-ref: add test cases for bare repository
  refs: add option core.logAllRefUpdates = always
  config: add markup to core.logAllRefUpdates doc
2017-02-03 11:25:19 -08:00
Junio C Hamano 74dee5cfae Merge branch 'pl/complete-diff-submodule-diff'
The command line completion (in contrib/) learned that
"git diff --submodule=" can take "diff" as a recently added option.

* pl/complete-diff-submodule-diff:
  Completion: Add support for --submodule=diff
2017-02-03 11:25:19 -08:00
Junio C Hamano 36acf41239 Merge branch 'rs/object-id'
"uchar [40]" to "struct object_id" conversion continues.

* rs/object-id:
  checkout: convert post_checkout_hook() to struct object_id
  use oidcpy() for copying hashes between instances of struct object_id
  use oid_to_hex_r() for converting struct object_id hashes to hex strings
2017-02-03 11:25:19 -08:00
Junio C Hamano ecc486b1f8 Merge branch 'js/re-running-failed-tests'
"make -C t failed" will now run only the tests that failed in the
previous run.  This is usable only when prove is not use, and gives
a useless error message when run after "make clean", but otherwise
is serviceable.

* js/re-running-failed-tests:
  t/Makefile: add a rule to re-run previously-failed tests
2017-02-03 11:25:19 -08:00
Junio C Hamano 4ba6bb2d17 Merge branch 'sb/submodule-update-initial-runs-custom-script'
The user can specify a custom update method that is run when
"submodule update" updates an already checked out submodule.  This
was ignored when checking the submodule out for the first time and
we instead always just checked out the commit that is bound to the
path in the superproject's index.

* sb/submodule-update-initial-runs-custom-script:
  submodule update: run custom update script for initial populating as well
2017-02-03 11:25:19 -08:00
Junio C Hamano 5348021c67 Merge branch 'sb/submodule-recursive-absorb'
When a submodule "A", which has another submodule "B" nested within
it, is "absorbed" into the top-level superproject, the inner
submodule "B" used to be left in a strange state.  The logic to
adjust the .git pointers in these submodules has been corrected.

* sb/submodule-recursive-absorb:
  submodule absorbing: fix worktree/gitdir pointers recursively for non-moves
  cache.h: expose the dying procedure for reading gitlinks
  setup: add gentle version of resolve_git_dir
2017-02-03 11:25:18 -08:00
Junio C Hamano 2243d229f7 Merge branch 'sb/unpack-trees-super-prefix'
"git read-tree" and its underlying unpack_trees() machinery learned
to report problematic paths prefixed with the --super-prefix option.

* sb/unpack-trees-super-prefix:
  unpack-trees: support super-prefix option
  t1001: modernize style
  t1000: modernize style
  read-tree: use OPT_BOOL instead of OPT_SET_INT
2017-02-03 11:25:18 -08:00