Commit Graph

46007 Commits

Author SHA1 Message Date
Stepan Kasal
5fc80b71bb Merge branch 'some-CR-fixes'
This branch contains some hacks so that Git produces less CR, and then
some tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 11:09:24 +02:00
Stepan Kasal
8746a0e5f3 Merge 'pull-rebase-interactive' into HEAD 2014-05-29 11:09:22 +02:00
Stepan Kasal
cd247ada61 Merge 'send-email' into HEAD 2014-05-29 11:09:21 +02:00
Stepan Kasal
9dd0c91441 Merge 'jberezanski/wincred-sso-r2' into HEAD 2014-05-29 11:09:19 +02:00
Stepan Kasal
146e000abe Merge 'gitweb-syntax' into HEAD 2014-05-29 11:09:18 +02:00
Stepan Kasal
83d825b573 Merge 'gitk' into HEAD 2014-05-29 11:09:16 +02:00
Stepan Kasal
900f993cb1 Merge 'git-gui' into HEAD 2014-05-29 11:09:15 +02:00
Stepan Kasal
32143d9161 Merge 'deny-current-branch' into HEAD 2014-05-29 11:09:14 +02:00
Stepan Kasal
fb0f5d14bc Merge 'criss-cross-merge' into HEAD 2014-05-29 11:09:12 +02:00
Stepan Kasal
82c8da7c74 Merge 'am-submodules' into HEAD 2014-05-29 11:09:11 +02:00
Stepan Kasal
2e69421a65 Merge 'home' into HEAD 2014-05-29 11:08:05 +02:00
Stepan Kasal
9e8817c4d0 Merge 'hide-dotgit' into HEAD 2014-05-29 10:58:53 +02:00
Stepan Kasal
dc63934ed3 Merge 'unicode' into HEAD 2014-05-29 10:58:25 +02:00
Stepan Kasal
6ac4a73cc8 Merge 'refs/rewritten/junio/notyet' into HEAD 2014-05-29 10:55:42 +02:00
Stepan Kasal
674dd13590 Merge 'refs/rewritten/junio/next' into HEAD 2014-05-29 10:55:41 +02:00
Brice Lambson
b1d0764958 MinGW: Update tests to handle a native eol of crlf
Some of the tests were written with the assumption that the native eol would
always be lf. After defining NATIVE_CRLF on MinGW, these tests began failing.
This change will update the tests to also handle a native eol of crlf.

