Commit Graph

63619 Commits

Author SHA1 Message Date
Johannes Schindelin
bbaf9b1f35 Merge pull request #665 from yaras/fix-git-664
Fix initial git gui message encoding
2016-09-12 10:04:00 +02:00
Johannes Schindelin
d75dccce09 Merge 'git-gui-add-2nd-line' into HEAD 2016-09-12 10:03:59 +02:00
Johannes Schindelin
555559c39c Merge pull request #620 from sidecut/sidecut-gitk-list-references-window-width
Make the "list references" default window width wider
2016-09-12 10:03:58 +02:00
Johannes Schindelin
c5f1cbc5f9 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-09-12 10:03:57 +02:00
Johannes Schindelin
ec813ff544 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-09-12 10:03:57 +02:00
Johannes Schindelin
442f673b59 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-09-12 10:03:56 +02:00
Johannes Schindelin
705b853172 Merge 'unc-alternates' into HEAD 2016-09-12 10:03:55 +02:00
Johannes Schindelin
70ee0deafc Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-09-12 10:03:54 +02:00
Johannes Schindelin
fbe9f6b0fd Merge 'mingw/default-ident'
Improve the default user name & email logic

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:53 +02:00
Johannes Schindelin
34a6f159a5 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-09-12 10:03:53 +02:00
Johannes Schindelin
bcf21350f8 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-09-12 10:03:52 +02:00
Johannes Schindelin
1a99d3733d Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-09-12 10:03:51 +02:00
Johannes Schindelin
5b88fbe68b Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2016-09-12 10:03:51 +02:00
Johannes Schindelin
4f69736b2e 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-09-12 10:03:50 +02:00
Johannes Schindelin
1c7e6ee5be Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-09-12 10:03:49 +02:00
Johannes Schindelin
077864b89f Merge 'mingw-getcwd' into HEAD 2016-09-12 10:03:48 +02:00
Johannes Schindelin
30bbe24fbb Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-09-12 10:03:47 +02:00
Johannes Schindelin
15e15cf684 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-09-12 10:03:47 +02:00
Johannes Schindelin
9f74522320 Merge 'fix-is-exe' into HEAD 2016-09-12 10:03:46 +02:00
Johannes Schindelin
a5425dee18 Merge 'fix-externals' into HEAD 2016-09-12 10:03:45 +02:00
Johannes Schindelin
376cfb7aa0 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-09-12 10:03:44 +02:00
Johannes Schindelin
2dd13a419d Merge 'win-tests-fixes' into HEAD 2016-09-12 10:03:44 +02:00
Johannes Schindelin
b62d7bbfb8 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:43 +02:00
Johannes Schindelin
c6430561d2 Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-09-12 10:03:42 +02:00
Johannes Schindelin
7732b9fe47 Merge 'gitk' into HEAD 2016-09-12 10:03:41 +02:00
Johannes Schindelin
8ea7a862c0 Merge 'git-gui' into HEAD 2016-09-12 10:03:40 +02:00
Johannes Schindelin
8f3e3956c6 Merge 'unicode' into HEAD 2016-09-12 10:03:40 +02:00
Johannes Schindelin
6bd9b67417 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:39 +02:00
yaras
b582592aab 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-09-12 10:03:37 +02:00
yaras
5ff0f2928b 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-09-12 10:03:36 +02:00
Johannes Schindelin
dc95b61e7f 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-09-12 10:03:35 +02:00
James J. Raden
31a7938b26 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-09-12 10:03:34 +02:00
Johannes Schindelin
6387eddfa5 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-09-12 10:03:33 +02:00
Johannes Schindelin
b2930ebc0e 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-09-12 10:03:32 +02:00
Johannes Schindelin
97ab9c8e5d 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-09-12 10:03:32 +02:00
İsmail Dönmez
4ad4629bc0 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-09-12 10:03:31 +02:00
İsmail Dönmez
08f64f77bd 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-09-12 10:03:31 +02:00
Johannes Schindelin
a5253a7120 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-09-12 10:03:30 +02:00
Philip Oakley
74937927c0 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-09-12 10:03:29 +02:00
Johannes Schindelin
7d51079c54 mingw: use domain information for default email
When a user is registered in a Windows domain, it is really easy to
obtain the email address. So let's do that.

