Commit Graph

60441 Commits

Author SHA1 Message Date
Jeff Hostetler
f840c4d411 Add very verbose porcelain output to status
Tools interacting with Git repositories may need to know the complete
state of the working directory. For efficiency, it would be good to have
a single command to obtain this information.

We already have a `--porcelain` mode intended for tools' consumption,
and it only makes sense to enhance this mode to offer more information.

Just like we do elsewhere in Git's source code, we now interpret
multiple `--verbose` flags accumulatively, and show substantially more
information in porcelain mode at verbosity level 2.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
2016-07-07 10:18:52 -04:00
Johannes Schindelin
dd1308ae22 mingw: work around t2300's assuming non-Windows paths
On Windows, we have to juggle two different schemes of representing
paths: the native, Windows paths (the only ones known to the main
Git executable) on the one hand, and POSIX-ish ones used by the Bash
through MSYS2's POSIX emulation layer on the other hand.

A Windows path looks like this: C:\git-sdk-64\usr\src\git. In modern
Windows, it is almost always legal to use forward slashes as directory
separators, which is the reason why the Git executable itself would use
the path C:/git-sdk-64/usr/src/git instead. The equivalent POSIX-ish
path would be: /c/git-sdk-64/usr/src/git.

This patch works around the assumption of t2300-cd-to-toplevel.sh that
`git --exec-path` spits out a POSIX-ish path, by converting the output
accordingly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.9.0.windows.1
2016-06-14 09:32:33 +02:00
Johannes Schindelin
f8fbb1fcf8 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-06-14 08:23:41 +02:00
Johannes Schindelin
1fde4c75e0 Merge pull request #755 from bwijen/master
Prevent child processes from inheriting a handle to index.lock
2016-06-14 08:23:41 +02:00
Ben Wijen
ee7e499a2c 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-06-14 08:23:41 +02:00
Ben Wijen
6aaab94a6d 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-06-14 08:23:41 +02:00
Johannes Schindelin
c09c246e53 Merge branch 'js/http-custom-headers'
Update tests for "http.extraHeaders=<header>" to be portable back
to Apache 2.2 (the original depended on <RequireAll/> which is a
more recent feature).

* js/http-custom-headers:
  submodule: ensure that -c http.extraheader is heeded
  t5551: make the test for extra HTTP headers more robust
  tests: adjust the configuration for Apache 2.2

Rebased-and-signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-06-14 08:23:40 +02:00
Johannes Schindelin
3f2baf609a Merge pull request #726 from orgads/git-gui-preserve-author-windows
git-gui: Do not reset author details on amend
2016-06-14 08:23:40 +02:00
Johannes Schindelin
e0e9d9b710 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-06-14 08:23:40 +02:00
Johannes Schindelin
4aca99a442 Merge branch 'jk/submodule-c-credential' into js/http-custom-headers
* jk/submodule-c-credential:
  submodule: stop sanitizing config options
  submodule: use prepare_submodule_repo_env consistently
  submodule--helper: move config-sanitizing to submodule.c
  submodule: export sanitized GIT_CONFIG_PARAMETERS
  t5550: break submodule config test into multiple sub-tests
  t5550: fix typo in $HTTPD_URL
  git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS
  git: submodule honor -c credential.* from command line
  quote: implement sq_quotef()
  submodule: fix segmentation fault in submodule--helper clone
  submodule: fix submodule--helper clone usage
  submodule: check argc count for git submodule--helper clone
  submodule: don't pass empty string arguments to submodule--helper clone

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-06-14 08:23:37 +02:00
Jacob Keller
9a237b760e submodule: fix segmentation fault in submodule--helper clone
The git submodule--helper clone command will fail with a segmentation
fault when given a null url or null path variable. Since these are
required for proper functioning of the submodule--helper clone
subcommand, add checks to prevent running and fail gracefully when
missing.

