Commit Graph

53272 Commits

Author SHA1 Message Date
Johannes Schindelin
04c882d9df Merge 'jberezanski/wincred-sso-r2' into HEAD 2015-09-18 15:11:54 +02:00
Johannes Schindelin
45f8b76bde Merge 'gitk' into HEAD 2015-09-18 15:11:53 +02:00
Johannes Schindelin
d8382c4e0f Merge 'git-gui' into HEAD 2015-09-18 15:11:52 +02:00
Johannes Schindelin
7a5ef4b2e0 Merge 'criss-cross-merge' into HEAD 2015-09-18 15:11:51 +02:00
Johannes Schindelin
5c3f081649 Merge 'hide-dotgit' into HEAD 2015-09-18 15:11:50 +02:00
Johannes Schindelin
22f179304b Merge 'unicode' into HEAD 2015-09-18 15:11:49 +02:00
Jakub Bereżański
cda15477d6 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>
2015-09-18 15:08:47 +02:00
Jakub Bereżański
21311208e2 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>
2015-09-18 15:08:46 +02:00
Sebastian Schuberth
ff0dcfb4e0 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>
2015-09-18 15:08:44 +02:00
Chris West (Faux)
72157edf37 Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2015-09-18 15:08:43 +02:00
Johannes Schindelin
71c279dcea 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>
2015-09-18 15:08:42 +02:00
Johannes Schindelin
249d9d39a8 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:08:39 +02:00
Heiko Voigt
0a85c57e80 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>
2015-09-18 15:08:38 +02:00
Heiko Voigt
a0939c17a3 Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2015-09-18 15:08:38 +02:00
Johannes Sixt
85a58f0a32 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:08:35 +02:00
Pat Thoyts
3fd350ca44 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>
2015-09-18 15:08:32 +02:00
Johannes Schindelin
678bd25545 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>
2015-09-18 15:08:31 +02:00
Erik Faye-Lund
d1d80725c4 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>
2015-09-18 15:08:30 +02:00
Karsten Blees
c53e49c0e0 git-gui:handle the encoding of Git's output correctly
If we use 'eval exec $opt $cmdp $args' to execute git command,
tcl engine will convert the output of the git comand with the rule
system default code page to unicode.

But cp936 -> unicode conversion implicitly done by exec is not reversible.
So we have to use git_read instead.

Bug report and an original reproducer by Cloud Chou:
https://github.com/msysgit/git/issues/302

Karsten Blees writes this code patch.
Cloud Chou find the reason of the bug.

Thanks-to: dscho
Thanks-to: patthoyts
Signed-off-by: Karsten Blees <blees@dcon.de>
Original-test-by: Cloud Chou <515312382@qq.com>
Signed-off-by: Cloud Chou <515312382@qq.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-18 15:08:27 +02:00
Karsten Blees
d338c68131 Unicode file name support (gitk and git-gui)
Assumes file names in git tree objects are UTF-8 encoded.

On most unix systems, the system encoding (and thus the TCL system
encoding) will be UTF-8, so file names will be displayed correctly.

On Windows, it is impossible to set the system encoding to UTF-8. Changing
the TCL system encoding (via 'encoding system ...', e.g. in the startup
code) is explicitly discouraged by the TCL docs.

Change gitk and git-gui functions dealing with file names to always convert
from and to UTF-8.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-09-18 15:08:26 +02:00
Johannes Schindelin
043706fe9f Start the merging-rebase to v2.5.3
This commit starts the rebase of 338406f to fadef2f
2015-09-18 15:08:23 +02:00
Junio C Hamano
ee6ad5f4d5 Git 2.5.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.5.3
2015-09-17 12:16:17 -07:00
Junio C Hamano
8833ccd7d0 Merge branch 'dt/untracked-subdir' into maint
The experimental untracked-cache feature were buggy when paths with
a few levels of subdirectories are involved.

* dt/untracked-subdir:
  untracked cache: fix entry invalidation
  untracked-cache: fix subdirectory handling
  t7063: use --force-untracked-cache to speed up a bit
  untracked-cache: support sparse checkout
