1
0
mirror of https://github.com/git/git.git synced 2024-10-22 13:39:05 +02:00
Commit Graph

55126 Commits

Author SHA1 Message Date
Junio C Hamano
3feaacbaa1 Merge branch 'nd/checkout-m-doc-update'
Doc about the above.

* nd/checkout-m-doc-update:
  checkout.txt: note about losing staged changes with --merge
2019-04-16 19:28:10 +09:00
Junio C Hamano
e9bd21c337 Merge branch 'tb/trace2-va-list-fix'
Fix some code that passed a NULL when a va_list was expected.

* tb/trace2-va-list-fix:
  trace2: NULL is not allowed for va_list
2019-04-16 19:28:10 +09:00
Junio C Hamano
2850232a21 Merge branch 'tz/completion'
The completion helper code now pays attention to repository-local
configuration (when available), which allows --list-cmds to honour
a repository specific setting of completion.commands, for example.

* tz/completion:
  completion: use __git when calling --list-cmds
  completion: fix multiple command removals
  t9902: test multiple removals via completion.commands
  git: read local config in --list-cmds
2019-04-16 19:28:09 +09:00
Junio C Hamano
08c9757a76 Merge branch 'ma/doc-diff-doc-vs-doctor-comparison'
Dev support update to make it easier to compare two formatted
results from our documentation.

* ma/doc-diff-doc-vs-doctor-comparison:
  doc-diff: add `--cut-header-footer`
  doc-diff: support diffing from/to AsciiDoc(tor)
  doc-diff: let `render_tree()` take an explicit directory name
  Doc: auto-detect changed build flags
2019-04-16 19:28:09 +09:00
Junio C Hamano
3221177559 Merge branch 'tz/t4038-bash-redirect-target-workaround'
Work-around extra warning from bash in our tests.

* tz/t4038-bash-redirect-target-workaround:
  t4038-diff-combined: quote paths with whitespace
2019-04-16 19:28:09 +09:00
Junio C Hamano
4f3036cfa1 Merge branch 'ab/drop-scripted-rebase'
Retire scripted "git rebase" implementation.

* ab/drop-scripted-rebase:
  rebase: remove the rebase.useBuiltin setting
2019-04-16 19:28:09 +09:00
Junio C Hamano
67e3ec10d0 Merge branch 'jk/perf-lib-tee'
Code cleanup in the test framework.

* jk/perf-lib-tee:
  perf-lib.sh: rely on test-lib.sh for --tee handling
2019-04-16 19:28:09 +09:00
Junio C Hamano
04116ecb7b Merge branch 'ab/doc-misc-typofixes'
Typofixes.

* ab/doc-misc-typofixes:
  doc: fix typos in man pages
2019-04-16 19:28:08 +09:00
Junio C Hamano
af1ec93755 Merge branch 'mh/pack-protocol-doc-fix'
Docfix.

* mh/pack-protocol-doc-fix:
  fix pack protocol example client/server communication
2019-04-16 19:28:08 +09:00
Junio C Hamano
b024a14876 Merge branch 'tg/glossary-overlay'
Doc update.

* tg/glossary-overlay:
  glossary: add definition for overlay
2019-04-16 19:28:07 +09:00
Junio C Hamano
04f879a7fb Merge branch 'nd/checkout-f-while-conflicted-fix'
"git checkout -f <branch>" while the index has an unmerged path
incorrectly left some paths in an unmerged state, which has been
corrected.

* nd/checkout-f-while-conflicted-fix:
  unpack-trees: fix oneway_merge accidentally carry over stage index
2019-04-16 19:28:07 +09:00
Junio C Hamano
fffbf7c6ba Merge branch 'pw/rerere-autoupdate'
Doc updates.

* pw/rerere-autoupdate:
  merge: tweak --rerere-autoupdate documentation
  am/cherry-pick/rebase/revert: document --rerere-autoupdate
2019-04-16 19:28:07 +09:00
Junio C Hamano
17c8f1f2ed Merge branch 'jc/format-patch-error-check'
"git format-patch" used overwrite an existing patch/cover-letter
file.  A new "--no-clobber" option stops it.

