Commit Graph

88368 Commits

Author SHA1 Message Date
Max Kirillov
151a9df03b git-gui: correctly restore GIT_DIR after invoking gitk
git-gui tries to temporary set GIT_DIR for starting gitk and restore
it back after they are started. But in case of GIT_DIR which was not set
prior to invocation it is not unset after it. This affects commands
which can be later started from that git gui, for example "Git Bash".

Fix it.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-10 16:42:06 -04:00
Johannes Schindelin
9b77f71c04 Merge branch 'git-gui'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-10 16:42:06 -04:00
Johannes Schindelin
c60e1de286 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-10 16:41:40 -04:00
Heiko Voigt
835d197d4b git-gui: provide question helper for retry fallback on Windows
Make use of the new environment variable GIT_ASK_YESNO to support the
recently implemented fallback in case unlink, rename or rmdir fail for
files in use on Windows. The added dialog will present a yes/no question
to the the user which will currently be used by the windows compat layer
to let the user retry a failed file operation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2018-09-10 16:41:40 -04:00
Heiko Voigt
54840a43ff Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2018-09-10 16:41:40 -04:00
Jameson Miller
0d848d696a Start the merging-rebase to v2.19.0
This commit starts the rebase of ce45ef2612 to 09963943a8
2018-09-10 16:41:38 -04:00
Junio C Hamano
1d4361b0f3 Git 2.19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.19.0
2018-09-10 10:41:56 -07:00
Junio C Hamano
46d9a284ee Merge tag 'l10n-2.19.0-rnd2' of git://github.com/git-l10n/git-po
l10n for Git 2.19.0 round 2

* tag 'l10n-2.19.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: for git v2.19.0 l10n round 1 to 2
  l10n: bg.po: Updated Bulgarian translation (3958t)
  l10n: vi.po(3958t): updated Vietnamese translation v2.19.0 round 2
  l10n: es.po v2.19.0 round 2
  l10n: fr.po v2.19.0 rnd 2
  l10n: fr.po v2.19.0 rnd 1
  l10n: fr: fix a message seen in git bisect
  l10n: sv.po: Update Swedish translation (3958t0f0u)
  l10n: git.pot: v2.19.0 round 2 (3 new, 5 removed)
  l10n: ru.po: update Russian translation
  l10n: git.pot: v2.19.0 round 1 (382 new, 30 removed)
  l10n: de.po: translate 108 new messages
  l10n: zh_CN: review for git 2.18.0
  l10n: sv.po: Update Swedish translation(3608t0f0u)
2018-09-10 10:41:11 -07:00
Junio C Hamano
f38a45b9ab Merge branch 'jn/submodule-core-worktree-revert'
* jn/submodule-core-worktree-revert:
  Revert "Merge branch 'sb/submodule-core-worktree'"
2018-09-10 10:38:58 -07:00
Junio C Hamano
fe468efff5 Merge branch 'mk/http-backend-content-length'
The earlier attempt barfed when given a CONTENT_LENGTH that is
set to an empty string.  RFC 3875 is fairly clear that in this
case we should not read any message body, but we've been reading
through to the EOF in previous versions (which did not even pay
attention to the environment variable), so keep that behaviour for
now in this late update.

* mk/http-backend-content-length:
  http-backend: allow empty CONTENT_LENGTH
