Commit graph

50141 commits

Author SHA1 Message Date
Peter Krefting 9d4b85be54 l10n: sv.po: Update Swedish translation (3288t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2018-01-09 20:10:14 +01:00
Junio C Hamano 02a5f25d95 Merge branch 'js/misc-git-gui-stuff' of ../git-gui
* 'js/misc-git-gui-stuff' of ../git-gui:
  git-gui: allow Ctrl+T to toggle multiple paths
  git-gui: fix exception when trying to stage with empty file list
  git-gui: avoid exception upon Ctrl+T in an empty list
  git gui: fix staging a second line to a 1-line file
2018-01-09 11:07:03 -08:00
Johannes Schindelin 76756d6706 git-gui: allow Ctrl+T to toggle multiple paths
It is possible to select multiple files in the "Unstaged Changes" and
the "Staged Changes" lists. But when hitting Ctrl+T, surprisingly only
one entry is handled, not all selected ones.

Let's just use the same code path as for the "Stage To Commit" and the
"Unstage From Commit" menu items.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-09 11:02:40 -08:00
Johannes Schindelin 2cd9179c14 git-gui: fix exception when trying to stage with empty file list
If there is nothing to stage, there is nothing to stage. Let's not try
to, even if the file list contains nothing at all.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-09 11:02:40 -08:00
Johannes Schindelin 2365e5b174 git-gui: avoid exception upon Ctrl+T in an empty list
Previously unstaged files can be staged by clicking on them and then
pressing Ctrl+T. Conveniently, the next unstaged file is selected
automatically so that the unstaged files can be staged by repeatedly
pressing Ctrl+T.

When a user hits Ctrl+T one time too many, though, Git GUI used to throw
this exception:

	expected number but got ""
	expected number but got ""
	    while executing
	"expr {int([lindex [$w tag ranges in_diff] 0])}"
	    (procedure "toggle_or_diff" line 13)
	    invoked from within
	"toggle_or_diff toggle .vpane.files.workdir.list "
	    (command bound to event)

Let's just avoid that by skipping the operation when there are no more
files to stage.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-09 11:02:40 -08:00
Johannes Schindelin 6d02c1e204 git gui: fix staging a second line to a 1-line file
When a 1-line file is augmented by a second line, and the user tries to
stage that single line via the "Stage Line" context menu item, we do not
want to see "apply: corrupt patch at line 5".

The reason for this error was that the hunk header looks like this:

	@@ -1 +1,2 @@

but the existing code expects the original range always to contain a
comma. This problem is easily fixed by cutting the string "1 +1,2"
(that Git GUI formerly mistook for the starting line) at the space.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-09 11:02:40 -08:00
Yasushi SHOJI f0a6068a9f bisect: debug: convert struct object to object_id
The commit f2fd0760 ("Convert struct object to object_id",
2015-11-10) converted struct object to object_id but forgot to
adjust a few callers in a debug function show_list(), which is
ifdef'ed to noop, in bisect.c.

Signed-off-by: Yasushi SHOJI <Yasushi.SHOJI@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-09 10:55:32 -08:00
Junio C Hamano 5b1c54ac99 Merge branch 'ew/empty-merge-with-dirty-index-maint' into ew/empty-merge-with-dirty-index
* ew/empty-merge-with-dirty-index-maint:
  merge-recursive: do not look at the index during recursive merge
2018-01-09 10:41:37 -08:00
Junio C Hamano f309e8e768 merge-recursive: do not look at the index during recursive merge
When merging another branch into ours, if their tree is the same as
the common ancestor's, we can declare that our tree represents the
result of three-way merge.  In such a case, the recursive merge
backend incorrectly used to create a commit out of our index, even
when the index has changes.

A recent fix attempted to prevent this by adding a comparison
between "our" tree and the index, but forgot that this check must be
restricted only to the outermost merge.  Inner merges performed by
the recursive backend across merge bases are by definition made from
scratch without having any local changes added to the index.  The
call to index_has_changes() during an inner merge is working on the
index that has no relation to the merge being performed, preventing
legitimate merges from getting carried out.

Fix it by limiting the check to the outermost merge.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-09 10:39:30 -08:00
Dimitriy Ryazantcev 846bb11707 l10n: ru.po: update Russian translation
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2018-01-09 13:22:24 +02:00
Changwoo Ryu 4b0d6bdafa l10n: TEAMS: Add ko team members
Add Gwan-gyeong Mun and Sihyeon Jang.

Signed-off-by: Changwoo Ryu <cwryu@debian.org>
2018-01-09 11:42:03 +09:00
Jiang Xin 77482d05d4 Merge branch 'ko/merge-l10n' of https://github.com/git-l10n-ko/git-l10n-ko
* 'ko/merge-l10n' of https://github.com/git-l10n-ko/git-l10n-ko:
  l10n: ko.po: Update Korean translation
2018-01-09 09:47:11 +08:00
Thomas Gummerer 03e7833f3a oidset: don't return value from oidset_init
c3a9ad3117 ("oidset: add iterator methods to oidset", 2017-11-21)
introduced a 'oidset_init()' function in oidset.h, which has void as
return type, but returns an expression.

This makes the solaris compiler fail with:

    "oidset.h", line 30: void function cannot return value

As the return type is void, and even the return type of the expression
we're trying to return (oidmap_init) is void just remove the return
statement to fix the compiler error.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-08 15:24:35 -08:00
Thomas Gummerer bba067d2fa stash: don't delete untracked files that match pathspec
Currently when 'git stash push -- <pathspec>' is used, untracked files
that match the pathspec will be deleted, even though they do not end up
in a stash anywhere.

This is because the original commit introducing the pathspec feature in
git stash push (df6bba0937 ("stash: teach 'push' (and 'create_stash') to
honor pathspec", 2017-02-28)) used the sequence of 'git reset <pathspec>
&& git ls-files --modified <pathspec> | git checkout-index && git clean
<pathspec>'.

The intention was to emulate what 'git reset --hard -- <pathspec>' would
do.  The call to 'git clean' was supposed to clean up the files that
were unstaged by 'git reset'.  This would work fine if the pathspec
doesn't match any files that were untracked before 'git stash push --
<pathspec>'.  However if <pathspec> matches a file that was untracked
before invoking the 'stash' command, all untracked files matching the
pathspec would inadvertently be deleted as well, even though they
wouldn't end up in the stash, and are therefore lost.

This behaviour was never what was intended, only blobs that also end up
in the stash should be reset to their state in HEAD, previously
untracked files should be left alone.

To achieve this, first match what's in the index and what's in the
working tree by adding all changes to the index, ask diff-index what
changed between HEAD and the current index, and then apply that patch in
reverse to get rid of the changes, which includes removal of added
files and resurrection of removed files.

Reported-by: Reid Price <reid.price@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-08 13:02:25 -08:00
Alex Bennée d60be8acab send-email: add test for Linux's get_maintainer.pl
We had a regression that broke Linux's get_maintainer.pl. Using
Mail::Address to parse email addresses fixed it, but let's protect
against future regressions.

Note that we need --cc-cmd to be relative because this option doesn't
accept spaces in script names (probably to allow --cc-cmd="executable
--option"), while --smtp-server needs to be absolute.

Patch-edited-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-08 10:36:47 -08:00
Matthieu Moy c8f9d13dc6 perl/Git: remove now useless email-address parsing code
We now use Mail::Address unconditionaly, hence parse_mailboxes is now
dead code. Remove it and its tests.

Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-08 10:35:38 -08:00
Changwoo Ryu 4a7e1b2475 l10n: ko.po: Update Korean translation
Signed-off-by: Changwoo Ryu <cwryu@debian.org>
Signed-off-by: Sihyeon Jang <uneedsihyeon@gmail.com>
Signed-off-by: Gwan-gyeong Mun <elongbug@gmail.com>
Reviewed-by: Changwoo Ryu <cwryu@debian.org>
2018-01-08 17:59:35 +09:00
Jiang Xin daa8563143 Merge branch '2.16' of https://github.com/ChrisADR/git-po
* '2.16' of https://github.com/ChrisADR/git-po:
  l10n: es.po: Spanish translation 2.16.0 round 2
2018-01-08 10:59:24 +08:00
Jiang Xin 9c315b944d Merge branch 'fr_2.16-rc1' of git://github.com/jnavila/git
* 'fr_2.16-rc1' of git://github.com/jnavila/git:
  l10n: fr.po 2.16 round 2
2018-01-08 09:17:24 +08:00
Jean-Noel Avila 2acb3d4992 l10n: fr.po 2.16 round 2
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2018-01-07 18:57:48 +01:00
Christopher Díaz Riveros 521437fe7c l10n: es.po: Spanish translation 2.16.0 round 2
Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
2018-01-07 12:15:35 -05:00
Tran Ngoc Quan fe73f3eecc l10n: vi.po(3288t): Updated Vietnamese translation for v2.16.0 round 2
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2018-01-07 08:20:27 +07:00
Jiang Xin 005c62fe46 l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)
Generate po/git.pot from v2.16.0-rc1 for git v2.16.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2018-01-07 07:50:31 +08:00
Jiang Xin 7398243260 Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
  l10n: es.po: Update Spanish Translation v2.16.0
  l10n: fr.po v2.16.0 round 1
  l10n: bg.po: Updated Bulgarian translation (3284t)
  l10n: sv.po: Update Swedish translation (3284t0f0u)
  l10n: fr.po: "worktree list" mistranslated as prune
  l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed)
  l10n: fixes to German translation
  l10n: Update Spanish translation
  l10n: zh_CN translate parameter name
  l10n: zh_CN Fix typo
  l10n: Fixes to Catalan translation
2018-01-07 07:49:43 +08:00
Jiang Xin 48f2a74589 Merge branch '2.16' of https://github.com/ChrisADR/git-po
* '2.16' of https://github.com/ChrisADR/git-po:
  l10n: es.po: Update Spanish Translation v2.16.0
2018-01-06 10:26:30 +08:00
Jiang Xin 4a6b2cb588 Merge branch 'fr_2.16' of git://github.com/jnavila/git
* 'fr_2.16' of git://github.com/jnavila/git:
  l10n: fr.po v2.16.0 round 1
  l10n: fr.po: "worktree list" mistranslated as prune
2018-01-06 10:24:52 +08:00
Junio C Hamano 36438dc19d Git 2.16-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 13:45:17 -08:00
Junio C Hamano 8c8ddbd082 Merge branch 'js/sequencer-cleanups'
Code cleanup.

* js/sequencer-cleanups:
  sequencer: do not invent whitespace when transforming OIDs
  sequencer: report when noop has an argument
  sequencer: remove superfluous conditional
  sequencer: strip bogus LF at end of error messages
  rebase: do not continue when the todo list generation failed
2018-01-05 13:28:12 -08:00
Junio C Hamano bc27a2e2fc Merge branch 'jh/memihash-opt'
Squelch compiler warning.

* jh/memihash-opt:
  t/helper/test-lazy-name-hash: fix compilation
2018-01-05 13:28:11 -08:00
Junio C Hamano e82bbcbf60 Merge branch 'tb/test-lint-wc-l'
Test update.

* tb/test-lint-wc-l:
  check-non-portable-shell.pl: `wc -l` may have leading WS
2018-01-05 13:28:11 -08:00
Junio C Hamano 0956eaa621 Merge branch 'rs/use-argv-array-in-child-process'
Code cleanup.

* rs/use-argv-array-in-child-process:
  send-pack: use internal argv_array of struct child_process
  http: use internal argv_array of struct child_process
2018-01-05 13:28:10 -08:00
Junio C Hamano a778ba1c71 Merge branch 'ld/p4-multiple-shelves'
"git p4" update.

* ld/p4-multiple-shelves:
  git-p4: update multiple shelved change lists
2018-01-05 13:28:10 -08:00
Junio C Hamano a741e2825b Merge branch 'jd/fix-strbuf-add-urlencode-bytes'
Bytes with high-bit set were encoded incorrectly and made
credential helper fail.

* jd/fix-strbuf-add-urlencode-bytes:
  strbuf: fix urlencode format string on signed char
2018-01-05 13:28:10 -08:00
Junio C Hamano 843d94b3cd Merge branch 'ew/empty-merge-with-dirty-index'
"git merge -s recursive" did not correctly abort when the index is
dirty, if the merged tree happened to be the same as the current
HEAD, which has been fixed.

* ew/empty-merge-with-dirty-index:
  merge-recursive: avoid incorporating uncommitted changes in a merge
  move index_has_changes() from builtin/am.c to merge.c for reuse
  t6044: recursive can silently incorporate dirty changes in a merge
2018-01-05 13:28:09 -08:00
Junio C Hamano fa62d0392b Merge branch 'db/doc-config-section-names-with-bs'
Doc update.

* db/doc-config-section-names-with-bs:
  config.txt: document behavior of backslashes in subsections
2018-01-05 13:28:09 -08:00
Junio C Hamano 07b747d324 Merge branch 'jk/test-suite-tracing'
Assorted fixes around running tests with "-x" tracing option.

* jk/test-suite-tracing:
  t/Makefile: introduce TEST_SHELL_PATH
  test-lib: make "-x" work with "--verbose-log"
  t5615: avoid re-using descriptor 4
  test-lib: silence "-x" cleanup under bash
2018-01-05 13:28:09 -08:00
Stefan Beller 7dcc1f4df8 submodule: submodule_move_head omits old argument in forced case
When using hard reset or forced checkout with the option to recurse into
submodules, the submodules need to be reset, too.

It turns out that we need to omit the duplicate old argument to read-tree
in all forced cases to omit the 2 way merge and use the more assertive
behavior of reading the specific new tree into the index and updating
the working tree.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:35:35 -08:00
Stefan Beller ad17312e11 unpack-trees: oneway_merge to update submodules
When there is a one way merge, each submodule needs to be one way merged
as well, if we're asked to recurse into submodules.

In case of a submodule, check if it is up-to-date, otherwise set the
flag CE_UPDATE, which will trigger an update of it in the phase updating
the tree later.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:35:35 -08:00
Stefan Beller 63d963a470 t/lib-submodule-update.sh: fix test ignoring ignored files in submodules
It turns out that the test replacing a submodule with a file with
the submodule containing an ignored file is incorrectly titled,
because the test put the file in place, but never ignored that file.
When having an untracked file Instead of an ignored file in the
submodule, git should refuse to remove the submodule, but that is
a bug in the implementation of recursing into submodules, such that
the test just passed, removing the untracked file.

Fix the test first; in a later patch we'll fix gits behavior,
that will make sure untracked files are not deleted.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:35:35 -08:00
Stefan Beller 6419a12397 t/lib-submodule-update.sh: clarify test
Keep the local branch name as the upstream branch name to avoid confusion.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:35:04 -08:00
Christian Couder 19cf57a92e perf/run: read GIT_PERF_REPO_NAME from perf.repoName
The GIT_PERF_REPO_NAME env variable is used in
the `aggregate.perl` script to set the 'environment'
field in the JSON Codespeed output.

Let's make it easy to set this variable by setting it
in a config file.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:08 -08:00
Christian Couder fccec20f0b perf/run: learn to send output to codespeed server
Let's make it possible to set in a config file the URL of
a codespeed server. And then let's make the `run` script
send the perf test results to this URL at the end of the
tests.

This should make is possible to easily automate the process
of running perf tests and having their results available in
Codespeed.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:08 -08:00
Christian Couder 5d6bb93090 perf/run: learn about perf.codespeedOutput
Let's make it possible to set in a config file the output
format (regular or codespeed) of the perf tests.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:08 -08:00
Christian Couder 3ae7d2b0cd perf/run: add conf_opts argument to get_var_from_env_or_config()
Let's make it possible to use `git config` type specifiers like
`--int` or `--bool`, so that config values are converted to the
canonical form and easier to use.

This additional argument is now the fourth argument of
get_var_from_env_or_config() instead of the fifth because we
want the default value argument to be unset if it is not
passed, and this is simpler if it is the last argument.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:07 -08:00
Christian Couder 05eb1c37ed perf/aggregate: implement codespeed JSON output
Codespeed (https://github.com/tobami/codespeed/) is an open source
project that can be used to track how some software performs over
time. It stores performance test results in a database and can show
nice graphs and charts on a web interface.

As it can be interesting to use Codespeed to see how Git performance
evolves over time and releases, let's implement a Codespeed output
in "perf/aggregate.perl".

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:07 -08:00
Christian Couder 30ffff6ee2 perf/aggregate: refactor printing results
As we want to implement another kind of output than
the current output for the perf test results, let's
refactor the existing code that outputs the results
in its own print_default_results() function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:07 -08:00
Christian Couder 6f5ecad6a5 perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION}
The way we check ENV{GIT_PERF_SUBSECTION} could trigger
comparison between undef and "" that may be flagged by
use of strict & warnings. Let's fix that.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:31:07 -08:00
Johannes Schindelin dd6fb0053c rebase -p: fix quoting when calling git merge
It has been reported that strategy arguments are not passed to `git
merge` correctly when rebasing interactively, preserving merges.

The reason is that the strategy arguments are already quoted, and then
quoted again.

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

Original-patch-by: Kim Gybels <kgybels@infogroep.be>
Also-reported-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:26:01 -08:00
Matthieu Moy bd869f67b9 send-email: add and use a local copy of Mail::Address
We used to have two versions of the email parsing code. Our
parse_mailboxes (in Git.pm), and Mail::Address which we used if
installed. Unfortunately, both versions have different sets of bugs, and
changing the behavior of git depending on whether Mail::Address is
installed was a bad idea.

A first attempt to solve this was cc90750 (send-email: don't use
Mail::Address, even if available, 2017-08-23), but it turns out our
parse_mailboxes is too buggy for some uses. For example the lack of
nested comments support breaks get_maintainer.pl in the Linux kernel
tree:

  https://public-inbox.org/git/20171116154814.23785-1-alex.bennee@linaro.org/

This patch goes the other way: use Mail::Address anyway, but have a
local copy from CPAN as a fallback, when the system one is not
available.

The duplicated script is small (276 lines of code) and stable in time.
Maintaining the local copy should not be an issue, and will certainly be
less burden than maintaining our own parse_mailboxes.

Another option would be to consider Mail::Address as a hard dependency,
but it's easy enough to save the trouble of extra-dependency to the end
user or packager.

Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-05 12:21:31 -08:00
Stefan Beller 4d8c51aa19 diff: use HAS_MULTI_BITS instead of counting bits manually
This aligns the style to the previous patch.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-04 15:02:40 -08:00