Commit Graph

49603 Commits

Author SHA1 Message Date
Johannes Schindelin
ba20c83cfc squash! Revert "mingw: Work around MSVCRT's isatty() not knowing about MSys2"
Replace commit subject with:

fixup! mingw: Work around MSVCRT's isatty() not knowing about MSys2

to remind myself to drop that patch.
2015-04-22 09:27:02 +01:00
Johannes Schindelin
ce5ca1f9bb fixup! mingw: make isatty() recognize MSys pseudo terminals (/dev/pty*) 2015-04-22 09:26:24 +01:00
Karsten Blees
7d57fb4511 mingw: make isatty() recognize MSys pseudo terminals (/dev/pty*)
MSys2 emulates pseudo terminals via named pipes, and isatty() returns 0
for such file descriptors. Therefore, some interactive functionality (such
as launching a pager, asking if a failed unlink should be repeated etc.)
doesn't work when run in a terminal emulator that uses MSys ptys (such as
mintty).

However, MSys uses special names for its pty pipes ('msys-*-pty*'), which
allows us to distinguish them from normal piped input / output.

On startup, check if stdin / stdout / stderr are connected to such pipes
using the NtQueryObject API from NTDll.dll. If the names match, adjust the
flags in MSVCRT's ioinfo structure accordingly.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-20 19:24:29 +02:00
Johannes Schindelin
22a888ee66 Revert "mingw: Work around MSVCRT's isatty() not knowing about MSys2"
This reverts commit 04cde2429a.

The MSYS_TTY_HANDLES trick doesn't work in a second shell window.

Additionally, #undef'ing 'isatty()' at the top of mingw.c breaks yes / no
questions (ask_yes_no_if_possible()) and probably other uses of isatty()
in mingw.c.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-20 18:51:52 +02:00
dscho
ca15bb6c0b Merge pull request #98 from nalla/stdout-unbuffered
mingw: explicitly `fflush` stdout
2015-04-16 17:05:50 +02:00
nalla
c1c0e75123 mingw: explicitly fflush stdout
For performance reasons `stdout` is not unbuffered by default. That leads
to problems if after printing to `stdout` a read on `stdin` is performed.

For that reason interactive commands like `git clean -i` do not function
properly anymore if the `stdout` is not flushed by `fflush(stdout)` before
trying to read from `stdin`.

In the case of `git clean -i` all reads on `stdin` were preceded by a
`fflush(stdout)` call.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-16 13:09:16 +01:00
dscho
4213cee7a8 Merge pull request #95 from vitalyster/wcsicmp
git-wrapper: case-insensitive path comparison
2015-04-15 15:16:34 +02:00
Vitaly Takmazov
c1904dbee2 git-wrapper: case-insensitive path comparison 2015-04-15 15:18:14 +03:00
dscho
018d3a642c Merge pull request #93 from nalla/asciidoctor-fixes
Asciidoctor fixes
2015-04-15 11:26:09 +02:00
nalla
fa3bbfd839 asciidoctor: Fix giteveryday.txt to be built with asciidoctor.
When building the `doc` with `asciidoctor`, `asciidoctor` complains about
a nested code block in a callout list. This is a really dirty solution to
restore the callout list to function properly. There is a minimal visual
sideeffect; the *immitated* codeblock has no overall greyish background.
Instead the individual lines have it.

Note: When building this patch with `asciidoc` the background is totally
gone but the font is still monospaced.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-15 08:24:52 +01:00
nalla
1fdff65565 asciidoctor: Fix user-manual to be built by asciidoctor
The `user-manual.txt` ist designed as a `book` but the `Makefile` wants to
build it as an `article`. This seems to be a problem when building the
documentation with `asciidoctor`. Furthermore the parts *Git Glossary*
and *Apendix B* had no subsections which is not allowed when building with
`asciidoctor`. So lets add a *dummy* section.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-15 07:54:39 +01:00
Johannes Schindelin
27c85de082 Merge pull request #73 from kblees/kb/environment-fixes
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-10 02:58:19 +01:00
Johannes Schindelin
2f464fb92a fixup! gettext: always use UTF-8 on native Windows
Whoops... style fix.
2015-04-10 02:03:56 +01:00
Johannes Schindelin
9e6ddd0b5f squash! gettext: always use UTF-8 on native Windows
In this developers' setup, HAVE_LIBCHARSET_H is apparently defined, but
we *really* want to override the locale_charset() here.