2018-09-10 10:35:42 -07:00
Jiang Xin
c1ac5258dc l10n: zh_CN: for git v2.19.0 l10n round 1 to 2
Translate 382 new messages (3958t0f0u) for git 2.19.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2018-09-09 22:38:39 +08:00
Jiang Xin
282c393e18 Merge branch 'master' of git://github.com/alshopov/git-po
* 'master' of git://github.com/alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (3958t)
2018-09-09 19:05:41 +08:00
Alexander Shopov
1eaabd4a0d l10n: bg.po: Updated Bulgarian translation (3958t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2018-09-09 11:29:19 +02:00
Jonathan Nieder
f178c13fda Revert "Merge branch 'sb/submodule-core-worktree'"
This reverts commit 7e25437d35, reversing
changes made to 00624d608c.

v2.19.0-rc0~165^2~1 (submodule: ensure core.worktree is set after
update, 2018-06-18) assumes an "absorbed" submodule layout, where the
submodule's Git directory is in the superproject's .git/modules/
directory and .git in the submodule worktree is a .git file pointing
there.  In particular, it uses $GIT_DIR/modules/$name to find the
submodule to find out whether it already has core.worktree set, and it
uses connect_work_tree_and_git_dir if not, resulting in

	fatal: could not open sub/.git for writing

The context behind that patch: v2.19.0-rc0~165^2~2 (submodule: unset
core.worktree if no working tree is present, 2018-06-12) unsets
core.worktree when running commands like "git checkout
--recurse-submodules" to switch to a branch without the submodule.  If
a user then uses "git checkout --no-recurse-submodules" to switch back
to a branch with the submodule and runs "git submodule update", this
patch is needed to ensure that commands using the submodule directly
are aware of the path to the worktree.

It is late in the release cycle, so revert the whole 3-patch series.
We can try again later for 2.20.

Reported-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-09-07 19:05:20 -07:00
Max Kirillov
574c513e8d http-backend: allow empty CONTENT_LENGTH
According to RFC3875, empty environment variable is equivalent to unset,
and for CONTENT_LENGTH it should mean zero body to read.

However, unset CONTENT_LENGTH is also used for chunked encoding to indicate
reading until EOF. At least, the test "large fetch-pack requests can be split
across POSTs" from t5551 starts faliing, if unset or empty CONTENT_LENGTH is
treated as zero length body. So keep the existing behavior as much as possible.

Add a test for the case.

Reported-By: Jelmer Vernooij <jelmer@jelmer.uk>
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-09-07 12:35:51 -07:00
Tran Ngoc Quan
7c73a6bf27 l10n: vi.po(3958t): updated Vietnamese translation v2.19.0 round 2
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2018-09-07 13:41:08 +07:00
Christopher Diaz Riveros
33b727947d l10n: es.po v2.19.0 round 2
Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
2018-09-06 04:27:56 -05:00
Jiang Xin
f1627fad4f Merge branch 'fr_2.19.0_rnd1' of git://github.com/jnavila/git
* 'fr_2.19.0_rnd1' of git://github.com/jnavila/git:
  l10n: fr.po v2.19.0 rnd 2
  l10n: fr.po v2.19.0 rnd 1
  l10n: fr: fix a message seen in git bisect
2018-09-06 09:17:55 +08:00
Jean-Noël Avila
2104663c7b l10n: fr.po v2.19.0 rnd 2
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2018-09-05 22:19:48 +02:00
Jean-Noël Avila
0859ed62b4 l10n: fr.po v2.19.0 rnd 1
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2018-09-05 22:15:09 +02:00
Raphaël Hertzog
8944a83342 l10n: fr: fix a message seen in git bisect
"cette" can be only be used before a word (like in "cette bouteille" for
"this bottle"), but here "this" refers to the current step and we have
to use "ceci" in French.

Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2018-09-05 22:15:09 +02:00
Jameson Miller
425f414f8e Merge builtin-stash-rebase-v2
This trick was performed by rebasing the builtin-stash-rebase branch
thicket via `git rebase -kir v2.19.0-rc1`, replacing all branches that
made it into `pu` by their current versions (and also the builtin-stash
by the newest iteration as of ungps/git), and then calling these
commands:

	# save current tip
	tip=$(git rev-parse HEAD)

	# revert previous merge
	git reset --hard git-for-windows/master^0
	git revert -n -m 1 HEAD
	git commit --squash HEAD -s -m "Let's drop this"

	# now perform the 3-way merge with v2.19.0-rc1 as base
	git merge-recursive v2.19.0-rc1 -- HEAD $tip
	git merge --ff-only \
		$(git commit-tree -p HEAD -p $tip -m "Merge" \
			$(git write-tree))
	git commit -c HEAD^^ --amend -s

The merge-recursive dance is necessary because of the merging-rebases:
the fake merges with which these start are mistaken by `git merge` to
mean that the branches were already merged, when the fake merges undid
the corresponding changes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 10:02:17 -04:00
Johannes Schindelin
676106064f Merge branch 'make-builtin-stash-and-rebase-opt-ins'
This branch adds back the scripted versions, then adds the option to
use the builtin versions of `stash` and `rebase` by setting
`stash.useBuiltin=true` and `rebase.useBuiltin=true`, respectively,
(the latter already worked for the top-level `git rebase` command and
the `--am` backend, and now it also works for the interactive backend).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:30 -04:00
Johannes Schindelin
153d28af87 Merge branch 'fixups'
A couple of fixes that should be squashed during the next merging
rebase of Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:30 -04:00
Johannes Schindelin
b17c9df5f9 stash/rebase: default to the non-builtin versions
The upcoming Git for Windows v2.19.0 wants to ship with the builtin
versions of stash, rebase and rebase -i. The reason: these are just *so
much faster*: t3400 and t3404 run about 60-70 percent faster, and t3903
even more than 80% faster.

However, these are still all pretty fresh, still being reviewed and
iterated on the Git mailing list.

So let's try to give users a way to test these (or to boldly use them
for their mission-critical tasks, as this here developer plans on
doing), but stay with the safe option by default: use the scripted
versions (which might be slow, but they are well tested).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:30 -04:00
Johannes Schindelin
bcfee386b1 Merge 'builtin-rebase--am'
This patch teaches the builtin rebase to avoid the scripted --am backend
and call `git format-patch` and `git am` directly.

