Documentation/git-commit: clarify that --only/--include records the working tree contents

With the original phrasing, it is possible to misunderstand as if
the contents in the index for only the specified paths are made into
the new commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
gittutorial.txt: remove reference to ancient Git version

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: honor --trust-exit-code for builtin tools

run_merge_tool() was not setting $status, which prevented the
exit code for builtin tools from being forwarded to the caller.

Capture the exit status and add a test to guarantee the behavior.

Reported-by: Adria Farres <14farresa@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
l10n: Update Catalan translation

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Merge branch 'da/difftool'

Fix-up to a new feature in 'master'.

* da/difftool:
  difftool: honor --trust-exit-code for builtin tools
Merge branch 'ta/tutorial-modernize'

* ta/tutorial-modernize:
  gittutorial.txt: remove reference to ancient Git version
Merge branch 'jc/doc-commit-only'

* jc/doc-commit-only:
  Documentation/git-commit: clarify that --only/--include records the working tree contents
Merge git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
  l10n: Update Catalan translation
!!! WIP !!! checkout-index: add t2025 for submodule updates

TODO: fix or expect failing tests

Test that the checkout-index command updates the work tree as expected
(for submodule changes which don't result in conflicts) with or without
the '-f' flag.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
!!! WIP !!! reminder of what is still left to do ...
!!! WIP !!! submodules: extend lib-submodule-update.sh for recursive update

TODO: test correct behavior with submodule content modifications

Add two new test helper functions (test_submodule_recursive_switch() and
test_submodule_forced_recursive_switch()) to simplify testing all relevant
combinations of recursive submodule update scenarios without having to add
them to a test of each work tree manipulating command over and over again.

While at it add an omitted "submodule update" followed by a test of the
proper submodule contents to the test_submodule_forced_switch() function
added in 42639d2317ac.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
submodule: prepare for recursive checkout of submodules

This commit adds the functions and files needed for configuration,
documentation, setting the default behavior and determining if a
submodule path should be updated automatically.

It won't really enable recursive submodule update. This will be done
by later commits.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Teach reset the --[no-]recurse-submodules option

This new option will allow the user to not only reset the work tree of
the superproject but to also update the work tree of all initialized
submodules (so they match the SHA-1 recorded in the superproject) when
used together with --hard or --merge. But this commit only adds the
option without any functionality, that will be added to unpack_trees()
in subsequent commits.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Teach checkout the --[no-]recurse-submodules option

This new option will allow the user to not only update the work tree of
the superproject according to the checked out commit but to also update
the work tree of all initialized submodules (so they match the SHA-1
recorded in the superproject). But this commit only adds the option
without any functionality, that will be added to unpack_trees() in
subsequent commits.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Teach merge the --[no-]recurse-submodules option

This new option will allow the user to not only update the work tree of
the superproject according to the merge result but to also update the
work tree of all initialized submodules (so they match the SHA-1 recorded
in the superproject). But this commit only adds the option without any
functionality, that will be added to unpack_trees() in subsequent commits.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Teach bisect--helper the --[no-]recurse-submodules option

This is necessary before we can teach 'git bisect' this option, as that
calls the bisect--helper to do the actual work which then in turn calls
'git checkout'. The helper just passes the option given on the command
line on to checkout. The new recurse_submodules_enum_to_option() is added
to avoid having the helper learn the command line representation of the
different option values himself.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Teach bisect the --[no-]recurse-submodules option

When using this option 'git bisect' will automatically update the work
tree of all initialized submodules (so they match the SHA-1 recorded in
the superproject) in each bisection step. This makes calling 'git
submodule update' each time obsolete, which was tedious and error prone.
If the option is given it is stored in the BISECT_RECURSE_SUBMODULES file
in the git directory so that later bisection steps can reuse it. But this
commit only adds the option without any functionality, that will be added
to unpack_trees() in subsequent commits.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Teach read-tree the --[no-]recurse-submodules option

This new option will allow the user to not only update the work tree of
the superproject but to also update the work tree of all initialized
submodules (so they match the SHA-1 recorded in the superproject) when
used together with -u. But this commit only adds the option without any
functionality, that will be added to unpack_trees() in subsequent commits.

gitmodules_config() had to be extended to cope with an empty index file,
as it is perfectly ok to call read-tree in that case.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
submodule: teach unpack_trees() to remove submodule contents

Implement the functionality needed to enable work tree manipulating
commands to that a deleted submodule should not only affect the index
(leaving all the files of the submodule in the work tree) but also to
remove the work tree of the superproject (including any untracked
files).

That will only work properly when the submodule uses a gitfile instead of
a .git directory and no untracked files are present. Otherwise the removal
will fail with a warning (which is just what happened until now).

Extend rmdir_or_warn() to remove the directories of those submodules which
are scheduled for removal. Also teach verify_clean_submodule() to check
that a submodule configured to be removed is not modified before scheduling
it for removal.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
submodule: teach unpack_trees() to repopulate submodules

Implement the functionality needed to enable work tree manipulating
commands so that an added submodule does not only affect the index and
creates an empty directory but it also populates the work tree of any
initialized submodule according to the SHA-1 recorded in the superproject.

That will only work for submodules that store their git directory in the
.git/modules directory of the superproject. Additionally the submodule has
to be found in the .gitmodules file before the work tree update starts as
the git directory is stored under the submodule name, not its path. This
will be fixed when the .gitmodules blob of the tree we are updating to
will be used for the path <-> name mapping in a later commit.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>