Signed-off-by: Brice Lambson <bricelam@live.com>
2014-05-29 10:41:36 +02:00
Pat Thoyts
0caba2cacb Push the NATIVE_CRLF Makefile variable to C and added a test for native.
Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is
incorrectly set on Mingw git. However, the Makefile variable is not
propagated to the C preprocessor and results in no change. This patch
pushes the definition to the C code and adds a test to validate that
when core.eol as native is crlf, we actually normalize text files to this
line ending convention when core.autocrlf is false.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
2014-05-29 10:41:35 +02:00
Johannes Schindelin
be6a5e9151 Windows: make sure that merge-octopus only outputs LF line endings
This happens to shut up t7602 on Windows which would otherwise take
the different line endings for a sign that the merge failed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:34 +02:00
Sebastian Schuberth
4dd031659b am: Use cat instead of echo to avoid DOS line-endings (fixes t4150)
Along the lines of 05d0e3b and f33946d, use cat instead of echo to avoid
line ending mismatches in the test result of "am empty-file does not
infloop" which make the test fail.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2014-05-29 10:41:33 +02:00
Sebastian Schuberth
69d482f5a7 submodule: Fix t7400, t7405, t7406 for msysGit
Again, avoid using echo (which issues DOS line endings on msysGit) to not mix
with Unix line-endings issued by git built-ins, even if this is at the cost of
calling an external executable (cat) instead of a shell built-in (echo).
2014-05-29 10:41:32 +02:00
Johannes Schindelin
12c760097d Teach 'git remote' that the config var branch.*.rebase can be 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:28 +02:00
Johannes Schindelin
e797040bba Handle the branch.<name>.rebase value 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:27 +02:00
Johannes Schindelin
8daee9646a Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:26 +02:00
bert Dvornik
2d6fc096e4 send-email: handle Windows paths for display just like we do for processing
In git-send-email.perl, here are two checks to determine if
$smtp_server is an absolute path (so it'll be treated as a mailer) or
not (so it'll be treated as a hostname).  The one that handles actual
mail processing has been taught to recognize Windows pathnames by
commit 33b2e81f.

The other check is just to tell the user what happened, so it's far
less important, but the current state is that we will still claim to
the user that c:/foo/bar is a server. =)  This makes the second check
consistent with the first.

Signed-off-by: bert Dvornik <dvornik+git@gmail.com>
2014-05-29 10:41:22 +02:00
Erik Faye-Lund
775b1e25ae send-email: accept absolute path even on Windows
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:21 +02:00
Jakub Bereżański
fc861ab1cc wincred: handle empty username/password correctly
Empty (length 0) usernames and/or passwords, when saved in the Windows
Credential Manager, come back as null when reading the credential.

One use case for such empty credentials is with NTLM authentication, where
empty username and password instruct libcurl to authenticate using the
credentials of the currently logged-on user (single sign-on).

When locating the relevant credentials, make empty username match null.
When outputting the credentials, handle nulls correctly.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
2014-05-29 10:41:17 +02:00
Jakub Bereżański
6efbe684e2 t0302: check helper can handle empty credentials
Make sure the helper does not crash when blank username and password is
provided. If the helper can save such credentials, it should be able to
read them back.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
2014-05-29 10:41:16 +02:00
Johannes Schindelin
afcbb0fd7b gitweb (SyntaxHighlighter): interpret #l<line-number>
It is pretty convenient to refer to a line number by appending, say,
highlighter, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:12 +02:00
Johannes Schindelin
71a8b525f1 Only switch on the line number toggle when highlighting is activated
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:11 +02:00
Johannes Schindelin
f8f90e7cc0 Gitweb: add support for Alex Gorbatchev's SyntaxHighlighter in Javascript
Gitweb is not exactly what you would call server-friendly, so let's
offload one more task onto the client.

To enable this, put something like this into your gitweb_config.perl:

	$feature{'syntaxhighlighter_js'}{'default'} = [{
		url => '/SyntaxHighlighter/',
		style => 'Django',
		theme => 'FadeToGrey'
	}];

and clone git://github.com/alexgorbatchev/SyntaxHighlighter into the
directory you specified via the 'url' parameter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:10 +02:00
Johannes Schindelin
fbf2d57473 Gitweb: make line number toggling work for Firefox and Safari
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:09 +02:00
Johannes Schindelin
26eae794db gitweb: Allow line number toggling with Javascript
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:08 +02:00
Sebastian Schuberth
0543774655 gitk: Use an external icon file on Windows
Git for Windows now ships with the new Git icon from git-scm.com. Use that
icon file if it exists instead of the old procedurally drawn one.

This patch was sent upstream but so far no decision on its inclusion was
made, so commit it to our fork.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2014-05-29 10:41:04 +02:00
Chris West (Faux)
d87a841315 Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2014-05-29 10:41:02 +02:00
Johannes Schindelin
0ff04fcb46 Work around the command line limit on Windows
On Windows, there are dramatic problems when a command line grows
beyond PATH_MAX, which is restricted to 8191 characters on XP and
later (according to http://support.microsoft.com/kb/830473).

Work around this by just cutting off the command line at that length
(actually, at a space boundary) in the hope that only negative
refs are chucked: gitk will then do unnecessary work, but that is
still better than flashing the gitk window and exiting with exit
status 5 (which no Windows user is able to make sense of).

The first fix caused Tcl to fail to compile the regexp, see msysGit issue
427. Here is another fix without using regexp, and using a more relaxed
command line length limit to fix the original issue 387.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:41:01 +02:00
Johannes Schindelin
5d7351cd78 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:57 +02:00
Heiko Voigt
a93ef7bd25 git-gui: provide question helper for retry fallback on Windows
Make use of the new environment variable GIT_ASK_YESNO to support the
recently implemented fallback in case unlink, rename or rmdir fail for
files in use on Windows. The added dialog will present a yes/no question
to the the user which will currently be used by the windows compat layer
to let the user retry a failed file operation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2014-05-29 10:40:56 +02:00
Heiko Voigt
371577816e Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2014-05-29 10:40:55 +02:00
Johannes Schindelin
620d6e9a33 Let deny.currentBranch=updateInstead ignore submodules
They are not affected by the update anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:51 +02:00
Johannes Schindelin
528a03f2bc Add a few more values for receive.denyCurrentBranch
For a long time, this developer thought that Git's insistence that
pushing into the current branch is evil was completely merited.

Just for fun, the original patch tried to show people that Git is
correct to forbid that, and that it causes more trouble than it does
good when Git allows you to try to update the working tree for
fast-forwards, or to detach the HEAD, depending on some config settings.

To the developer's surprise, the opposite was shown.

So here is the support for two new options you can give the config
variable receive.denyCurrentBranch:

'updateInstead':
	Try to merge the working tree with the new tip of the branch
	(which can lead to really horrible merge conflicts).

'detachInstead':
	Detach the HEAD, thereby avoiding a disagreement between the
	HEAD and the index (as well as the working tree), possibly
	leaving the local user wondering how on earth her HEAD became
	so detached.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:50 +02:00
Johannes Sixt
552ca1b23d criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:46 +02:00
Johannes Schindelin
e897327f55 git am: ignore dirty submodules
This fixes a rebase in the presence of dirty submodules. This is
orthogonal to the application of patches changing submodules.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:43 +02:00
Johannes Schindelin
8dfd8dc634 Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:39 +02:00
Pat Thoyts
4620246f73 mingw: add tests for the hidden attribute on the git directory
With msysGit the .git directory is supposed to be hidden, unless it is
a bare git repository. Test this.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-05-29 10:40:35 +02:00
Johannes Schindelin
94519d45f3 When initializing .git/, record the current setting of core.hideDotFiles
This is on Windows only, of course.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:34 +02:00
Erik Faye-Lund
0cdb44c8ba core.hidedotfiles: hide '.git' dir by default
At least for cross-platform projects, it makes sense to hide the
files starting with a dot, as this is the behavior on Unix/MacOSX.

However, at least Eclipse has problems interpreting the hidden flag
correctly, so the default is to hide only the .git/ directory.

The config setting core.hideDotFiles therefore supports not only
'true' and 'false', but also 'dotGitOnly'.

[jes: clarified the commit message, made git init respect the setting
by marking the .git/ directory only after reading the config, and added
documentation, and rebased on top of current junio/next]

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-29 10:40:33 +02:00
Karsten Blees
cd0792afff Win32: fix segfault in WriteConsoleW when debugging in gdb
On Windows XP (not Win7), WriteConsoleW and WriteFile seem to raise and
catch SIGSEGV if the lpNumberOfCharsWritten parameter is NULL. This is not
a problem when executed standalone, but gdb stops execution here (unless
disabled via "handle SIGSEGV nostop").

Fix it by passing a dummy variable.

Signed-off-by: Karsten Blees <blees@dcon.de>
2014-05-29 10:40:30 +02:00
Karsten Blees
67934f93f5 Win32: fix broken pipe detection
As of "Win32: Thread-safe windows console output", git-log no longer
terminates when the pager process dies. This is due to disabling buffering
for the replaced stdout / stderr streams. Git-log will periodically fflush
stdout (see write_or_die.c/mayble_flush_or_die()), but with no buffering,
this is a NOP that always succeeds (so we never detect the EPIPE error).

Exchange the original console handles with our console thread pipe handles
by accessing the internal MSVCRT data structures directly (which are
exposed via __pioinfo for some reason).

Implement this with minimal assumptions about the actual data structure to
make it work with different (hopefully even future) MSVCRT versions.

While messing with internal data structures is ugly, this patch solves the
problem at the source instead of adding more workarounds. We no longer need
the special winansi_isatty override, and the limitations documented in
"Win32: Thread-safe windows console output" are gone (i.e. fdopen(1/2)
returns unbuffered streams now, and isatty() for duped console file
descriptors works as expected).

Signed-off-by: Karsten Blees <blees@dcon.de>
2014-05-29 10:40:28 +02:00
Karsten Blees
94948aa6dc Win32: fix detection of empty directories in is_dir_empty
On Windows XP (not Win7), directories cannot be deleted while a find handle
is open, causing "Deletion of directory '...' failed. Should I try again?"
prompts.

Prior to 19d1e75d "Win32: Unicode file name support (except dirent)",
these failures were silently ignored due to strbuf_free in is_dir_empty
resetting GetLastError to ERROR_SUCCESS.

Close the find handle in is_dir_empty so that git doesn't block deletion
of the directory even after all other applications have released it.

Reported-by: John Chen <john0312@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
2014-05-29 10:40:27 +02:00
Karsten Blees
80e6f0f8be Win32: patch Windows environment on startup
Fix Windows specific environment settings on startup rather than checking
for special values on every getenv call.

As a side effect, this makes the patched environment (i.e. with properly
initialized TMPDIR and TERM) available to child processes.

Signed-off-by: Karsten Blees <blees@dcon.de>
2014-05-29 10:40:26 +02:00