git
5 years agoMerge branch 'jh/trace2'
Junio C Hamano [Thu, 7 Mar 2019 00:59:56 +0000 (09:59 +0900)] 
Merge branch 'jh/trace2'

A more structured way to obtain execution trace has been added.

* jh/trace2:
  trace2: add for_each macros to clang-format
  trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh
  trace2:data: add subverb for rebase
  trace2:data: add subverb to reset command
  trace2:data: add subverb to checkout command
  trace2:data: pack-objects: add trace2 regions
  trace2:data: add trace2 instrumentation to index read/write
  trace2:data: add trace2 hook classification
  trace2:data: add trace2 transport child classification
  trace2:data: add trace2 sub-process classification
  trace2:data: add editor/pager child classification
  trace2:data: add trace2 regions to wt-status
  trace2: collect Windows-specific process information
  trace2: create new combined trace facility
  trace2: Documentation/technical/api-trace2.txt

5 years agoMerge branch 'js/doc-symref-in-proto-v1'
Junio C Hamano [Thu, 7 Mar 2019 00:59:56 +0000 (09:59 +0900)] 
Merge branch 'js/doc-symref-in-proto-v1'

Doc update.

* js/doc-symref-in-proto-v1:
  protocol-capabilities.txt: document symref

5 years agoMerge branch 'nd/split-index-null-base-fix'
Junio C Hamano [Thu, 7 Mar 2019 00:59:56 +0000 (09:59 +0900)] 
Merge branch 'nd/split-index-null-base-fix'

Split-index fix.

* nd/split-index-null-base-fix:
  read-cache.c: fix writing "link" index ext with null base oid

5 years agoMerge branch 'rj/prune-packed-excess-args'
Junio C Hamano [Thu, 7 Mar 2019 00:59:55 +0000 (09:59 +0900)] 
Merge branch 'rj/prune-packed-excess-args'

"git prune-packed" did not notice and complain against excess
arguments given from the command line, which now it does.

* rj/prune-packed-excess-args:
  prune-packed: check for too many arguments

5 years agoMerge branch 'jc/test-yes-doc'
Junio C Hamano [Thu, 7 Mar 2019 00:59:54 +0000 (09:59 +0900)] 
Merge branch 'jc/test-yes-doc'

Test doc update.

* jc/test-yes-doc:
  test: caution on our version of 'yes'

5 years agoMerge branch 'en/combined-all-paths'
Junio C Hamano [Thu, 7 Mar 2019 00:59:54 +0000 (09:59 +0900)] 
Merge branch 'en/combined-all-paths'

Output from "diff --cc" did not show the original paths when the
merge involved renames.  A new option adds the paths in the
original trees to the output.

* en/combined-all-paths:
  log,diff-tree: add --combined-all-paths option

5 years agoMerge branch 'sc/pack-redundant'
Junio C Hamano [Thu, 7 Mar 2019 00:59:54 +0000 (09:59 +0900)] 
Merge branch 'sc/pack-redundant'

Update the implementation of pack-redundant for performance in a
repository with many packfiles.

* sc/pack-redundant:
  pack-redundant: consistent sort method
  pack-redundant: rename pack_list.all_objects
  pack-redundant: new algorithm to find min packs
  pack-redundant: delete redundant code
  pack-redundant: delay creation of unique_objects
  t5323: test cases for git-pack-redundant

5 years agoMerge branch 'du/branch-show-current'
Junio C Hamano [Thu, 7 Mar 2019 00:59:53 +0000 (09:59 +0900)] 
Merge branch 'du/branch-show-current'

"git branch" learned a new subcommand "--show-current".

* du/branch-show-current:
  branch: introduce --show-current display option

5 years agoMerge branch 'dl/complete-submodule-absorbgitdirs'
Junio C Hamano [Thu, 7 Mar 2019 00:59:53 +0000 (09:59 +0900)] 
Merge branch 'dl/complete-submodule-absorbgitdirs'

Command-line completion (in contrib/) learned to tab-complete the
"git submodule absorbgitdirs" subcommand.

* dl/complete-submodule-absorbgitdirs:
  completion: complete git submodule absorbgitdirs

5 years agoMerge branch 'wh/author-committer-ident-config'
Junio C Hamano [Thu, 7 Mar 2019 00:59:53 +0000 (09:59 +0900)] 
Merge branch 'wh/author-committer-ident-config'

Four new configuration variables {author,committer}.{name,email}
have been introduced to override user.{name,email} in more specific
cases.

* wh/author-committer-ident-config:
  config: allow giving separate author and committer idents

5 years agoMerge branch 'aw/pretty-trailers'
Junio C Hamano [Thu, 7 Mar 2019 00:59:52 +0000 (09:59 +0900)] 
Merge branch 'aw/pretty-trailers'

The %(trailers) formatter in "git log --format=..."  now allows to
optionally pick trailers selectively by keyword, show only values,
etc.

* aw/pretty-trailers:
  pretty: add support for separator option in %(trailers)
  strbuf: separate callback for strbuf_expand:ing literals
  pretty: add support for "valueonly" option in %(trailers)
  pretty: allow showing specific trailers
  pretty: single return path in %(trailers) handling
  pretty: allow %(trailers) options with explicit value
  doc: group pretty-format.txt placeholders descriptions

5 years agoMerge branch 'nd/diff-parseopt'
Junio C Hamano [Thu, 7 Mar 2019 00:59:52 +0000 (09:59 +0900)] 
Merge branch 'nd/diff-parseopt'

The diff machinery, one of the oldest parts of the system, which
long predates the parse-options API, uses fairly long and complex
handcrafted option parser.  This is being rewritten to use the
parse-options API.

