git
3 years agoMerge branch 'jr/doc-ignore-typofix'
Junio C Hamano [Mon, 22 Mar 2021 21:00:25 +0000 (14:00 -0700)] 
Merge branch 'jr/doc-ignore-typofix'

Doc cleanup.

* jr/doc-ignore-typofix:
  doc: .gitignore documentation typofix

3 years agoMerge branch 'sv/t9801-test-path-is-file-cleanup'
Junio C Hamano [Mon, 22 Mar 2021 21:00:24 +0000 (14:00 -0700)] 
Merge branch 'sv/t9801-test-path-is-file-cleanup'

Test cleanup.

* sv/t9801-test-path-is-file-cleanup:
  t9801: replace test -f with test_path_is_file

3 years agoMerge branch 'dl/cat-file-doc-cleanup'
Junio C Hamano [Mon, 22 Mar 2021 21:00:24 +0000 (14:00 -0700)] 
Merge branch 'dl/cat-file-doc-cleanup'

Doc cleanup.

* dl/cat-file-doc-cleanup:
  git-cat-file.txt: remove references to "sha1"
  git-cat-file.txt: monospace args, placeholders and filenames

3 years agoMerge branch 'rs/pretty-describe'
Junio C Hamano [Mon, 22 Mar 2021 21:00:24 +0000 (14:00 -0700)] 
Merge branch 'rs/pretty-describe'

"git log --format='...'" learned "%(describe)" placeholder.

* rs/pretty-describe:
  archive: expand only a single %(describe) per archive
  pretty: document multiple %(describe) being inconsistent
  t4205: assert %(describe) test coverage
  pretty: add merge and exclude options to %(describe)
  pretty: add %(describe)

3 years agoMerge branch 'dl/stash-show-untracked'
Junio C Hamano [Mon, 22 Mar 2021 21:00:24 +0000 (14:00 -0700)] 
Merge branch 'dl/stash-show-untracked'

"git stash show" learned to optionally show untracked part of the
stash.

* dl/stash-show-untracked:
  stash show: learn stash.showIncludeUntracked
  stash show: teach --include-untracked and --only-untracked

3 years agoMerge branch 'en/ort-perf-batch-8'
Junio C Hamano [Mon, 22 Mar 2021 21:00:23 +0000 (14:00 -0700)] 
Merge branch 'en/ort-perf-batch-8'

Rename detection rework continues.

* en/ort-perf-batch-8:
  diffcore-rename: compute dir_rename_guess from dir_rename_counts
  diffcore-rename: limit dir_rename_counts computation to relevant dirs
  diffcore-rename: compute dir_rename_counts in stages
  diffcore-rename: extend cleanup_dir_rename_info()
  diffcore-rename: move dir_rename_counts into dir_rename_info struct
  diffcore-rename: add function for clearing dir_rename_count
  Move computation of dir_rename_count from merge-ort to diffcore-rename
  diffcore-rename: add a mapping of destination names to their indices
  diffcore-rename: provide basic implementation of idx_possible_rename()
  diffcore-rename: use directory rename guided basename comparisons

3 years agoMerge branch 'ab/grep-pcre2-allocfix'
Junio C Hamano [Mon, 22 Mar 2021 21:00:23 +0000 (14:00 -0700)] 
Merge branch 'ab/grep-pcre2-allocfix'

Updates to memory allocation code around the use of pcre2 library.

* ab/grep-pcre2-allocfix:
  grep/pcre2: move definitions of pcre2_{malloc,free}
  grep/pcre2: move back to thread-only PCREv2 structures
  grep/pcre2: actually make pcre2 use custom allocator
  grep/pcre2: use pcre2_maketables_free() function
  grep/pcre2: use compile-time PCREv2 version test
  grep/pcre2: add GREP_PCRE2_DEBUG_MALLOC debug mode
  grep/pcre2: prepare to add debugging to pcre2_malloc()
  grep/pcre2: correct reference to grep_init() in comment
  grep/pcre2: drop needless assignment to NULL
  grep/pcre2: drop needless assignment + assert() on opt->pcre2

3 years agoMerge branch 'jk/perf-in-worktrees'
Junio C Hamano [Mon, 22 Mar 2021 21:00:23 +0000 (14:00 -0700)] 
Merge branch 'jk/perf-in-worktrees'

Perf test update to work better in secondary worktrees.

* jk/perf-in-worktrees:
  t/perf: avoid copying worktree files from test repo
  t/perf: handle worktrees as test repos

3 years agoMerge branch 'ds/commit-graph-generation-config'
Junio C Hamano [Mon, 22 Mar 2021 21:00:23 +0000 (14:00 -0700)] 
Merge branch 'ds/commit-graph-generation-config'

A new configuration variable has been introduced to allow choosing
which version of the generation number gets used in the
commit-graph file.

* ds/commit-graph-generation-config:
  commit-graph: use config to specify generation type
  commit-graph: create local repository pointer

3 years agoMerge branch 'ab/remote-write-config-in-camel-case'
Junio C Hamano [Mon, 22 Mar 2021 21:00:23 +0000 (14:00 -0700)] 
Merge branch 'ab/remote-write-config-in-camel-case'

Update C code that sets a few configuration variables when a remote
is configured so that it spells configuration variable names in the
canonical camelCase.

* ab/remote-write-config-in-camel-case:
  remote: write camel-cased *.pushRemote on rename
  remote: add camel-cased *.tagOpt key, like clone

3 years agoMerge branch 'mt/cleanly-die-upon-missing-required-filter'
Junio C Hamano [Mon, 22 Mar 2021 21:00:22 +0000 (14:00 -0700)] 
Merge branch 'mt/cleanly-die-upon-missing-required-filter'

We had a code to diagnose and die cleanly when a required
clean/smudge filter is missing, but an assert before that
unnecessarily fired, hiding the end-user facing die() message.

* mt/cleanly-die-upon-missing-required-filter:
  convert: fail gracefully upon missing clean cmd on required filter

3 years agoMerge branch 'jk/open-dotgitx-with-nofollow'
Junio C Hamano [Mon, 22 Mar 2021 21:00:22 +0000 (14:00 -0700)] 
Merge branch 'jk/open-dotgitx-with-nofollow'

It does not make sense to make ".gitattributes", ".gitignore" and
".mailmap" symlinks, as they are supposed to be usable from the
object store (think: bare repositories where HEAD:.mailmap etc. are
used).  When these files are symbolic links, we used to read the
contents of the files pointed by them by mistake, which has been
corrected.