* jc/format-patch-error-check:
  format-patch: notice failure to open cover letter for writing
  builtin/log: downcase the beginning of error messages
2019-04-16 19:28:06 +09:00
Junio C Hamano
e197980eb2 Merge branch 'js/get-short-oid-drop-cache'
A corner-case object name ambiguity while the sequencer machinery
is working (e.g. "rebase -i -x") has been (half) fixed.

* js/get-short-oid-drop-cache:
  get_oid(): when an object was not found, try harder
  sequencer: move stale comment into correct location
  sequencer: improve error message when an OID could not be parsed
  rebase -i: demonstrate obscure loose object cache bug
2019-04-16 19:28:06 +09:00
Junio C Hamano
8b7150327e Merge branch 'dl/subtree-limit-to-one-rev'
"git subtree" (in contrib/) update.

* dl/subtree-limit-to-one-rev:
  contrib/subtree: ensure only one rev is provided
2019-04-16 19:28:06 +09:00
Junio C Hamano
63643865d2 Merge branch 'js/init-db-update-for-mingw'
"git init" forgot to read platform-specific repository
configuration, which made Windows port to ignore settings of
core.hidedotfiles, for example.

* js/init-db-update-for-mingw:
  mingw: respect core.hidedotfiles = false in git-init again
2019-04-16 19:28:05 +09:00
Junio C Hamano
aa1edf14f9 Merge branch 'js/remote-curl-i18n'
Error messages given from the http transport have been updated so
that they can be localized.

* js/remote-curl-i18n:
  remote-curl: mark all error messages for translation
2019-04-16 19:28:05 +09:00
Junio C Hamano
764bd200e1 Merge branch 'js/anonymize-remote-curl-diag'
remote-http transport did not anonymize URLs reported in its error
messages at places.

* js/anonymize-remote-curl-diag:
  curl: anonymize URLs in error messages and warnings
2019-04-16 19:28:04 +09:00
Junio C Hamano
6d281f70cc Merge branch 'ma/asciidoctor-fixes-more'
Documentation mark-up fixes.

* ma/asciidoctor-fixes-more:
  Documentation: turn middle-of-line tabs into spaces
  git-svn.txt: drop escaping '\' that ends up being rendered
  git.txt: remove empty line before list continuation
  config/fsck.txt: avoid starting line with dash
  config/diff.txt: drop spurious backtick
2019-04-16 19:28:04 +09:00
Junio C Hamano
8ddee13597 Merge branch 'ma/asciidoctor-fixes'
Build fix around use of asciidoctor instead of asciidoc

* ma/asciidoctor-fixes:
  asciidoctor-extensions: fix spurious space after linkgit
  Documentation/Makefile: add missing dependency on asciidoctor-extensions
  Documentation/Makefile: add missing xsl dependencies for manpages
2019-04-16 19:28:04 +09:00
Junio C Hamano
24d73d2a4c Merge branch 'jt/test-protocol-version'
Help developers by making it easier to run most of the tests under
different versions of over-the-wire protocols.

* jt/test-protocol-version:
  t5552: compensate for v2 filtering ref adv.
  tests: fix protocol version for overspecifications
  t5700: only run with protocol version 1
  t5512: compensate for v0 only sending HEAD symrefs
  t5503: fix overspecification of trace expectation
  tests: always test fetch of unreachable with v0
  t5601: check ssh command only with protocol v0
  tests: define GIT_TEST_PROTOCOL_VERSION
2019-04-16 19:28:03 +09:00
Junio C Hamano
8a9a837a63 Merge branch 'nd/diff-parseopt-3'
Third batch to teach the diff machinery to use the parse-options
API.

