Commit Graph

49593 Commits

Author SHA1 Message Date
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
Johannes Schindelin
a734aee4bc Merge 'gitk' into HEAD 2015-04-01 09:54:08 +01:00
Johannes Schindelin
2f1d6d2fb2 Merge 'git-gui' into HEAD 2015-04-01 09:54:06 +01:00
Johannes Schindelin
658804380a Merge 'criss-cross-merge' into HEAD 2015-04-01 09:54:04 +01:00
Johannes Schindelin
b6eef3094d Merge 'am-submodules' into HEAD 2015-04-01 09:54:03 +01:00
Johannes Schindelin
93e43168f7 Merge 'hide-dotgit' into HEAD 2015-04-01 09:54:01 +01:00
Johannes Schindelin
5b609d68a9 Merge 'unicode' into HEAD 2015-04-01 09:53:59 +01:00
nalla
70f2dac5d0 git-wrapper: support git.exe to be in a spaced dir
When *Git for Windows* is installed into a directory that has spaces in
it, e.g. `C:\Program Files\Git`, the `git-wrapper` appends this directory
unquoted when fixing up the command line. To resolve this, just quote the
provided `execpath`.

Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-01 09:53:55 +01:00
nalla
2baaa5f5d3 mingw: Support git_terminal_prompt with more terminals
The `git_terminal_prompt()` function expects the terminal window to be
attached to a Win32 Console. However, this is not the case with terminal
windows other than `cmd.exe`'s, e.g. with MSys2's own `mintty`.

Non-cmd terminals such as `mintty` still have to have a Win32 Console
to be proper console programs, but have to hide the Win32 Console to
be able to provide more flexibility (such as being resizeable not only
vertically but also horizontally). By writing to that Win32 Console,
`git_terminal_prompt()` manages only to send the prompt to nowhere and
to wait for input from a Console to which the user has no access.

This commit introduces a function specifically to support `mintty` -- or
other terminals that are compatible with MSys2's `/dev/tty` emulation. We
use the `TERM` environment variable as an indicator for that: if the value
starts with "xterm" (such as `mintty`'s "xterm_256color"), we prefer to
let `xterm_prompt()` handle the user interaction.

To handle the case when standard input/output are redirected – as is the
case when pushing via HTTPS: `git-remote-https`' standard input and
output are pipes from/to the main Git executable – we make use of the
`MSYS_TTY_HANDLES` environment variable that was introduced to
fix another bug in MSys2-based Git: this environment variable contains
the Win32 `HANDLE`s of the standard input, output and error as originally
passed from MSys2 to the Git executable, enclosed within space
characters, skipping handles that do not refer to the terminal window
(e.g. when they were redirected). We will only use those handles when
that environment variable lists all three handles because then we can be
100% certain that we are running inside a terminal window, and that we
know exactly which Win32 handles to use to communicate with it.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: nalla <nalla@hamal.uberspace.de>
2015-04-01 09:53:54 +01:00
Johannes Schindelin
43d41fc387 git-wrapper: Allow git-cmd.exe to add only /cmd/ to the PATH
The idea of having the Git wrapper in the /cmd/ directory is to allow
adding only a *tiny* set of executables to the search path, to allow
minimal interference with other software applications. It is quite
likely, for example, that other software applications require their own
version of zlib1.dll and would not be overly happy to find the version
Git for Windows ships.

The /cmd/ directory also gives us the opportunity to let the Git wrapper
handle the `gitk` script. It is a Tcl/Tk script that is not recognized
by Windows, therefore calling `gitk` in `cmd.exe` would not work, even
if we add all of Git for Windows' bin/ directories.

So let's use the /cmd/ directory instead of adding /mingw??/bin/ and
/usr/bin/ to the PATH when launching Git CMD.

The way we implemented Git CMD is to embed the appropriate command line
as string resource into a copy of the Git wrapper. Therefore we extended
that syntax to allow for configuring a minimal search path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 09:53:53 +01:00
Johannes Schindelin
bd8d129e45 git-wrapper: optionally skip cd $HOME when configured via resources
We recently added the ability to configure copies of the Git wrapper to
launch custom command-lines, configured via plain old Windows resources.
The main user is Git for Windows' `git-bash.exe`, of course. When the
user double-clicks the `git bash` icon, it makes sense to start the Bash
in the user's home directory.

Third-party software, such as TortoiseGit or GitHub for Windows, may
want to start the Git Bash in another directory, though.

Now, when third-party software wants to call Git, they already have to
construct a command-line, and can easily pass a command-line option
`--no-cd` (which this commit introduces), and since that option is not
available when the user double-clicks an icon on the Desktop or in the
Explorer, let's keep the default to switch to the home directory if the
`--no-cd` flag was not passed along.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-01 09:53:51 +01:00