* jk/open-dotgitx-with-nofollow:
  mailmap: do not respect symlinks for in-tree .mailmap
  exclude: do not respect symlinks for in-tree .gitignore
  attr: do not respect symlinks for in-tree .gitattributes
  exclude: add flags parameter to add_patterns()
  attr: convert "macro_ok" into a flags field
  add open_nofollow() helper

3 years agoThe first batch in 2.32 cycle
Junio C Hamano [Fri, 19 Mar 2021 22:07:58 +0000 (15:07 -0700)] 
The first batch in 2.32 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'tb/git-mv-icase-fix'
Junio C Hamano [Fri, 19 Mar 2021 22:25:40 +0000 (15:25 -0700)] 
Merge branch 'tb/git-mv-icase-fix'

Fix a corner case bug in "git mv" on case insensitive systems,
which was introduced in 2.29 timeframe.

* tb/git-mv-icase-fix:
  git mv foo FOO ; git mv foo bar gave an assert

3 years agoMerge branch 'rs/xcalloc-takes-nelem-first'
Junio C Hamano [Fri, 19 Mar 2021 22:25:39 +0000 (15:25 -0700)] 
Merge branch 'rs/xcalloc-takes-nelem-first'

Code cleanup.

* rs/xcalloc-takes-nelem-first:
  fix xcalloc() argument order

3 years agoMerge branch 'ah/make-fuzz-all-doc-update'
Junio C Hamano [Fri, 19 Mar 2021 22:25:39 +0000 (15:25 -0700)] 
Merge branch 'ah/make-fuzz-all-doc-update'

Update insn in Makefile comments to run fuzz-all target.

* ah/make-fuzz-all-doc-update:
  Makefile: update 'make fuzz-all' docs to reflect modern clang