* nd/diff-parseopt-3:
  diff-parseopt: convert --submodule
  diff-parseopt: convert --ignore-submodules
  diff-parseopt: convert --textconv
  diff-parseopt: convert --ext-diff
  diff-parseopt: convert --quiet
  diff-parseopt: convert --exit-code
  diff-parseopt: convert --color-words
  diff-parseopt: convert --word-diff-regex
  diff-parseopt: convert --word-diff
  diff-parseopt: convert --[no-]color
  diff-parseopt: convert --[no-]follow
  diff-parseopt: convert -R
  diff-parseopt: convert -a|--text
  diff-parseopt: convert --full-index
  diff-parseopt: convert --binary
  diff-parseopt: convert --anchored
  diff-parseopt: convert --diff-algorithm
  diff-parseopt: convert --histogram
  diff-parseopt: convert --patience
  diff-parseopt: convert --[no-]indent-heuristic
2019-04-16 19:28:03 +09:00
Junio C Hamano
e35b8cb8e2 The fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-10 02:19:09 +09:00
Junio C Hamano
32414ceb85 Merge branch 'jt/submodule-fetch-errmsg'
Error message update.

* jt/submodule-fetch-errmsg:
  submodule: explain first attempt failure clearly
2019-04-10 02:14:26 +09:00
Junio C Hamano
c063a537be Merge branch 'jk/sha1dc'
Build update for SHA-1 with collision detection.

* jk/sha1dc:
  Makefile: fix unaligned loads in sha1dc with UBSan
2019-04-10 02:14:26 +09:00
Junio C Hamano
2d3372883f Merge branch 'jk/promote-ggg'
Suggest GitGitGadget instead of submitGit as a way to submit
patches based on GitHub PR to us.

* jk/promote-ggg:
  point pull requesters to GitGitGadget
2019-04-10 02:14:25 +09:00
Junio C Hamano
7caf4cfb81 Merge branch 'ar/t4150-remove-cruft'
Test cleanup.

* ar/t4150-remove-cruft:
  t4150: remove unused variable
2019-04-10 02:14:25 +09:00
Junio C Hamano
fa1b86e457 Merge branch 'js/rebase-deprecate-preserve-merges'
"git rebase --rebase-merges" replaces its old "--preserve-merges"
option; the latter is now marked as deprecated.

* js/rebase-deprecate-preserve-merges:
  rebase: deprecate --preserve-merges
2019-04-10 02:14:24 +09:00
Junio C Hamano
20fe798b1b Merge branch 'ms/worktree-add-atomic-mkdir'
"git worktree add" used to do a "find an available name with stat
and then mkdir", which is race-prone.  This has been fixed by using
mkdir and reacting to EEXIST in a loop.

* ms/worktree-add-atomic-mkdir:
  worktree: fix worktree add race
2019-04-10 02:14:24 +09:00
Junio C Hamano
31df2c1019 Merge branch 'jk/line-log-with-patch'
"git log -L<from>,<to>:<path>" with "-s" did not suppress the patch
output as it should.  This has been corrected.

* jk/line-log-with-patch:
  line-log: detect unsupported formats
  line-log: suppress diff output with "-s"
2019-04-10 02:14:23 +09:00
Junio C Hamano
ac9e40e8ef Merge branch 'ra/t3600-test-path-funcs'
A GSoC micro.

* ra/t3600-test-path-funcs:
  t3600: use helpers to replace test -d/f/e/s <path>
  t3600: modernize style
  test functions: add function `test_file_not_empty`
2019-04-10 02:14:23 +09:00
Junio C Hamano
917f2cd1c2 Merge branch 'nd/rewritten-ref-is-per-worktree'
"git rebase" uses the refs/rewritten/ hierarchy to store its
intermediate states, which inherently makes the hierarchy per
worktree, but it didn't quite work well.

* nd/rewritten-ref-is-per-worktree:
  Make sure refs/rewritten/ is per-worktree
  files-backend.c: reduce duplication in add_per_worktree_entries_to_dir()
  files-backend.c: factor out per-worktree code in loose_fill_ref_dir()
2019-04-10 02:14:23 +09:00
Junio C Hamano
1828e52efc Merge branch 'jh/resize-convert-scratch-buffer'
When the "clean" filter can reduce the size of a huge file in the
working tree down to a small "token" (a la Git LFS), there is no
point in allocating a huge scratch area upfront, but the buffer is
sized based on the original file size.  The convert mechanism now
allocates very minimum and reallocates as it receives the output
from the clean filter process.

