Commit graph

55943 commits

Author SHA1 Message Date
SZEDER Gábor 1aed1a5f25 progress: avoid empty line when breaking the progress line
Since commit 545dc345eb (progress: break too long progress bar lines,
2019-04-12) when splitting a too long progress line, sometimes it
looks as if a superfluous empty line were added between the title
line and the counters.

To make sure that the previously displayed progress line is completely
covered up when writing the new, shorter title line, we calculate how
many characters need to be overwritten with spaces.  Alas, this
calculation doesn't account for the newline character at the end of
the new title line, and resulted in printing one more space than
strictly necessary.  This extra space character doesn't matter, if the
length of the previous progress line was shorter than the width of the
terminal.  However, if the previous line matched the terminal width,
then this extra space made the new line longer, effectively adding
that empty line after the title line.

Fix this off-by-one to avoid that spurious empty line.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-28 10:21:11 -07:00
SZEDER Gábor 4e0d3aa18a trace2: document the supported values of GIT_TRACE2* env variables
The descriptions of the GIT_TRACE2* environment variables link to the
technical docs for further details on the supported values.  However,
a link like this only really works if the docs are viewed in a browser
and the full documentation is available.  OTOH, in 'man git' there are
no links to conveniently click on, and distro-shipped git packages
tend to include only the man pages, while the technical docs and the
docs in html format are in a separate 'git-doc' package.

So let's describe the supported values to make the manpage more
self-contained, but still keep the references to the technical docs
because the details of the SID, and the JSON and perf output formats
are definitely beyond the scope of 'man git'.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-28 10:20:36 -07:00
SZEDER Gábor e4b75d6a1d trace2: rename environment variables to GIT_TRACE2*
For an environment variable that is supposed to be set by users, the
GIT_TR2* env vars are just too unclear, inconsistent, and ugly.

Most of the established GIT_* environment variables don't use
abbreviations, and in case of the few that do (GIT_DIR,
GIT_COMMON_DIR, GIT_DIFF_OPTS) it's quite obvious what the
abbreviations (DIR and OPTS) stand for.  But what does TR stand for?
Track, traditional, trailer, transaction, transfer, transformation,
transition, translation, transplant, transport, traversal, tree,
trigger, truncate, trust, or ...?!

The trace2 facility, as the '2' suffix in its name suggests, is
supposed to eventually supercede Git's original trace facility.  It's
reasonable to expect that the corresponding environment variables
follow suit, and after the original GIT_TRACE variables they are
called GIT_TRACE2; there is no such thing is 'GIT_TR'.

All trace2-specific config variables are, very sensibly, in the
'trace2' section, not in 'tr2'.

OTOH, we don't gain anything at all by omitting the last three
characters of "trace" from the names of these environment variables.

So let's rename all GIT_TR2* environment variables to GIT_TRACE2*,
before they make their way into a stable release.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-28 10:20:34 -07:00
Jeff King 533e088250 upload-pack: strip namespace from symref data
Since 7171d8c15f (upload-pack: send symbolic ref information as
capability, 2013-09-17), we've sent cloning and fetching clients special
information about which branch HEAD is pointing to, so that they don't
have to guess based on matching up commit ids.

However, this feature has never worked properly with the GIT_NAMESPACE
feature.  Because upload-pack uses head_ref_namespaced(find_symref), we
do find and report on refs/namespaces/foo/HEAD instead of the actual
HEAD of the repo. This makes sense, since the branch pointed to by the
top-level HEAD may not be advertised at all. But we do two things wrong:

  1. We report the full name refs/namespaces/foo/HEAD, instead of just
     HEAD. Meaning no client is going to bother doing anything with that
     symref, since we're not otherwise advertising it.

  2. We report the symref destination using its full name (e.g.,
     refs/namespaces/foo/refs/heads/master). That's similarly useless to
     the client, who only saw "refs/heads/master" in the advertisement.

We should be stripping the namespace prefix off of both places (which
this patch fixes).

Likely nobody noticed because we tend to do the right thing anyway. Bug
(1) means that we said nothing about HEAD (just refs/namespace/foo/HEAD).
And so the client half of the code, from a45b5f0552 (connect: annotate
refs with their symref information in get_remote_head(), 2013-09-17),
does not annotate HEAD, and we use the fallback in guess_remote_head(),
matching refs by object id. Which is usually right. It only falls down
in ambiguous cases, like the one laid out in the included test.

