Commit Graph

49634 Commits

Author SHA1 Message Date
Johannes Schindelin
a5849e8a30 Handle http.* config variables pointing to files gracefully on Windows
On Windows, we would like to be able to have a default http.sslCAinfo
that points to an MSys path (i.e. relative to the installation root of
Git).  As Git is a MinGW program, it has to handle the conversion
of the MSys path into a MinGW32 path itself.

Since system_path() considers paths starting with '/' as absolute, we
have to convince it to make a Windows path by stripping the leading
slash.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-22 20:49:38 +01:00
Johannes Schindelin
16685c2d7a Start the merging-rebase to v2.3.6
This commit starts the rebase of 0eff6b5 to 8e73045
2015-04-22 20:48:51 +01:00
dscho
027ca35366 Merge pull request #104 from dscho/super-config
Add support for %PROGRAMDATA%\Git\config
2015-04-22 21:42:17 +02:00
Johannes Schindelin
c963b8eef6 Document the Windows-wide config file
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-22 14:54:58 +01:00
Johannes Schindelin
255007634f Windows: use %PROGRAMDATA%\Git\config as Windows-wide configuration
Between the libgit2 and the Git for Windows project, there has been a
discussion how we could share Git configuration to avoid duplication (or
worse: skew).

Earlier, libgit2 was nice enough to just re-use Git for Windows'

	C:\Program Files (x86)\Git\etc\gitconfig

but with the upcoming Git for Windows 2.x, there would be more paths to
search, as we will have 64-bit and 32-bit versions, and the
corresponding config files will be in %PROGRAMFILES%\Git\mingw64\etc and
...\mingw32\etc, respectively.

Therefore we came to a consensus to use %PROGRAMDATA%\Git as the
location for Git-specific files that are of wider interest than just Git
for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-22 14:47:27 +01:00
dscho
7cee1210cf Merge pull request #60 from weakcamel/fscanf-64bit-constants
Correct fscanf formatting string for I64u values

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-22 13:23:04 +01:00
Waldek Maleska
1931c84a9e Correct fscanf formatting string for I64u values
Signed-off-by: Waldek Maleska <w.maleska@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-22 13:17:19 +01:00
dscho
14f6c21f88 Merge pull request #102 from kb/msys-tty
Better MSys PTY detection

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-04-22 13:03:51 +01:00
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
Junio C Hamano
ba63bfaa59 Git 2.3.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.3.6
2015-04-21 12:17:09 -07:00
Junio C Hamano
d544696afa Merge branch 'jk/colors' into maint
"diff-highlight" (in contrib/) used to show byte-by-byte
differences, which meant that multi-byte characters can be chopped
in the middle.  It learned to pay attention to character boundaries
(assuming the UTF-8 payload).

* jk/colors:
  diff-highlight: do not split multibyte characters
2015-04-21 12:12:25 -07:00
Junio C Hamano
d3115a35fc Merge branch 'jk/test-annoyances' into maint
Test fixes.

* jk/test-annoyances:
  t5551: make EXPENSIVE test cheaper
  t5541: move run_with_cmdline_limit to test-lib.sh
  t: pass GIT_TRACE through Apache
  t: redirect stderr GIT_TRACE to descriptor 4
  t: translate SIGINT to an exit
2015-04-21 12:12:24 -07:00
Junio C Hamano
42b2f894a0 Merge branch 'pt/enter-repo-comment-fix' into maint
Documentation update.

* pt/enter-repo-comment-fix:
  enter_repo(): fix docs to match code
2015-04-21 12:12:23 -07:00
Junio C Hamano
1c30f8efa4 Merge branch 'jz/gitweb-conf-doc-fix' into maint
Documentation update.

* jz/gitweb-conf-doc-fix:
  gitweb.conf.txt: say "build-time", not "built-time"
2015-04-21 12:12:22 -07:00
Junio C Hamano
c809f4258f Merge branch 'jk/cherry-pick-docfix' into maint
* jk/cherry-pick-docfix:
  cherry-pick: fix docs describing handling of empty commits
2015-04-21 12:12:21 -07:00
Junio C Hamano
c84364abe3 Merge branch 'iu/fix-parse-options-h-comment' into maint
* iu/fix-parse-options-h-comment:
  parse-options.h: OPTION_{BIT,SET_INT} do not store pointer to defval
2015-04-21 12:12:20 -07:00
Junio C Hamano
e8281f0164 Merge branch 'jg/cguide-we-cannot-count' into maint
* jg/cguide-we-cannot-count:
  CodingGuidelines: update 'rough' rule count
2015-04-21 12:12:19 -07:00
Junio C Hamano
2e0aabe602 Merge branch 'jk/pack-corruption-post-mortem' into maint
Documentation update.

* jk/pack-corruption-post-mortem:
  howto: document more tools for recovery corruption
2015-04-21 12:12:18 -07:00
Junio C Hamano
e9ab76da8f Merge branch 'jn/doc-fast-import-no-16-octopus-limit' into maint
Documentation update.

* jn/doc-fast-import-no-16-octopus-limit:
  fast-import doc: remove suggested 16-parent limit
2015-04-21 12:12:17 -07: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
Julian Gindi
6c3b2afe6f CodingGuidelines: update 'rough' rule count
Changed inaccurate count of "rough rules" from three to the more
generic 'a few'.

Signed-off-by: Julian Gindi <juliangindi@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-04-14 09:50:31 -07: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
Kyle J. McKay
8d00662d7d diff-highlight: do not split multibyte characters
When the input is UTF-8 and Perl is operating on bytes instead of
characters, a diff that changes one multibyte character to another
that shares an initial byte sequence will result in a broken diff
display as the common byte sequence prefix will be separated from
the rest of the bytes in the multibyte character.

For example, if a single line contains only the unicode character
U+C9C4 (encoded as UTF-8 0xEC, 0xA7, 0x84) and that line is then
changed to the unicode character U+C9C0 (encoded as UTF-8 0xEC,
0xA7, 0x80), when operating on bytes diff-highlight will show only
the single byte change from 0x84 to 0x80 thus creating invalid UTF-8
and a broken diff display.

Fix this by putting Perl into character mode when splitting the line
and then back into byte mode after the split is finished.

The utf8::xxx functions require Perl 5.8 so we require that as well.

Also, since we are mucking with code in the split_line function, we
change a '*' quantifier to a '+' quantifier when matching the $COLOR
expression which has the side effect of speeding everything up while
eliminating useless '' elements in the returned array.

Reported-by: Yi EungJun <semtlenori@gmail.com>
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-04-04 13:03:45 -07: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