Commit Graph

64764 Commits

Author SHA1 Message Date
Johannes Schindelin
2faf5f6b58 Merge 'release-gc-repack' into HEAD 2016-10-29 10:41:38 +02:00
Johannes Schindelin
1abb9c5218 Merge pull request #726 from orgads/git-gui-preserve-author-windows
git-gui: Do not reset author details on amend
2016-10-29 10:41:38 +02:00
Johannes Schindelin
fba0367f14 Merge branch 'spawn-with-spaces'
This change lets us spawn .bat scripts whose paths contain spaces.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:38 +02:00
Johannes Schindelin
e11d7fddf9 gc/repack: release packs when needed
On Windows, files cannot be removed nor renamed if there are still
handles held by a process. To remedy that, we introduced the
close_all_packs() function.

Earlier, we made sure that the packs are released just before `git gc`
is spawned, in case that gc wants to remove no-longer needed packs.

But this developer forgot that gc itself also needs to let go of packs,
e.g. when consolidating all packs via the --aggressive option.

Likewise, `git repack -d` wants to delete obsolete packs and therefore
needs to close all pack handles, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:13 +02:00
Orgad Shaneh
938d1d7ecd git-gui: Do not reset author details on amend
git commit --amend preserves the author details unless --reset-author is
given.

git-gui discards the author details on amend.

Fix by reading the author details along with the commit message, and
setting the appropriate environment variables required for preserving
them.

Reported long ago in the mailing list[1].

[1] http://article.gmane.org/gmane.comp.version-control.git/243921

Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
2016-10-29 10:41:13 +02:00
Johannes Schindelin
9dfad9ee05 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2016-10-29 10:41:13 +02:00
Johannes Schindelin
0ef0f0ebf9 mingw: support spawning programs containing spaces in their names
The CreateProcessW() function does not really support spaces in its
first argument, lpApplicationName. But it supports passing NULL as
lpApplicationName, which makes it figure out the application from the
(possibly quoted) first argument of lpCommandLine.

Let's use that trick (if we are certain that the first argument matches
the executable's path) to support launching programs whose path contains
spaces.

This fixes https://github.com/git-for-windows/git/issue/692

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:13 +02:00
Johannes Schindelin
2eba3ccb4b Merge pull request #665 from yaras/fix-git-664
Fix initial git gui message encoding
2016-10-29 10:41:13 +02:00
Johannes Schindelin
d3bcdd703b Merge 'git-gui-add-2nd-line' into HEAD 2016-10-29 10:41:13 +02:00
Johannes Schindelin
92eea79c5a Merge pull request #620 from sidecut/sidecut-gitk-list-references-window-width
Make the "list references" default window width wider
2016-10-29 10:41:13 +02:00
Johannes Schindelin
a79c5903a3 Merge branch 'gitk-cursor-keys'
This patch needs to be contributed to gitk proper, of course.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:12 +02:00
Johannes Schindelin
1a460d1a5a Merge branch 'clean-long-paths'
This addresses https://github.com/git-for-windows/git/issues/521

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:12 +02:00
Johannes Schindelin
3a2c757f59 Merge 'aslr' into HEAD
Address Space Layout Randomization (ASLR) allows executables' memory
layout to change at random between runs, and therefore offers a quite
decent protection against many attacks.

We enable ASLR because MSYS2's C compiler offers support for ASLR, and
whatever performance impact it has is neglible, according to
https://insights.sei.cmu.edu/cert/2014/02/differences-between-aslr-on-windows-and-linux.html

