Commit Graph

60752 Commits

Author SHA1 Message Date
Johannes Schindelin
4c30620104 credential-store: avoid assertion
As of 1a9d15d (tempfile: a new module for handling temporary files,
2015-08-10), the temporary files which are used by the lock file
machinery adjust the permissions, and to do that, the config is read,
which in turn requires the config to be read.

This means that the runtime prefix needs to be resolved properly, but we
did not set that correctly in credential-store.

The symptom of this bug: when running

	printf '%s\n%s\n%s\n%s\n' \
		'protocol=https' 'host=gitblub.com' \
		'username=hello' 'password=world' |
	git credential-store store

an assertion is thrown:

	Assertion failed!

	Program: ...\libexec\git-core\git-credential-store.exe
	File: exec_cmd.c, Line 23

	Expression: argv0_path

	This application has requested the Runtime to terminate it in an
	unusual way.  Please contact the application's support team for
	more information.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:34:24 +02:00
Johannes Schindelin
577e09a42f Merge pull request #793 from boumenot/pr-web--browse
mingw: delete call to ShellExecute for opening help.
2016-07-12 06:34:22 +02:00
Johannes Schindelin
e695c9b4f4 Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2016-07-12 06:34:20 +02:00
Christopher Boumenot
5d560cbc5e mingw: delete call to ShellExecute for opening help.
The Windows flavor of git calls ShellExecute to view web pages.  This call
launches the default handler for .html files.  The user is not able to
configure an alternative despite git having full support for doing so on
Windows.

The original request for this change dates back to 12-May-2014, and refers
to dropping commit 4804aab from the msysgit repository.  This is exactly
what this commit does.
2016-07-12 06:34:18 +02:00
Gaël Lhez
7e7d709dd6 git bundle create <bundle> leaks handle the revlist is empty.
issue #790: git bundle create does not close handle to *.lock file

This problem happens when an user tries to create an empty bundle, using the
following command:  `git bundle create <bundle> <revlist>` and when <revlist>
resolve to an empty list (for example, like `master..master`), `git bundle` fails
and warn the user about how it don't want to create empty bundle.

In that case, git tries to delete the `<bundle>.lock` file, and since there's still
an open file handle, fails to do so and ask the user if it should retry (which will
fail again).

The lock can still be deleted manually by the user (and it is required if the user
want to create a bundle after revising his rev-list).

Signed-off-by: Gaël Lhez <gael.lhez@gmail.com>
2016-07-12 06:34:17 +02:00
Johannes Schindelin
a6098c7428 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-07-12 06:33:57 +02:00
Johannes Schindelin
4759d0733b Merge pull request #755 from bwijen/master
Prevent child processes from inheriting a handle to index.lock
2016-07-12 06:33:55 +02:00
Ben Wijen
e3aa9686ce Make sure temporary file handles are not inherited by child processes
When testing a merge driver which spawns a merge server (for future merges)
I got the following error:

    Rename from 'xxx/.git/index.lock' to 'xxx/.git/index' failed. Should I try again? (y/n)

Only after I stop the merge server the lock is released.
This is caused by windows handle inheritance.

Starting childs with bInheritHandles==FALSE does not work,
because no file handles would be inherited,
not even the hStdXxx handles in STARTUPINFO.

Opening every file with O_NOINHERIT does not work,
Since it is used by git-upload-pack for example,
which expects inherited handles.

This leaves us with only creating temp files with the O_NOINHERIT flag.
Which (currently) only used by lock_file which is exactly what we want.


Signed-off-by: Ben Wijen <ben@wijen.net>
2016-07-12 06:33:53 +02:00
Ben Wijen
7c20d7b29a Add index.lock test to t/t6026-merge-attr.sh
This test was added to verify the behaviour of merge
when a merge server is spawned.

Because file handles are inherited by child processes,
the index.lock is also inherited and - on win32 - can't
be released until the child has stopped.

Signed-off-by: Ben Wijen <ben@wijen.net>
2016-07-12 06:33:53 +02:00
Johannes Schindelin
86be6f0ead Merge pull request #726 from orgads/git-gui-preserve-author-windows
git-gui: Do not reset author details on amend
2016-07-12 06:33:51 +02:00
Johannes Schindelin
9e8ba78e07 Merge branch 'resource-version'
This topic branch increases the precision of the version recorded in
the resources of the .exe files from major/minor to include also the
micro version and the patch level.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:50 +02:00
Orgad Shaneh
ca49de5534 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-07-12 06:33:45 +02:00
Johannes Schindelin
97fcda52f8 mingw: include the full version information in the resources
This fixes https://github.com/git-for-windows/git/issues/723

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:43 +02:00
Johannes Schindelin
5792d61162 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-07-12 06:33:41 +02:00
Johannes Schindelin
59e3e292ff 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-07-12 06:33:39 +02:00
Johannes Schindelin
575d445626 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2016-07-12 06:33:37 +02:00
Johannes Schindelin
40e1286881 Merge pull request #665 from yaras/fix-git-664
Fix initial git gui message encoding
2016-07-12 06:33:35 +02:00
Johannes Schindelin
902f3004e8 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-07-12 06:33:34 +02:00
Johannes Schindelin
c339803804 Merge pull request #620 from sidecut/sidecut-gitk-list-references-window-width
Make the "list references" default window width wider
2016-07-12 06:33:33 +02:00
Johannes Schindelin
d7ced1f146 Merge pull request #662 from shiftkey/issue_template
added issue template mirroring wiki notes
2016-07-12 06:33:32 +02:00
Johannes Schindelin
77b96e1313 Merge branch 'consolez'
This fixes an issue where the Git wrapper would terminate upon Ctrl+C,
even in the case when its child process would *not* terminate.