* nd/diff-parseopt:
  diff.c: convert --raw
  diff.c: convert -W|--[no-]function-context
  diff.c: convert -U|--unified
  diff.c: convert -u|-p|--patch
  diff.c: prepare to use parse_options() for parsing
  diff.h: avoid bit fields in struct diff_flags
  diff.h: keep forward struct declarations sorted
  parse-options: allow ll_callback with OPTION_CALLBACK
  parse-options: avoid magic return codes
  parse-options: stop abusing 'callback' for lowlevel callbacks
  parse-options: add OPT_BITOP()
  parse-options: disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN
  parse-options: add one-shot mode
  parse-options.h: remove extern on function prototypes

5 years agoMerge branch 'tg/checkout-no-overlay'
Junio C Hamano [Thu, 7 Mar 2019 00:59:51 +0000 (09:59 +0900)] 
Merge branch 'tg/checkout-no-overlay'

"git checkout --no-overlay" can be used to trigger a new mode of
checking out paths out of the tree-ish, that allows paths that
match the pathspec that are in the current index and working tree
and are not in the tree-ish.

* tg/checkout-no-overlay:
  revert "checkout: introduce checkout.overlayMode config"
  checkout: introduce checkout.overlayMode config
  checkout: introduce --{,no-}overlay option
  checkout: factor out mark_cache_entry_for_checkout function
  checkout: clarify comment
  read-cache: add invalidate parameter to remove_marked_cache_entries
  entry: support CE_WT_REMOVE flag in checkout_entry
  entry: factor out unlink_entry function
  move worktree tests to t24*

5 years agoMerge tag 'l10n-2.21.0-rnd2.1' of git://github.com/git-l10n/git-po
Junio C Hamano [Tue, 5 Mar 2019 12:53:10 +0000 (21:53 +0900)] 
Merge tag 'l10n-2.21.0-rnd2.1' of git://github.com/git-l10n/git-po

L10n for Git 2.21.0 round 2.1

* tag 'l10n-2.21.0-rnd2.1' of git://github.com/git-l10n/git-po:
  l10n: Fixes to Catalan translation
  l10n: Updated Vietnamese translation for v2.21 rd2
  l10n: fr.po remove obsolete entries

5 years agol10n: Fixes to Catalan translation
Jordi Mas [Sat, 2 Mar 2019 18:12:58 +0000 (19:12 +0100)] 
l10n: Fixes to Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
5 years agol10n: Updated Vietnamese translation for v2.21 rd2
Tran Ngoc Quan [Tue, 26 Feb 2019 07:50:59 +0000 (14:50 +0700)] 
l10n: Updated Vietnamese translation for v2.21 rd2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
5 years agol10n: fr.po remove obsolete entries
Jean-Noël Avila [Mon, 25 Feb 2019 21:11:15 +0000 (22:11 +0100)] 
l10n: fr.po remove obsolete entries

On NetBSD, the version of msgfmt is still 0.14.4. There's no hope for
an upgrade due to some GPLv3 allergy of NetBSD's. This version chokes
on heavily decorated commented entries in po files. It's safer to get
rid of all these obsolete entries.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
5 years agoGit 2.21 v2.21.0
Junio C Hamano [Sun, 24 Feb 2019 15:55:19 +0000 (07:55 -0800)] 
Git 2.21

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'yn/checkout-doc-fix'
Junio C Hamano [Sun, 24 Feb 2019 15:18:00 +0000 (07:18 -0800)] 
Merge branch 'yn/checkout-doc-fix'

Doc fix.

* yn/checkout-doc-fix:
  checkout doc: fix an unmatched double-quote pair

5 years agoMerge tag 'l10n-2.21.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Sun, 24 Feb 2019 15:03:39 +0000 (07:03 -0800)] 
Merge tag 'l10n-2.21.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.21.0-rnd2

* tag 'l10n-2.21.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: bg.po: Updated Bulgarian translation (4363t)
  l10n: update German translation
  l10n: zh_CN: Revision for git v2.21.0 l10n
  l10n: zh_CN: for git v2.21.0 l10n round 1~2
  l10n: bg.po: correct typo
  l10n: Update Swedish translation (4363t0f0u)
  l10n: de.po: fix grammar in message for tag.c
  l10n: de.po: fix a message for index-pack.c
  l10n: de.po: consistent translation of 'root commit'
  l10n: it: update the Italian translation
  l10n: es: 2.21.0 round 2
  l10n: el: add Greek l10n team and essential translations
  l10n: fr.po v2.21.0 rnd 2
  l10n: fr.po Fix some typos from round3
  l10n: fr.po Fix some typos
  l10n: Fixes to Catalan translation
  l10n: git.pot: v2.21.0 round 2 (3 new, 3 removed)
  l10n: git.pot: v2.21.0 round 1 (214 new, 38 removed)
  l10n: zh_CN: fix typo of submodule init message
  l10n: Update Catalan translation

5 years agoREADME: adjust for final Azure Pipeline ID
Johannes Schindelin [Sat, 23 Feb 2019 14:49:23 +0000 (06:49 -0800)] 
README: adjust for final Azure Pipeline ID

During the six months of development of the Azure Pipelines support, the
patches went through quite a few iterations of changes, and to test
those iterations, a temporary build definition was used.

In the meantime, Azure Pipelines support made it to `master`, and we now
have a regular Azure Pipeline, installed via the common GitHub App
workflow. This new pipeline has a different name (git.git instead of
test-git.git), and a new ID (11 instead of 2).

Let's adjust the badge in our README to reflect that final shape of the
Azure Pipeline.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agocheckout doc: fix an unmatched double-quote pair
Yoichi Nakayama [Sat, 23 Feb 2019 06:33:40 +0000 (15:33 +0900)] 
checkout doc: fix an unmatched double-quote pair