3 years agoMerge branch 'jk/slimmed-down'
Junio C Hamano [Fri, 19 Mar 2021 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'jk/slimmed-down'

Unused code removal.

* jk/slimmed-down:
  vcs-svn: remove header files as well

3 years agoMerge branch 'rs/calloc-array'
Junio C Hamano [Fri, 19 Mar 2021 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'rs/calloc-array'

CALLOC_ARRAY() macro replaces many uses of xcalloc().

* rs/calloc-array:
  cocci: allow xcalloc(1, size)
  use CALLOC_ARRAY
  git-compat-util.h: drop trailing semicolon from macro definition

3 years agoMerge branch 'rs/avoid-null-statement-after-macro-call'
Junio C Hamano [Fri, 19 Mar 2021 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'rs/avoid-null-statement-after-macro-call'

Fix macros that can silently inject unintended null-statements.

* rs/avoid-null-statement-after-macro-call:
  mem-pool: drop trailing semicolon from macro definition
  block-sha1: drop trailing semicolon from macro definition

3 years agoMerge branch 'km/config-doc-typofix'
Junio C Hamano [Fri, 19 Mar 2021 22:25:38 +0000 (15:25 -0700)] 
Merge branch 'km/config-doc-typofix'

Docfix.

* km/config-doc-typofix:
  config.txt: add missing period

3 years agoMerge branch 'jt/clone-unborn-head'
Junio C Hamano [Fri, 19 Mar 2021 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'jt/clone-unborn-head'

Test fix.

* jt/clone-unborn-head:
  t5606: run clone branch name test with protocol v2

3 years agoMerge branch 'js/fsmonitor-unpack-fix'
Junio C Hamano [Fri, 19 Mar 2021 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'js/fsmonitor-unpack-fix'

The data structure used by fsmonitor interface was not properly
duplicated during an in-core merge, leading to use-after-free etc.

* js/fsmonitor-unpack-fix:
  fsmonitor: do not forget to release the token in `discard_index()`
  fsmonitor: fix memory corruption in some corner cases

3 years agoMerge branch 'jk/bisect-peel-tag-fix'
Junio C Hamano [Fri, 19 Mar 2021 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'jk/bisect-peel-tag-fix'

"git bisect" reimplemented more in C during 2.30 timeframe did not
take an annotated tag as a good/bad endpoint well.  This regression
has been corrected.

* jk/bisect-peel-tag-fix:
  bisect: peel annotated tags to commits

3 years agoMerge branch 'jh/fsmonitor-prework'
Junio C Hamano [Fri, 19 Mar 2021 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'jh/fsmonitor-prework'

The fsmonitor interface read from its input without making sure
there is something to read from.  This bug is new in 2.31
timeframe.

* jh/fsmonitor-prework:
  fsmonitor: avoid global-buffer-overflow READ when checking trivial response

3 years agoMerge branch 'jc/calloc-fix'
Junio C Hamano [Fri, 19 Mar 2021 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'jc/calloc-fix'

Code clean-up.

* jc/calloc-fix:
  xcalloc: use CALLOC_ARRAY() when applicable

3 years agofsmonitor: do not forget to release the token in `discard_index()`
Johannes Schindelin [Wed, 17 Mar 2021 15:30:49 +0000 (15:30 +0000)] 
fsmonitor: do not forget to release the token in `discard_index()`

In 56c6910028a (fsmonitor: change last update timestamp on the
index_state to opaque token, 2020-01-07), we forgot to adjust
`discard_index()` to release the "last-update" token: it is no longer a
64-bit number, but a free-form string that has been allocated.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agofsmonitor: fix memory corruption in some corner cases
Johannes Schindelin [Wed, 17 Mar 2021 15:30:48 +0000 (15:30 +0000)] 
fsmonitor: fix memory corruption in some corner cases

In 56c6910028a (fsmonitor: change last update timestamp on the
index_state to opaque token, 2020-01-07), we forgot to adjust the part
of `unpack_trees()` that copies the FSMonitor "last-update" information
that we copy from the source index to the result index since 679f2f9fdd2
(unpack-trees: skip stat on fsmonitor-valid files, 2019-11-20).

Since the "last-update" information is no longer a 64-bit number, but a
free-form string that has been allocated, we need to duplicate it rather
than just copying it.

This is important because there _are_ cases when `unpack_trees()` will
perform a oneway merge that implicitly calls `refresh_fsmonitor()`
(which will allocate that "last-update" token). This happens _after_
that token was copied into the result index. However, we _then_ call
`check_updates()` on that index, which will _also_ call
`refresh_fsmonitor()`, accessing the "last-update" string, which by now
would be released already.

In the instance that lead to this patch, this caused a segmentation
fault during a lengthy, complicated rebase involving the todo command
`reset` that (crucially) had to updated many files. Unfortunately, it
seems very hard to trigger that crash, therefore this patch is not
accompanied by a regression test.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoconfig.txt: add missing period
Kyle Meyer [Tue, 16 Mar 2021 14:40:40 +0000 (10:40 -0400)] 
config.txt: add missing period

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobisect: peel annotated tags to commits
Jeff King [Tue, 16 Mar 2021 15:15:55 +0000 (11:15 -0400)] 
bisect: peel annotated tags to commits

This patch fixes a bug where git-bisect doesn't handle receiving
annotated tags as "git bisect good <tag>", etc. It's a regression in
27257bc466 (bisect--helper: reimplement `bisect_state` & `bisect_head`
shell functions in C, 2020-10-15).

The original shell code called:

  sha=$(git rev-parse --verify "$rev^{commit}") ||
          die "$(eval_gettext "Bad rev input: \$rev")"

which will peel the input to a commit (or complain if that's not
possible). But the C code just calls get_oid(), which will yield the oid
of the tag.

The fix is to peel to a commit. The error message here is a little
non-idiomatic for Git (since it starts with a capital). I've mostly left
it, as it matches the other converted messages (like the "Bad rev input"
we print when get_oid() fails), though I did add an indication that it
was the peeling that was the problem. It might be worth taking a pass
through this converted code to modernize some of the error messages.

Note also that the test does a bare "grep" (not i18ngrep) on the
expected "X is the first bad commit" output message. This matches the
rest of the test script.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot5606: run clone branch name test with protocol v2
Jonathan Tan [Wed, 17 Mar 2021 15:42:00 +0000 (08:42 -0700)] 
t5606: run clone branch name test with protocol v2

4f37d45706 ("clone: respect remote unborn HEAD", 2021-02-05) introduces
a new feature (if the remote has an unborn HEAD, e.g. when the remote
repository is empty, use it as the name of the branch) that only works
in protocol v2, but did not ensure that one of its tests always uses
protocol v2, and thus that test would fail if
GIT_TEST_PROTOCOL_VERSION=0 (or 1) is used. Therefore, add "-c
protocol.version=2" to the appropriate test.

(The rest of the tests from that commit have "-c protocol.version=2"
already added.)

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agomem-pool: drop trailing semicolon from macro definition
René Scharfe [Sat, 13 Mar 2021 16:17:37 +0000 (17:17 +0100)] 
mem-pool: drop trailing semicolon from macro definition

Allow BLOCK_GROWTH_SIZE to be used like an integer literal by removing
the trailing semicolon from its definition.  Also wrap the expression in
parentheses, to allow it to be used with operators without leading to
unexpected results.  It doesn't matter for the current use site, but
make it follow standard macro rules anyway to avoid future surprises.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoblock-sha1: drop trailing semicolon from macro definition
René Scharfe [Sat, 13 Mar 2021 16:17:30 +0000 (17:17 +0100)] 
block-sha1: drop trailing semicolon from macro definition

23119ffb4e (block-sha1: put expanded macro parameters in parentheses,
2012-07-22) added a trailing semicolon to the definition of SHA_MIX
without explanation.  It doesn't matter with the current code, but make
sure to avoid potential surprises by removing it again.

This allows the macro to be used almost like a function: Users can
combine it with operators of their choice, but still must not pass an
expression with side-effects as a parameter, as it would be evaluated
multiple times.

Signed-off-by: René Scharfe <l.s.r@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agofsmonitor: avoid global-buffer-overflow READ when checking trivial response
Andrzej Hunt [Mon, 15 Mar 2021 16:39:23 +0000 (16:39 +0000)] 
fsmonitor: avoid global-buffer-overflow READ when checking trivial response

query_result can be be an empty strbuf (STRBUF_INIT) - in that case
trying to read 3 bytes triggers a buffer overflow read (as
query_result.buf = '\0').

Therefore we need to check query_result's length before trying to read 3
bytes.

This overflow was introduced in:
  940b94f35c (fsmonitor: log invocation of FSMonitor hook to trace2, 2021-02-03)
It was found when running the test-suite against ASAN, and can be most
easily reproduced with the following command:

make GIT_TEST_OPTS="-v" DEFAULT_TEST_TARGET="t7519-status-fsmonitor.sh" \
SANITIZE=address DEVELOPER=1 test

==2235==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000019e6e5e at pc 0x00000043745c bp 0x7fffd382c520 sp 0x7fffd382bcc8
READ of size 3 at 0x0000019e6e5e thread T0
    #0 0x43745b in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-11.0.0.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:842:7
    #1 0x43786d in bcmp /home/abuild/rpmbuild/BUILD/llvm-11.0.0.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:887:10
    #2 0x80b146 in fsmonitor_is_trivial_response /home/ahunt/oss-fuzz/git/fsmonitor.c:192:10
    #3 0x80b146 in query_fsmonitor /home/ahunt/oss-fuzz/git/fsmonitor.c:175:7
    #4 0x80a749 in refresh_fsmonitor /home/ahunt/oss-fuzz/git/fsmonitor.c:267:21
    #5 0x80bad1 in tweak_fsmonitor /home/ahunt/oss-fuzz/git/fsmonitor.c:429:4
    #6 0x90f040 in read_index_from /home/ahunt/oss-fuzz/git/read-cache.c:2321:3
    #7 0x8e5d08 in repo_read_index_preload /home/ahunt/oss-fuzz/git/preload-index.c:164:15
    #8 0x52dd45 in prepare_index /home/ahunt/oss-fuzz/git/builtin/commit.c:363:6
    #9 0x52a188 in cmd_commit /home/ahunt/oss-fuzz/git/builtin/commit.c:1588:15
    #10 0x4ce77e in run_builtin /home/ahunt/oss-fuzz/git/git.c:453:11
    #11 0x4ccb18 in handle_builtin /home/ahunt/oss-fuzz/git/git.c:704:3
    #12 0x4cb01c in run_argv /home/ahunt/oss-fuzz/git/git.c:771:4
    #13 0x4cb01c in cmd_main /home/ahunt/oss-fuzz/git/git.c:902:19
    #14 0x6aca8d in main /home/ahunt/oss-fuzz/git/common-main.c:52:11
    #15 0x7fb027bf5349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #16 0x4206b9 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

0x0000019e6e5e is located 2 bytes to the left of global variable 'strbuf_slopbuf' defined in 'strbuf.c:51:6' (0x19e6e60) of size 1
  'strbuf_slopbuf' is ascii string ''
0x0000019e6e5e is located 126 bytes to the right of global variable 'signals' defined in 'sigchain.c:11:31' (0x19e6be0) of size 512
SUMMARY: AddressSanitizer: global-buffer-overflow /home/abuild/rpmbuild/BUILD/llvm-11.0.0.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:842:7 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long)
Shadow bytes around the buggy address:
  0x000080334d70: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080334d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080334d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080334da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080334db0: 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9
=>0x000080334dc0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9[f9]01 f9 f9 f9
  0x000080334dd0: f9 f9 f9 f9 03 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9
  0x000080334de0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x000080334df0: f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080334e00: f9 f9 f9 f9 00 00 00 00 f9 f9 f9 f9 01 f9 f9 f9
  0x000080334e10: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc

Signed-off-by: Andrzej Hunt <ajrhunt@google.com>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agococci: allow xcalloc(1, size)
Junio C Hamano [Tue, 16 Mar 2021 00:56:07 +0000 (17:56 -0700)] 
cocci: allow xcalloc(1, size)

Allocating a pre-cleared single element is quite common and it is
misleading to use CALLOC_ARRAY(); these allocations that would be
affected without this change are not allocating an array.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoxcalloc: use CALLOC_ARRAY() when applicable
Junio C Hamano [Mon, 15 Mar 2021 22:05:04 +0000 (15:05 -0700)] 
xcalloc: use CALLOC_ARRAY() when applicable

These are for codebase before Git 2.31

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.31 v2.31.0
Junio C Hamano [Mon, 15 Mar 2021 18:51:51 +0000 (11:51 -0700)] 
Git 2.31

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jn/mergetool-hideresolved-is-optional'
Junio C Hamano [Sun, 14 Mar 2021 23:01:41 +0000 (16:01 -0700)] 
Merge branch 'jn/mergetool-hideresolved-is-optional'

Disable the recent mergetool's hideresolved feature by default for
backward compatibility and safety.

* jn/mergetool-hideresolved-is-optional:
  doc: describe mergetool configuration in git-mergetool(1)
  mergetool: do not enable hideResolved by default

3 years agoMerge branch 'tb/pack-revindex-on-disk'
Junio C Hamano [Sun, 14 Mar 2021 23:01:40 +0000 (16:01 -0700)] 
Merge branch 'tb/pack-revindex-on-disk'

Fix for a topic in 'master'.

* tb/pack-revindex-on-disk:
  pack-revindex.c: don't close unopened file descriptors

3 years agoMerge tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Sun, 14 Mar 2021 22:50:36 +0000 (15:50 -0700)] 
Merge tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.31.0 round 2

* tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: for git v2.31.0 l10n round 1 and 2
  l10n: de.po: Update German translation for Git v2.31.0
  l10n: pt_PT: add Portuguese translations part 1
  l10n: vi.po(5104t): for git v2.31.0 l10n round 2
  l10n: es: 2.31.0 round 2
  l10n: Add translation team info
  l10n: start Indonesian translation
  l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)
  l10n: bg.po: Updated Bulgarian translation (5104t)
  l10n: fr: v2.31 rnd 2
  l10n: tr: v2.31.0-rc1
  l10n: sv.po: Update Swedish translation (5104t0f0u)
  l10n: git.pot: v2.31.0 round 2 (9 new, 8 removed)
  l10n: tr: v2.31.0-rc0
  l10n: sv.po: Update Swedish translation (5103t0f0u)
  l10n: pl.po: Update translation
  l10n: fr: v2.31.0 rnd 1
  l10n: git.pot: v2.31.0 round 1 (155 new, 89 removed)
  l10n: Update Catalan translation
  l10n: ru.po: update Russian translation

3 years agovcs-svn: remove header files as well
René Scharfe [Sun, 14 Mar 2021 14:37:39 +0000 (15:37 +0100)] 
vcs-svn: remove header files as well

fc47391e24 (drop vcs-svn experiment, 2020-08-13) removed most vcs-svn
files.  Drop the remaining header files as well, as they are no longer
used.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: zh_CN: for git v2.31.0 l10n round 1 and 2
Jiang Xin [Thu, 4 Mar 2021 14:44:43 +0000 (22:44 +0800)] 
l10n: zh_CN: for git v2.31.0 l10n round 1 and 2

Translate 161 new messages (5104t0f0u) for git 2.31.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoMerge branch 'master' of github.com:vnwildman/git
Jiang Xin [Sun, 14 Mar 2021 16:04:47 +0000 (00:04 +0800)] 
Merge branch 'master' of github.com:vnwildman/git

* 'master' of github.com:vnwildman/git:
  l10n: vi.po(5104t): for git v2.31.0 l10n round 2

3 years agoMerge branch 'l10n/zh_TW/210301' of github.com:l10n-tw/git-po
Jiang Xin [Sun, 14 Mar 2021 14:35:44 +0000 (22:35 +0800)] 
Merge branch 'l10n/zh_TW/210301' of github.com:l10n-tw/git-po

* 'l10n/zh_TW/210301' of github.com:l10n-tw/git-po:
  l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)

3 years agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sun, 14 Mar 2021 14:35:17 +0000 (22:35 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: Add translation team info
  l10n: start Indonesian translation

3 years agoMerge branch 'master' of github.com:Softcatala/git-po
Jiang Xin [Sun, 14 Mar 2021 14:34:46 +0000 (22:34 +0800)] 
Merge branch 'master' of github.com:Softcatala/git-po

* 'master' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

3 years agoMerge branch 'russian-l10n' of github.com:DJm00n/git-po-ru
Jiang Xin [Sun, 14 Mar 2021 14:34:12 +0000 (22:34 +0800)] 
Merge branch 'russian-l10n' of github.com:DJm00n/git-po-ru

* 'russian-l10n' of github.com:DJm00n/git-po-ru:
  l10n: ru.po: update Russian translation

3 years agoMerge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-po
Jiang Xin [Sun, 14 Mar 2021 14:33:26 +0000 (22:33 +0800)] 
Merge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-po

* 'pt-PT' of github.com:git-l10n-pt-PT/git-po:
  l10n: pt_PT: add Portuguese translations part 1

3 years agouse CALLOC_ARRAY
René Scharfe [Sat, 13 Mar 2021 16:17:22 +0000 (17:17 +0100)] 
use CALLOC_ARRAY

Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-compat-util.h: drop trailing semicolon from macro definition
René Scharfe [Sat, 13 Mar 2021 16:10:47 +0000 (17:10 +0100)] 
git-compat-util.h: drop trailing semicolon from macro definition

Make CALLOC_ARRAY usable like a function by requiring callers to supply
the trailing semicolon, which all of the current ones already do.  With
the extra semicolon e.g. the following code wouldn't compile because it
disconnects the "else" from the "if":

if (condition)
CALLOC_ARRAY(ptr, n);
else
whatever();

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodoc: describe mergetool configuration in git-mergetool(1)
Jonathan Nieder [Sat, 13 Mar 2021 08:41:33 +0000 (00:41 -0800)] 
doc: describe mergetool configuration in git-mergetool(1)

In particular, this describes mergetool.hideResolved, which can help
users discover this setting (either because it may be useful to them
or in order to understand mergetool's behavior if they have forgotten
setting it in the past).

Tested by running

make -C Documentation git-mergetool.1
man Documentation/git-mergetool.1

and reading through the page.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agomergetool: do not enable hideResolved by default
Jonathan Nieder [Sat, 13 Mar 2021 08:38:48 +0000 (00:38 -0800)] 
mergetool: do not enable hideResolved by default

When 98ea309b3f (mergetool: add hideResolved configuration,
2021-02-09) introduced the mergetool.hideResolved setting to reduce
the clutter in viewing non-conflicted sections of files in a
mergetool, it enabled it by default, explaining:

    No adverse effects were noted in a small survey of popular mergetools[1]
    so this behavior defaults to `true`.

In practice, alas, adverse effects do appear.  A few issues:

1. No indication is shown in the UI that the base, local, and remote
   versions shown have been modified by additional resolution.  This
   is inherent in the design: the idea of mergetool.hideResolved is to
   convince a mergetool that expects pristine local, base, and remote
   files to show partially resolved verisons of those files instead;
   there is no additional source of information accessible to the
   mergetool to see where the resolution has happened.

   (By contrast, a mergetool generating the partial resolution from
   conflict markers for itself would be able to hilight the resolved
   sections with a different color.)

   A user accustomed to seeing the files without partial resolution
   gets no indication that this behavior has changed when they upgrade
   Git.

2. If the computed merge did not line up the files correctly (for
   example due to repeated sections in the file), the partially
   resolved files can be misleading and do not have enough information
   to reconstruct what happened and compute the correct merge result.

3. Resolving a conflict can involve information beyond the textual
   conflict.  For example, if the local and remote versions added
   overlapping functionality in different ways, seeing the full
   unresolved versions of each alongside the base gives information
   about each side's intent that makes it possible to come up with a
   resolution that combines those two intents.  By contrast, when
   starting with partially resolved versions of those files, one can
   produce a subtly wrong resolution that includes redundant extra
   code added by one side that is not needed in the approach taken
   on the other.

All that said, a user wanting to focus on textual conflicts with
reduced clutter can still benefit from mergetool.hideResolved=true as
a way to deemphasize sections of the code that resolve cleanly without
requiring any changes to the invoked mergetool.  The caveats described
above are reduced when the user has explicitly turned this on, because
then the user is aware of them.

Flip the default to 'false'.

Reported-by: Dana Dahlstrom <dahlstrom@google.com>
Helped-by: Seth House <seth@eseth.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoarchive: expand only a single %(describe) per archive
René Scharfe [Sun, 28 Feb 2021 11:22:47 +0000 (12:22 +0100)] 
archive: expand only a single %(describe) per archive

Every %(describe) placeholder in $Format:...$ strings in files with the
attribute export-subst is expanded by calling git describe.  This can
potentially result in a lot of such calls per archive.  That's OK for
local repositories under control of the user of git archive, but could
be a problem for hosted repositories.

Expand only a single %(describe) placeholder per archive for now to
avoid denial-of-service attacks.  We can make this limit configurable
later if needed, but let's start out simple.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.31-rc2 v2.31.0-rc2
Junio C Hamano [Tue, 9 Mar 2021 00:09:43 +0000 (16:09 -0800)] 
Git 2.31-rc2

3 years agoSync with Git 2.30.2 for CVE-2021-21300
Junio C Hamano [Tue, 9 Mar 2021 00:09:07 +0000 (16:09 -0800)] 
Sync with Git 2.30.2 for CVE-2021-21300

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jt/transfer-fsck-across-packs-fix'
Junio C Hamano [Tue, 9 Mar 2021 00:04:47 +0000 (16:04 -0800)] 
Merge branch 'jt/transfer-fsck-across-packs-fix'

The code to fsck objects received across multiple packs during a
single git fetch session has been broken when the packfile URI
feature was in use.  A workaround has been added by disabling the
codepath to avoid keeping a packfile that is too small.

* jt/transfer-fsck-across-packs-fix:
  fetch-pack: do not mix --pack_header and packfile uri

3 years agol10n: de.po: Update German translation for Git v2.31.0
Matthias Rüster [Sun, 28 Feb 2021 14:40:23 +0000 (15:40 +0100)] 
l10n: de.po: Update German translation for Git v2.31.0

Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
3 years agoMakefile: update 'make fuzz-all' docs to reflect modern clang
Andrzej Hunt [Mon, 8 Mar 2021 17:14:42 +0000 (17:14 +0000)] 
Makefile: update 'make fuzz-all' docs to reflect modern clang

Clang no longer produces a libFuzzer.a. Instead, you can include
libFuzzer by using -fsanitize=fuzzer. Therefore we should use that in
the example command for building fuzzers.

We also add -fsanitize=fuzzer-no-link to the CFLAGS to ensure that all
the required instrumentation is added when compiling git [1], and remove
 -fsanitize-coverage=trace-pc-guard as it is deprecated.

I happen to have tested with LLVM 11 - however -fsanitize=fuzzer appears
to work in a wide range of reasonably modern clangs.

(On my system: what used to be libFuzzer.a now lives under the following
 path, which is tricky albeit not impossible for a novice such as myself
 to find:
/usr/lib64/clang/11.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a )

[1] https://releases.llvm.org/11.0.0/docs/LibFuzzer.html#fuzzer-usage

Signed-off-by: Andrzej Hunt <ajrhunt@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agofix xcalloc() argument order
René Scharfe [Sat, 6 Mar 2021 11:26:19 +0000 (12:26 +0100)] 
fix xcalloc() argument order

Pass the number of elements first and ther size second, as expected
by xcalloc().  Provide a semantic patch, which was actually used to
generate the rest of this patch.

The semantic patch would generate flip-flop diffs if both arguments
are sizeofs.  We don't have such a case, and it's hard to imagine
the usefulness of such an allocation.  If it ever occurs then we
could deal with it by duplicating the rule in the semantic patch to
make it cancel itself out, or we could change the code to use
CALLOC_ARRAY.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: pt_PT: add Portuguese translations part 1
Daniel Santos [Thu, 22 Oct 2020 09:52:22 +0000 (10:52 +0100)] 
l10n: pt_PT: add Portuguese translations part 1

* Newlines corrected.
* Add concept translation table.
* Translated some.
* Corrected some.
* Corrected some 'Negation of Emptiness'.

Signed-off-by: Daniel Santos <hello@brighterdan.com>
3 years agol10n: vi.po(5104t): for git v2.31.0 l10n round 2
Tran Ngoc Quan [Mon, 8 Mar 2021 02:00:45 +0000 (09:00 +0700)] 
l10n: vi.po(5104t): for git v2.31.0 l10n round 2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
3 years agol10n: es: 2.31.0 round 2
Christopher Diaz Riveros [Sun, 7 Mar 2021 23:31:14 +0000 (18:31 -0500)] 
l10n: es: 2.31.0 round 2

Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
3 years agol10n: Add translation team info
Bagas Sanjaya [Tue, 2 Mar 2021 06:38:43 +0000 (13:38 +0700)] 
l10n: Add translation team info

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agol10n: start Indonesian translation
Bagas Sanjaya [Sat, 20 Feb 2021 11:21:42 +0000 (18:21 +0700)] 
l10n: start Indonesian translation

  * Initialize PO file
  * Translate init-db.c
  * Translate wt-status.c
  * Translate builtin/clone.c
  * Translate builtin/checkout.c
  * Translate builtin/fetch.c
  * Complete core translations:
    * builtin/remote.c
    * builtin/index-pack.c
    * push.c
    * reset.c
  * Sync with l10n upstream

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agofetch-pack: do not mix --pack_header and packfile uri
Jonathan Tan [Fri, 5 Mar 2021 01:16:20 +0000 (17:16 -0800)] 
fetch-pack: do not mix --pack_header and packfile uri

When fetching (as opposed to cloning) from a repository with packfile
URIs enabled, an error like this may occur:

 fatal: pack has bad object at offset 12: unknown object type 5
 fatal: finish_http_pack_request gave result -1
 fatal: fetch-pack: expected keep then TAB at start of http-fetch output

This bug was introduced in b664e9ffa1 ("fetch-pack: with packfile URIs,
use index-pack arg", 2021-02-22), when the index-pack args used when
processing the inline packfile of a fetch response and when processing
packfile URIs were unified.

This bug happens because fetch, by default, partially reads (and
consumes) the header of the inline packfile to determine if it should
store the downloaded objects as a packfile or loose objects, and thus
passes --pack_header=<...> to index-pack to inform it that some bytes
are missing. However, when it subsequently fetches the additional
packfiles linked by URIs, it reuses the same index-pack arguments, thus
wrongly passing --index-pack-arg=--pack_header=<...> when no bytes are
missing.

This does not happen when cloning because "git clone" always passes
do_keep, which instructs the fetch mechanism to always retain the
packfile, eliminating the need to read the header.

There are a few ways to fix this, including filtering out pack_header
arguments when downloading the additional packfiles, but I decided to
stick to always using index-pack throughout when packfile URIs are
present - thus, Git no longer needs to read the bytes, and no longer
needs --pack_header here.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agostash show: learn stash.showIncludeUntracked
Denton Liu [Wed, 3 Mar 2021 11:16:43 +0000 (03:16 -0800)] 
stash show: learn stash.showIncludeUntracked

The previous commit teaches `git stash show --include-untracked`. It
may be desirable for a user to be able to always enable the
--include-untracked behavior. Teach the stash.showIncludeUntracked
config option which allows users to do this in a similar manner to
stash.showPatch.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agostash show: teach --include-untracked and --only-untracked
Denton Liu [Wed, 3 Mar 2021 11:16:42 +0000 (03:16 -0800)] 
stash show: teach --include-untracked and --only-untracked

Stash entries can be made with untracked files via
`git stash push --include-untracked`. However, because the untracked
files are stored in the third parent of the stash entry and not the
stash entry itself, running `git stash show` does not include the
untracked files as part of the diff.

With --include-untracked, untracked paths, which are recorded in the
third-parent if it exists, are shown in addition to the paths that have
modifications between the stash base and the working tree in the stash.

It is possible to manually craft a malformed stash entry where duplicate
untracked files in the stash entry will mask tracked files. We detect
and error out in that case via a custom unpack_trees() callback:
stash_worktree_untracked_merge().

Also, teach stash the --only-untracked option which only shows the
untracked files of a stash entry. This is similar to `git show stash^3`
but it is nice to provide a convenient abstraction for it so that users
do not have to think about the underlying implementation.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)
Yi-Jyun Pan [Mon, 1 Mar 2021 13:17:36 +0000 (21:17 +0800)] 
l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
3 years agol10n: bg.po: Updated Bulgarian translation (5104t)
Alexander Shopov [Fri, 26 Feb 2021 07:00:26 +0000 (08:00 +0100)] 
l10n: bg.po: Updated Bulgarian translation (5104t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agoMerge branch 'fr_next' of github.com:jnavila/git
Jiang Xin [Fri, 5 Mar 2021 05:47:07 +0000 (13:47 +0800)] 
Merge branch 'fr_next' of github.com:jnavila/git

* 'fr_next' of github.com:jnavila/git:
  l10n: fr: v2.31 rnd 2

3 years agoMerge branch 'master' of github.com:nafmo/git-l10n-sv
Jiang Xin [Fri, 5 Mar 2021 05:46:25 +0000 (13:46 +0800)] 
Merge branch 'master' of github.com:nafmo/git-l10n-sv

* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation (5104t0f0u)

3 years agoMerged the open-eintr workaround for macOS
Junio C Hamano [Thu, 4 Mar 2021 23:42:50 +0000 (15:42 -0800)] 
Merged the open-eintr workaround for macOS

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoDocumentation/RelNotes: improve release note for rename detection work
Elijah Newren [Thu, 4 Mar 2021 22:51:32 +0000 (22:51 +0000)] 
Documentation/RelNotes: improve release note for rename detection work

There were some early changes in the 2.31 cycle to optimize some setup
in diffcore-rename.c[1], some later changes to measure performance[2],
and finally some significant changes to improve rename detection
performance.  The final one was merged with the note

   Performance optimization work on the rename detection continues.

That works for the commit log, but feels misleading as a release note
since all the changes were within one cycle.  Simplify this to just

   Performance improvements for rename detection.

The former wording could be seen as hinting that more performance
improvements will come in 2.32, which is true, but we can just cover
those in the 2.32 release notes when the time comes.

[1] a5ac31b5b1 (Merge branch 'en/diffcore-rename', 2021-01-25)
[2] d3a035b055 (Merge branch 'en/merge-ort-perf', 2021-02-11)
[3] 12bd17521c (Merge branch 'en/diffcore-rename', 2021-03-01)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jk/open-returns-eintr'
Junio C Hamano [Thu, 4 Mar 2021 23:34:45 +0000 (15:34 -0800)] 
Merge branch 'jk/open-returns-eintr'

Work around platforms whose open() is reported to return EINTR (it
shouldn't, as we do our signals with SA_RESTART).

* jk/open-returns-eintr:
  config.mak.uname: enable OPEN_RETURNS_EINTR for macOS Big Sur
  Makefile: add OPEN_RETURNS_EINTR knob

3 years agol10n: fr: v2.31 rnd 2
Jean-Noël Avila [Thu, 4 Mar 2021 20:53:45 +0000 (21:53 +0100)] 
l10n: fr: v2.31 rnd 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agoMerge https://github.com/prati0100/git-gui
Junio C Hamano [Thu, 4 Mar 2021 20:38:50 +0000 (12:38 -0800)] 
Merge https://github.com/prati0100/git-gui

* https://github.com/prati0100/git-gui:
  Revert "git-gui: remove lines starting with the comment character"

3 years agol10n: tr: v2.31.0-rc1
Emir Sarı [Thu, 4 Mar 2021 19:29:24 +0000 (22:29 +0300)] 
l10n: tr: v2.31.0-rc1

Signed-off-by: Emir Sarı <bitigchi@me.com>
3 years agol10n: sv.po: Update Swedish translation (5104t0f0u)
Peter Krefting [Thu, 4 Mar 2021 18:10:43 +0000 (19:10 +0100)] 
l10n: sv.po: Update Swedish translation (5104t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
3 years agol10n: git.pot: v2.31.0 round 2 (9 new, 8 removed)
Jiang Xin [Thu, 4 Mar 2021 14:41:21 +0000 (22:41 +0800)] 
l10n: git.pot: v2.31.0 round 2 (9 new, 8 removed)

Generate po/git.pot from v2.31.0-rc1 for git v2.31.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Thu, 4 Mar 2021 14:40:13 +0000 (22:40 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git: (63 commits)
  Git 2.31-rc1
  Hopefully the last batch before -rc1
  Revert "commit-graph: when incompatible with graphs, indicate why"
  read-cache: make the index write buffer size 128K
  dir: fix malloc of root untracked_cache_dir
  commit-graph.c: display correct number of chunks when writing
  doc/reftable: document how to handle windows
  fetch-pack: print and use dangling .gitmodules
  fetch-pack: with packfile URIs, use index-pack arg
  http-fetch: allow custom index-pack args
  http: allow custom index-pack args
  chunk-format: add technical docs
  chunk-format: restore duplicate chunk checks
  midx: use 64-bit multiplication for chunk sizes
  midx: use chunk-format read API
  commit-graph: use chunk-format read API
  chunk-format: create read chunk API
  midx: use chunk-format API in write_midx_internal()
  midx: drop chunk progress during write
  midx: return success/failure in chunk write methods
  ...

3 years agoMerge branch 'py/revert-commit-comments'
Pratyush Yadav [Thu, 4 Mar 2021 08:29:45 +0000 (13:59 +0530)] 
Merge branch 'py/revert-commit-comments'

This commit causes breakage on macOS, or in fact any platform using
older versions of Tcl. Revert it.

* py/revert-commit-comments:
  Revert "git-gui: remove lines starting with the comment character"

3 years agoRevert "git-gui: remove lines starting with the comment character"
Pratyush Yadav [Thu, 4 Mar 2021 08:23:27 +0000 (13:53 +0530)] 
Revert "git-gui: remove lines starting with the comment character"

This reverts commit b9a43869c9f96d3577d6f568c1bda1940c8f0e31.

This commit causes breakage on macOS (10.13). It causes errors on
startup and completely breaks the commit functionality. There are two
main problems. First, it uses `string cat` which is not supported on
older Tcl versions. Second, it does a half close of the bidirectional
pipe to git-stripspace which is also not supported on older Tcl
versions.

Reported-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
3 years agodoc: .gitignore documentation typofix
Julien Richard [Wed, 3 Mar 2021 12:40:54 +0000 (12:40 +0000)] 
doc: .gitignore documentation typofix

Signed-off-by: Julien Richard <julien.richard@ubisoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot9801: replace test -f with test_path_is_file
Shubham Verma [Tue, 2 Mar 2021 18:50:56 +0000 (00:20 +0530)] 
t9801: replace test -f with test_path_is_file

Although `test -f` has the same functionality as test_path_is_file(), in
the case where test_path_is_file() fails, we get much better debugging
information.

Replace `test -f` with test_path_is_file so that future developers
will have a better experience debugging these test cases.

Signed-off-by: Shubham Verma <shubhunic@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit mv foo FOO ; git mv foo bar gave an assert
Torsten Bögershausen [Mon, 1 Mar 2021 21:41:42 +0000 (22:41 +0100)] 
git mv foo FOO ; git mv foo bar gave an assert

The following sequence, on a case-insensitive file system,
(strictly speeking with core.ignorecase=true)
leads to an assertion failure and leaves .git/index.lock behind.

git init
echo foo >foo
git add foo
git mv foo FOO
git mv foo bar

This regression was introduced in Commit 9b906af657,
"git-mv: improve error message for conflicted file"

The bugfix is to change the "file exist case-insensitive in the index"
into the correct "file exist (case-sensitive) in the index".

This avoids the "assert" later in the code and keeps setting up the
"ce" pointer for ce_stage(ce) done in the next else if.

This fixes
https://github.com/git-for-windows/git/issues/2920

Reported-By: Dan Moseley <Dan.Moseley@microsoft.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-cat-file.txt: remove references to "sha1"
Denton Liu [Wed, 3 Mar 2021 09:21:56 +0000 (01:21 -0800)] 
git-cat-file.txt: remove references to "sha1"

As part of the hash-transition, git can operate on more than just SHA-1
repositories. Replace "sha1"-specific documentation with hash-agnostic
terminology.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-cat-file.txt: monospace args, placeholders and filenames
Denton Liu [Wed, 3 Mar 2021 09:21:55 +0000 (01:21 -0800)] 
git-cat-file.txt: monospace args, placeholders and filenames

In modern documentation, args, placeholders and filenames are
monospaced. Apply monospace formatting to these objects.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.31-rc1 v2.31.0-rc1
Junio C Hamano [Wed, 3 Mar 2021 06:41:13 +0000 (22:41 -0800)] 
Git 2.31-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: tr: v2.31.0-rc0
Emir Sarı [Sat, 27 Feb 2021 09:02:50 +0000 (12:02 +0300)] 
l10n: tr: v2.31.0-rc0

Signed-off-by: Emir Sarı <bitigchi@me.com>
3 years agoHopefully the last batch before -rc1
Junio C Hamano [Mon, 1 Mar 2021 22:02:42 +0000 (14:02 -0800)] 
Hopefully the last batch before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jh/untracked-cache-fix'
Junio C Hamano [Mon, 1 Mar 2021 22:02:58 +0000 (14:02 -0800)] 
Merge branch 'jh/untracked-cache-fix'

An under-allocation for the untracked cache data has been corrected.

* jh/untracked-cache-fix:
  dir: fix malloc of root untracked_cache_dir

3 years agoMerge branch 'ns/raise-write-index-buffer-size'
Junio C Hamano [Mon, 1 Mar 2021 22:02:58 +0000 (14:02 -0800)] 
Merge branch 'ns/raise-write-index-buffer-size'

Raise the buffer size used when writing the index file out from
(obviously too small) 8kB to (clearly sufficiently large) 128kB.

* ns/raise-write-index-buffer-size:
  read-cache: make the index write buffer size 128K

3 years agoMerge branch 'hv/trailer-formatting'
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)] 
Merge branch 'hv/trailer-formatting'

The logic to handle "trailer" related placeholders in the
"--format=" mechanisms in the "log" family and "for-each-ref"
family is getting unified.

* hv/trailer-formatting:
  ref-filter: use pretty.c logic for trailers
  pretty.c: capture invalid trailer argument
  pretty.c: refactor trailer logic to `format_set_trailers_options()`
  t6300: use function to test trailer options

3 years agoMerge branch 'hn/reftable-tables-doc-update'
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)] 
Merge branch 'hn/reftable-tables-doc-update'

Documentation update.

* hn/reftable-tables-doc-update:
  doc/reftable: document how to handle windows

3 years agoMerge branch 'sv/t7001-modernize'
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)] 
Merge branch 'sv/t7001-modernize'

Test script modernization.

* sv/t7001-modernize:
  t7001: use `test` rather than `[`
  t7001: use here-docs instead of echo
  t7001: put each command on a separate line
  t7001: use '>' rather than 'touch'
  t7001: avoid using `cd` outside of subshells
  t7001: remove whitespace after redirect operators
  t7001: modernize subshell formatting
  t7001: remove unnecessary blank lines
  t7001: indent with TABs instead of spaces
  t7001: modernize test formatting

3 years agoMerge branch 'jt/transfer-fsck-across-packs'
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)] 
Merge branch 'jt/transfer-fsck-across-packs'

The approach to "fsck" the incoming objects in "index-pack" is
attractive for performance reasons (we have them already in core,
inflated and ready to be inspected), but fundamentally cannot be
applied fully when we receive more than one pack stream, as a tree
object in one pack may refer to a blob object in another pack as
".gitmodules", when we want to inspect blobs that are used as
".gitmodules" file, for example.  Teach "index-pack" to emit
objects that must be inspected later and check them in the calling
"fetch-pack" process.

* jt/transfer-fsck-across-packs:
  fetch-pack: print and use dangling .gitmodules
  fetch-pack: with packfile URIs, use index-pack arg
  http-fetch: allow custom index-pack args
  http: allow custom index-pack args

3 years agoMerge branch 'ds/chunked-file-api'
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)] 
Merge branch 'ds/chunked-file-api'

