Commit Graph

43672 Commits

Author SHA1 Message Date
Jakub Bereżański
3c8cbb4edc 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>
2013-12-29 19:17:58 -06:00
Jakub Bereżański
10c1fbee71 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>
2013-12-29 19:17:58 -06:00
Johannes Schindelin
ccf398bf3f Start the merging-rebase to v1.8.5.2
This commit starts the rebase of 04deb9e to b684000
2013-12-29 19:17:47 -06:00
Johannes Schindelin
5e4a59bb78 Merge 'unlimited-grafts' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
2ca0702d7e Merge 'poll-busy-wait' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
3b23ed706a Merge 'normalize-win-paths' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
2579131837 Merge 'msvc-link-crt' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
543d32434b Merge 'install-wincred' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
87aa0f06fd Merge 'fix-is-exe' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
7b42a55fe7 Merge 'fix-externals' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
3d87967789 Merge 'stash-reflog' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
09f648cd7c Merge 'http-msys-paths' into HEAD 2013-12-27 18:09:43 -06:00
Johannes Schindelin
a5b0843e5f 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>
2013-12-27 18:09:43 -06:00
Johannes Schindelin
38fd197d28 Merge 'win-tests-fixes' into HEAD 2013-12-27 18:09:42 -06:00
Johannes Schindelin
c149701fd4 Merge 'grep-fixes' into HEAD 2013-12-27 18:09:42 -06:00
Johannes Schindelin
d562b59a22 Merge 'pull-rebase-interactive' into HEAD 2013-12-27 18:09:42 -06:00
Johannes Schindelin
343fea4042 Teach 'git remote' that the config var branch.*.rebase can be 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:09:37 -06:00
Johannes Schindelin
9e62257790 Handle the branch.<name>.rebase value 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:09:37 -06:00
Johannes Schindelin
f557f6771d Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:09:37 -06:00
Johannes Schindelin
609484f9eb Disable t0110's high-bit test on Windows
The bash Git for Windows uses (i.e. the MSys bash) cannot pass
command-line arguments with high bits set verbatim to non-MSys programs,
but instead converts those characters with high bits set to their hex
representation.

For example, when running

	strings "$(echo -e '\x80')"

(where strings.exe is a MinGW program, not an MSys one) it will complain
about not finding the file called "80".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:02:54 -06:00
Brice Lambson
d1e14dd7b9 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>
2013-12-27 18:02:53 -06:00
Pat Thoyts
4eae745fcf 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>
2013-12-27 18:02:52 -06:00
Pat Thoyts
59a30f38a3 t9902: mingw-specific fix for gitfile link files
The path in a .git platform independent link file needs to be absolute
and under mingw we need it to be a windows type path, not a unix style
path so it should start with a drive letter and not a /.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-12-27 18:02:51 -06:00
Karsten Blees
2d52168a4b t800[12]: work around MSys limitation
MSys works very hard to convert Unix-style paths into DOS-style ones.
*Very* hard.

So hard, indeed, that

	git blame -L/hello/,/green/

is translated into something like

	git blame -LC:/msysgit/hello/,C:/msysgit/green/

As seen in msys_p2w in src\msys\msys\rt\src\winsup\cygwin\path.cc, line
3204ff:

	case '-':
	  //
	  // here we check for POSIX paths as attributes to a POSIX switch.
	  //
	...

seemingly absolute POSIX paths in single-letter options get expanded by
msys.dll unless they contain '=' or ';'.

So a quick and very dirty fix is to use '-L/;*evil/'. (Using an equal sign
works only when it is before a comma, so in the above example, /=*green/
would still be converted to a DOS-style path.)

Commit-message-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 18:02:50 -06:00
Johannes Schindelin
0b93eb3da7 Remove the line length limit for graft files
Support for grafts predates Git's strbuf, and hence it is understandable
that there was a hard-coded line length limit of 1023 characters (which
was chosen a bit awkwardly, given that it is *exactly* one byte short of
aligning with the 41 bytes occupied by a commit name and the following
space or new-line character).

While regular commit histories hardly win comprehensibility in general
if they merge more than twenty-two branches in one go, only a lack of
imagination could explain this unnecessary limitation for general use
cases: the grafts facility *was* introduced to override regular commit
histories.

In this particular developer's case, the use case that requires
substantially longer graft lines to be supported is the visualization of
the commits' order implied by their changes: commits are considered to
have an implicit relationship iff exchanging them in an interactive
rebase would result in merge conflicts.

Thusly implied branches tend to be very shallow in general, and the
resulting thicket of implied branches is usually very wide; It is
actually quite common that *most* of the commits in a topic branch have
not even one implied parents, so that a final merge commit has about as
many implied parents as there are commits in said branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 10:18:36 -06:00
Adam Roben
b09deaa0aa Make non-.exe externals work again
7ebac8cb94 made launching of .exe
externals work when installed in Unicode paths. But it broke launching
of non-.exe externals, no matter where they were installed. We now
correctly maintain the UTF-8 and UTF-16 paths in tandem in lookup_prog.