Signed-off-by: Yoichi Nakayama <yoichi.nakayama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agol10n: bg.po: Updated Bulgarian translation (4363t)
Alexander Shopov [Sat, 23 Feb 2019 16:39:07 +0000 (18:39 +0200)] 
l10n: bg.po: Updated Bulgarian translation (4363t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
5 years agoMerge branch 'ab/bsd-fixes'
Junio C Hamano [Sat, 23 Feb 2019 05:20:19 +0000 (21:20 -0800)] 
Merge branch 'ab/bsd-fixes'

Test portability fix.

* ab/bsd-fixes:
  commit-graph tests: fix unportable "dd" invocation
  tests: fix unportable "\?" and "\+" regex syntax

5 years agoMerge branch 'ab/workaround-dash-bug-in-test'
Junio C Hamano [Sat, 23 Feb 2019 05:20:19 +0000 (21:20 -0800)] 
Merge branch 'ab/workaround-dash-bug-in-test'

* ab/workaround-dash-bug-in-test:
  tests: avoid syntax triggering old dash bug

5 years agotrace2: add for_each macros to clang-format
Jeff Hostetler [Fri, 22 Feb 2019 22:25:11 +0000 (14:25 -0800)] 
trace2: add for_each macros to clang-format

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh
Jeff Hostetler [Fri, 22 Feb 2019 22:25:10 +0000 (14:25 -0800)] 
trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh

Create unit tests for Trace2.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add subverb for rebase
Jeff Hostetler [Fri, 22 Feb 2019 22:25:10 +0000 (14:25 -0800)] 
trace2:data: add subverb for rebase

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add subverb to reset command
Jeff Hostetler [Fri, 22 Feb 2019 22:25:09 +0000 (14:25 -0800)] 
trace2:data: add subverb to reset command

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add subverb to checkout command
Jeff Hostetler [Fri, 22 Feb 2019 22:25:08 +0000 (14:25 -0800)] 
trace2:data: add subverb to checkout command

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: pack-objects: add trace2 regions
Derrick Stolee [Fri, 22 Feb 2019 22:25:07 +0000 (14:25 -0800)] 
trace2:data: pack-objects: add trace2 regions

When studying the performance of 'git push' we would like to know
how much time is spent at various parts of the command. One area
that could cause performance trouble is 'git pack-objects'.

Add trace2 regions around the three main actions taken in this
command:

1. Enumerate objects.
2. Prepare pack.
3. Write pack-file.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add trace2 instrumentation to index read/write
Jeff Hostetler [Fri, 22 Feb 2019 22:25:07 +0000 (14:25 -0800)] 
trace2:data: add trace2 instrumentation to index read/write

Add trace2 events to measure reading and writing the index.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add trace2 hook classification
Jeff Hostetler [Fri, 22 Feb 2019 22:25:06 +0000 (14:25 -0800)] 
trace2:data: add trace2 hook classification

Classify certain child processes as hooks.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add trace2 transport child classification
Jeff Hostetler [Fri, 22 Feb 2019 22:25:05 +0000 (14:25 -0800)] 
trace2:data: add trace2 transport child classification

Add trace2 child classification for transport processes.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add trace2 sub-process classification
Jeff Hostetler [Fri, 22 Feb 2019 22:25:05 +0000 (14:25 -0800)] 
trace2:data: add trace2 sub-process classification

Add trace2 classification for long-running processes
started in sub-process.c

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add editor/pager child classification
Jeff Hostetler [Fri, 22 Feb 2019 22:25:04 +0000 (14:25 -0800)] 
trace2:data: add editor/pager child classification

Add trace2 process classification for editor and pager
child processes.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2:data: add trace2 regions to wt-status
Jeff Hostetler [Fri, 22 Feb 2019 22:25:03 +0000 (14:25 -0800)] 
trace2:data: add trace2 regions to wt-status

Add trace2_region_enter() and trace2_region_leave() calls around the
various phases of a status scan.  This gives elapsed time for each
phase in the GIT_TR2_PERF and GIT_TR2_EVENT trace target.

Also, these Trace2 calls now use s->repo rather than the_repository.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2: collect Windows-specific process information
Jeff Hostetler [Fri, 22 Feb 2019 22:25:02 +0000 (14:25 -0800)] 
trace2: collect Windows-specific process information

Add platform-specific interface to log information about the current
process.

On Windows, this interface is used to indicate whether the git process
is running under a debugger and list names of the process ancestors.

Information for other platforms is left for a future effort.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2: create new combined trace facility
Jeff Hostetler [Fri, 22 Feb 2019 22:25:01 +0000 (14:25 -0800)] 
trace2: create new combined trace facility

Create a new unified tracing facility for git.  The eventual intent is to
replace the current trace_printf* and trace_performance* routines with a
unified set of git_trace2* routines.

In addition to the usual printf-style API, trace2 provides higer-level
event verbs with fixed-fields allowing structured data to be written.
This makes post-processing and analysis easier for external tools.

Trace2 defines 3 output targets.  These are set using the environment
variables "GIT_TR2", "GIT_TR2_PERF", and "GIT_TR2_EVENT".  These may be
set to "1" or to an absolute pathname (just like the current GIT_TRACE).

* GIT_TR2 is intended to be a replacement for GIT_TRACE and logs command
  summary data.

* GIT_TR2_PERF is intended as a replacement for GIT_TRACE_PERFORMANCE.
  It extends the output with columns for the command process, thread,
  repo, absolute and relative elapsed times.  It reports events for
  child process start/stop, thread start/stop, and per-thread function
  nesting.

* GIT_TR2_EVENT is a new structured format. It writes event data as a
  series of JSON records.

Calls to trace2 functions log to any of the 3 output targets enabled
without the need to call different trace_printf* or trace_performance*
routines.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotrace2: Documentation/technical/api-trace2.txt
Jeff Hostetler [Fri, 22 Feb 2019 22:25:00 +0000 (14:25 -0800)] 
trace2: Documentation/technical/api-trace2.txt

Created design document for Trace2 feature.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agocommit-graph tests: fix unportable "dd" invocation
Ævar Arnfjörð Bjarmason [Thu, 21 Feb 2019 19:28:49 +0000 (20:28 +0100)] 
commit-graph tests: fix unportable "dd" invocation

Change an unportable invocation of "dd" with count=0, that wanted to
truncate the commit-graph file.  In POSIX it is unspecified what
happens when count=0 is provided[1]. The NetBSD "dd" behavior
differs from GNU (and seemingly other BSDs), which has left this test
broken since d2b86fbaa1 ("commit-graph: fix buffer read-overflow",
2019-01-15).

Copying from /dev/null would seek/truncate to seek=$zero_pos and
stop immediately after that (without being able to copy anything),
which is the right way to truncate the file.

1. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'master' of https://github.com/ralfth/git-po-de
Jiang Xin [Fri, 22 Feb 2019 14:18:12 +0000 (22:18 +0800)] 
Merge branch 'master' of https://github.com/ralfth/git-po-de

5 years agol10n: update German translation
Ralf Thielow [Fri, 22 Feb 2019 07:45:40 +0000 (08:45 +0100)] 
l10n: update German translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Matthias Rüster <matthias.ruester@gmail.com>
5 years agotests: fix unportable "\?" and "\+" regex syntax
Ævar Arnfjörð Bjarmason [Thu, 21 Feb 2019 19:28:48 +0000 (20:28 +0100)] 
tests: fix unportable "\?" and "\+" regex syntax

Fix widely supported but non-POSIX basic regex syntax introduced in
[1] and [2]. On GNU, NetBSD and FreeBSD the following works:

    $ echo xy >f
    $ grep 'xy\?' f; echo $?
    xy
    0

The same goes for "\+". The "?" and "+" syntax is not in the BRE
syntax, just in ERE, but on some implementations it can be invoked by
prefixing the meta-operator with "\", but not on OpenBSD:

    $ uname -a
    OpenBSD obsd.my.domain 6.2 GENERIC#132 amd64
    $ grep --version
    grep version 0.9
    $ grep 'xy\?' f; echo $?
    1

Let's fix this by moving to ERE syntax instead, where "?" and "+" are
universally supported:

    $ grep -E 'xy?' f; echo $?
    xy
    0

1. 2ed5c8e174 ("describe: setup working tree for --dirty", 2019-02-03)
2. c801170b0c ("t6120: test for describe with a bare repository",
   2019-02-03)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoprotocol-capabilities.txt: document symref
Josh Steadmon [Wed, 20 Feb 2019 00:32:26 +0000 (16:32 -0800)] 
protocol-capabilities.txt: document symref

In 7171d8c15f ("upload-pack: send symbolic ref information as
capability"), we added a symref capability to the pack protocol, but it
was never documented. Adapt the patch notes from that commit and add
them to the capabilities documentation.

While we're at it, add a disclaimer to the top of
protocol-capabilities.txt noting that the doc only applies to v0/v1 of
the wire protocol.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'bg-submodule-helper-typo' of github.com:pclouds/git-po
Jiang Xin [Wed, 20 Feb 2019 13:40:54 +0000 (21:40 +0800)] 
Merge branch 'bg-submodule-helper-typo' of github.com:pclouds/git-po

5 years agol10n: zh_CN: Revision for git v2.21.0 l10n
Fangyi Zhou [Mon, 11 Feb 2019 11:28:55 +0000 (11:28 +0000)] 
l10n: zh_CN: Revision for git v2.21.0 l10n

Signed-off-by: Fangyi Zhou <fangyi.zhou@yuriko.moe>
5 years agol10n: zh_CN: for git v2.21.0 l10n round 1~2
Jiang Xin [Tue, 20 Nov 2018 02:18:06 +0000 (10:18 +0800)] 
l10n: zh_CN: for git v2.21.0 l10n round 1~2

Translate 214 new messages (4363t0f0u) for git 2.21.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
5 years agol10n: bg.po: correct typo
Nguyễn Thái Ngọc Duy [Wed, 20 Feb 2019 09:59:24 +0000 (16:59 +0700)] 
l10n: bg.po: correct typo

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
5 years agol10n: Update Swedish translation (4363t0f0u)
Peter Krefting [Mon, 11 Feb 2019 21:34:05 +0000 (22:34 +0100)] 
l10n: Update Swedish translation (4363t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
5 years agoGit 2.21-rc2 v2.21.0-rc2
Junio C Hamano [Tue, 19 Feb 2019 21:20:23 +0000 (13:20 -0800)] 
Git 2.21-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'js/test-tool-gen-nuls'
Junio C Hamano [Tue, 19 Feb 2019 21:18:08 +0000 (13:18 -0800)] 
Merge branch 'js/test-tool-gen-nuls'

* js/test-tool-gen-nuls:
  tests: teach the test-tool to generate NUL bytes and use it

5 years agoMerge branch 'mk/t5562-no-input-to-too-large-an-input-test'
Junio C Hamano [Tue, 19 Feb 2019 21:18:08 +0000 (13:18 -0800)] 
Merge branch 'mk/t5562-no-input-to-too-large-an-input-test'

* mk/t5562-no-input-to-too-large-an-input-test:
  t5562: do not depend on /dev/zero
  Revert "t5562: replace /dev/zero with a pipe from generate_zero_bytes"

5 years agoMerge branch 'mk/t5562-do-not-reuse-output-files'
Junio C Hamano [Tue, 19 Feb 2019 21:18:08 +0000 (13:18 -0800)] 
Merge branch 'mk/t5562-do-not-reuse-output-files'

* mk/t5562-do-not-reuse-output-files:
  t5562: do not reuse output files

5 years agot5562: do not reuse output files
Max Kirillov [Sat, 24 Nov 2018 09:37:19 +0000 (11:37 +0200)] 
t5562: do not reuse output files

Some expected failures of git-http-backend leaves running its children
(receive-pack or upload-pack) which still hold opened descriptors
to act.err and with some probability they live long enough to write
there their failure messages after next test has already truncated
the files. This causes occasional failures of the test script.

Avoid the issue by using separated output and error file for each test,
apprending the test number to their name.

Reported-by: Carlo Arenas <carenas@gmail.com>
Helped-by: Carlo Arenas <carenas@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotests: teach the test-tool to generate NUL bytes and use it
Johannes Schindelin [Thu, 14 Feb 2019 21:33:12 +0000 (13:33 -0800)] 
tests: teach the test-tool to generate NUL bytes and use it

In cc95bc2025 (t5562: replace /dev/zero with a pipe from
generate_zero_bytes, 2019-02-09), we replaced usage of /dev/zero (which
is not available on NonStop, apparently) by a Perl script snippet to
generate NUL bytes.

Sadly, it does not seem to work on NonStop, as t5562 reportedly hangs.

Worse, this also hangs in the Ubuntu 16.04 agents of the CI builds on
Azure Pipelines: for some reason, the Perl script snippet that is run
via `generate_zero_bytes` in t5562's 'CONTENT_LENGTH overflow ssite_t'
test case tries to write out an infinite amount of NUL bytes unless a
broken pipe is encountered, that snippet never encounters the broken
pipe, and keeps going until the build times out.

Oddly enough, this does not reproduce on the Windows and macOS agents,
nor in a local Ubuntu 18.04.

This developer tried for a day to figure out the exact circumstances
under which this hang happens, to no avail, the details remain a
mystery.

In the end, though, what counts is that this here change incidentally
fixes that hang (maybe also on NonStop?). Even more positively, it gets
rid of yet another unnecessary Perl invocation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agot5562: do not depend on /dev/zero
Max Kirillov [Fri, 15 Feb 2019 16:42:37 +0000 (18:42 +0200)] 
t5562: do not depend on /dev/zero

It was reported [1] that NonStop platform does not have /dev/zero.

The test uses /dev/zero as a dummy input. Passing case (http-backed
failed because of too big input size) should not be reading anything
from it. If http-backend would erroneously try to read any data
returning EOF probably would be even safer than providing some
meaningless data.

Replace /dev/zero with /dev/null to avoid issues with platforms which do
not have /dev/zero.

[1] https://public-inbox.org/git/20190209185930.5256-4-randall.s.becker@rogers.com/

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoRevert "t5562: replace /dev/zero with a pipe from generate_zero_bytes"
Junio C Hamano [Tue, 19 Feb 2019 18:18:15 +0000 (10:18 -0800)] 
Revert "t5562: replace /dev/zero with a pipe from generate_zero_bytes"

Revert cc95bc20 ("t5562: replace /dev/zero with a pipe from
generate_zero_bytes", 2019-02-09), as not feeding anything to the
command is a better way to test it.

5 years agol10n: de.po: fix grammar in message for tag.c
Sebastian Staudt [Sun, 3 Feb 2019 10:33:39 +0000 (11:33 +0100)] 
l10n: de.po: fix grammar in message for tag.c

Signed-off-by: Sebastian Staudt <koraktor@gmail.com>
5 years agol10n: de.po: fix a message for index-pack.c
Sebastian Staudt [Sun, 3 Feb 2019 10:32:20 +0000 (11:32 +0100)] 
l10n: de.po: fix a message for index-pack.c

Signed-off-by: Sebastian Staudt <koraktor@gmail.com>
5 years agol10n: de.po: consistent translation of 'root commit'
Sebastian Staudt [Sun, 3 Feb 2019 10:21:14 +0000 (11:21 +0100)] 
l10n: de.po: consistent translation of 'root commit'

'root commit' is usually translated as 'Root-Commit'. But in one
occasion it‘s translated as 'Basis-Commit' which is the translation
for 'base commit'.

Signed-off-by: Sebastian Staudt <koraktor@gmail.com>
5 years agol10n: it: update the Italian translation
Alessandro Menti [Sun, 17 Feb 2019 17:04:51 +0000 (18:04 +0100)] 
l10n: it: update the Italian translation

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
5 years agoMerge branch 'master' of https://github.com/Softcatala/git-po
Jiang Xin [Sun, 17 Feb 2019 07:28:15 +0000 (15:28 +0800)] 
Merge branch 'master' of https://github.com/Softcatala/git-po

5 years agol10n: es: 2.21.0 round 2
Christopher Diaz Riveros [Wed, 6 Feb 2019 13:36:53 +0000 (08:36 -0500)] 
l10n: es: 2.21.0 round 2

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
5 years agoMerge branch 'fr_2.21.0_rnd2' of git://github.com/jnavila/git
Jiang Xin [Sat, 16 Feb 2019 01:54:53 +0000 (09:54 +0800)] 
Merge branch 'fr_2.21.0_rnd2' of git://github.com/jnavila/git

5 years agol10n: el: add Greek l10n team and essential translations
Jimmy Angelakos [Fri, 15 Feb 2019 02:28:19 +0000 (02:28 +0000)] 
l10n: el: add Greek l10n team and essential translations

Signed-off-by: Jimmy Angelakos <vyruss@hellug.gr>
5 years agol10n: fr.po v2.21.0 rnd 2
Jean-Noël Avila [Wed, 13 Feb 2019 19:35:13 +0000 (20:35 +0100)] 
l10n: fr.po v2.21.0 rnd 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
5 years agol10n: fr.po Fix some typos from round3
Fabien Villepinte [Thu, 20 Dec 2018 08:59:45 +0000 (09:59 +0100)] 
l10n: fr.po Fix some typos from round3

Signed-off-by: Fabien Villepinte <fabien.villepinte@gmail.com>
5 years agol10n: fr.po Fix some typos
Fabien Villepinte [Mon, 17 Dec 2018 11:51:58 +0000 (12:51 +0100)] 
l10n: fr.po Fix some typos

Signed-off-by: Fabien Villepinte <fabien.villepinte@gmail.com>
5 years agomingw: safe-guard a bit more against getenv() problems
Johannes Schindelin [Fri, 15 Feb 2019 15:17:45 +0000 (07:17 -0800)] 
mingw: safe-guard a bit more against getenv() problems

Running up to v2.21.0, we fixed two bugs that were made prominent by the
Windows-specific change to retain copies of only the 30 latest getenv()
calls' returned strings, invalidating any copies of previous getenv()
calls' return values.

While this really shines a light onto bugs of the form where we hold
onto getenv()'s return values without copying them, it is also a real
problem for users.

And even if Jeff King's patches merged via 773e408881 (Merge branch
'jk/save-getenv-result', 2019-01-29) provide further work on that front,
we are far from done. Just one example: on Windows, we unset environment
variables when spawning new processes, which potentially invalidates
strings that were previously obtained via getenv(), and therefore we
have to duplicate environment values that are somehow involved in
spawning new processes (e.g. GIT_MAN_VIEWER in show_man_page()).

We do not have a chance to investigate, let address, all of those issues
in time for v2.21.0, so let's at least help Windows users by increasing
the number of getenv() calls' return values that are kept valid. The
number 64 was determined by looking at the average number of getenv()
calls per process in the entire test suite run on Windows (which is
around 40) and then adding a bit for good measure. And it is a power of
two (which would have hit yesterday's theme perfectly).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agol10n: Fixes to Catalan translation
Jordi Mas [Fri, 15 Feb 2019 15:43:59 +0000 (16:43 +0100)] 
l10n: Fixes to Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
5 years agol10n: git.pot: v2.21.0 round 2 (3 new, 3 removed)
Jiang Xin [Fri, 15 Feb 2019 02:12:14 +0000 (10:12 +0800)] 
l10n: git.pot: v2.21.0 round 2 (3 new, 3 removed)

Introduce 3 update messages for v2.21.0 l10n round 2 from commit
32ceace39f (Fix typos in translatable strings for v2.21.0, 2019-02-11).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
5 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/git/git
Jiang Xin [Fri, 15 Feb 2019 02:09:07 +0000 (10:09 +0800)] 
Merge branch 'master' of git://git./git/git

5 years agoMerge branch 'ea/rebase-compat-doc-fix'
Junio C Hamano [Thu, 14 Feb 2019 22:28:22 +0000 (14:28 -0800)] 
Merge branch 'ea/rebase-compat-doc-fix'

* ea/rebase-compat-doc-fix:
  docs/git-rebase: remove redundant entry in incompatible options list

5 years agoMerge branch 'jc/no-grepping-for-strerror-in-tests'
Junio C Hamano [Thu, 14 Feb 2019 22:28:21 +0000 (14:28 -0800)] 
Merge branch 'jc/no-grepping-for-strerror-in-tests'

* jc/no-grepping-for-strerror-in-tests:
  t1404: do not rely on the exact phrasing of strerror()

5 years agoMerge branch 'jt/fetch-v2-sideband'
Junio C Hamano [Thu, 14 Feb 2019 22:28:20 +0000 (14:28 -0800)] 
Merge branch 'jt/fetch-v2-sideband'

"git fetch" and "git upload-pack" learned to send all exchange over
the sideband channel while talking the v2 protocol.

* jt/fetch-v2-sideband:
  t/lib-httpd: pass GIT_TEST_SIDEBAND_ALL through Apache

5 years agoMerge branch 'en/rebase-merge-on-sequencer'
Junio C Hamano [Thu, 14 Feb 2019 22:28:20 +0000 (14:28 -0800)] 
Merge branch 'en/rebase-merge-on-sequencer'

"git rebase --merge" as been reimplemented by reusing the internal
machinery used for "git rebase -i".

* en/rebase-merge-on-sequencer:
  git-rebase.txt: update to reflect merge now implemented on sequencer

5 years agogit-rebase.txt: update to reflect merge now implemented on sequencer
Elijah Newren [Thu, 14 Feb 2019 20:25:41 +0000 (12:25 -0800)] 
git-rebase.txt: update to reflect merge now implemented on sequencer

Since commit 8fe9c3f21dff (Merge branch 'en/rebase-merge-on-sequencer',
2019-02-06), --merge now uses the interactive backend (and matches its
behavior) so there is no separate merge backend anymore.  Fix an
oversight in the docs that should have been updated with the previous
change.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agot/lib-httpd: pass GIT_TEST_SIDEBAND_ALL through Apache
Todd Zullinger [Thu, 14 Feb 2019 06:35:13 +0000 (01:35 -0500)] 
t/lib-httpd: pass GIT_TEST_SIDEBAND_ALL through Apache

07c3c2aa16 ("tests: define GIT_TEST_SIDEBAND_ALL", 2019-01-16) added
GIT_TEST_SIDEBAND_ALL to the apache.conf PassEnv list.  Avoid warnings
from Apache when the variable is unset, as we do for GIT_VALGRIND* and
GIT_TRACE, from f628825481 ("t/lib-httpd: handle running under
--valgrind", 2012-07-24) and 89c57ab3f0 ("t: pass GIT_TRACE through
Apache", 2015-03-13), respectively.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agot1404: do not rely on the exact phrasing of strerror()
Junio C Hamano [Thu, 14 Feb 2019 20:16:20 +0000 (12:16 -0800)] 
t1404: do not rely on the exact phrasing of strerror()

Not even in C locale, it is wrong to expect that the exact phrasing
"File exists" is used to show EEXIST.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Helped-by: Duy Nguyen <pclouds@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agodocs/git-rebase: remove redundant entry in incompatible options list
Emilio Cobos Álvarez [Wed, 13 Feb 2019 23:44:33 +0000 (00:44 +0100)] 
docs/git-rebase: remove redundant entry in incompatible options list

The --autosquash option is implied by the earlier --[no-]autosquash
entry in the list.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoGit 2.21-rc1 v2.21.0-rc1
Junio C Hamano [Thu, 14 Feb 2019 02:18:11 +0000 (18:18 -0800)] 
Git 2.21-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoMerge branch 'ab/rebase-test-fix'
Junio C Hamano [Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)] 
Merge branch 'ab/rebase-test-fix'

* ab/rebase-test-fix:
  rebase: fix regression in rebase.useBuiltin=false test mode

5 years agoMerge branch 'rb/no-dev-zero-in-test'
Junio C Hamano [Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)] 
Merge branch 'rb/no-dev-zero-in-test'

* rb/no-dev-zero-in-test:
  t5562: replace /dev/zero with a pipe from generate_zero_bytes
  t5318: replace use of /dev/zero with generate_zero_bytes
  test-lib-functions.sh: add generate_zero_bytes function

5 years agoMerge branch 'rs/bash-is-in-coreutils-on-nonstop'
Junio C Hamano [Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)] 
Merge branch 'rs/bash-is-in-coreutils-on-nonstop'

* rs/bash-is-in-coreutils-on-nonstop:
  config.mak.uname: move location of bash on NonStop to CoreUtils

5 years agoMerge branch 'js/mingw-host-cpu'
Junio C Hamano [Thu, 14 Feb 2019 02:18:43 +0000 (18:18 -0800)] 
Merge branch 'js/mingw-host-cpu'

Windows update.

* js/mingw-host-cpu:
  mingw: use a more canonical method to fix the CPU reporting

5 years agoMerge branch 'sg/stress-test'
Junio C Hamano [Thu, 14 Feb 2019 02:18:42 +0000 (18:18 -0800)] 
Merge branch 'sg/stress-test'

Test improvement.

* sg/stress-test:
  test-lib: fix non-portable pattern bracket expressions
  test-lib: make '--stress' more bisect-friendly

5 years agoMerge branch 'kd/t0028-octal-del-is-377-not-777'
Junio C Hamano [Thu, 14 Feb 2019 02:18:42 +0000 (18:18 -0800)] 
Merge branch 'kd/t0028-octal-del-is-377-not-777'

Test fix.

* kd/t0028-octal-del-is-377-not-777:
  t0028: fix wrong octal values for BOM in setup

5 years agoMerge branch 'bc/utf16-portability-fix'
Junio C Hamano [Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)] 
Merge branch 'bc/utf16-portability-fix'

The code and tests assume that the system supplied iconv() would
always use BOM in its output when asked to encode to UTF-16 (or
UTF-32), but apparently some implementations output big-endian
without BOM.  A compile-time knob has been added to help such
systems (e.g. NonStop) to add BOM to the output to increase
portability.

* bc/utf16-portability-fix:
  utf8: handle systems that don't write BOM for UTF-16

5 years agoMerge branch 'nd/fileno-may-be-macro'
Junio C Hamano [Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)] 
Merge branch 'nd/fileno-may-be-macro'