Reminder: at the next merging rebase, fix the ACP typo as requested by
Karsten.
2015-04-10 00:40:01 +01:00
Karsten Blees
d4e943c8e7 git-wrapper: remove redundant TERM initialization
Remove redundant TERM initialization from git-wrapper in favor of TERM
initialization in git itself.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-09 23:30:29 +01:00
Karsten Blees
a95753b365 mingw: initialize HOME on startup
HOME initialization was historically duplicated in many different places,
including /etc/profile, launch scripts such as git-bash.vbs and gitk.cmd,
and (although slightly broken) in the git-wrapper.

Even unrelated projects such as GitExtensions and TortoiseGit need to
implement the same logic to be able to call git directly.

Initialize HOME in git's own startup code so that we can eventually retire
all the duplicate initialization code.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-09 23:30:23 +01:00
Karsten Blees
0d6d6731a3 mingw: move MSys2 specific environment tweaks to setup_windows_environment
Lets keep the environment initialization and conversion section as lean as
possible and move recently added tweaks to setup_windows_environment().

This fixes the following potential problems:

 * Prevent duplicate TZ variables if both TZ and MSYS2_TZ are set.
 * Some of the higher level x* APIs from wrapper.c require a working
   getenv(), using e.g. xstrdup() during initialization is dangerous.
 * Slashifying the Windows TMP variable may break native Windows programs,
   use POSIX TMPDIR instead.
 * Properly slashify TMPDIR even if it is already set, and also if we only
   have TEMP, but not TMP.
 * Reduce complexity from O(n) to O(log n).

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-09 23:30:17 +01:00
Karsten Blees
e678595d67 mingw: factor out Windows specific environment setup
Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-09 23:30:05 +01:00
Karsten Blees
d6271ce991 git-wrapper: fix HOME initialization
git-wrapper fails to initialize HOME correctly if $HOMEDRIVE$HOMEPATH
points to a disconnected network drive.

Check if the directory exists before using $HOMEDRIVE$HOMEPATH.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-09 23:29:52 +01:00
dscho
d8467171eb Merge pull request #83 from kblees/kb/gettext-encoding
gettext: always use UTF-8 on native Windows
2015-04-09 17:35:30 +02:00
Karsten Blees
d3b9944e10 gettext: always use UTF-8 on native Windows
Git on native Windows exclusively uses UTF-8 for console output (both with
mintty and native console windows). Gettext uses setlocale() to determine
the output encoding for translated text, however, MSVCRT's setlocale()
doesn't support UTF-8. As a result, translated text is encoded in system
encoding (GetAPC()), and non-ASCII chars are mangled in console output.

Use gettext's bind_textdomain_codeset() to force the encoding to UTF-8 on
native Windows.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-04-09 16:19:56 +01:00
Johannes Schindelin
ebc298daac squash! mingw: HOT FIX: work around environment issues -- again
cURL actually uses "cp" + GetACP():
https://github.com/bagder/curl/blob/aa5808b5/lib/easy.c#L157-L162
2015-04-07 14:48:32 +02:00
Johannes Schindelin
8d76720583 squash! mingw: HOT FIX: work around environment issues -- again
Add the following clarifier with the next merging rebase:

Note: cURL manages to set the variable CHARSET when nedmalloc is *not*
enabled, without causing an access violation. In that case, it sets it
successfully to the value "cp1252" (hence it is our choice, too, cURL may
need it, Git does not).
2015-04-07 14:28:53 +02:00
Johannes Schindelin
5ccd51f85e mingw: HOT FIX: work around environment issues -- again
This developer should really, really have known better. The fact that we
are changing the environment in ways for which the MSVCRT is not
prepared for is bad enough. But then this developer followed the request
to re-enable nedmalloc -- despite the prediction that it would cause an
access violation, predicting it in the same message as the request to
re-enable nedmalloc, no less!

To paper over the issue until the time when this developer finds the
time to re-design the Unicode environment handling from scratch, let's
hope that cURL is the only library we are using that *may* set an
environment variable using MSVCRT's putenv() after we fscked the
environment up.

Note: this commit can serve as no source of pride to anyone, certainly
not yours truly. It is necessary as a quick and pragmatic stop gap,
though, to prevent worse problems.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-07 10:24:55 +01:00
Johannes Schindelin
57900198bd git-gui (MinGW): make use of MSys2's msgfmt
When Git for Windows was still based on MSys1, we had no gettext, ergo
no msgfmt, either. Therefore, we introduced a small and simple Tcl
script to perform the same task.

However, with MSys2, we no longer need that because we have a proper
msgfmt executable. Plus, the po2msg.sh script somehow manages to hang
when run in parallel.

