This is one of the few places where Git violates its own deprecation of
the dashed form. It is not necessary, either.
As of 595d59e2b5 (git.c: ignore pager.* when launching builtin as
dashed external, 2017-08-02), Git wants to ignore the pager.* config
setting when expanding aliases. So let's strip out the
check_pager_config(<command-name>) call from the copy-edited code.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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
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>
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>
"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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This wave of built rebase patches implements the remaining rebase
options in the builtin rebase.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
Git documentation refers to $HOME and $XDG_CONFIG_HOME often, but does not specify how or where these values come from on Windows where neither is set by default. The new documentation reflects the behavior of setup_windows_environment() in compat/mingw.c.
Signed-off-by: Alejandro Barreto <alejandro.barreto@ni.com>