]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agoMerge branch 'js/bisect-helper-check-get-oid-return-value' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:14 +0000 (14:27 -0700)] 
Merge branch 'js/bisect-helper-check-get-oid-return-value' into maint

Code cleanup.

* js/bisect-helper-check-get-oid-return-value:
  bisect--helper: verify HEAD could be parsed before continuing

4 years agoMerge branch 'es/git-debugger-doc' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:14 +0000 (14:27 -0700)] 
Merge branch 'es/git-debugger-doc' into maint

Doc update.

* es/git-debugger-doc:
  doc: hint about GIT_DEBUGGER in CodingGuidelines

4 years agoMerge branch 'mo/clang-format-for-each-update' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:14 +0000 (14:27 -0700)] 
Merge branch 'mo/clang-format-for-each-update' into maint

The list of for-each like macros used by clang-format has been
updated.

* mo/clang-format-for-each-update:
  clang-format: use git grep to generate the ForEachMacros list

4 years agoMerge branch 'md/url-parse-harden' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:13 +0000 (14:27 -0700)] 
Merge branch 'md/url-parse-harden' into maint

The URL decoding code has been updated to avoid going past the end
of the string while parsing %-<hex>-<hex> sequence.

* md/url-parse-harden:
  url: do not allow %00 to represent NUL in URLs
  url: do not read past end of buffer

4 years agoMerge branch 'an/ignore-doc-update' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:13 +0000 (14:27 -0700)] 
Merge branch 'an/ignore-doc-update' into maint

The description about slashes in gitignore patterns (used to
indicate things like "anchored to this level only" and "only
matches directories") has been revamped.

* an/ignore-doc-update:
  gitignore.txt: make slash-rules more readable

4 years agoMerge branch 'md/list-objects-filter-memfix' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:12 +0000 (14:27 -0700)] 
Merge branch 'md/list-objects-filter-memfix' into maint

The filter_data used in the list-objects-filter (which manages a
lazily sparse clone repository) did not use the dynamic array API
correctly---'nr' is supposed to point at one past the last element
of the array in use.  This has been corrected.

* md/list-objects-filter-memfix:
  list-objects-filter: correct usage of ALLOC_GROW

4 years agoMerge branch 'jt/partial-clone-missing-ref-delta-base' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:12 +0000 (14:27 -0700)] 
Merge branch 'jt/partial-clone-missing-ref-delta-base' into maint

"git fetch" into a lazy clone forgot to fetch base objects that are
necessary to complete delta in a thin packfile, which has been
corrected.

* jt/partial-clone-missing-ref-delta-base:
  t5616: cover case of client having delta base
  t5616: use correct flag to check object is missing
  index-pack: prefetch missing REF_DELTA bases
  t5616: refactor packfile replacement

4 years agoMerge branch 'xl/record-partial-clone-origin' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:12 +0000 (14:27 -0700)] 
Merge branch 'xl/record-partial-clone-origin' into maint

When creating a partial clone, the object filtering criteria is
recorded for the origin of the clone, but this incorrectly used a
hardcoded name "origin" to name that remote; it has been corrected
to honor the "--origin <name>" option.

* xl/record-partial-clone-origin:
  clone: respect user supplied origin name when setting up partial clone

4 years agoMerge branch 'pb/request-pull-verify-remote-ref' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:11 +0000 (14:27 -0700)] 
Merge branch 'pb/request-pull-verify-remote-ref' into maint

"git request-pull" learned to warn when the ref we ask them to pull
from in the local repository and in the published repository are
different.

* pb/request-pull-verify-remote-ref:
  request-pull: warn if the remote object is not the same as the local one
  request-pull: quote regex metacharacters in local ref

4 years agoMerge branch 'mm/p4-unshelve-windows-fix' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:11 +0000 (14:27 -0700)] 
Merge branch 'mm/p4-unshelve-windows-fix' into maint

The command line to invoke a "git cat-file" command from inside
"git p4" was not properly quoted to protect a caret and running a
broken command on Windows, which has been corrected.

* mm/p4-unshelve-windows-fix:
  p4 unshelve: fix "Not a valid object name HEAD0" on Windows

4 years agoMerge branch 'bb/unicode-12.1-reiwa' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:10 +0000 (14:27 -0700)] 
Merge branch 'bb/unicode-12.1-reiwa' into maint

Update to Unicode 12.1 width table.

* bb/unicode-12.1-reiwa:
  unicode: update the width tables to Unicode 12.1

4 years agoMerge branch 'js/fsmonitor-unflake' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:10 +0000 (14:27 -0700)] 
Merge branch 'js/fsmonitor-unflake' into maint

The data collected by fsmonitor was not properly written back to
the on-disk index file, breaking t7519 tests occasionally, which
has been corrected.

* js/fsmonitor-unflake:
  mark_fsmonitor_valid(): mark the index as changed if needed
  fill_stat_cache_info(): prepare for an fsmonitor fix

4 years agoMerge branch 'vv/merge-squash-with-explicit-commit' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:10 +0000 (14:27 -0700)] 
Merge branch 'vv/merge-squash-with-explicit-commit' into maint

"git merge --squash" is designed to update the working tree and the
index without creating the commit, and this cannot be countermanded
by adding the "--commit" option; the command now refuses to work
when both options are given.

* vv/merge-squash-with-explicit-commit:
  merge: refuse --commit with --squash

4 years agoMerge branch 'js/bundle-verify-require-object-store' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:09 +0000 (14:27 -0700)] 
Merge branch 'js/bundle-verify-require-object-store' into maint

"git bundle verify" needs to see if prerequisite objects exist in
the receiving repository, but the command did not check if we are
in a repository upfront, which has been corrected.

* js/bundle-verify-require-object-store:
  bundle verify: error out if called without an object database

4 years agoMerge branch 'jk/am-i-resolved-fix' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:09 +0000 (14:27 -0700)] 
Merge branch 'jk/am-i-resolved-fix' into maint