* jh/resize-convert-scratch-buffer:
  convert: avoid malloc of original file size
2019-04-10 02:14:22 +09:00
Junio C Hamano
b582c1681e Merge branch 'dl/ignore-docs'
Doc update.

* dl/ignore-docs:
  docs: move core.excludesFile from git-add to gitignore
  git-clean.txt: clarify ignore pattern files
2019-04-10 02:14:22 +09:00
Junio C Hamano
081b08c45c Merge branch 'ja/dir-rename-doc-markup-fix'
Doc update.

* ja/dir-rename-doc-markup-fix:
  Doc: fix misleading asciidoc formating
2019-04-10 02:14:21 +09:00
Junio C Hamano
0b2094b06b Merge branch 'dl/reset-doc-no-wrt-abbrev'
Doc update.

* dl/reset-doc-no-wrt-abbrev:
  git-reset.txt: clarify documentation
2019-04-10 02:14:21 +09:00
Nguyễn Thái Ngọc Duy
a7256debd4 checkout.txt: note about losing staged changes with --merge
If you have staged changes in path A and perform 'checkout
--merge' (which could result in conflicts in a totally unrelated path
B), changes in A will be gone. Which is unexpected. We are supposed
to keep all changes, or kick and scream otherwise.

This is the result of how --merge is implemented, from the very first
day in 1be0659efc (checkout: merge local modifications while switching
branches., 2006-01-12):

1. a merge is done, unmerged entries are collected
2. a hard switch to a new branch is done, then unmerged entries added
   back

There is no trivial fix for this. Going with 3-way merge one file at a
time loses rename detection. Going with 3-way merge by trees requires
teaching the algorithm to pick up staged changes. And even if we detect
staged changes with --merge and abort for safety, an option to continue
--merge is very weird. Such an option would keep worktree changes, but
drop staged changes.

Because the problem has been with us since the introduction of --merge
and everybody has been pretty happy (except Phillip, who found this
problem), I'll just take a note here to acknowledge it and wait for
merge wizards to come in and work their magic. There may be a way
forward [1].

[1] CABPp-BFoL_U=bzON4SEMaQSKU2TKwnOgNqjt5MUaOejTKGUJxw@mail.gmail.com

Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21 12:07:41 +09:00
Nguyễn Thái Ngọc Duy
ab5af825db unpack-trees: fix oneway_merge accidentally carry over stage index
Phillip found out that 'git checkout -f <branch>' does not restore
conflict/unmerged files correctly. All tracked files should be taken
from <branch> and all non-zero stages removed. Most of this is true,
except that the final file could be in stage one instead of zero.

"checkout -f" (among other commands) does this with one-way merge, which
is supposed to take stat info from the index and everything else from
the given tree. The add_entry(.., old, ...) call in oneway_merge()
though will keep stage index from the index.