Meaning: apart from the --merge and the --preserve-merges backends, `git
rebase` is now implemented in pure C, with no need to ask the Unix shell
interpreter for help.

This brings us really close to a fully builtin `git rebase`: the
--preserve-merges mode is about to be deprecated (as soon as the
--rebase-merges mode has proven stable and robust enough), and there are
plans to scrap the `git-rebase--merge` backend in favor of teaching the
interactive rebase enough tricks to run the --merge mode, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:29 -04:00
Johannes Schindelin
c0adcc65e9 "fixup! builtin rebase: support keep-empty option"
This *would* be a fixup commit, except that we want to avoid rewriting
commits that we merged from upstream's `pu` branch. Instead, we want to
send a new iteration, and then re-merge the new iteration once it made
it into the `pu` branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:29 -04:00
Johannes Schindelin
b19f089e7c stash: optionally use the scripted version again
We recently converted the `git stash` command from Unix shell scripts
to builtins.

Just like we have `rebase.useBuiltin` to fall back to the scripted
rebase, to give end users a way out when they discover a bug in the
builtin command, this commit adds support for `stash.useBuiltin`.

This is necessary because Git for Windows wants to ship the builtin
stash earlier than core Git: Git for Windows v2.19.0 will come with
the option of a drastically faster (if a lot less battle-tested)
`git stash`.

As the file name `git-stash` is already in use, let's rename the
scripted backend to `git-legacy-stash`.

To make the test suite pass with `stash.useBuiltin=false`, this commit
also backports rudimentary support for `-q` (but only *just* enough
to appease the test suite), and adds a super-ugly hack to force exit
code 129 for `git stash -h`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:29 -04:00
Johannes Schindelin
3d5907d11d Add back the original, scripted git stash
This simply copies the version as of v2.19.0-rc0 verbatim. As of now,
it is not hooked up.