This merges the part of https://github.com/git-for-windows/git/pull/612
that does not break Git ;-)

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:12 +02:00
Johannes Schindelin
7af861e74f Merge 'unc-alternates' into HEAD 2016-10-29 10:41:12 +02:00
Johannes Schindelin
b8e6af3187 Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-10-29 10:41:12 +02:00
Johannes Schindelin
16ae2db0ac Merge pull request #773 from jeffhostetler/vs2015
Build with VS2015
2016-10-29 10:41:12 +02:00
Johannes Schindelin
69b8d6a04d Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-10-29 10:41:12 +02:00
Johannes Schindelin
63b4ccbbd0 Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2016-10-29 10:41:12 +02:00
Johannes Schindelin
b4a58f86b1 Merge branch 'program-data-config'
This branch introduces support for reading the "Windows-wide" Git
configuration from `%PROGRAMDATA%\Git\config`. As these settings are
intended to be shared between *all* Git-related software, that config
file takes an even lower precedence than `$(prefix)/etc/gitconfig`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:12 +02:00
Johannes Schindelin
abcda19a06 Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-10-29 10:41:11 +02:00
Johannes Schindelin
49550f679e Merge 'mingw-getcwd' into HEAD 2016-10-29 10:41:11 +02:00
Johannes Schindelin
df224221b6 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-10-29 10:41:11 +02:00
Johannes Schindelin
bdc6f6cbe0 Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-10-29 10:41:11 +02:00
Johannes Schindelin
e876a88e21 Merge 'sideband-bug' into HEAD
This works around the push-over-git-protocol issues pointed out in
https://github.com/msysgit/git/issues/101.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:11 +02:00
Johannes Schindelin
8cd84d2d20 Merge 'fix-is-exe' into HEAD 2016-10-29 10:41:11 +02:00
Johannes Schindelin
99f6f40d6b Merge 'fix-externals' into HEAD 2016-10-29 10:41:11 +02:00
Johannes Schindelin
4418bcf766 Merge 'remote-hg-prerequisites' into HEAD
These fixes were necessary for Sverre Rabbelier's remote-hg to work,
but for some magic reason they are not necessary for the current
remote-hg. Makes you wonder how that one gets away with it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:11 +02:00
Johannes Schindelin
b99ccaf59d Merge 'win-tests-fixes' into HEAD 2016-10-29 10:41:11 +02:00
Johannes Schindelin
f693874708 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:11 +02:00
yaras
2ce9976111 Do not mask the username when reading credentials
When user is asked for credentials there is no need to mask username,
so PROMPT_ASKPASS flag on calling credential_ask_one for login is
unnecessary.

credential_ask_one internally uses git_prompt which in case of given
flag PROMPT_ASKPASS uses masked input method instead of
git_terminal_prompt, which does not mask user input.

This fixes #675

Signed-off-by: yaras <yaras6@gmail.com>
2016-10-29 10:41:10 +02:00
yaras
446f4bb92e Fix initial git gui message encoding
This fix refers https://github.com/git-for-windows/git/issues/664

After `git merge --squash` git creates .git/SQUASH_MSG (UTF-8 encoded)
which contains squashed commits. When run `git gui` it copies SQUASH_MSG
to PREPARE_COMMIT_MSG, but without honoring UTF-8. This leads to encoding
problems on `git gui` commit prompt.

The same applies on git cherry-pick conflict, where MERGE_MSG is created
and then is copied to PREPARE_COMMIT_MSG.

In both cases PREPARE_COMMIT_MSG must be configured to store data in UTF-8.

Signed-off-by: yaras <yaras6@gmail.com>
2016-10-29 10:41:10 +02:00
Johannes Schindelin
173b153180 Merge 'resource-version' into HEAD 2016-10-29 10:41:10 +02:00
Johannes Schindelin
51a63b90ea Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-10-29 10:41:10 +02:00
Johannes Schindelin
f1156a3fae Merge 'gitk' into HEAD 2016-10-29 10:41:10 +02:00
Johannes Schindelin
e68393e18c Merge branch 'msys2-git-gui'
This topic branch addresses the bug where Git for Windows 2.x' Git GUI
failed to generate a working shortcut via Repository>Create Desktop
Shortcut.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:10 +02:00
Johannes Schindelin
6e824ea31d Merge 'git-gui' into HEAD 2016-10-29 10:41:10 +02:00
Johannes Schindelin
f1f522515c Merge 'unicode' into HEAD 2016-10-29 10:41:10 +02:00
Johannes Schindelin
d0491762ed Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:10 +02:00
Johannes Schindelin
071a4d1bfc 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>
2016-10-29 10:41:09 +02:00
James J. Raden
827334836e gitk: make the "list references" default window width wider
When using remotes (with git-flow especially), the remote reference names
are almost always wordwrapped in the "list references" window because it's
somewhat narrow by default. It's possible to resize it with a mouse,
but it's annoying to have to do this every time, especially on Windows 10,
where the window border seems to be only one (1) pixel wide, thus making
the grabbing of the window border tricky.

