Commit Graph

59035 Commits

Author SHA1 Message Date
Jon Griffiths
6e61449051 credential-cache--daemon: change to the socket dir on startup
Changing to the socket path stops the daemon holding open
the directory the user was in when it was started,
preventing umount from working. We're already holding open a
socket in that directory, so there's no downside.

Thanks-to: Jeff King <peff@peff.net>
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 14:48:03 -08:00
Matthieu Moy
f6b1fb372e Documentation/git-push: document that 'simple' is the default
The default behavior is well documented already in git-config(1), but
git-push(1) itself did not mention it at all. For users willing to learn
how "git push" works but not how to configure it, this makes the
documentation cumbersome to read.

Make the git-push(1) page self-contained by adding a short summary of
what 'push.default=simple' does, early in the page.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 13:35:10 -08:00
Patrick Steinhardt
4867f1184c xdiff/xmerge: fix memory leak in xdl_merge
When building the script for the second file that is to be merged
we have already allocated memory for data structures related to
the first file. When we encounter an error in building the second
script we only free allocated memory related to the second file
before erroring out.

Fix this memory leak by also releasing allocated memory related
to the first file.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 12:58:26 -08:00
Jon Griffiths
bd93b8d9be credential-cache--daemon: disallow relative socket path
Relative socket paths are dangerous since the user cannot generally
control when the daemon starts (initially, after a timeout, kill or
crash). Since the daemon creates but does not delete the socket
directory, this could lead to spurious directory creation relative
to the users cwd.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 12:56:27 -08:00
Jon Griffiths
a6e5e2864f credential-cache--daemon: refactor check_socket_directory
This function does an early return, and therefore has to
repeat its cleanup. We can stick the later bit of the
function into an "else" and avoid duplicating the shared
part (which will get bigger in a future patch).

Let's also rename the function to init_socket_directory. It
not only checks the directory but also creates it. Saying
"init" is more accurate.

Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 12:56:26 -08:00
Eric Wong
7c0da37d7b tests: remove no-op full-svn-test target
git-svn has not supported GIT_SVN_NO_OPTIMIZE_COMMITS for
the "set-tree" sub-command in 9 years since commit 490f49ea58
("git-svn: remove optimized commit stuff for set-tree").

So remove this target and TSVN variable to avoid confusion.

ref: http://mid.gmane.org/56C9B7B7.7030406@f2.dion.ne.jp

Helped-by: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 12:55:03 -08:00
Torsten Bögershausen
817a0c7968 convert.c: correct attr_action()
df747b81 (convert.c: refactor crlf_action, 2016-02-10) introduced a
bug to "git ls-files --eol".

The "text" attribute was shown as "text eol=lf" or "text eol=crlf",
depending on core.autocrlf or core.eol.

Correct this and add test cases in t0027.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 12:53:15 -08:00
Johannes Schindelin
bc859c8ac9 Merge pull request #665 from yaras/fix-git-664
Fix initial git gui message encoding
2016-02-23 13:40:44 +01:00
yaras
eb8ed4b340 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-02-23 12:55:46 +01:00
Johannes Schindelin
781f3c47ab 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-02-23 11:15:49 +01:00
Johannes Schindelin
33015f295a Merge pull request #620 from sidecut/sidecut-gitk-list-references-window-width
Make the "list references" default window width wider
2016-02-23 11:15:47 +01:00
Johannes Schindelin
a8911bd4cf Merge pull request #662 from shiftkey/issue_template
added issue template mirroring wiki notes
2016-02-23 11:15:47 +01:00
Johannes Schindelin
dfb1fbf849 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-02-23 11:15:47 +01:00
James J. Raden
c1c606c3de 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-02-23 11:15:46 +01:00
Brendan Forster
ba49ebbf27 added issue template mirroring wiki notes 2016-02-23 11:15:45 +01:00
Christophe Bucher
a057401fc1 git-wrapper: do not let the Ctrl-C event kill the wrapper
... while waiting for the child process to finish.

The Git wrapper serves, among other things, as git-cmd.exe. In that
role, its primary purpose is to provide an interactive cmd window that
knows where to find Git.

A secondary use of git-cmd.exe is to be able to launch other console
processes that know about Git, e.g. when ConsoleZ wants to call an
interactive Bash (it cannot call git-bash.exe because that would open a
new MinTTY window). To this end, git-cmd.exe supports the --command=...
command-line option. The interactive bash would be called like this:

	git-cmd --command=usr\bin\bash.exe -l -i

The command-line arguments after the --command=... options are simply
passed through to the command itself. If no --command=... option is
specified, git-cmd.exe defaults to cmd.exe.

Once git-cmd.exe is launched, it finds the top-level directory of the
Git for Windows installation and then launches the command as a child
process. And this is where things get a little bit tricky: When the user
presses CTRL-C, the cmd window receives WM_KEYDOWN/WM_KEYUP messages
which are then handled by the TranslateMessage function that generates a
CTRL-C event that is sent to the console processes running in the
console window (i.e. both git-cmd.exe and the child process).

If no Console Ctrl Handlers have been registered, the git-cmd.exe
process will simply be terminated, without having waited for the
interactive Bash to quit (it does not quit, of course, because it
handles Ctrl+C by terminating any process launched from within the
Bash). Now both cmd and the Bash compete for user input.

Luckily, the solution is very easy: the Win32 API sports a
SetConsoleCtrlHandler() function to register/unregister Console Ctrl
Handlers. When the NULL pointer is registered as "handler", it "causes
the calling process to ignore CTRL+C input":

https://msdn.microsoft.com/en-us/library/windows/desktop/ms686016.aspx