2015-09-17 12:12:29 -07:00
Junio C Hamano
d6579d9436 Merge branch 'br/svn-doc-include-paths-config' into maint
* br/svn-doc-include-paths-config:
  git-svn doc: mention "svn-remote.<name>.include-paths"
2015-09-17 12:11:46 -07:00
Junio C Hamano
cfc3e0ee4a Merge branch 'ah/submodule-typofix-in-error' into maint
Error string fix.

* ah/submodule-typofix-in-error:
  git-submodule: remove extraneous space from error message
2015-09-17 12:11:08 -07:00
Junio C Hamano
02dad2673b Merge branch 'js/maint-am-skip-performance-regression' into maint
* js/maint-am-skip-performance-regression:
  am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
2015-09-17 12:03:02 -07:00
Johannes Schindelin
0c51399ed6 Merge pull request #305 from dscho/msysgit_issues_182
Allow `add -p` and `add -i` with a large number of files
2015-09-12 13:44:10 +02:00
Johannes Schindelin
5049df366a t3701: verify that we can add *lots* of files interactively
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-12 11:36:31 +00:00
Kelly Heller
1834d85115 Allow add -p and add -i with a large number of files
This fixes https://github.com/msysgit/git/issues/182.

Inspired by Pull Request 218 using code from @PhilipDavis.

[jes: simplified code quite a bit]

Signed-off-by: Kelly Heller <kkheller@cedrus.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-12 11:36:00 +00:00
Johannes Schindelin
6f82752590 fixup! mingw: clean up the Git wrapper a bit
This fixes https://github.com/git-for-windows/git/issues/376

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-11 10:14:24 +02:00
Johannes Schindelin
e1c45a0965 fixup! mingw: clean up the Git wrapper a bit 2015-09-10 17:03:22 +00:00
Johannes Schindelin
ed73117950 Merge branch 'bash-redirector' 2015-09-10 18:34:24 +02:00
Johannes Schindelin
4ab44321ce am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
This is a backport of the corresponding patch to the builtin am in 2.6:
3ecc704 (am --skip/--abort: merge HEAD/ORIG_HEAD tree into index,
2015-08-19).

Reportedly, it can make a huge difference on Windows, in one case a `git
rebase --skip` took 1m40s without, and 5s with, this patch.

Reported-and-suggested-by: Kim Gybels <kim.gybels@engilico.com>
Original report: https://github.com/git-for-windows/git/issues/365
Acked-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:24 +02:00
Johannes Schindelin
0ff238555e mingw: let the Git wrapper determine the top-level directory
The Git wrapper is also used as a redirector for Git for Windows'
bin\bash.exe dropin: for backwards-compatibility, bin\bash.exe exists
and simply sets up the environment variables before executing the
*real* bash.

However, due to our logic to use the directory in which the `.exe`
lives as top-level directory (or one directory below for certain, known
basenames such as `git.exe` and `gitk.exe`), the `PATH` environment
variable was prefixed with the `/bin/bin` and `/bin/mingw/bin`
directories -- which makes no sense.