"git am -i --resolved" segfaulted after trying to see a commit as
if it were a tree, which has been corrected.

* jk/am-i-resolved-fix:
  am: fix --interactive HEAD tree resolution
  am: drop tty requirement for --interactive
  am: read interactive input from stdin
  am: simplify prompt response handling

4 years agoMerge branch 'jk/HEAD-symref-in-xfer-namespaces' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:09 +0000 (14:27 -0700)] 
Merge branch 'jk/HEAD-symref-in-xfer-namespaces' into maint

The server side support for "git fetch" used to show incorrect
value for the HEAD symbolic ref when the namespace feature is in
use, which has been corrected.

* jk/HEAD-symref-in-xfer-namespaces:
  upload-pack: strip namespace from symref data

4 years agoMerge branch 'ew/server-info-remove-crufts' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:08 +0000 (14:27 -0700)] 
Merge branch 'ew/server-info-remove-crufts' into maint

"git update-server-info" used to leave stale packfiles in its
output, which has been corrected.

* ew/server-info-remove-crufts:
  server-info: do not list unlinked packs

4 years agoMerge branch 'es/grep-require-name-when-needed' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:08 +0000 (14:27 -0700)] 
Merge branch 'es/grep-require-name-when-needed' into maint

More parameter validation.

* es/grep-require-name-when-needed:
  grep: fail if call could output and name is null

4 years agoMerge branch 'ds/object-info-for-prefetch-fix' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:08 +0000 (14:27 -0700)] 
Merge branch 'ds/object-info-for-prefetch-fix' into maint

Code cleanup and futureproof.

* ds/object-info-for-prefetch-fix:
  sha1-file: split OBJECT_INFO_FOR_PREFETCH

4 years agoMerge branch 'mh/import-transport-fd-fix' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:07 +0000 (14:27 -0700)] 
Merge branch 'mh/import-transport-fd-fix' into maint

The ownership rule for the file descriptor to fast-import remote
backend was mixed up, leading to unrelated file descriptor getting
closed, which has been fixed.

* mh/import-transport-fd-fix:
  Use xmmap_gently instead of xmmap in use_pack
  dup() the input fd for fast-import used for remote helpers

4 years agoMerge branch 'nd/corrupt-worktrees' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:07 +0000 (14:27 -0700)] 
Merge branch 'nd/corrupt-worktrees' into maint

"git worktree add" used to fail when another worktree connected to
the same repository was corrupt, which has been corrected.

* nd/corrupt-worktrees:
  worktree add: be tolerant of corrupt worktrees

4 years agoMerge branch 'nd/init-relative-template-fix' into maint
Junio C Hamano [Thu, 25 Jul 2019 21:27:06 +0000 (14:27 -0700)] 
Merge branch 'nd/init-relative-template-fix' into maint

A relative pathname given to "git init --template=<path> <repo>"
ought to be relative to the directory "git init" gets invoked in,
but it instead was made relative to the repository, which has been
corrected.

* nd/init-relative-template-fix:
  init: make --template path relative to $CWD

4 years agot5616: cover case of client having delta base
Jonathan Tan [Tue, 11 Jun 2019 21:06:47 +0000 (14:06 -0700)] 
t5616: cover case of client having delta base

When fetching into a partial clone, Git first prefetches missing
REF_DELTA bases from the promisor remote. (This feature was introduced
in [1].) But as can be seen in a recent test coverage report [2], the
case in which a REF_DELTA base is already present is not covered by
tests.

Extend the tests slightly to cover this case.

[1] 8a30a1efd1 ("index-pack: prefetch missing REF_DELTA bases",
2019-05-15).
[2] https://public-inbox.org/git/396091fc-5572-19a5-4f18-61c258590dd5@gmail.com/

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5616: use correct flag to check object is missing
Jonathan Tan [Tue, 11 Jun 2019 21:06:46 +0000 (14:06 -0700)] 
t5616: use correct flag to check object is missing

If we want to check whether an object is missing, the correct flag to
pass to rev-list is --ignore-missing; --exclude-promisor-objects will
exclude any object that came from the promisor remote, whether it is
present or missing. Use the correct flag.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.22 v2.22.0
Junio C Hamano [Fri, 7 Jun 2019 16:39:21 +0000 (09:39 -0700)] 
Git 2.22

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge tag 'l10n-2.22.0-rnd3' of git://github.com/git-l10n/git-po
Junio C Hamano [Fri, 7 Jun 2019 16:36:32 +0000 (09:36 -0700)] 
Merge tag 'l10n-2.22.0-rnd3' of git://github.com/git-l10n/git-po

l10n-2.22.0-rnd3

* tag 'l10n-2.22.0-rnd3' of git://github.com/git-l10n/git-po: (25 commits)
  l10n: fr.po: Review French translation
  l10n: de.po: Update German translation
  l10n: de.po: improve description of 'git reset --quiet'
  l10n: TEAMS: Change German translation team leader
  l10n: bg.po: Updated Bulgarian translation (4581t)
  l10n: zh_CN: Revision for git v2.22.0 l10n
  l10n: zh_CN: for git v2.22.0 l10n round 1~3
  l10n: es: 2.22.0 round 3
  l10n: it.po: Updated Italian translation
  l10n: fr v2.22.0 rnd 3
  l10n: vi.po(4581t): Updated Vietnamese translation for v2.22.0 round 3
  l10n: git.pot: v2.22.0 round 3 (3 new, 2 removed)
  l10n: es: 2.22.0 round 2
  l10n: bg.po: Updated Bulgarian translation (4580t)
  l10n: vi.po(4580t): Updated Vietnamese translation for v2.22.0 round 2
  l10n: fr.po v2.22.0 round 2
  l10n: git.pot: v2.22.0 round 2 (6 new, 3 removed)
  l10n: bg.po: Updated Bulgarian translation (4577t)
  l10n: es: 2.22.0 round 1
  l10n: vi.po(4577t): Updated Vietnamese translation for v2.22.0 round 1
  ...