This is exactly what we need here: while waiting for the child processes
to finish, the git-cmd.exe process itself should not be interruptible by
the user. Immediately after the child process terminates, we unregister
the Console Ctrl Handler.

Note: we need to be careful with changes to the Git wrapper as it serves
many other purposes in addition to git-cmd.exe. For example, it serves
as the cmd\git.exe as well as all of the git-<builtin>.exe stand-ins.
So do we want the same Ctrl+C behavior even in those instances? Yes: If
the user interrupts using Ctrl+C, the child process should terminate
before the Git wrapper.

Also note: We cannot override the Console Ctrl Handler with a function
that simply always returns TRUE: this would prevent the console window
opened via git-cmd.exe from closing, since the Console Ctrl Handler
*also* handles "signals generated by the system when the user closes the
console, logs off, or shuts down the system."

[jes: changed the patch to conform with the surrounding coding style, to
pass NULL as Console Ctrl Handler and unregister it as soon as
appropriate, fixed commit message to be more accurate and informative,
added link to the SetConsoleCtrlHandler() documentation.]

This fixes https://github.com/git-for-windows/git/pull/205

Signed-off-by: Christophe Bucher Developer <christophe.bucher@laposte.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-02-23 11:15:35 +01:00
Johannes Schindelin
9c9b336c3d 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-02-23 11:05:01 +01:00
Johannes Schindelin
d9c8eca3b8 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-02-23 11:05:00 +01:00
Johannes Schindelin
a2b3ad46d3 Merge branch 'js/pull-rebase-i'
"git pull --rebase" has been extended to allow invoking
"rebase -i".

* js/pull-rebase-i:
  completion: add missing branch.*.rebase values
  remote: handle the config setting branch.*.rebase=interactive
  pull: allow interactive rebase with --rebase=interactive

Forward-port from upstream Git.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-02-23 11:04:56 +01:00
Johannes Schindelin
244e6ba72c 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-02-23 11:04:55 +01:00
Johannes Schindelin
b4cd8fb5bc Merge branch 'home-bin' 2016-02-23 11:04:55 +01:00
Johannes Schindelin
0a496c47c0 Merge branch 'conhost-git-bash' 2016-02-23 11:04:54 +01:00
Johannes Schindelin
0c9097b447 Merge branch 'bash-redirector' 2016-02-23 11:04:53 +01:00
Johannes Schindelin
7b5e5eb1a1 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-02-23 11:04:51 +01:00
Johannes Schindelin
97a317effe 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-02-23 11:04:50 +01:00
Johannes Schindelin
e381250c9f 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-02-23 11:04:48 +01:00
Johannes Schindelin
5b8f1db0cc 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-02-23 11:04:47 +01:00
Johannes Schindelin
72411ab35f Merge 'unc-alternates' into HEAD 2016-02-23 11:04:45 +01:00
Johannes Schindelin
0a35c93f3c Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-02-23 11:04:44 +01:00
Johannes Schindelin
6cc8e87c11 Merge pull request #487 from dscho/default-username
Improve the default user name & email logic
2016-02-23 11:04:43 +01:00
Johannes Schindelin
3ddc1f73c9 Merge pull request #486 from dscho/mmap-no-error
Better mmap() emulation
2016-02-23 11:04:41 +01:00
Johannes Schindelin
198918e81a 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-02-23 11:04:40 +01:00
Johannes Schindelin
9fb445ea53 Merge pull request #443 from kblees/kb/nanosecond-file-times-v2.5.3
nanosecond file times for v2.5.3
2016-02-23 11:04:39 +01:00
Johannes Schindelin
8d5f130320 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2016-02-23 11:04:39 +01:00
Johannes Schindelin
bb5ed63c9d Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2016-02-23 11:04:37 +01:00
Johannes Schindelin
49806da564 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-02-23 11:04:36 +01:00
Johannes Schindelin
84af15652c Merge pull request #159 from dscho/vagrant
Add Vagrant support (easy Linux VM setup)
2016-02-23 11:04:35 +01:00
Johannes Schindelin
dcc776258d Merge pull request #156 from kblees/kb/symlinks
Symlink support
2016-02-23 11:04:33 +01:00
Johannes Schindelin
71a0e3129f 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-02-23 11:04:33 +01:00
Johannes Schindelin
1c29e45974 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-02-23 11:04:32 +01:00
Johannes Schindelin
a5e42253ad Merge 'fix-is-exe' into HEAD 2016-02-23 11:04:31 +01:00
Johannes Schindelin
6b0d8de965 Merge 'fix-externals' into HEAD 2016-02-23 11:04:30 +01:00
Johannes Schindelin
8f64728419 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-02-23 11:04:29 +01:00
Johannes Schindelin
97449a4d1e Merge 'win-tests-fixes' into HEAD 2016-02-23 11:04:29 +01:00
Johannes Schindelin
f57e083657 Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-02-23 11:04:27 +01:00
Johannes Schindelin
d9ff0c8de9 Merge 'jberezanski/wincred-sso-r2' into HEAD 2016-02-23 11:04:25 +01:00
Johannes Schindelin
52552fe7dd Merge 'gitk' into HEAD 2016-02-23 11:04:23 +01:00
Johannes Schindelin
6ace83a27d Merge 'git-gui' into HEAD 2016-02-23 11:04:22 +01:00
Johannes Schindelin
1cf41998a4 Merge 'hide-dotgit' into HEAD 2016-02-23 11:04:21 +01:00
Johannes Schindelin
9018bb01ab Merge 'unicode' into HEAD 2016-02-23 11:04:20 +01:00