This is normally not a problem if the entry from the index is
normal (stage #0). But if there is a conflict, stage #0 does not exist
and we'll get stage #1 entry as "old" variable, which gets recorded in
the final index. Fix it by clearing stage mask.

This bug probably comes from b5b425074e (git-read-tree: make one-way
merge also honor the "update" flag, 2005-06-07). Before this commit, we
may create the final ("dst") index entry from the one in index, but we
do clear CE_STAGEMASK.

I briefly checked two- and three-way merge functions. I think we don't
have the same problem in those.

Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21 12:06:28 +09:00
Todd Zullinger
2eb6f09f7d completion: use __git when calling --list-cmds
As we made --list-cmds read the local configuration file in an
earlier step, the completion.commands variable respects repo-level
configuration.  Use __git which ensures that the proper repo config
is consulted if the command line contains 'git -C /some/other/repo'.

Suggested-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21 11:55:34 +09:00
Jeff King
057ab54b66 completion: fix multiple command removals
Commit 6532f3740b ("completion: allow to customize the completable
command list", 2018-05-20) tried to allow multiple space-separated
entries in completion.commands. To do this, it copies each parsed token
into a strbuf so that the result is NUL-terminated.

However, for tokens starting with "-", it accidentally passes the
original non-terminated string, meaning that only the final one worked.
Switch to using the strbuf.

Reported-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21 11:52:11 +09:00
Todd Zullinger
402e3e1500 t9902: test multiple removals via completion.commands
6532f3740b ("completion: allow to customize the completable command
list", 2018-05-20) added the completion.commands config variable.
Multiple commands may be added or removed, separated by a space.

Demonstrate the failure of multiple removals.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21 11:52:11 +09:00
Jeff King
83b0ecf333 git: read local config in --list-cmds
Normally code that is checking config before we've decided to do
setup_git_directory() would use read_early_config(), which uses
discover_git_directory() to tentatively see if we're in a repo,
and if so to add it to the config sequence.

But list_cmds() uses the caching configset mechanism which
rightly does not use read_early_config(), because it has no
idea if it's being called early.

Call setup_git_directory_gently() so we can pick up repo-level
config (like completion.commands).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21 11:52:11 +09:00
Junio C Hamano
041f5ea1cf The third batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-20 15:19:48 +09:00
Junio C Hamano
0c45fa32ec Merge branch 'br/commit-tree-parseopt'
The command line parser of "git commit-tree" has been rewritten to
use the parse-options API.

* br/commit-tree-parseopt:
  commit-tree: utilize parse-options api
2019-03-20 15:16:08 +09:00
Junio C Hamano
f6c75e392e Merge branch 'jk/config-type-color-ends-with-lf'
"git config --type=color ..." is meant to replace "git config --get-color"
but there is a slight difference that wasn't documented, which is
now fixed.

* jk/config-type-color-ends-with-lf:
  config: document --type=color output is a complete line
2019-03-20 15:16:08 +09:00
Junio C Hamano
6b5688b760 Merge branch 'ma/clear-repository-format'
The setup code has been cleaned up to avoid leaks around the
repository_format structure.

* ma/clear-repository-format:
  setup: fix memory leaks with `struct repository_format`
  setup: free old value before setting `work_tree`
2019-03-20 15:16:07 +09:00
Junio C Hamano
83b13e284c Merge branch 'jk/virtual-objects-do-exist'
A recent update broke "is this object available to us?" check for
well-known objects like an empty tree (which should yield "yes",
even when there is no on-disk object for an empty tree), which has
been corrected.

* jk/virtual-objects-do-exist:
  rev-list: allow cached objects in existence check
2019-03-20 15:16:07 +09:00
Junio C Hamano
27cdbdd134 Merge branch 'jk/no-sigpipe-during-network-transport'
On platforms where "git fetch" is killed with SIGPIPE (e.g. OSX),
the upload-pack that runs on the other end that hangs up after
detecting an error could cause "git fetch" to die with a signal,
which led to a flakey test.  "git fetch" now ignores SIGPIPE during
the network portion of its operation (this is not a problem as we
check the return status from our write(2)s).

* jk/no-sigpipe-during-network-transport:
  fetch: ignore SIGPIPE during network operation
  fetch: avoid calling write_or_die()
2019-03-20 15:16:06 +09:00
Junio C Hamano
ea327760d3 Merge branch 'jk/fsck-doc'
"git fsck --connectivity-only" omits computation necessary to sift
the objects that are not reachable from any of the refs into
unreachable and dangling.  This is now enabled when dangling
objects are requested (which is done by default, but can be
overridden with the "--no-dangling" option).

* jk/fsck-doc:
  fsck: always compute USED flags for unreachable objects
  doc/fsck: clarify --connectivity-only behavior
2019-03-20 15:16:06 +09:00
Junio C Hamano
88255bba45 Merge branch 'js/stress-test-ui-tweak'
Dev support.

* js/stress-test-ui-tweak:
  tests: introduce --stress-jobs=<N>
  tests: let --stress-limit=<N> imply --stress
2019-03-20 15:16:05 +09:00