The common code to deal with "chunked file format" that is shared
by the multi-pack-index and commit-graph files have been factored
out, to help codepaths for both filetypes to become more robust.

* ds/chunked-file-api:
  commit-graph.c: display correct number of chunks when writing
  chunk-format: add technical docs
  chunk-format: restore duplicate chunk checks
  midx: use 64-bit multiplication for chunk sizes
  midx: use chunk-format read API
  commit-graph: use chunk-format read API
  chunk-format: create read chunk API
  midx: use chunk-format API in write_midx_internal()
  midx: drop chunk progress during write
  midx: return success/failure in chunk write methods
  midx: add num_large_offsets to write_midx_context
  midx: add pack_perm to write_midx_context
  midx: add entries to write_midx_context
  midx: use context in write_midx_pack_names()
  midx: rename pack_info to write_midx_context
  commit-graph: use chunk-format write API
  chunk-format: create chunk format write API
  commit-graph: anonymize data in chunk_write_fn

3 years agoMerge branch 'en/diffcore-rename'
Junio C Hamano [Mon, 1 Mar 2021 22:02:56 +0000 (14:02 -0800)] 
Merge branch 'en/diffcore-rename'

Performance optimization work on the rename detection continues.

* en/diffcore-rename:
  merge-ort: call diffcore_rename() directly
  gitdiffcore doc: mention new preliminary step for rename detection
  diffcore-rename: guide inexact rename detection based on basenames
  diffcore-rename: complete find_basename_matches()
  diffcore-rename: compute basenames of source and dest candidates
  t4001: add a test comparing basename similarity and content similarity
  diffcore-rename: filter rename_src list when possible
  diffcore-rename: no point trying to find a match better than exact