The next commit will change the builtin `stash` to hand off to the
scripted `git stash` when `stash.useBuiltin=false`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:29 -04:00
Johannes Schindelin
4f1741fa70 non-builtin rebase: use non-builtin interactive backend
We recently converted both the `git rebase` and the `git rebase -i`
command from Unix shell scripts to builtins.

The former has a safety valve allowing to fall back to the scripted
`rebase`, just in case that there is a bug in the builtin `rebase`:
setting the config variable `rebase.useBuiltin` to `false` will
fall back to using the scripted version.

The latter did not have such a safety hatch.

Let's reinstate the scripted interactive rebase backend so that `rebase.useBuiltin=false` will not use the builtin interactive rebase,
just in case that an end user runs into a bug with the builtin version
and needs to get out of the fix really quickly.

This is necessary because Git for Windows wants to ship the builtin
rebase/interactive rebase earlier than core Git: Git for Windows
v2.19.0 will come with the option of a drastically faster (if a lot
less battle-tested) `git rebase`/`git rebase -i`.

As the file name `git-rebase--interactive` is already in use, let's
rename the scripted backend to `git-legacy-rebase--interactive`.

A couple of additional touch-ups are needed (such as teaching the
builtin `rebase--interactive`, which assumed the role of the
`rebase--helper`, to perform the two tricks to skip the unnecessary
picks and to generate a new todo list) to make things work again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:29 -04:00
Johannes Schindelin
175f60f7b0 Add back the original, scripted interactive rebase backend
This simply copies the version as of v2.19.0-rc0 verbatim. As of now,
it is not hooked up (because it needs a couple more changes to work);
The next commit will use the scripted interactive rebase backend from
`git rebase` again when `rebase.useBuiltin=false`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:29 -04:00
Johannes Schindelin
35b0f81046 Merge 'pk/rebase-in-c-6-final'
This final patch flips the switch and makes the builtin rebase the
default. The old, Unix shell scripted version can still be called via

	git -c rebase.useBuiltin=false rebase [...]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:28 -04:00
Johannes Schindelin
8976e33315 Merge 'js/rebase-in-c-5.5-work-with-rebase-i-in-c'
This branch first merges the builtin interactive rebase, and then
teaches the builtin rebase to hand off interactive rebases to the
builtin backend correctly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:28 -04:00
Johannes Schindelin
43944feb1c Merge 'pk/rebase-in-c-5-test'
This fifth batch of builtin rebase patches concludes the conversion: the
builtin rebase is now feature-complete.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:28 -04:00
Johannes Schindelin
af9582d63f Merge 'pk/rebase-in-c-4-opts'
This wave of built rebase patches implements the remaining rebase
options in the builtin rebase.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:27 -04:00
Johannes Schindelin
ae0044245d Merge 'pk/rebase-in-c-3-acts'
This set of patches implements the actions (such as --continue, --skip,
etc) in the builtin rebase.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:27 -04:00
Johannes Schindelin
da50c7835a Merge 'pk/rebase-in-c-2-basic'
This is the second wave of patches to bring us closer to a builtin `git
rebase`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:27 -04:00
Johannes Schindelin
63d084d944 Merge 'pk/rebase-in-c'
This is the first batch of the patches that turn `git rebase` into
a builtin.

This not only helps performance on Windows, but *especially* makes
things more robust, as no MSYS2 Bash will be required to run this
command any longer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:26 -04:00
Johannes Schindelin
b0b4f25d4b Merge 'ps/stash-in-c'
This merges the builtin stash.

Upstream Git did not integrate it into any stable integration branch
yet, but the performance improvements are substantial enough,
especially on Windows, that we really, really, really want to have it
early.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:52:26 -04:00
Jeff Hostetler
8f2714b752 Merge pull request #1766 from jeffhostetler/gfw-msvc-bin-dir
find_vs_env.bat: Fix bin dir path used by msys
2018-09-05 09:26:28 -04:00
Pratik Karki
f5d88c4e91 CONTRIBUTING.md: add an extra example
This commit adds an extra example to submit an incrementing version
patch series to the mailing list which should be the continuation to
previous patch series.