Suggested by Lutz Roeder.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:27 +02:00
Johannes Schindelin
1ee1f4d273 getpwuid(mingw): provide a better default for the user name
We do have the excellent GetUserInfoEx() function to obtain more
detailed information of the current user (if the user is part of a
Windows domain); Let's use it.

Suggested by Lutz Roeder.

To avoid the cost of loading Secur32.dll (even lazily, loading DLLs
takes a non-neglibile amount of time), we use the established technique
to load DLLs only when, and if, needed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:27 +02:00
Johannes Schindelin
de7c43fe18 getpwuid(mingw): initialize the structure only once
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:27 +02:00
Johannes Schindelin
2f8164fdce Merge 'kblees/kb/symlinks' into HEAD 2016-09-12 10:03:27 +02:00
Thomas Klaeger
843adcc7e0 git-gui (Windows): use git-bash.exe if it is available
Git for Windows 2.x ships with an executable that starts the Git Bash
with all the environment variables and what not properly set up. It is
also adjusted according to the Terminal emulator option chosen when
installing Git for Windows (while `bash.exe --login -i` would always
launch with Windows' default console).

So let's use that executable (usually C:\Program Files\Git\git-bash.exe)
instead of `bash.exe --login -i` if its presence was detected.

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

Signed-off-by: Thomas Kläger <thomas.klaeger@10a.ch>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:25 +02:00
Johannes Schindelin
318208e4b9 git-gui (Windows): use git-gui.exe in Create Desktop Shortcut
When calling `Repository>Create Desktop Shortcut`, Git GUI assumes
that it is okay to call `wish.exe` directly on Windows. However, in
Git for Windows 2.x' context, that leaves several crucial environment
variables uninitialized, resulting in a shortcut that does not work.

To fix those environment variable woes, Git for Windows comes with a
convenient `git-gui.exe`, so let's just use it when it is available.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:25 +02:00
Johannes Schindelin
be63921b3c git-gui: fix detection of Cygwin
MSys2 might *look* like Cygwin, but it is *not* Cygwin... Unless it
is run with `MSYSTEM=MSYS`, that is.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:25 +02:00
Karsten Blees
fb3a526f1e Win32: implement nanosecond-precision file times
We no longer use any of MSVCRT's stat-functions, so there's no need to
stick to a CRT-compatible 'struct stat' either.

Define and use our own POSIX-2013-compatible 'struct stat' with nanosecond-
precision file times.

Note: Due to performance issues when using git variants with different file
time resolutions, this patch does *not* yet enable nanosecond precision in
the Makefile (use 'make USE_NSEC=1').

Signed-off-by: Karsten Blees <blees@dcon.de>
2016-09-12 10:03:24 +02:00
Karsten Blees
99d8846695 Win32: replace MSVCRT's fstat() with a Win32-based implementation
fstat() is the only stat-related CRT function for which we don't have a
full replacement yet (and thus the only reason to stick with MSVCRT's
'struct stat' definition).

Fully implement fstat(), in preparation of implementing a POSIX 2013
compatible 'struct stat' with nanosecond-precision file times.

Signed-off-by: Karsten Blees <blees@dcon.de>
2016-09-12 10:03:24 +02:00
Johannes Schindelin
e11fb56045 t3701: verify that we can add *lots* of files interactively
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:23 +02:00
Kelly Heller
ad49e83024 Allow add -p and add -i with a large number of files
This fixes https://github.com/msysgit/git/issues/182.

Inspired by Pull Request 218 using code from @PhilipDavis.

[jes: simplified code quite a bit]

Signed-off-by: Kelly Heller <kkheller@cedrus.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-09-12 10:03:23 +02:00