4 years agoMerge branch 'fr_review' of git://github.com/jnavila/git
Jiang Xin [Fri, 7 Jun 2019 08:51:09 +0000 (16:51 +0800)] 
Merge branch 'fr_review' of git://github.com/jnavila/git

* 'fr_review' of git://github.com/jnavila/git:
  l10n: fr.po: Review French translation

4 years agoMerge branch 'master' of git://github.com/alshopov/git-po
Jiang Xin [Fri, 7 Jun 2019 08:50:23 +0000 (16:50 +0800)] 
Merge branch 'master' of git://github.com/alshopov/git-po

* 'master' of git://github.com/alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (4581t)

4 years agol10n: fr.po: Review French translation
Cédric Malard [Wed, 5 Jun 2019 21:33:52 +0000 (23:33 +0200)] 
l10n: fr.po: Review French translation

Signed-off-by: Cédric Malard <c.malard-git@valdun.net>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
4 years agoMerge branch 'en/merge-directory-renames-fix'
Junio C Hamano [Thu, 6 Jun 2019 21:03:36 +0000 (14:03 -0700)] 
Merge branch 'en/merge-directory-renames-fix'

Recent code restructuring of merge-recursive engine introduced a
regression dealing with rename/add conflict.

* en/merge-directory-renames-fix:
  merge-recursive: restore accidentally dropped setting of path

4 years agol10n: de.po: Update German translation
Matthias Rüster [Sat, 1 Jun 2019 12:32:49 +0000 (14:32 +0200)] 
l10n: de.po: Update German translation

Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
4 years agol10n: de.po: improve description of 'git reset --quiet'
Ralf Thielow [Thu, 28 Feb 2019 18:25:51 +0000 (19:25 +0100)] 
l10n: de.po: improve description of 'git reset --quiet'

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
4 years agol10n: TEAMS: Change German translation team leader
Matthias Rüster [Sat, 1 Jun 2019 12:32:44 +0000 (14:32 +0200)] 
l10n: TEAMS: Change German translation team leader

Acked-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
4 years agomerge-recursive: restore accidentally dropped setting of path
Elijah Newren [Tue, 4 Jun 2019 20:27:50 +0000 (13:27 -0700)] 
merge-recursive: restore accidentally dropped setting of path