Instead, let's just auto-detect the top-level directory in the common
case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:24 +02:00
Johannes Schindelin
17d76759c3 Merge pull request #286 from dscho/unc-alternates
Make alternates work on UNC paths
2015-09-10 18:34:24 +02:00
Johannes Schindelin
bed42cc575 mingw: clean up the Git wrapper a bit
We should not conflate the 'exepath' with the 'top-level
directory'. The former should be the directory in which the executable
lives while the latter should be the top-level directory ("POSIX root
directory") as far as Git is concerned.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:23 +02:00
Johannes Schindelin
496b91e8d9 Merge branch 'issue-231'
This branch hopefully addresses

	https://github.com/git-for-windows/git/issues/231

where `git repack` could not delete the object directory because there
was still an open handle on it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:23 +02:00
Johannes Schindelin
ac9fa963d8 mingw: support UNC alternates
Just like we support having alternates pointing to different drives, we
want to support alternates pointing to network shares, i.e. UNC paths.

Technically, what we do in this patch is not to support UNC alternates,
but to support UNC paths when normalizing paths. But the latter implies
the former, and the former really was the motivation for this patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:23 +02:00
Johannes Schindelin
c4dec7a329 Merge pull request #275 from cs96and/cygwin_fixes
winansi.c: Fix colourization on Cygwin pseudo terminals.
2015-09-10 18:34:23 +02:00
Johannes Sixt
e14f54b98a prune: close directory earlier during loose-object directory traversal
27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)
introduced a new function for_each_loose_file_in_objdir() with a helper
for_each_file_in_obj_subdir(). The latter calls callbacks for each file
found during a directory traversal and finally also a callback for the
directory itself.

git-prune uses the function to clean up the object directory. In
particular, in the directory callback it calls rmdir(). On Windows XP,
this rmdir call fails, because the directory is still open while the
callback is called. Close the directory before calling the callback.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:22 +02:00
Johannes Schindelin
52faf766e3 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>
2015-09-10 18:34:22 +02:00
Alan Davies
4b76e24533 winansi.c: Fix colourization on Cygwin pseudo terminals.
Git only colours the output and uses pagination if isatty() returns 1.
MSys and Cygwin emulate pseudo terminals via named pipes, meaning that
isatty() returns 0.

Commit 3adef8de55 fixed this for MSys
terminals, but not Cygwin.

The named pipes that Cygwin and Msys use are very similar.  MSys PTY pipes
are called 'msys-*-pty*' and Cygwin uses 'cygwin-*-pty*'.  This commit
modifies the existing check to allow both MSys and Cygwin PTY pipes to be
identified as TTYs.

Note that Pagination is still broken on Cygwin.  less.exe is spawned (as
seen in Process Explorer and using GIT_TRACE=1), but the output is not
being piped into it.

This partially fixes https://github.com/git-for-windows/git/issues/267

Signed-off-by: Alan Davies <alan.n.davies@gmail.com>
2015-09-10 18:34:22 +02:00
Johannes Schindelin
0fed13cfd9 Merge pull request #276 from dscho/issue-0xff
mingw: Suppress warning that <commit>:.gitattributes does not exist
2015-09-10 18:34:22 +02:00
Johannes Schindelin
1fffa7dcf0 git-wrapper: also allow setting the application ID
Windows 7 allows users to pin running applications to the task bar. By
setting the application ID, multiple processes can share a single task
bar entry, and this is exactly what we need for `git-bash.exe` which
wants to share the task bar entry with the `mintty.exe` instance it
launches.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:22 +02:00
Johannes Schindelin
6e3b996efa Merge pull request #200 from dscho/code-of-conduct
Add a brief "code of conduct" section to the Governance Model
2015-09-10 18:34:21 +02:00
Johannes Schindelin
2d040d72df mingw: Suppress warning that <commit>:.gitattributes does not exist
On Windows, a file name containing a colon is illegal. We should
therefore expect the corresponding errno when `fopen()` is called for a
path of the form <commit>:.gitattributes.

This fixes https://github.com/git-for-windows/git/issues/255.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:21 +02:00
Johannes Schindelin
c6ae57cc35 Work around MinGW-w64 erroneously claiming to have flockfile()
The _POSIX_THREAD_SAFE_FUNCTIONS constant is supposed to be defined only
if flockfile() and friends are available. MinGW-w64 defines that
constant, but the functions are not available. Work around that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-09-10 18:34:21 +02:00
Johannes Schindelin
3076e3b666 Merge pull request #246 from uecasm/patch-1
Verify memoized files can be reloaded before using them
2015-09-10 18:34:21 +02:00
Johannes Schindelin
1d5bf71dac 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>
2015-09-10 18:34:21 +02:00
Johannes Schindelin
fbfff43f78 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>
2015-09-10 18:34:20 +02:00