Update the usage string to reflect the requirement that the --url and
--path "options" are required.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-06-14 08:23:08 +02:00
Jacob Keller
a7e254611d submodule: check argc count for git submodule--helper clone
Extra unused arguments to git submodule--helper clone subcommand were
being silently ignored. Add a check to the argc count after options
handling to ensure that no extra arguments were left on the argv array.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-06-14 08:23:06 +02:00
Orgad Shaneh
e4b3409c7e 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-06-14 08:22:40 +02:00
Johannes Schindelin
9503efc0c5 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-06-14 08:22:40 +02:00
Johannes Schindelin
0006617883 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-06-14 08:22:39 +02:00
Johannes Schindelin
db19c473b3 Merge pull request #677 from yaras/fix-git-675
Fixed masking username with asterisks when reading credentials
2016-06-14 08:22:39 +02:00
Johannes Schindelin
6d262b689f 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-06-14 08:22:39 +02:00
Johannes Schindelin
593192850f Merge pull request #665 from yaras/fix-git-664
Fix initial git gui message encoding
2016-06-14 08:22:38 +02:00
Johannes Schindelin
6edaa497dc 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-06-14 08:22:38 +02:00
Johannes Schindelin
0d0a063c32 Merge pull request #620 from sidecut/sidecut-gitk-list-references-window-width
Make the "list references" default window width wider
2016-06-14 08:22:38 +02:00
Johannes Schindelin
abe71ddf0c Merge pull request #662 from shiftkey/issue_template
added issue template mirroring wiki notes
2016-06-14 08:22:37 +02:00
Johannes Schindelin
3a826b39d9 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-06-14 08:22:37 +02:00
Johannes Schindelin
3d1a6fdc83 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-06-14 08:22:37 +02:00
Johannes Schindelin
10daed8d2e 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-06-14 08:22:36 +02:00
Johannes Schindelin
00b5b55080 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-06-14 08:22:36 +02:00
Johannes Schindelin
0516daf9e1 Merge branch 'home-bin' 2016-06-14 08:22:36 +02:00
Johannes Schindelin
c4dc06c29a Merge branch 'conhost-git-bash' 2016-06-14 08:22:35 +02:00
Johannes Schindelin
83ea643b2d Merge branch 'bash-redirector' 2016-06-14 08:22:35 +02:00
Johannes Schindelin
6ed901b0a3 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-06-14 08:22:35 +02:00
Johannes Schindelin
9377bd8fe0 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-06-14 08:22:34 +02:00
Johannes Schindelin
67effa7606 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-06-14 08:22:34 +02:00
Johannes Schindelin
44debade36 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-06-14 08:22:34 +02:00
Johannes Schindelin
8182995629 Merge 'unc-alternates' into HEAD 2016-06-14 08:22:33 +02:00
Johannes Schindelin
859451f6ec Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-06-14 08:22:33 +02:00
Johannes Schindelin
33842da3c5 Merge pull request #487 from dscho/default-username
Improve the default user name & email logic
2016-06-14 08:22:33 +02:00
Johannes Schindelin
b257b17896 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-06-14 08:22:32 +02:00
Johannes Schindelin
98c0d2cf65 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-06-14 08:22:32 +02:00
Johannes Schindelin
af3cb15d1d Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-06-14 08:22:32 +02:00
Johannes Schindelin
0e71ff0670 Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2016-06-14 08:22:31 +02:00
Johannes Schindelin
d9d3e99d7e 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-06-14 08:22:31 +02:00
Johannes Schindelin
ebf5b4de17 Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-06-14 08:22:31 +02:00
Johannes Schindelin
5d59526d6e Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-06-14 08:22:30 +02:00
Johannes Schindelin
419c4a916d 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-06-14 08:22:30 +02:00
Johannes Schindelin
21835e804d Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-06-14 08:22:30 +02:00
Johannes Schindelin
a3d943ca71 Merge 'fix-is-exe' into HEAD 2016-06-14 08:22:29 +02:00
Johannes Schindelin
cde399e6da Merge 'fix-externals' into HEAD 2016-06-14 08:22:29 +02:00
Johannes Schindelin
e5cee9301c 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-06-14 08:22:29 +02:00
Johannes Schindelin
92659ffc06 Merge 'win-tests-fixes' into HEAD 2016-06-14 08:22:28 +02:00
Johannes Schindelin
6170115602 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-06-14 08:22:28 +02:00
Johannes Schindelin
56c97f788b Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-06-14 08:22:28 +02:00