3 years agoMerge branch 'jh/fsmonitor-prework'
Junio C Hamano [Mon, 1 Mar 2021 22:02:56 +0000 (14:02 -0800)] 
Merge branch 'jh/fsmonitor-prework'

Preliminary changes to fsmonitor integration.

* jh/fsmonitor-prework:
  fsmonitor: refactor initialization of fsmonitor_last_update token
  fsmonitor: allow all entries for a folder to be invalidated
  fsmonitor: log FSMN token when reading and writing the index
  fsmonitor: log invocation of FSMonitor hook to trace2
  read-cache: log the number of scanned files to trace2
  read-cache: log the number of lstat calls to trace2
  preload-index: log the number of lstat calls to trace2
  p7519: add trace logging during perf test
  p7519: move watchman cleanup earlier in the test
  p7519: fix watchman watch-list test on Windows
  p7519: do not rely on "xargs -d" in test

3 years agopretty: document multiple %(describe) being inconsistent
René Scharfe [Sun, 28 Feb 2021 11:22:34 +0000 (12:22 +0100)] 
pretty: document multiple %(describe) being inconsistent

Each %(describe) placeholder is expanded using a separate git describe
call.  Their outputs depend on the tags present at the time, so there's
no consistency guarantee.  Document that fact.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot4205: assert %(describe) test coverage
René Scharfe [Sun, 28 Feb 2021 11:22:26 +0000 (12:22 +0100)] 
t4205: assert %(describe) test coverage

Document that the test is covering both describable and
undescribable commits.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>