This fixes t5526, among others.

Signed-off-by: Adam Roben <adam@roben.org>
2013-12-27 10:17:12 -06:00
Adam Roben
a781e47db3 Fix launching of externals from Unicode paths
If Git were installed in a path containing non-ASCII characters,
commands such as git-am and git-submodule, which are implemented as
externals, would fail to launch with the following error:

> fatal: 'am' appears to be a git command, but we were not
> able to execute it. Maybe git-am is broken?

This was due to lookup_prog not being Unicode-aware. It was somehow
missed in 2ee5a1a14a.

Note that the only problem in this function was calling
GetFileAttributes instead of GetFileAttributesW. The calls to access()
were fine because access() is a macro which resolves to mingw_access,
which already handles Unicode correctly. But I changed lookup_prog to
use _waccess directly so that we only convert the path to UTF-16 once.

Signed-off-by: Adam Roben <adam@roben.org>
2013-12-27 10:17:12 -06:00
Evgeny Pashkin
6f399b0e21 Fixed wrong path delimiter in exe finding
On Windows XP3 in git bash
git clone git@github.com:octocat/Spoon-Knife.git
cd Spoon-Knife
git gui
menu Remote\Fetch from\origin
error: cannot spawn git: No such file or directory
error: could not run rev-list

if u run
git fetch --all
it worked normal in git bash or gitgui tools

In second version CreateProcess get 'C:\Git\libexec\git-core/git.exe' in
first version - C:/Git/libexec/git-core/git.exe and not executes (unix
slashes)

after fixing C:\Git\libexec\git-core\git.exe or
C:/Git/libexec/git-core\git.exe it works normal

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 10:17:11 -06:00
Johannes Schindelin
6d13ea2f8c Merge 'send-email' into HEAD 2013-12-27 10:15:38 -06:00
Johannes Schindelin
d56518eb96 Merge 'jberezanski/wincred-sso-r2' into HEAD 2013-12-27 10:15:38 -06:00
Johannes Schindelin
2c2e61445d Merge 'gitweb-syntax' into HEAD 2013-12-27 10:15:38 -06:00
Johannes Schindelin
378395f0c9 Merge 'gitk' into HEAD 2013-12-27 10:15:37 -06:00
Johannes Schindelin
3e7696ad78 Merge 'git-gui' into HEAD 2013-12-27 10:15:37 -06:00
Johannes Schindelin
0ec714e2b3 Merge 'deny-current-branch' into HEAD 2013-12-27 10:15:37 -06:00
Johannes Schindelin
d1e2d00835 Merge 'criss-cross-merge' into HEAD 2013-12-27 10:15:36 -06:00
Johannes Schindelin
2861cca392 Merge 'am-submodules' into HEAD 2013-12-27 10:15:36 -06:00
Johannes Schindelin
81787f1563 Merge 'unc' into HEAD 2013-12-27 10:15:36 -06:00
Johannes Schindelin
3652c337a3 Merge 'home' into HEAD 2013-12-27 10:15:35 -06:00
Johannes Schindelin
3cea76a597 Merge 'hide-dotgit' into HEAD 2013-12-27 10:15:35 -06:00
Johannes Schindelin
b1e61f22aa Merge 'unicode' into HEAD 2013-12-27 10:15:22 -06:00
Eric Sunshine
31609d017f Make mingw_offset_1st_component() behave consistently for all paths.
mingw_offset_1st_component() returns "foo" for inputs "/foo" and
"c:/foo", but inconsistently returns "/foo" for UNC input
"/machine/share/foo".  Fix it to return "foo" for all cases.

Reference: http://groups.google.com/group/msysgit/browse_thread/thread/c0af578549b5dda0

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 10:05:01 -06:00
Johannes Schindelin
fba8882696 Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 10:05:00 -06:00
Cezary Zawadka
313ed0f44d Allow using UNC path for git repository
[efl: moved MinGW-specific part to compat/]

[jes: fixed compilation on non-Windows]

Signed-off-by: Cezary Zawadka <czawadka@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-27 10:05:00 -06:00
Pat Thoyts
37471904e9 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>
2013-12-27 10:04:57 -06:00
Johannes Schindelin
fc67a8e263 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>
2013-12-27 10:04:57 -06:00
Erik Faye-Lund
87ba51ce4e 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>
2013-12-27 10:04:57 -06:00
Karsten Blees
215532a2ca 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>
2013-12-27 10:04:56 -06:00
Karsten Blees
de46432724 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>
2013-12-27 10:04:56 -06:00
Karsten Blees
609d83243d 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>
2013-12-27 10:04:56 -06:00
Karsten Blees
87b4e46381 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>
2013-12-27 10:04:56 -06:00