Signed-off-by: James J. Raden <james.raden@gmail.com>
2016-10-29 10:41:09 +02:00
Johannes Schindelin
150e4a65fd gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
Tcl/Tk 8.6 introduced new events for the cursor left/right keys and
apparently changed the behavior of the previous event.

Let's work around that by using the new events when we are running with
Tcl/Tk 8.6 or later.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:09 +02:00
Johannes Schindelin
8038dccd47 t7300: git clean -dfx must show an error with long paths
In particular on Windows, where the default maximum path length is quite
small, but there are ways to circumvent that limit in many cases, it is
very important that users be given an indication why their command
failed because of too long paths when it did.

This test case makes sure that a warning is issued that would have
helped the user who reported Git for Windows' issue 521:

	https://github.com/git-for-windows/git/issues/521

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:09 +02:00
İsmail Dönmez
22d0841f97 Enable DEP and ASLR
Enable DEP (Data Execution Prevention) and ASLR (Address Space Layout
Randomization) support. This applies to both 32bit and 64bit builds
and makes it substantially harder to exploit security holes in Git by
offering a much more unpredictable attack surface.

ASLR interferes with GDB's ability to set breakpoints. A similar issue
holds true when compiling with -O2 (in which case single-stepping is
messed up because GDB cannot map the code back to the original source
code properly). Therefore we simply enable ASLR only when an
optimization flag is present in the CFLAGS, using it as an indicator
that the developer does not want to debug in GDB anyway.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:09 +02:00
Johannes Schindelin
7095d5b33f mingw: support UNC alternates
Just like we support having alternates pointing to different drives, we
want to support alternates pointing to network shares, i.e. UNC paths.

Technically, what we do in this patch is not to support UNC alternates,
but to support UNC paths when normalizing paths. But the latter implies
the former, and the former really was the motivation for this patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:09 +02:00
Johannes Schindelin
31b8a6a6f6 remove_dirs: do not swallow error when stat() failed
Without an error message when stat() failed, e.g. `git clean` would
abort without an error message, leaving the user quite puzzled.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:09 +02:00
İsmail Dönmez
bb1811fa7b Don't let ld strip relocations
This is the first step for enabling ASLR (Address Space Layout
Randomization) support. We want to enable ASLR for better protection
against exploiting security holes in Git.

The problem fixed by this commit is that `ld.exe` seems to be stripping
relocations which in turn will break ASLR support. We just make sure
it's not stripping the main executable entry.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:09 +02:00
Philip Oakley
df715fc913 engine.pl: ignore invalidcontinue.obj which is known to MSVC
Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better
POSIX compatibility, 2014-03-29) introduced invalidcontinue.obj
into the Makefile output, which was not parsed correctly by the
buildsystem. Ignore it, as it is known to Visual Studio and,
there is no matching source file.

Only substitute filenames ending with .o when generating the
source .c filename, otherwise a .cbj file may be expected.

Split the .o and .obj processing; 'make' does not produce .obj
files.

In the future there may be source files that produce .obj files
so keep the two issues (.obj files with & without source files)
separate.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Duncan Smart <duncan.smart@gmail.com>

(cherry picked from commit d01d71fe1aed67f4e3a5ab80eeadeaf525ad0846)
2016-10-29 10:41:08 +02:00
Johannes Schindelin
8e7eb9f365 t7800: fix quoting
When passing a command-line to call an external diff command to the
difftool, we must be prepared for paths containing special characters,
e.g. backslashes in the temporary directory's path on Windows.

This has been caught by running the test suite with an MSVC-built Git:
in contrast to the MINGW one, it does not rewrite `$TMP` to use forward
slashes instead of backslashes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:08 +02:00
Johannes Schindelin
eac947dc3a msvc: work around iconv() not setting errno
When compiling with MSVC, we rely on NuPkgs to provide the binaries of
dependencies such as libiconv. The libiconv 1.14.0.11 package available
from https://www.nuget.org/packages/libiconv seems to have a bug where
it does not set errno (when we would expect it to be E2BIG).

Let's simulate the error condition by taking less than 16 bytes
remaining in the out buffer as an indicator that we ran out of space.
While 16 might seem a bit excessive (when converting from, say, any
encoding to UTF-8, 8 bytes should be fine), it is designed to be a safe
margin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:08 +02:00
Johannes Schindelin
09ffdf4193 msvc: use libiconv
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-10-29 10:41:08 +02:00