This also means that we don't have to worry about breaking anybody who
was putting pre-stripped names into their namespace symrefs when we fix
bug (2). Because of bug (1), nobody would have been using the symref we
advertised in the first place (not to mention that those symrefs would
have appeared broken for any non-namespaced access).

Note that we have separate fixes here for the v0 and v2 protocols. The
symref advertisement moved in v2 to be a part of the ls-refs command.
This actually gets part (1) right, since the symref annotation
piggy-backs on the existing ref advertisement, which is properly
stripped. But it still needs a fix for part (2). The included tests
cover both protocols.

Reported-by: Bryan Turner <bturner@atlassian.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-28 10:02:00 -07:00
Emily Shaffer 8e9fe16c87 gitsubmodules: align html and nroff lists
There appears to be a bug in the toolchain generating manpages from
lettered lists. When a list is enumerated with letters, the resulting
nroff shows numbers instead. Mostly this is harmless, but in the case of
gitsubmodules, the paragraph following the list refers back to each
bullet by letter. As a result, reading this documentation via `man
gitsubmodules` is hard to parse - readers must infer that a bug exists
and a refers to 1, b refers to 2, and c refers to 3 in the list above.

The problem specifically was introduced in ad47194; previously rather
than generating numerated lists the bulleted area was entirely
monospaced in HTML and shown in plaintext in nroff.

The bug seems to exist in docbook-xml - I've reported it on May 1 via
the docbook-apps mail list - but for now it may make more sense to just
work around the issue.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-28 09:42:06 -07:00
Christopher Diaz Riveros d0b1b61578 l10n: es: 2.22.0 round 1
Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
2019-05-28 11:33:00 -05:00
Ben Avison 4c6910163a clone: add --remote-submodules flag
When using `git clone --recurse-submodules` there was previously no way to
pass a `--remote` switch to the implicit `git submodule update` command for
any use case where you want the submodules to be checked out on their
remote-tracking branch rather than with the SHA-1 recorded in the superproject.

This patch rectifies this situation. It actually passes `--no-fetch` to
`git submodule update` as well on the grounds they the submodule has only just
been cloned, so fetching from the remote again only serves to slow things down.

Signed-off-by: Ben Avison <bavison@riscosopen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-28 09:22:02 -07:00
Jiang Xin 1e24ee8471 Merge branch 'master' of https://github.com/vnwildman/git
* 'master' of https://github.com/vnwildman/git:
  l10n: vi.po(4577t): Updated Vietnamese translation for v2.22.0 round 1
2019-05-21 08:55:54 +08:00
Junio C Hamano aa25c82427 Git 2.22-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 16:46:42 +09:00
Junio C Hamano fab4a8a396 Merge branch 'js/difftool-no-index'
The "--dir-diff" mode of "git difftool" is not useful in "--no-index"
mode; they are now explicitly marked as mutually incompatible.