Two reasons to use real msgfmt.exe instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-06 14:34:59 +01:00
Johannes Schindelin
0160e8e2a1 git-wrapper: interpret --cd=<directory> when configured via resources
This change accompanies the `--no-cd` option when configured via
resources. It is required to support `Git Bash Here`: when
right-clicking an icon in the Explorer to start a Bash, the working
directory is actually the directory that is displayed in the Explorer.
That means if the clicked icon actually refers to a directory, the
working directory would be its *parent* directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-06 12:53:27 +01:00
Johannes Schindelin
0defb66cf4 Avoid illegal filenames when building Documentation on NTFS
A '+' is not a valid part of a filename with Windows file systems (it is
reserved because the '+' operator meant file concatenation back in the
DOS days).

Let's just not use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-06 12:53:25 +01:00
Johannes Schindelin
3b36eb3b22 squash! config.mak.uname: support MSys2
Make sure that the nedmalloc patch is applied before.
2015-04-03 20:03:51 +01:00
Johannes Schindelin
7d549c0382 fixup! mingw: uglify pthread_mutex_init definition to shut up warning 2015-04-03 20:01:19 +01:00
Johannes Schindelin
186a915275 mingw: allow compiling with MSys2's compiler
With MSys2's GCC, `ReadWriteBarrier` is already defined, and FORCEINLINE
unfortunately gets defined incorrectly.

Let's work around both problems, using the MSys2-specific
__MINGW64_VERSION_MAJOR constant to guard them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-03 20:00:02 +01:00
Johannes Schindelin
df5092509f squash! git-wrapper: serve as git-gui.exe, too
To avoid confusion with builtins, we need to move the code block
handling gitk (and now git-gui, too) to intercept before git-gui is
mistaken for a builtin.

Unfortunately, git-gui is in libexec/git-core/ while gitk is in bin/,
therefore we need slightly more adjustments than just moving and
augmenting the gitk case.
2015-04-03 11:55:42 +01:00
Johannes Schindelin
9a5c96c2ed squash! git-wrapper: support git.exe to be in a spaced dir
... and `gitk.exe`, too...
2015-04-02 16:37:51 +01:00
Johannes Schindelin
3c5faa8885 Merge branch 'git-gui-wrapper'
This commit needs to be moved into the 'git-wrapper' branch with the
next merging rebase.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-02 11:29:07 +01:00
Johannes Schindelin
b351a65cbc git-wrapper: serve as git-gui.exe, too
To avoid that ugly Console window when calling \cmd\git.exe gui...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-02 11:23:34 +01:00
Johannes Schindelin
fa34d4d1b3 fixup! config.mak.uname: support MSys2 2015-04-01 13:34:31 +01:00
Johannes Schindelin
4d0cd24332 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>
2015-04-01 10:03:56 +01:00
Johannes Schindelin
cb87df80f4 Merge 'poll_inftim' into HEAD
This was originally 'pull request #330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 10:03:53 +01:00
Johannes Schindelin
51aaa88b77 Merge 'non-win-fixes' into HEAD 2015-04-01 10:03:51 +01:00
Johannes Schindelin
d897a6528a Merge 'taskkill' into HEAD
git-gui/gitk: Do not use a Cygwin-specific kill flag on Windows

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 10:00:47 +01:00
Johannes Schindelin
f77a0e62ad Merge 'long-paths' into HEAD
This works around path length limitations by using the \\?\* trick.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 10:00:06 +01:00
Johannes Schindelin
f786037078 Merge 'fscache' into HEAD
This brings considerable speed-ups to Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 09:59:35 +01:00
Johannes Schindelin
a2ff733c6d 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>
2015-04-01 09:55:29 +01:00
Johannes Schindelin
46d7b0eab9 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 09:55:06 +01:00
Johannes Schindelin
8898d56b26 Merge 'fix-is-exe' into HEAD 2015-04-01 09:55:03 +01:00
Johannes Schindelin
a62c7e3908 Merge 'fix-externals' into HEAD 2015-04-01 09:55:01 +01:00
Johannes Schindelin
8858018e01 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>
2015-04-01 09:54:59 +01:00
Johannes Schindelin
fd48988184 Merge 'win-tests-fixes' into HEAD 2015-04-01 09:54:57 +01:00
Johannes Schindelin
f676df393d Merge 'msys2' into HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 09:54:14 +01:00
Johannes Schindelin
0b3c6a1822 Merge 'pull-rebase-interactive' into HEAD 2015-04-01 09:54:11 +01:00
Johannes Schindelin
c10078288f Merge 'jberezanski/wincred-sso-r2' into HEAD 2015-04-01 09:54:10 +01:00