Note: while the original intention was to fix running Git Bash in
ConsoleZ, the bug fix applies also to running

	C:\Program Files\Git\bin\bash -l -i

in a cmd window.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:31 +02:00
Johannes Schindelin
2c47072849 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-07-12 06:33:30 +02:00
Johannes Schindelin
a6403f39dc 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-07-12 06:33:28 +02:00
Johannes Schindelin
e78ab53fbd Merge branch 'git-wrapper-interpolate'
There was a bug in the wrapper where it would interpolate incorrectly if
the name of the environment variable to expand was longer than the value.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:26 +02:00
Johannes Schindelin
24e12a243c Merge branch 'home-bin' 2016-07-12 06:33:25 +02:00
Johannes Schindelin
5c9f9a4a38 Merge branch 'conhost-git-bash' 2016-07-12 06:33:24 +02:00
Johannes Schindelin
872d78a56e Merge branch 'bash-redirector' 2016-07-12 06:33:22 +02:00
Johannes Schindelin
9b85e0cd6d Merge branch 'pinnable'
Part 2/3 of fixing https://github.com/git-for-windows/git/issues/263

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:20 +02:00
Johannes Schindelin
1b1f0226c7 Merge branch 'git-wrapper--command'
This topic branch adds the --command=<command> option that allows
starting the Git Bash (or Git CMD) with different terminal emulators
than the one encoded via embedded string resources.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:17 +02:00
Johannes Schindelin
02379056a5 Merge 'git-wrapper' into HEAD
Use msysGit's `git-wrapper` instead of the builtins. This works around
two issues:

- when the file system does not allow hard links, we would waste over
  800 megabyte by having 109 copies of a multi-megabyte executable

- even when the file system allows hard links, the Windows Explorer
  counts the disk usage as if it did not. Many users complained about
  Git for Windows using too much space (when it actually did not). We
  can easily avoid those user complaints by merging this branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:33:16 +02:00
Johannes Schindelin
241b6e235a 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-07-12 06:33:14 +02:00
Johannes Schindelin
97653cc7bf Merge 'unc-alternates' into HEAD 2016-07-12 06:33:12 +02:00
Johannes Schindelin
e22ab5f661 Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-07-12 06:33:11 +02:00
Johannes Schindelin
331ab30481 Merge pull request #487 from dscho/default-username
Improve the default user name & email logic
2016-07-12 06:33:10 +02:00
Johannes Schindelin
594ce30cb9 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-07-12 06:33:08 +02:00
Johannes Schindelin
a0d56503ba Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-07-12 06:33:07 +02:00
Johannes Schindelin
d0dbaf77da Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-07-12 06:33:05 +02:00
Johannes Schindelin
bce046ae65 Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2016-07-12 06:33:03 +02:00
Johannes Schindelin
84c2568058 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-07-12 06:33:02 +02:00
Johannes Schindelin
e616ddc293 Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-07-12 06:33:01 +02:00
Johannes Schindelin
994c1f7310 Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-07-12 06:32:59 +02:00
Johannes Schindelin
e7a92e4539 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-07-12 06:32:58 +02:00
Johannes Schindelin
35d52a3e77 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:32:57 +02:00
Johannes Schindelin
66cb419981 Merge 'fix-is-exe' into HEAD 2016-07-12 06:32:55 +02:00
Johannes Schindelin
3def2762b6 Merge 'fix-externals' into HEAD 2016-07-12 06:32:54 +02:00
Johannes Schindelin
a4437dc0cc 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-07-12 06:32:53 +02:00
Johannes Schindelin
830ca06a80 Merge 'win-tests-fixes' into HEAD 2016-07-12 06:32:52 +02:00
Johannes Schindelin
c610a29c55 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-12 06:32:50 +02:00
Johannes Schindelin
648fbf717f Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-07-12 06:32:49 +02:00
Johannes Schindelin
627ccb4cfe Merge 'gitk' into HEAD 2016-07-12 06:32:48 +02:00