* js/difftool-no-index:
  difftool --no-index: error out on --dir-diff (and don't crash)
2019-05-19 16:45:35 +09:00
Junio C Hamano 8c59ba9a76 Merge branch 'jk/get-oid-indexed-object-name'
The codepath to parse :<path> that obtains the object name for an
indexed object has been made more robust.

* jk/get-oid-indexed-object-name:
  get_oid: handle NULL repo->index
2019-05-19 16:45:35 +09:00
Junio C Hamano bca6aba72e Merge branch 'jc/set-packet-header-signature-fix'
Code clean-up.

* jc/set-packet-header-signature-fix:
  pkt-line: drop 'const'-ness of a param to set_packet_header()
2019-05-19 16:45:35 +09:00
Junio C Hamano 8cbad4935e Merge branch 'cb/http-push-null-in-message-fix'
Code clean-up.

* cb/http-push-null-in-message-fix:
  http-push: prevent format overflow warning with gcc >= 9
2019-05-19 16:45:35 +09:00
Junio C Hamano 4ecaedec04 Merge branch 'js/stash-in-c-use-builtin-doc'
Doc update.

* js/stash-in-c-use-builtin-doc:
  stash: document stash.useBuiltin
2019-05-19 16:45:34 +09:00
Junio C Hamano dc58922cf0 Merge branch 'tz/test-lib-check-working-jgit'
A prerequiste check in the test suite to see if a working jgit is
available was made more robust.

* tz/test-lib-check-working-jgit:
  test-lib: try harder to ensure a working jgit
2019-05-19 16:45:34 +09:00
Junio C Hamano 7a09f5f1b6 Merge branch 'js/parseopt-unknown-cb-returns-an-enum'
Code clean-up.

* js/parseopt-unknown-cb-returns-an-enum:
  parse-options: adjust `parse_opt_unknown_cb()`s declared return type
2019-05-19 16:45:34 +09:00
Junio C Hamano ed8a451689 Merge branch 'ab/sha1dc'
Update collision-detecting SHA-1 code to build properly on HP-UX.

* ab/sha1dc:
  sha1dc: update from upstream
2019-05-19 16:45:34 +09:00
Junio C Hamano cfd635c742 Merge branch 'js/fsmonitor-refresh-after-discarding-index'
The fsmonitor interface got out of sync after the in-core index
file gets discarded, which has been corrected.

* js/fsmonitor-refresh-after-discarding-index:
  fsmonitor: force a refresh after the index was discarded
  fsmonitor: demonstrate that it is not refreshed after discard_index()
2019-05-19 16:45:33 +09:00
Junio C Hamano e0708c24d5 Merge branch 'js/rebase-i-label-shown-in-status-fix'
"git status" did not know that the "label" instruction in the
todo-list "rebase -i -r" uses should not be shown as a hex object
name.

* js/rebase-i-label-shown-in-status-fix:
  status: fix display of rebase -ir's `label` command
2019-05-19 16:45:33 +09:00
Junio C Hamano dd5b7dc8ed Merge branch 'es/check-non-portable-pre-5.10'
Developer support update.

* es/check-non-portable-pre-5.10:
  check-non-portable-shell: support Perl versions older than 5.10
2019-05-19 16:45:33 +09:00
Junio C Hamano bd96a7871a Merge branch 'ds/trace2-document-env-vars'
Doc update.

* ds/trace2-document-env-vars:
  trace2: add variable description to git.txt
2019-05-19 16:45:33 +09:00
Junio C Hamano 521d3ef38a Merge branch 'cm/notes-comment-fix'
A stale in-code comment has been updated.

* cm/notes-comment-fix:
  notes: correct documentation of format_display_notes()
2019-05-19 16:45:32 +09:00
Junio C Hamano b3e0981f28 Merge branch 'tt/no-ipv6-fallback-for-winxp'
Code cleanup.

* tt/no-ipv6-fallback-for-winxp:
  mingw: remove obsolete IPv6-related code
2019-05-19 16:45:32 +09:00
Junio C Hamano 0b076b4c0e Merge branch 'js/t5580-unc-alternate-test'
An additional test for MinGW

* js/t5580-unc-alternate-test:
  t5580: verify that alternates can be UNC paths
2019-05-19 16:45:32 +09:00
Junio C Hamano b5fb62bf49 Merge branch 'ds/cvsexportcommit-force-text'
"git cvsexportcommit" running on msys did not expect cvsnt showed
"cvs status" output with CRLF line endings.

* ds/cvsexportcommit-force-text:
  cvsexportcommit: force crlf translation
2019-05-19 16:45:31 +09:00
Junio C Hamano 6f3d93f7ac Merge branch 'sg/ci-libsvn-perl'
To run tests for Git SVN, our scripts for CI used to install the
git-svn package (in the hope that it would bring in the right
dependencies).  This has been updated to install the more direct
dependency, namely, libsvn-perl.

* sg/ci-libsvn-perl:
  ci: install 'libsvn-perl' instead of 'git-svn'
2019-05-19 16:45:31 +09:00
Junio C Hamano 717dad8ebc Merge branch 'bl/t4253-exit-code-from-format-patch'
Avoid patterns to pipe output from a git command to feed another
command in tests.

* bl/t4253-exit-code-from-format-patch:
  t4253-am-keep-cr-dos: avoid using pipes
2019-05-19 16:45:31 +09:00
Junio C Hamano 454b419729 Merge branch 'ds/midx-too-many-packs'
The code to generate the multi-pack idx file was not prepared to
see too many packfiles and ran out of open file descriptor, which
has been corrected.

* ds/midx-too-many-packs:
  midx: add packs to packed_git linked list
  midx: pass a repository pointer
2019-05-19 16:45:30 +09:00
Junio C Hamano 97616ca488 Merge branch 'en/unicode-in-refnames'
On a filesystem like HFS+, the names of the refs stored as filesystem
entities may become different from what the end-user expects, just
like files in the working tree get "renamed".  Work around the
mismatch by paying attention to the core.precomposeUnicode
configuration.

* en/unicode-in-refnames:
  Honor core.precomposeUnicode in more places
2019-05-19 16:45:30 +09:00
Junio C Hamano 85ac27e04f Merge branch 'dl/difftool-mergetool'
Update "git difftool" and "git mergetool" so that the combinations
of {diff,merge}.{tool,guitool} configuration variables serve as
fallback settings of each other in a sensible order.

* dl/difftool-mergetool:
  difftool: fallback on merge.guitool
  difftool: make --gui, --tool and --extcmd mutually exclusive
  mergetool: fallback to tool when guitool unavailable
  mergetool--lib: create gui_mode function
  mergetool: use get_merge_tool function
  t7610: add mergetool --gui tests
  t7610: unsuppress output
2019-05-19 16:45:30 +09:00
Junio C Hamano fed9391fba Merge branch 'mh/http-fread-api-fix'
A pair of private functions in http.c that had names similar to
fread/fwrite did not return the number of elements, which was found
to be confusing.

* mh/http-fread-api-fix:
  Make fread/fwrite-like functions in http.c more like fread/fwrite.
2019-05-19 16:45:29 +09:00
Junio C Hamano b20b8fecfb Merge branch 'js/t6500-use-windows-pid-on-mingw'
Future-proof a test against an update to MSYS2 runtime v3.x series.

* js/t6500-use-windows-pid-on-mingw:
  t6500(mingw): use the Windows PID of the shell
2019-05-19 16:45:29 +09:00
Junio C Hamano 7782066f67 Merge branch 'jk/apache-lsan'
Allow tests that involve httpd to be run under leak sanitizer, just
like we can already do so under address sanitizer.

* jk/apache-lsan:
  t/lib-httpd: pass LSAN_OPTIONS through apache
2019-05-19 16:45:29 +09:00
Junio C Hamano 2cfab60877 Merge branch 'nd/parse-options-aliases'
Attempt to use an abbreviated option in "git clone --recurs" is
responded by a request to disambiguate between --recursive and
--recurse-submodules, which is bad because these two are synonyms.
The parse-options API has been extended to define such synonyms
more easily and not produce an unnecessary failure.

* nd/parse-options-aliases:
  parse-options: don't emit "ambiguous option" for aliases
2019-05-19 16:45:28 +09:00
Junio C Hamano 4ac8371a1c Merge branch 'dl/branch-from-3dot-merge-base'
"git branch new A...B" and "git checkout -b new A...B" have been
taught that in their contexts, the notation A...B means "the merge
base between these two commits", just like "git checkout A...B"
detaches HEAD at that commit.

* dl/branch-from-3dot-merge-base:
  branch: make create_branch accept a merge base rev
  t2018: cleanup in current test
2019-05-19 16:45:28 +09:00
Junio C Hamano 3c9b393ca8 Merge branch 'js/commit-graph-parse-leakfix'
Leakfix.

* js/commit-graph-parse-leakfix:
  commit-graph: fix memory leak
2019-05-19 16:45:28 +09:00
Junio C Hamano 6795fc8afd Merge branch 'jk/cocci-batch'
Optionally "make coccicheck" can feed multiple source files to
spatch, gaining performance while spending more memory.

* jk/cocci-batch:
  coccicheck: make batch size of 0 mean "unlimited"
  coccicheck: optionally batch spatch invocations
2019-05-19 16:45:28 +09:00
Junio C Hamano 82dca958dd Merge branch 'ab/perf-installed-fix'
Performance test framework has been broken and measured the version
of Git that happens to be on $PATH, not the specified one to
measure, for a while, which has been corrected.

* ab/perf-installed-fix:
  perf-lib.sh: forbid the use of GIT_TEST_INSTALLED
  perf tests: add "bindir" prefix to git tree test results
  perf-lib.sh: remove GIT_TEST_INSTALLED from perf-lib.sh
  perf-lib.sh: make "./run <revisions>" use the correct gits
  perf aggregate: remove GIT_TEST_INSTALLED from --codespeed
  perf README: correct docs for 3c8f12c96c regression
2019-05-19 16:45:28 +09:00
Junio C Hamano f42bee7d51 Merge branch 'id/windows-dep-aslr'
Allow DEP and ASLR for Windows build to for security hardening.

* id/windows-dep-aslr:
  mingw: enable DEP and ASLR
  mingw: do not let ld strip relocations
2019-05-19 16:45:27 +09:00
Junio C Hamano d66da839d8 Merge branch 'ab/trace2-typofix'
Typofix.

* ab/trace2-typofix:
  trace2: fix up a missing "leave" entry point
2019-05-19 16:45:27 +09:00
Junio C Hamano 195d799955 Merge branch 'nd/submodule-helper-incomplete-line-fix'
Typofix.

* nd/submodule-helper-incomplete-line-fix:
  submodule--helper: add a missing \n
2019-05-19 16:45:27 +09:00
Junio C Hamano 18cfb74f31 Merge branch 'cw/diff-highlight'
Portability fix for a diff-highlight tool (in contrib/).

* cw/diff-highlight:
  diff-highlight: use correct /dev/null for UNIX and Windows
2019-05-19 16:45:26 +09:00
Junio C Hamano 1294160b27 Merge branch 'dl/warn-tagging-a-tag'
Typofix.

* dl/warn-tagging-a-tag:
  tag: fix typo in nested tagging hint
2019-05-19 16:45:26 +09:00
Emily Shaffer 5ef811ac5d documentation: add anchors to MyFirstContribution
During the course of review for MyFirstContribution.txt, the suggestion
came up to include anchors to make it easier for veteran contributors to
link specific sections of this documents to newbies. To make life easier
for reviewers, add these anchors in their own commit. See review context
here: https://public-inbox.org/git/20190507195938.GD220818@google.com/

AsciiDoc does not support :sectanchors: and the anchors are not
discoverable, but they are referenceable. So a link to
"foo.com/MyFirstContribution.html#prerequisites" will still work if that
file was generated with AsciiDoc. The inclusion of :sectanchors: does
not create warnings or errors while compiling directly with `asciidoc -b
html5 Documentation/MyFirstContribution.txt` or while compiling with
`make doc`.

AsciiDoctor does support :sectanchors: and displays a paragraph link on
mouseover. When the anchor is included above or inline with a section
(as in this change), the link provided points to the custom ID contained
within [[]] instead of to an autogenerated ID. Practically speaking,
this means we have .../MyFirstContribution.html#summary instead of
.../MyFirstContribution.html#_summary. In addition to being prettier,
the custom IDs also enable anchor linking to work with
asciidoc-generated pages. This change compiles with no warnings using
`asciidoctor -b html5 Documentation/MyFirstContribution.txt`.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 11:01:24 +09:00
Emily Shaffer 76644e3268 documentation: add tutorial for first contribution
This tutorial covers how to add a new command to Git and, in the
process, everything from cloning git/git to getting reviewed on the
mailing list. It's meant for new contributors to go through
interactively, learning the techniques generally used by the git/git
development community.

Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 11:01:23 +09:00
Jean-Noël Avila 8bcd8f4cea diff: fix mistake in translatable strings
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 11:01:02 +09:00
Nguyễn Thái Ngọc Duy f3f8311ec7 merge: add --quit
This allows to cancel the current merge without resetting worktree/index,
which is what --abort is for. Like other --quit(s), this is often used
when you forgot that you're in the middle of a merge and already
switched away, doing different things. By the time you've realized, you
can't even continue the merge anymore.

This also makes all in-progress commands, am, merge, rebase, revert and
cherry-pick, take all three --abort, --continue and --quit (bisect has a
different UI).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 10:47:40 +09:00
Boxuan Li 91bf382fcf userdiff: add Octave
Octave pattern is almost the same as matlab, except
that '%%%' and '##' can also be used to begin code sections,
in addition to '%%' that is understood by both. Octave
pattern is merged into Matlab pattern. Test cases for
the hunk header patterns of matlab and octave under
t/t4018 are added.

Signed-off-by: Boxuan Li <liboxuan@connect.hku.hk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 10:45:28 +09:00
Tran Ngoc Quan 28e0eb8086 l10n: vi.po(4577t): Updated Vietnamese translation for v2.22.0 round 1
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2019-05-19 08:40:33 +07:00
Phillip Wood 6df8df0831 rebase -r: always reword merge -c
If a merge can be fast-forwarded then make sure that we still edit the
commit message if the user specifies -c. The implementation follows the
same pattern that is used for ordinary rewords that are fast-forwarded.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-19 10:33:43 +09:00