This closes https://github.com/git-for-windows/git/pull/1745

Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:26:28 -04:00
Jeff Hostetler
cfa49382a9 find_vs_env.bat: Fix bin dir path used by msys
Completely convert the pathname expoted in the %msvc_bin_dir_msys%
variable to MSYS format with forward slashes rather than a mixture
of forward and back slashes.

This solves an obscure problem observed by some developers:

    [...]
    http-push.c
        CC remote-curl.o
    remote-curl.c
        * new script parameters
        GEN git-instaweb
    sed: -e expression #7, char 155: invalid reference \2 on `s' command's RHS
    make: *** [Makefile:2023: git-instaweb] Error 1

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2018-09-05 09:25:59 -04:00
Johannes Schindelin
efad6e994b Merge pull request #1679 from telezhnaya/win
vcxproj: change build logic
2018-09-05 09:25:58 -04:00
Johannes Schindelin
ca65c9ff03 Merge pull request #1645 from ZCube/master
Support windows container.
2018-09-05 09:25:58 -04:00
Olga Telezhnaia
840967cf79 vcxproj: change build logic
Add new condition to invoke vcpkg_install.bat: it's not enough to check
the presence of folder vcpkg. We need to check the presence of some
header files because this is one of the main goals of this script.
Previous build attempt could be aborted, so the folder will exist but
the project will not be built properly.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
2018-09-05 09:25:58 -04:00
Johannes Schindelin
2801e24646 Merge branch 'ctrl-c'
This is part two of the Ctrl+C story, where part one is
https://github.com/git-for-windows/MSYS2-packages/commit/f4fda0f30aa.

Part one took care of extending the signal handling in the MSYS2 runtime
such that non-MSYS2 processes "receive" a SIGINT by injecting a remote
thread that runs kernel32!CtrlRoutine as if GenerateConsoleCtrlHandler()
had been called (but in contrast to the latter, only one process is
targeted at a time, not every process attached to the same Console) into
the process that needs to be interrupted as well as into all of the
spawned child processes.

Part two now takes care of removing the misguided "kill all spawned
children" atexit() handler, and it also installs a ConsoleCtrl handler
to run Git's SIGINT handlers, such as the one waiting for the pager to
exit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:25:57 -04:00
Johannes Schindelin
0b7b251282 mingw: Windows Docker volumes are *not* symbolic links
... even if they may look like them.

As looking up the target of the "symbolic link" (just to see whether it
starts with `/ContainerMappedDirectories/`) is pretty expensive, we
do it when we can be *really* sure that there is a possibility that this
might be the case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: JiSeop Moon <zcube@zcube.kr>
2018-09-05 09:25:57 -04:00
Johannes Schindelin
ff3bc65b0a mingw: really handle SIGINT
Previously, we did not install any handler for Ctrl+C, but now we really
want to because the MSYS2 runtime learned the trick to call the
ConsoleCtrlHandler when Ctrl+C was pressed.

With this, hitting Ctrl+C while `git log` is running will only terminate
the Git process, but not the pager. This finally matches the behavior on
Linux and on macOS.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:25:57 -04:00
JiSeop Moon
e31672baa5 mingw: move the file_attr_to_st_mode() function definition
In preparation for making this function a bit more complicated (to allow
for special-casing the `ContainerMappedDirectories` in Windows
containers, which look like a symbolic link, but are not), let's move it
out of the header.

Signed-off-by: JiSeop Moon <zcube@zcube.kr>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:25:57 -04:00
JiSeop Moon
e7468340a5 mingw: when running in a Windows container, try to rename() harder
It is a known issue that a rename() can fail with an "Access denied"
error at times, when copying followed by deleting the original file
works. Let's just fall back to that behavior.

Signed-off-by: JiSeop Moon <zcube@zcube.kr>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2018-09-05 09:25:57 -04:00