Commit Graph

60971 Commits

Author SHA1 Message Date
Johannes Schindelin
fbbd1671e3 Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
2016-07-16 07:34:10 +02:00
Johannes Schindelin
27df15d2e5 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-16 07:34:04 +02:00
Gaël Lhez
f526af9caa 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-16 07:34:04 +02:00
Johannes Schindelin
041cb342cc Merge pull request #755 from bwijen/master
Prevent child processes from inheriting a handle to index.lock
2016-07-16 07:34:02 +02:00
Ben Wijen
2a382ad8cf 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-16 07:34:00 +02:00
Ben Wijen
7a45a66bcd 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-16 07:33:59 +02:00
Johannes Schindelin
b7f7626cb7 Merge pull request #726 from orgads/git-gui-preserve-author-windows
git-gui: Do not reset author details on amend
2016-07-16 07:33:58 +02:00
Johannes Schindelin
8f50d3b2ba 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-16 07:33:56 +02:00
Orgad Shaneh
ff3985aeb2 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-16 07:33:54 +02:00
Johannes Schindelin
464f126d14 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-16 07:33:53 +02:00
Johannes Schindelin
89c43ee5fb 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-16 07:33:51 +02:00
Johannes Schindelin
0c4b86ee25 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-16 07:33:50 +02:00
Johannes Schindelin
d2d9a0a97f Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2016-07-16 07:33:49 +02:00
Johannes Schindelin
c23fc4dcb7 Merge pull request #665 from yaras/fix-git-664
Fix initial git gui message encoding
2016-07-16 07:33:48 +02:00
Johannes Schindelin
d8342c774c 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-16 07:33:47 +02:00
Johannes Schindelin
c70fac2da5 Merge pull request #620 from sidecut/sidecut-gitk-list-references-window-width
Make the "list references" default window width wider
2016-07-16 07:33:46 +02:00
Johannes Schindelin
be2a7b645d Merge pull request #662 from shiftkey/issue_template
added issue template mirroring wiki notes
2016-07-16 07:33:44 +02:00
Johannes Schindelin
494112d161 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-16 07:33:43 +02:00
Johannes Schindelin
9333a622b9 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-16 07:33:42 +02:00
Johannes Schindelin
271f621372 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-16 07:33:39 +02:00
Johannes Schindelin
9dc5246218 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-16 07:33:37 +02:00
Johannes Schindelin
9b6d4c5780 Merge branch 'home-bin' 2016-07-16 07:33:35 +02:00
Johannes Schindelin
d3c60e97be Merge branch 'conhost-git-bash' 2016-07-16 07:33:33 +02:00
Johannes Schindelin
c2ee7bcc92 Merge branch 'bash-redirector' 2016-07-16 07:33:30 +02:00
Johannes Schindelin
6efb995cf0 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-16 07:33:29 +02:00
Johannes Schindelin
0d52bc8bac 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-16 07:33:27 +02:00
Johannes Schindelin
4d8bd21f76 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-16 07:33:25 +02:00
Johannes Schindelin
4f30c8d3e4 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-16 07:33:23 +02:00
Johannes Schindelin
ed96742033 Merge 'unc-alternates' into HEAD 2016-07-16 07:33:22 +02:00
Johannes Schindelin
54c14d12c5 Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-07-16 07:33:19 +02:00
Johannes Schindelin
b1ccfc2061 Merge pull request #487 from dscho/default-username
Improve the default user name & email logic
2016-07-16 07:33:18 +02:00
Johannes Schindelin
3405cb16c0 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-16 07:33:17 +02:00
Johannes Schindelin
bc9e7986d9 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-07-16 07:33:15 +02:00
Johannes Schindelin
0aa601c001 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-07-16 07:33:13 +02:00
Johannes Schindelin
cbcb34c53f Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2016-07-16 07:33:11 +02:00
Johannes Schindelin
d8cc144388 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-16 07:33:10 +02:00
Johannes Schindelin
d90f80cec2 Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-07-16 07:33:09 +02:00
Johannes Schindelin
62da013b2b Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-07-16 07:33:07 +02:00
Johannes Schindelin
d7dba40d6a 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-16 07:33:04 +02:00
Johannes Schindelin
a4941486f8 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-16 07:33:01 +02:00
Johannes Schindelin
6bd061ffab Merge 'fix-is-exe' into HEAD 2016-07-16 07:32:58 +02:00
Johannes Schindelin
9837f6ea34 Merge 'fix-externals' into HEAD 2016-07-16 07:32:57 +02:00
Johannes Schindelin
2983c2506b 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-16 07:32:55 +02:00
Johannes Schindelin
bd4e74eef3 Merge 'win-tests-fixes' into HEAD 2016-07-16 07:32:52 +02:00
Johannes Schindelin
40a7638b9a Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-07-16 07:32:51 +02:00
Johannes Schindelin
bbaa617594 Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-07-16 07:32:50 +02:00
Johannes Schindelin
4d0bd15f51 Merge 'gitk' into HEAD 2016-07-16 07:32:49 +02:00
Johannes Schindelin
4c34b14510 Merge 'git-gui' into HEAD 2016-07-16 07:32:47 +02:00
Johannes Schindelin
6a74102416 Merge 'unicode' into HEAD 2016-07-16 07:32:44 +02:00
yaras
324eee8642 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-07-16 07:32:41 +02:00