* nd/fileno-may-be-macro:
  git-compat-util: work around fileno(fp) that is a macro

5 years agoMerge branch 'nd/get-oid-with-context-returns-an-enum'
Junio C Hamano [Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)] 
Merge branch 'nd/get-oid-with-context-returns-an-enum'

* nd/get-oid-with-context-returns-an-enum:
  get_oid_with_context(): match prototype and implementation

5 years agoMerge branch 'rj/sequencer-sign-off-header-static'
Junio C Hamano [Thu, 14 Feb 2019 02:18:41 +0000 (18:18 -0800)] 
Merge branch 'rj/sequencer-sign-off-header-static'

Code clean-up.

* rj/sequencer-sign-off-header-static:
  sequencer: make sign_off_header a file local symbol

5 years agorebase: fix regression in rebase.useBuiltin=false test mode
Ævar Arnfjörð Bjarmason [Wed, 13 Feb 2019 21:49:08 +0000 (22:49 +0100)] 
rebase: fix regression in rebase.useBuiltin=false test mode

Fix a recently introduced regression in c762aada1a ("rebase -x: sanity
check command", 2019-01-29) triggered when running the tests with
GIT_TEST_REBASE_USE_BUILTIN=false. See 62c23938fa ("tests: add a
special setup where rebase.useBuiltin is off", 2018-11-14) for how
that test mode works.

As discussed on-list[1] it's not worth it to implement the sanity
check in the legacy rebase code, we plan to remove it after the 2.21
release. So let's do the bare minimum to make the tests pass under the
GIT_TEST_REBASE_USE_BUILTIN=false special setup.

1. https://public-inbox.org/git/xmqqva1nbeno.fsf@gitster-ct.c.googlers.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agomingw: use a more canonical method to fix the CPU reporting
Johannes Schindelin [Wed, 13 Feb 2019 10:19:49 +0000 (02:19 -0800)] 
mingw: use a more canonical method to fix the CPU reporting

In `git version --build-options`, we report also the CPU, but in Git for
Windows we actually cross-compile the 32-bit version in a 64-bit Git for
Windows, so we cannot rely on the auto-detected value.

In 3815f64b0dd9 (mingw: fix CPU reporting in `git version
--build-options`, 2019-02-07), we fixed this by a Windows-only
workaround, making use of magic pre-processor constants, which works in
GCC, but most likely not all C compilers.

As pointed out by Eric Sunshine, there is a better way, anyway: to set
the Makefile variable HOST_CPU explicitly for cross-compiled Git. So
let's do that!

This reverts commit 3815f64b0dd983bdbf9242a0547706d5d81cb3e6 partially.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agotests: avoid syntax triggering old dash bug
Ævar Arnfjörð Bjarmason [Wed, 13 Feb 2019 11:59:51 +0000 (12:59 +0100)] 
tests: avoid syntax triggering old dash bug

Avoid a bug in dash that's been fixed ever since its
ec2c84d ("[PARSER] Fix clobbering of checkkwd", 2011-03-15)[1] first
released with dash v0.5.7 in July 2011. This failing test was
introduced in 5f9674243d ("config: add --expiry-date", 2017-11-18).

This fixes 1/2 tests failing on Debian Lenny & Squeeze. The other
failure is due to 1b42f45255 ("git-svn: apply "svn.pathnameencoding"
before URL encoding", 2016-02-09).

The dash bug is triggered by this test because the heredoc contains a
command embedded in "$()" with a "{}" block coming right after
it. Refactoring the "$()" to e.g. be a variable that was set earlier
will also work around it, but let's instead break up the "EOF" and the
"{}".

An earlier version of this patch[2] mitigated the issue by breaking
the "$()" out of the "{}" block, that worked, but just because it
broke up the "EOF" and "{}" block. Putting e.g. "echo &&" between the
two would also work.

1. https://git.kernel.org/pub/scm/utils/dash/dash.git/
2. https://public-inbox.org/git/20181127164253.9832-1-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoconfig.mak.uname: move location of bash on NonStop to CoreUtils
Randall S. Becker [Sat, 9 Feb 2019 17:26:11 +0000 (12:26 -0500)] 
config.mak.uname: move location of bash on NonStop to CoreUtils

The default bash is now officially in /usr/coreutils/bin instead
of in /usr/local/bin. This version of bash is more stable and
recommended for all use as of the J06.22 and L18.02 operating
system revision levels. This new version provides more stability
of test results.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoread-cache.c: fix writing "link" index ext with null base oid
Nguyễn Thái Ngọc Duy [Wed, 13 Feb 2019 09:51:29 +0000 (16:51 +0700)] 
read-cache.c: fix writing "link" index ext with null base oid

Since commit 7db118303a (unpack_trees: fix breakage when o->src_index !=
o->dst_index - 2018-04-23) and changes in merge code to use separate
index_state for source and destination, when doing a merge with split
index activated, we may run into this line in unpack_trees():

    o->result.split_index = init_split_index(&o->result);

This is by itself not wrong. But this split index information is not
fully populated (and it's only so when move_cache_to_base_index() is
called, aka force splitting the index, or loading index_state from a
file). Both "base_oid" and "base" in this case remain null.

So when writing the main index down, we link to this index with null
oid (default value after init_split_index()), which also means "no split
index" internally. This triggers an incorrect base index refresh:

    warning: could not freshen shared index '.../sharedindex.0{40}'

This patch makes sure we will not refresh null base_oid (because the
file is never there). It also makes sure not to write "link" extension
with null base_oid in the first place (no point having it at
all). Read code already has protection against null base_oid.

There is also another side fix in remove_split_index() that causes a
crash when doing "git update-index --no-split-index" when base_oid in
the index file is null. In this case we will not load
istate->split_index->base but we dereference it anyway and are rewarded
with a segfault. This should not happen anymore, but it's still wrong to
dereference a potential NULL pointer, especially when we do check for
NULL pointer in the next code.

Reported-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agot5562: replace /dev/zero with a pipe from generate_zero_bytes
Randall S. Becker [Sat, 9 Feb 2019 18:59:30 +0000 (13:59 -0500)] 
t5562: replace /dev/zero with a pipe from generate_zero_bytes

To help platforms that lack /dev/zero (e.g. NonStop), replace use
of /dev/zero to feed "git http-backend" with a pipe of output from
the generate_zero_bytes helper.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agot5318: replace use of /dev/zero with generate_zero_bytes
Randall S. Becker [Sat, 9 Feb 2019 18:59:29 +0000 (13:59 -0500)] 
t5318: replace use of /dev/zero with generate_zero_bytes

There are platforms (e.g. NonStop) that lack /dev/zero; use the
generate_zero_bytes helper we just introduced to append stream
of NULs at the end of the file.

The original, even though it uses "dd seek=... count=..." to make it
look like it is overwriting the middle part of an existing file, has
truncated the file before this step with another use of "dd", which
may make it tricky to see why this rewrite is a correct one.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 years agoget_oid_with_context(): match prototype and implementation
Duy Nguyen [Tue, 12 Feb 2019 12:43:23 +0000 (19:43 +0700)] 
get_oid_with_context(): match prototype and implementation

The get_oid_with_context() function is declared to return an enum in
cache.h, but defined to return an int in sha1-name.c.  The compiler
notices this on AIX and rejects the build, since d1dd94b308 (Do not
print 'dangling' for cat-file in case of ambiguity - 2019-01-17) was
merged.

Return the correct type from the implementation to fix this.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>