In commit 8daec1df03de ("merge-recursive: switch from (oid,mode) pairs
to a diff_filespec", 2019-04-05), we actually switched from
(oid,mode,path) triplets to a diff_filespec -- but most callsites in the
patch only needed to worry about oid and mode so the commit message
focused on that.  The oversight in the commit message apparently spilled
over to the code as well; one of the dozen or so callsites accidentally
dropped the setting of the path in the conversion.  Restore the path
setting in that location.

Also, this pointed out that our testsuite was lacking a good rename/add
test, at least one that involved the need for merge content with the
rename.  Add such a test, and since rename/add vs. add/rename could
possibly be important, redo the merge the opposite direction to make
sure we don't have issues with the direction of the merge.  These
testcases failed before restoring the setting of path, but with the
paths appropriately set the testcases both pass.

Reported-by: Ben Humphreys <behumphreys@atlassian.com>
Based-on-patch-by: SZEDER Gábor <szeder.dev@gmail.com>
Tested-by: Ben Humphreys <behumphreys@atlassian.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: bg.po: Updated Bulgarian translation (4581t)
Alexander Shopov [Wed, 5 Jun 2019 06:51:15 +0000 (08:51 +0200)] 
l10n: bg.po: Updated Bulgarian translation (4581t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
4 years agol10n: zh_CN: Revision for git v2.22.0 l10n
Fangyi Zhou [Sun, 2 Jun 2019 21:41:45 +0000 (22:41 +0100)] 
l10n: zh_CN: Revision for git v2.22.0 l10n

Revise 51 translations, improving consistency for some phrased.
Update email address for Fangyi Zhou

Signed-off-by: Fangyi Zhou <me@fangyi.io>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agol10n: zh_CN: for git v2.22.0 l10n round 1~3
Jiang Xin [Tue, 16 Apr 2019 00:56:12 +0000 (08:56 +0800)] 
l10n: zh_CN: for git v2.22.0 l10n round 1~3

Translate 274 new messages (4581t0f0u) for git 2.22.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoMerge branch '2.22' of https://github.com/ChrisADR/git-po
Jiang Xin [Wed, 5 Jun 2019 00:35:35 +0000 (08:35 +0800)] 
Merge branch '2.22' of https://github.com/ChrisADR/git-po

* '2.22' of https://github.com/ChrisADR/git-po:
  l10n: es: 2.22.0 round 3

4 years agoMerge branch 'it-l10n-wip' of github.com:AlessandroMenti/git-po
Jiang Xin [Wed, 5 Jun 2019 00:17:28 +0000 (08:17 +0800)] 
Merge branch 'it-l10n-wip' of github.com:AlessandroMenti/git-po

* 'it-l10n-wip' of github.com:AlessandroMenti/git-po:
  l10n: it.po: Updated Italian translation

4 years agol10n: es: 2.22.0 round 3
Christopher Diaz Riveros [Tue, 4 Jun 2019 23:52:28 +0000 (18:52 -0500)] 
l10n: es: 2.22.0 round 3

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
4 years agoclang-format: use git grep to generate the ForEachMacros list
Miguel Ojeda [Mon, 3 Jun 2019 22:48:14 +0000 (00:48 +0200)] 
clang-format: use git grep to generate the ForEachMacros list

The ForEachMacros list can reasonably be generated grepping
the C source code for macros with 'for_each' in their name.

Taken almost verbatim from the .clang-format file in the Linux kernel.

Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agourl: do not allow %00 to represent NUL in URLs
Matthew DeVore [Tue, 4 Jun 2019 17:57:05 +0000 (10:57 -0700)] 
url: do not allow %00 to represent NUL in URLs

There is no reason to allow %00 to terminate a string, so do not allow it.
Otherwise, we end up returning arbitrary content in the string (that which is
after the %00) which is effectively hidden from callers and can escape sanity
checks and validation, and possible be used in tandem with a security
vulnerability to introduce a payload.

Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agourl: do not read past end of buffer
Matthew DeVore [Tue, 4 Jun 2019 17:57:04 +0000 (10:57 -0700)] 
url: do not read past end of buffer

url_decode_internal could have been tricked into reading past the length
of the **query buffer if there are fewer than 2 characters after a % (in
a null-terminated string, % would have to be the last character).
Prevent this from happening by checking len before decoding the %
sequence.

Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogitignore.txt: make slash-rules more readable
Dr. Adam Nielsen [Tue, 4 Jun 2019 17:34:46 +0000 (19:34 +0200)] 
gitignore.txt: make slash-rules more readable

Renew paragraphs relevant for pattern with slash.
Aim to make it more clear and to avoid possible
pitfalls for the reader. Add some examples.

Signed-off-by: Dr. Adam Nielsen <admin@in-ici.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: it.po: Updated Italian translation
Alessandro Menti [Sun, 19 May 2019 06:51:55 +0000 (08:51 +0200)] 
l10n: it.po: Updated Italian translation

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
4 years agol10n: fr v2.22.0 rnd 3
Jean-Noël Avila [Tue, 4 Jun 2019 17:53:32 +0000 (19:53 +0200)] 
l10n: fr v2.22.0 rnd 3

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
4 years agol10n: vi.po(4581t): Updated Vietnamese translation for v2.22.0 round 3
Tran Ngoc Quan [Tue, 4 Jun 2019 01:10:46 +0000 (08:10 +0700)] 
l10n: vi.po(4581t): Updated Vietnamese translation for v2.22.0 round 3

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
4 years agol10n: git.pot: v2.22.0 round 3 (3 new, 2 removed)
Jiang Xin [Tue, 4 Jun 2019 00:27:36 +0000 (08:27 +0800)] 
l10n: git.pot: v2.22.0 round 3 (3 new, 2 removed)

Generate po/git.pot from v2.22.0-rc3 for git v2.22.0 l10n round 3.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/git/git
Jiang Xin [Tue, 4 Jun 2019 00:24:28 +0000 (08:24 +0800)] 
Merge branch 'master' of git://git.kernel.org/pub/scm/git/git

* 'master' of git://git.kernel.org/pub/scm/git/git:
  Git 2.22-rc3
  i18n: fix typos found during l10n for git 2.22.0
  RelNotes: minor typo fixes in 2.22.0 draft
  list-objects-filter: disable 'sparse:path' filters

4 years agoGit 2.22-rc3 v2.22.0-rc3
Junio C Hamano [Mon, 3 Jun 2019 18:25:12 +0000 (11:25 -0700)] 
Git 2.22-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'cc/list-objects-filter-wo-sparse-path'
Junio C Hamano [Mon, 3 Jun 2019 18:18:54 +0000 (11:18 -0700)] 
Merge branch 'cc/list-objects-filter-wo-sparse-path'

Disable "--filter=sparse:path=<path>" that would allow reading from
paths on the filesystem.

* cc/list-objects-filter-wo-sparse-path:
  list-objects-filter: disable 'sparse:path' filters

4 years agoi18n: fix typos found during l10n for git 2.22.0
Jiang Xin [Sun, 2 Jun 2019 15:11:22 +0000 (23:11 +0800)] 
i18n: fix typos found during l10n for git 2.22.0

Fix two typos introduced by the following commits:

31fba9d3b4 (diff-parseopt: convert --[src|dst]-prefix, 2019-03-24)
ed8b4132c8 (remote-curl: mark all error messages for translation,
  2019-03-05)

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoRelNotes: minor typo fixes in 2.22.0 draft
Todd Zullinger [Sat, 1 Jun 2019 15:51:06 +0000 (11:51 -0400)] 
RelNotes: minor typo fixes in 2.22.0 draft

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: es: 2.22.0 round 2
Christopher Diaz Riveros [Mon, 3 Jun 2019 14:34:50 +0000 (09:34 -0500)] 
l10n: es: 2.22.0 round 2

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
4 years agoMerge branch 'master' of https://github.com/vnwildman/git
Jiang Xin [Sun, 2 Jun 2019 14:35:11 +0000 (22:35 +0800)] 
Merge branch 'master' of https://github.com/vnwildman/git

* 'master' of https://github.com/vnwildman/git:
  l10n: vi.po(4580t): Updated Vietnamese translation for v2.22.0 round 2

4 years agoMerge branch 'master' of git://github.com/alshopov/git-po
Jiang Xin [Sun, 2 Jun 2019 14:09:35 +0000 (22:09 +0800)] 
Merge branch 'master' of git://github.com/alshopov/git-po

* 'master' of git://github.com/alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (4580t)

4 years agol10n: bg.po: Updated Bulgarian translation (4580t)
Alexander Shopov [Sun, 2 Jun 2019 07:26:52 +0000 (09:26 +0200)] 
l10n: bg.po: Updated Bulgarian translation (4580t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
4 years agol10n: vi.po(4580t): Updated Vietnamese translation for v2.22.0 round 2
Tran Ngoc Quan [Sat, 1 Jun 2019 01:36:37 +0000 (08:36 +0700)] 
l10n: vi.po(4580t): Updated Vietnamese translation for v2.22.0 round 2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
4 years agolist-objects-filter: correct usage of ALLOC_GROW
Matthew DeVore [Fri, 31 May 2019 18:46:06 +0000 (11:46 -0700)] 
list-objects-filter: correct usage of ALLOC_GROW

In the sparse filter data, array_frame array is used in a way such that
nr is the index of the last element. Fix this so that nr is actually the
number of elements in the array.

The filter_sparse_free function also has an unaddressed TODO to free the
memory associated with the sparse filter data. Address that TODO and fix
the memory leak.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: fr.po v2.22.0 round 2
Jean-Noël Avila [Fri, 31 May 2019 08:46:21 +0000 (10:46 +0200)] 
l10n: fr.po v2.22.0 round 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
4 years agol10n: git.pot: v2.22.0 round 2 (6 new, 3 removed)
Jiang Xin [Fri, 31 May 2019 06:36:22 +0000 (14:36 +0800)] 
l10n: git.pot: v2.22.0 round 2 (6 new, 3 removed)

Generate po/git.pot from v2.22.0-rc2 for git v2.22.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/git/git
Jiang Xin [Fri, 31 May 2019 06:34:26 +0000 (14:34 +0800)] 
Merge branch 'master' of git://git.kernel.org/pub/scm/git/git

* 'master' of git://git.kernel.org/pub/scm/git/git: (66 commits)
  Git 2.22-rc2
  ...

4 years agoMerge branch 'master' of https://github.com/Softcatala/git-po
Jiang Xin [Fri, 31 May 2019 06:32:35 +0000 (14:32 +0800)] 
Merge branch 'master' of https://github.com/Softcatala/git-po

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

4 years agoGit 2.22-rc2 v2.22.0-rc2
Junio C Hamano [Thu, 30 May 2019 17:56:29 +0000 (10:56 -0700)] 
Git 2.22-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'js/rebase-config-bitfix'
Junio C Hamano [Thu, 30 May 2019 17:50:47 +0000 (10:50 -0700)] 
Merge branch 'js/rebase-config-bitfix'

* js/rebase-config-bitfix:
  rebase: replace incorrect logical negation by correct bitwise one

4 years agoMerge branch 'es/doc-gitsubmodules-markup'
Junio C Hamano [Thu, 30 May 2019 17:50:46 +0000 (10:50 -0700)] 
Merge branch 'es/doc-gitsubmodules-markup'

Doc markup fix.

* es/doc-gitsubmodules-markup:
  gitsubmodules: align html and nroff lists

4 years agoMerge branch 'ja/diff-opt-typofix'
Junio C Hamano [Thu, 30 May 2019 17:50:46 +0000 (10:50 -0700)] 
Merge branch 'ja/diff-opt-typofix'

Typofix.

* ja/diff-opt-typofix:
  diff: fix mistake in translatable strings

4 years agoMerge branch 'jt/clone-server-option'
Junio C Hamano [Thu, 30 May 2019 17:50:46 +0000 (10:50 -0700)] 
Merge branch 'jt/clone-server-option'

A brown-paper-bag bugfix to a change already in 'master'.

* jt/clone-server-option:
  fetch-pack: send server options after command

4 years agoMerge branch 'sg/progress-off-by-one-fix'
Junio C Hamano [Thu, 30 May 2019 17:50:45 +0000 (10:50 -0700)] 
Merge branch 'sg/progress-off-by-one-fix'

A brown-paper-bag bugfix to a change already in 'master'.

* sg/progress-off-by-one-fix:
  progress: avoid empty line when breaking the progress line

4 years agoMerge branch 'js/rebase-deprecate-preserve-merges'
Junio C Hamano [Thu, 30 May 2019 17:50:45 +0000 (10:50 -0700)] 
Merge branch 'js/rebase-deprecate-preserve-merges'

A bit more leftover clean-up to deprepcate "rebase -p".

* js/rebase-deprecate-preserve-merges:
  rebase docs: recommend `-r` over `-p`
  docs: say that `--rebase=preserve` is deprecated
  tests: mark a couple more test cases as requiring `rebase -p`

4 years agoMerge branch 'sg/trace2-rename'
Junio C Hamano [Thu, 30 May 2019 17:50:45 +0000 (10:50 -0700)] 
Merge branch 'sg/trace2-rename'

Rename environment variables that are used to control the "trace2"
mechanism to a more readable name.

* sg/trace2-rename:
  trace2: document the supported values of GIT_TRACE2* env variables
  trace2: rename environment variables to GIT_TRACE2*

4 years agoMerge branch 'jh/trace2'
Junio C Hamano [Thu, 30 May 2019 17:50:44 +0000 (10:50 -0700)] 
Merge branch 'jh/trace2'

* jh/trace2:
  trace2: fix tracing when NO_PTHREADS is defined

4 years agoMerge branch 'nd/diff-parseopt'
Junio C Hamano [Thu, 30 May 2019 17:50:44 +0000 (10:50 -0700)] 
Merge branch 'nd/diff-parseopt'

A brown-paper-bag bugfix to a change already in 'master'.

* nd/diff-parseopt:
  parse-options: check empty value in OPT_INTEGER and OPT_ABBREV
  diff-parseopt: restore -U (no argument) behavior
  diff-parseopt: correct variable types that are used by parseopt

4 years agoclone: respect user supplied origin name when setting up partial clone
Xin Li [Wed, 29 May 2019 21:26:43 +0000 (14:26 -0700)] 
clone: respect user supplied origin name when setting up partial clone

Signed-off-by: Xin Li <delphij@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agounicode: update the width tables to Unicode 12.1
Beat Bolli [Wed, 29 May 2019 20:50:45 +0000 (22:50 +0200)] 
unicode: update the width tables to Unicode 12.1

Now that Unicode 12.1 has been announced[0], update the character
width tables to the new version.

[0] http://blog.unicode.org/2019/05/unicode-12-1-en.html

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolist-objects-filter: disable 'sparse:path' filters
Christian Couder [Wed, 29 May 2019 12:44:32 +0000 (14:44 +0200)] 
list-objects-filter: disable 'sparse:path' filters

If someone wants to use as a filter a sparse file that is in the
repository, something like "--filter=sparse:oid=<ref>:<path>"
already works.

So 'sparse:path' is only interesting if the sparse file is not in
the repository. In this case though the current implementation has
a big security issue, as it makes it possible to ask the server to
read any file, like for example /etc/password, and to explore the
filesystem, as well as individual lines of files.

If someone is interested in using a sparse file that is not in the
repository as a filter, then at the minimum a config option, such
as "uploadpack.sparsePathFilter", should be implemented first to
restrict the directory from which the files specified by
'sparse:path' can be read.

For now though, let's just disable 'sparse:path' filters.

Helped-by: Matthew DeVore <matvore@google.com>
Helped-by: Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoparse-options: check empty value in OPT_INTEGER and OPT_ABBREV
Nguyễn Thái Ngọc Duy [Wed, 29 May 2019 09:11:16 +0000 (16:11 +0700)] 
parse-options: check empty value in OPT_INTEGER and OPT_ABBREV

When parsing the argument for OPT_INTEGER and OPT_ABBREV, we check if we
can parse the entire argument to a number with "if (*s)". There is one
missing check: if "arg" is empty to begin with, we fail to notice.

This could happen with long option by writing like

  git diff --inter-hunk-context= blah blah

Before 16ed6c97cc (diff-parseopt: convert --inter-hunk-context,
2019-03-24), --inter-hunk-context is handled by a custom parser
opt_arg() and does detect this correctly.

This restores the bahvior for --inter-hunk-context and make sure all
other integer options are handled the same (sane) way. For OPT_ABBREV
this is new behavior. But it makes it consistent with the rest.

PS. OPT_MAGNITUDE has similar code but git_parse_ulong() does detect
empty "arg". So it's good to go.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodiff-parseopt: restore -U (no argument) behavior
Nguyễn Thái Ngọc Duy [Wed, 29 May 2019 09:11:15 +0000 (16:11 +0700)] 
diff-parseopt: restore -U (no argument) behavior

Before d473e2e0e8 (diff.c: convert -U|--unified, 2019-01-27), -U and
--unified are implemented with a custom parser opt_arg() in diff.c. I
didn't check this code carefully and not realize that it's the
equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.

In other words, if -U is specified without any argument, the option
should be accepted, and the default value should be used. Without
PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
regression.

Reported-by: Bryan Turner <bturner@atlassian.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodiff-parseopt: correct variable types that are used by parseopt
Nguyễn Thái Ngọc Duy [Wed, 29 May 2019 09:11:14 +0000 (16:11 +0700)] 
diff-parseopt: correct variable types that are used by parseopt

Most number-related OPT_ macros store the value in an 'int'
variable. Many of the variables in 'struct diff_options' have a
different type, but during the conversion to using parse_options() I
failed to notice and correct.

The problem was reported on s360x which is a big-endian
architechture. The variable to store '-w' option in this case is
xdl_opts, 'long' type, 8 bytes. But since parse_options() assumes
'int' (4 bytes), it will store bits in the wrong part of xdl_opts. The
problem was found on little-endian platforms because parse_options()
will accidentally store at the right part of xdl_opts.

There aren't much to say about the type change (except that 'int' for
xdl_opts should still be big enough, since Windows' long is the same
size as 'int' and nobody has complained so far). Some safety checks may
be implemented in the future to prevent class of bugs.

Reported-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'master' of git://github.com/alshopov/git-po
Jiang Xin [Wed, 29 May 2019 14:01:19 +0000 (22:01 +0800)] 
Merge branch 'master' of git://github.com/alshopov/git-po

* 'master' of git://github.com/alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (4577t)

4 years agol10n: bg.po: Updated Bulgarian translation (4577t)
Alexander Shopov [Fri, 17 May 2019 08:27:52 +0000 (10:27 +0200)] 
l10n: bg.po: Updated Bulgarian translation (4577t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
4 years agodoc: hint about GIT_DEBUGGER in CodingGuidelines
Emily Shaffer [Tue, 28 May 2019 19:07:29 +0000 (12:07 -0700)] 
doc: hint about GIT_DEBUGGER in CodingGuidelines

We check for a handy environment variable GIT_DEBUGGER when running via
bin-wrappers/, but this feature is undocumented. Add a hint to how to
use it into the CodingGuidelines (which is where other useful
environment settings like DEVELOPER are documented).

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agop4 unshelve: fix "Not a valid object name HEAD0" on Windows
Mike Mueller [Tue, 28 May 2019 18:15:46 +0000 (11:15 -0700)] 
p4 unshelve: fix "Not a valid object name HEAD0" on Windows

git p4 unshelve was failing with these errors:

fatal: Not a valid object name HEAD0
Command failed: git cat-file commit HEAD^0

(git version 2.21.0.windows.1, python 2.7.16)

The pOpen call used by git-p4 to invoke the git command can take either a
string or an array as a first argument. The array form is preferred
because platform-specific escaping of special characters will be
handled automatically.(https://docs.python.org/2/library/subprocess.html)
The extractLogMessageFromGitCommit method was, however, using the string
form and so the caret (^) character in the HEAD^0 argument was not being
escaped on Windows.  The caret happens to be the escape character, which
is why the git command was receiving HEAD0.

The behaviour can be confirmed by typing ECHO HEAD^0 at the command-
prompt, which emits HEAD0.

The solution is simply to use the array format of passing the command to
fOpen, which is recommended and used in other parts of this code anyway.

Signed-off-by: Mike Mueller <mike.mueller@moodys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosha1-file: split OBJECT_INFO_FOR_PREFETCH
Derrick Stolee [Tue, 28 May 2019 15:19:07 +0000 (08:19 -0700)] 
sha1-file: split OBJECT_INFO_FOR_PREFETCH

The OBJECT_INFO_FOR_PREFETCH bitflag was added to sha1-file.c in 0f4a4fb1
(sha1-file: support OBJECT_INFO_FOR_PREFETCH, 2019-03-29) and is used to
prevent the fetch_objects() method when enabled.

However, there is a problem with the current use. The definition of
OBJECT_INFO_FOR_PREFETCH is given by adding 32 to OBJECT_INFO_QUICK. This is
clearly stated above the definition (in a comment) that this is so
OBJECT_INFO_FOR_PREFETCH implies OBJECT_INFO_QUICK. The problem is that using
"flag & OBJECT_INFO_FOR_PREFETCH" means that OBJECT_INFO_QUICK also implies
OBJECT_INFO_FOR_PREFETCH.

Split out the single bit from OBJECT_INFO_FOR_PREFETCH into a new
OBJECT_INFO_SKIP_FETCH_OBJECT as the single bit and keep
OBJECT_INFO_FOR_PREFETCH as the union of two flags. This allows a clearer use
of flag checking while also keeping the implication of OBJECT_INFO_QUICK.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorebase docs: recommend `-r` over `-p`
Johannes Schindelin [Tue, 28 May 2019 12:42:16 +0000 (05:42 -0700)] 
rebase docs: recommend `-r` over `-p`

The `--preserve-merges` option is now deprecated in favor of
`--rebase-merges`; Let's stop recommending the former.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodocs: say that `--rebase=preserve` is deprecated
Johannes Schindelin [Tue, 28 May 2019 12:42:15 +0000 (05:42 -0700)] 
docs: say that `--rebase=preserve` is deprecated

As of Git v2.22.0, the `--preserve-merges` backend of `git rebase` will
be officially deprecated in favor of the `--rebase-merges` backend.
Consequently, `git pull --rebase=preserve` will also be deprected. State
this explicitly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotests: mark a couple more test cases as requiring `rebase -p`
Johannes Schindelin [Tue, 28 May 2019 12:42:14 +0000 (05:42 -0700)] 
tests: mark a couple more test cases as requiring `rebase -p`

The `--preserve-merges` option has been deprecated, and as a consequence
we started to mark test cases that require that option to be supported,
in preparation for removing that support eventually.

Since we marked those test cases, a couple more crept into the test
suite, and with this patch, we mark them, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorequest-pull: warn if the remote object is not the same as the local one
Paolo Bonzini [Tue, 28 May 2019 10:15:43 +0000 (12:15 +0200)] 
request-pull: warn if the remote object is not the same as the local one

In some cases, git request-pull might be invoked with remote and
local objects that differ even though they point to the same commit.
For example, the remote object might be a lightweight tag
vs. an annotated tag on the local side; or the user might have
reworded the tag locally and forgotten to push it.

When this happens git-request-pull will not warn, because it only
checks that "git ls-remote" returns an SHA1 that matches the local
commit (known as $headrev in the script).  This patch makes
git-request-pull retrieve the tag object SHA1 while processing
the "git ls-remote" output, so that it can be matched against the
local object.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorequest-pull: quote regex metacharacters in local ref
Paolo Bonzini [Tue, 28 May 2019 10:15:42 +0000 (12:15 +0200)] 
request-pull: quote regex metacharacters in local ref

The local part of the third argument of git-request-pull is used in
a regular expression without quoting it.  Use qr{} and \Q\E to ensure
that e.g. a period in a tag name does not match any character on the
remote side.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobundle verify: error out if called without an object database
Johannes Schindelin [Mon, 27 May 2019 19:59:14 +0000 (12:59 -0700)] 
bundle verify: error out if called without an object database

The deal with bundles is: they really are thin packs, with very little
sugar on top. So we really need a repository (or more appropriately, an
object database) to work with, when asked to verify a bundle.

Let's error out with a useful error message if `git bundle verify` is
called without such an object database to work with.

Reported by Konstantin Ryabitsev.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomark_fsmonitor_valid(): mark the index as changed if needed
Johannes Schindelin [Fri, 24 May 2019 12:23:48 +0000 (05:23 -0700)] 
mark_fsmonitor_valid(): mark the index as changed if needed

Without this bug fix, t7519's four "status doesn't detect unreported
modifications" test cases would fail occasionally (and, oddly enough,
*a lot* more frequently on Windows).

The reason is that these test cases intentionally use the side effect of
`git status` to re-write the index if any updates were detected: they
first clean the worktree, run `git status` to update the index as well
as show the output to the casual reader, then make the worktree dirty
again and expect no changes to reported if running with a mocked
fsmonitor hook.

The problem with this strategy was that the index was written during
said `git status` on the clean worktree for the *wrong* reason: not
because the index was marked as changed (it wasn't), but because the
recorded mtimes were racy with the index' own mtime.

As the mtime granularity on Windows is 100 nanoseconds (see e.g.
https://docs.microsoft.com/en-us/windows/desktop/SysInfo/file-times),
the mtimes of the files are often enough *not* racy with the index', so
that that `git status` call currently does not always update the index
(including the fsmonitor extension), causing the test case to fail.

The obvious fix: if we change *any* index entry's `CE_FSMONITOR_VALID`
flag, we should also mark the index as changed. That will cause the
index to be written upon `git status`, *including* an updated fsmonitor
extension.

Side note: Even though the reader might think that the t7519 issue
should be *much* more prevalent on Linux, given that the ext4 filesystem
(that seems to be used by every Linux distribution) stores mtimes in
nanosecond precision. However, ext4 uses `current_kernel_time()` (see
https://unix.stackexchange.com/questions/11599#comment762968_11599; it
is *amazingly* hard to find any proper source of information about such
ext4 questions) whose accuracy seems to depend on many factors but is
safely worse than the 100-nanosecond granularity of NTFS (again, it is
*horribly* hard to find anything remotely authoritative about this
question). So it seems that the racy index condition that hid the bug
fixed by this patch simply is a lot more likely on Linux than on
Windows. But not impossible ;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofill_stat_cache_info(): prepare for an fsmonitor fix
Johannes Schindelin [Fri, 24 May 2019 12:23:47 +0000 (05:23 -0700)] 
fill_stat_cache_info(): prepare for an fsmonitor fix

We will need to pass down the `struct index_state` to
`mark_fsmonitor_valid()` for an upcoming bug fix, and this here function
calls that there function, so we need to extend the signature of
`fill_stat_cache_info()` first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge: refuse --commit with --squash
Vishal Verma [Fri, 24 May 2019 18:36:17 +0000 (12:36 -0600)] 
merge: refuse --commit with --squash

Convert option_commit to tristate, representing the states of
'default/untouched', 'enabled-by-cli', 'disabled-by-cli'. With this in
place, check whether option_commit was enabled by cli when squashing a
merge. If so, error out, as this is not supported.

Previously, when --squash was supplied, 'option_commit' was silently
dropped. This could have been surprising to a user who tried to override
the no-commit behavior of squash using --commit explicitly.

Add a note to the --squash option for git-merge to clarify the
incompatibility, and add a test case to t7600-merge.sh

Cc: Junio C Hamano <gitster@pobox.com>
Cc: Rafael Ascensão <rafa.almas@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Vishal Verma <vishal@stellar.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoserver-info: do not list unlinked packs
Eric Wong [Thu, 23 May 2019 17:27:23 +0000 (17:27 +0000)] 
server-info: do not list unlinked packs

Having non-existent packs in objects/info/packs causes
dumb HTTP clients to abort.

v2: use single loop with ALLOC_GROW as suggested by Jeff King

Signed-off-by: Eric Wong <e@80x24.org>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agofetch-pack: send server options after command
Jonathan Tan [Wed, 22 May 2019 20:08:22 +0000 (13:08 -0700)] 
fetch-pack: send server options after command

Currently, if any server options are specified during a protocol v2
fetch, server options will be sent before "command=fetch". Write server
options to the request buffer in send_fetch_request() so that the
components of the request are sent in the correct order.

The protocol documentation states that the command must come first. The
Git server implementation in serve.c (see process_request() in that
file) tolerates any order of command and capability, which is perhaps
why we haven't noticed this. This was noticed when testing against a
JGit server implementation, which follows the documentation in this
regard.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogrep: fail if call could output and name is null
Emily Shaffer [Thu, 23 May 2019 20:23:56 +0000 (13:23 -0700)] 
grep: fail if call could output and name is null

grep_source(), which performs much of the work for Git's grep library,
allows passing an arbitrary struct grep_source which represents the text
which grep_source() should search to match a pattern in the provided
struct grep_opt. In most callers, the grep_source::name field is set to
an appropriate prefix to print before a colon when a result matches:

README:Git is an Open Source project covered by the GNU General

One caller, grep_buffer(), leaves the grep_source::name field set to
NULL because there isn't enough context to determine an appropriate name
for this kind of output line. In practice, this has been fine: the only
caller of grep_buffer() is "git log --grep", and that caller sets
grep_opt::status_only, which disables output and only checks whether a
match exists. But this is brittle: a future caller can call
grep_buffer() without grep_opt::status_only set, and as soon as it hits
a match, grep_source() will try to print the match and segfault:

(null):Git is an Open Source project covered by the GNU General

For example, a future caller might want to print all matching lines from
commits which match a regex.

Futureproof by diagnosing early a use of the API that could trigger that
condition, before we know whether the pattern matches:

BUG: grep.c:1783: grep call which could print a name requires
grep_source.name be non-NULL
Aborted

This way, the caller's author gets an indication of how to fix the issue
- by providing grep_source::name or setting grep_opt::status_only - and
they are warned of the potential for a segfault unconditionally, rather
than only if there is a match.

Noticed while adding such a call to a tutorial on revision walks.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotrace2: fix tracing when NO_PTHREADS is defined
Jeff Hostetler [Tue, 21 May 2019 19:33:59 +0000 (12:33 -0700)] 
trace2: fix tracing when NO_PTHREADS is defined

Teach trace2 TLS code to not rely on pthread_getspecific() when NO_PTHREADS
is defined.  Instead, always assume the context data of the main thread.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobisect--helper: verify HEAD could be parsed before continuing
Johannes Schindelin [Tue, 21 May 2019 17:50:21 +0000 (10:50 -0700)] 
bisect--helper: verify HEAD could be parsed before continuing

In 06f5608c14e6 (bisect--helper: `bisect_start` shell function partially
in C, 2019-01-02), we introduced a call to `get_oid()` and did not check
whether it succeeded before using its output.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorebase: replace incorrect logical negation by correct bitwise one
Johannes Schindelin [Tue, 21 May 2019 17:50:20 +0000 (10:50 -0700)] 
rebase: replace incorrect logical negation by correct bitwise one

In bff014dac7d9 (builtin rebase: support the `verbose` and `diffstat`
options, 2018-09-04), we added a line that wanted to remove the
`REBASE_DIFFSTAT` bit from the flags, but it used an incorrect negation.

Found by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoam: fix --interactive HEAD tree resolution
Jeff King [Fri, 24 May 2019 06:46:27 +0000 (02:46 -0400)] 
am: fix --interactive HEAD tree resolution

In --interactive mode, "git am --resolved" will try to generate a patch
based on what is in the index, so that it can prompt "apply this
patch?". To do so it needs the tree of HEAD, which it tries to get with
get_oid_tree(). However, this doesn't yield a tree object; the "tree"
part just means "if you must disambiguate short oids, then prefer trees"
(and we do not need to disambiguate at all, since we are feeding a ref).

Instead, we must parse the oid as a commit (which should always be true
in a non-corrupt repository), and access its tree pointer manually.

This has been broken since the conversion to C in 7ff2683253
(builtin-am: implement -i/--interactive, 2015-08-04), but there was no
test coverage because of interactive-mode's insistence on having a tty.
That was lifted in the previous commit, so we can now add a test for
this case.

Note that before this patch, the test would result in a BUG() which
comes from 3506dc9445 (has_uncommitted_changes(): fall back to empty
tree, 2018-07-11). But before that, we'd have simply segfaulted (and in
fact this is the exact type of case the BUG() added there was trying to
catch!).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>