Commit Graph

45038 Commits

Author SHA1 Message Date
Karsten Blees
ee80482893 Win32 dirent: change FILENAME_MAX to MAX_PATH
FILENAME_MAX and MAX_PATH are both 260 on Windows, however, MAX_PATH is
used throughout the other Win32 code in Git, and also defines the length
of file name buffers in the Win32 API (e.g. WIN32_FIND_DATA.cFileName,
from which we're copying the dirent data).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2014-05-10 16:56:28 -05:00
Karsten Blees
bac659a8d2 Win32 dirent: remove unused dirent.d_reclen member
Remove the union around dirent.d_type and the unused dirent.d_reclen member
(which was necessary for compatibility with the MinGW dirent runtime, which
is no longer used).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2014-05-10 16:56:28 -05:00
Karsten Blees
336d506567 Win32 dirent: remove unused dirent.d_ino member
There are no proper inodes on Windows, so remove dirent.d_ino and #define
NO_D_INO_IN_DIRENT in the Makefile (this skips e.g. an ineffective qsort in
fsck.c).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2014-05-10 16:56:27 -05:00
Karsten Blees
89b944569b Warn if the Windows console font doesn't support Unicode
Unicode console output won't display correctly with default settings
because the default console font ("Terminal") only supports the system's
OEM charset. Unfortunately, this is a user specific setting, so it cannot
be easily fixed by e.g. some registry tricks in the setup program.

This change prints a warning on exit if console output contained non-ascii
characters and the console font is supposedly not a TrueType font (which
usually have decent Unicode support).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:56:27 -05:00
Karsten Blees
232d19d124 Detect console streams more reliably on Windows
GetStdHandle(STD_OUTPUT_HANDLE) doesn't work for stderr if stdout is
redirected. Use _get_osfhandle of the FILE* instead.

_isatty() is true for all character devices (including parallel and serial
ports). Check return value of GetConsoleScreenBufferInfo instead to
reliably detect console handles (also don't initialize internal state from
an uninitialized CONSOLE_SCREEN_BUFFER_INFO structure if the function
fails).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:56:27 -05:00
Karsten Blees
64341b5358 Support Unicode console output on Windows
WriteConsoleW seems to be the only way to reliably print unicode to the
console (without weird code page conversions).

Also redirects vfprintf to the winansi.c version.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:56:27 -05:00
Johannes Schindelin
4e4b3c742b Start the merging-rebase to v1.9.3
This commit starts the rebase of d4c3651 to 3d9867a
2014-05-10 16:56:27 -05:00
Johannes Schindelin
e22e6e6fc7 Merge remote-tracking branch 't-b/sideband-bug'
This will allow us to work around the push issues pointed out in
https://github.com/msysgit/git/issues/101.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-05-10 16:33:59 -05:00
Junio C Hamano
eea591373e Git 1.9.3
The third maintenance release for Git 1.9; contains all the fixes
that are scheduled to appear in Git 2.0 since 1.9.2.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.9.3
2014-05-09 10:59:07 -07:00
Thomas Braun
f7242e3478 Config option to disable side-band-64k for transport
Since commit 0c499ea60f the send-pack builtin uses the side-band-64k
capability if advertised by the server.

Unfortunately this breaks pushing over the dump git protocol if used
over a network connection.

The detailed reasons for this breakage are (by courtesy of Jeff Preshing,
quoted from ttps://groups.google.com/d/msg/msysgit/at8D7J-h7mw/eaLujILGUWoJ):
----------------------------------------------------------------------------
MinGW wraps Windows sockets in CRT file descriptors in order to mimic the
functionality of POSIX sockets. This causes msvcrt.dll to treat sockets as
Installable File System (IFS) handles, calling ReadFile, WriteFile,
DuplicateHandle and CloseHandle on them. This approach works well in simple
cases on recent versions of Windows, but does not support all usage patterns.
In particular, using this approach, any attempt to read & write concurrently
on the same socket (from one or more processes) will deadlock in a scenario
where the read waits for a response from the server which is only invoked after
the write. This is what send_pack currently attempts to do in the use_sideband
codepath.
----------------------------------------------------------------------------

The new config option "sendpack.sideband" allows to override the side-band-64k
capability of the server, and thus makes the dump git protocol work.

Other transportation methods like ssh and http/https still benefit from
the sideband channel, therefore the default value of "sendpack.sideband"
is still true.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2014-05-09 09:31:52 +02:00
Jonathan Nieder
e28dcdce13 shell doc: remove stray "+" in example
The git-shell(1) manpage says

	EXAMPLE
	       To disable interactive logins, displaying a greeting
		instead:

		+

		   $ chsh -s /usr/bin/git-shell
		   $ mkdir $HOME/git-shell-commands
[...]

The stray "+" has been there ever since the example was added in
v1.8.3-rc0~210^2 (shell: new no-interactive-login command to print a
custom message, 2013-03-09).  The "+" sign between paragraphs is
needed in asciidoc to attach extra paragraphs to a list item but here
it is not needed and ends up rendered as a literal "+".  Remove it.

A quick search with "grep -e '<p>+' /usr/share/doc/git/html/*.html"
doesn't find any other instances of this problem.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-08 10:26:26 -07:00
Junio C Hamano
86ae051274 Start preparing for 1.9.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-08 10:05:22 -07:00
Junio C Hamano
bd51339355 Merge branch 'cl/p4-use-diff-tree' into maint
"git p4" dealing with changes in binary files were broken by a
change in 1.9 release.

* cl/p4-use-diff-tree:
  git-p4: format-patch to diff-tree change breaks binary patches
2014-05-08 10:01:32 -07:00
Junio C Hamano
6eca9c0e87 Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maint
The shell prompt script (in contrib/), when using the PROMPT_COMMAND
interface, used an unsafe construct when showing the branch name in
$PS1.

* rh/prompt-pcmode-avoid-eval-on-refname:
  git-prompt.sh: don't put unsanitized branch names in $PS1
2014-05-08 10:01:18 -07:00
Junio C Hamano
e79fcfcd3f Merge branch 'km/avoid-non-function-return-in-rebase' into maint
"git rebase" used a POSIX shell construct FreeBSD /bin/sh does not
work well with.

* km/avoid-non-function-return-in-rebase:
  Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
  rebase: avoid non-function use of "return" on FreeBSD
2014-05-08 10:01:06 -07:00
Junio C Hamano
e230cd861b Merge branch 'tb/unicode-6.3-zero-width' into maint
Some more Unicode codepoints defined in Unicode 6.3 as having zero
width have been taught to our display column counting logic.

* tb/unicode-6.3-zero-width:
  utf8.c: partially update to version 6.3
2014-05-08 10:00:45 -07:00
Junio C Hamano
16fefdc3eb Merge branch 'km/avoid-bs-in-shell-glob' into maint
Some tests used shell constructs that did not work well on FreeBSD

* km/avoid-bs-in-shell-glob:
  test: fix t5560 on FreeBSD
2014-05-08 10:00:36 -07:00
Junio C Hamano
73edc54e90 Merge branch 'km/avoid-cp-a' into maint
Some tests used shell constructs that did not work well on FreeBSD

* km/avoid-cp-a:
  test: fix t7001 cp to use POSIX options
2014-05-08 09:59:41 -07:00
Tolga Ceylan
749b668c7d git-p4: format-patch to diff-tree change breaks binary patches
When applying binary patches a full index is required. format-patch
already handles this, but diff-tree needs '--full-index' argument
to always output full index. When git-p4 runs git-apply to test
the patch, git-apply rejects the patch due to abbreviated blob
object names. This is the error message git-apply emits in this
case:

    error: cannot apply binary patch to '<filename>' without full index line
    error: <filename>: patch does not apply

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-07 10:27:22 -07:00
Erik Faye-Lund
83227c1f2b Makefile: do not depend on curl-config
MinGW builds of cURL does not ship with curl-config unless built
with the autoconf based build system, which is not the practice
recommended by the documentation. MsysGit has had issues with
binaries of that sort, so it has switched away from autoconf-based
cURL-builds.

Unfortunately, broke pushing over WebDAV on Windows, because
http-push.c depends on cURL's multi-threaded API, which we could
not determine the presence of any more.

Since troublesome curl-versions are ancient, and not even present
in RedHat 5, let's just assume cURL is capable instead of doing a
non-robust check.

Instead, add a check for curl_multi_init to our configure-script,
for those on ancient system. They probably already need to do the
configure-dance anyway.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2014-05-05 12:47:34 +02:00
dscho
c132ea951b Merge pull request #175 from kasal/normalize-win-paths
fixup! Windows: Always normalize paths to Windows-style
2014-04-28 12:46:21 -05:00
Stepan Kasal
01f0811d11 fixup! Windows: Always normalize paths to Windows-style 2014-04-28 15:35:33 +02:00
Richard Hansen
8976500cbb git-prompt.sh: don't put unsanitized branch names in $PS1
Both bash and zsh subject the value of PS1 to parameter expansion,
command substitution, and arithmetic expansion.  Rather than include
the raw, unescaped branch name in PS1 when running in two- or
three-argument mode, construct PS1 to reference a variable that holds
the branch name.  Because the shells do not recursively expand, this
avoids arbitrary code execution by specially-crafted branch names such
as '$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)'.

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-22 12:37:53 -07:00
dscho
6070ceed93 Merge pull request #169 from kasal/master
fixup! git tag --contains : avoid stack overflow
2014-04-22 11:48:51 -05:00
Stepan Kasal
c68e27d50c fixup! git tag --contains : avoid stack overflow
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
2014-04-22 17:55:31 +02:00
Johannes Schindelin
c63d196ece fixup! git tag --contains : avoid stack overflow 2014-04-17 12:24:31 -05:00
Kyle J. McKay
8cd65967fe Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
This reverts commit 99855ddf4b.

The workaround 99855ddf introduced to deal with problematic
"return" statements in scripts run by "dot" commands located
inside functions only handles one part of the problem.  The
issue has now been addressed by not using "return" statements
in this way in the git-rebase--*.sh scripts.

This workaround is therefore no longer necessary, so clean
up the code by reverting it.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-17 10:15:27 -07:00
Kyle J. McKay
9f50d32b9c rebase: avoid non-function use of "return" on FreeBSD
Since a1549e10, 15d4bf2e and 01a1e646 (first appearing in v1.8.4)
the git-rebase--*.sh scripts have used a "return" to stop execution
of the dot-sourced file and return to the "dot" command that
dot-sourced it.  The /bin/sh utility on FreeBSD however behaves
poorly under some circumstances when such a "return" is executed.

In particular, if the "dot" command is contained within a function,
then when a "return" is executed by the script it runs (that is not
itself inside a function), control will return from the function
that contains the "dot" command skipping any statements that might
follow the dot command inside that function.  Commit 99855ddf (first
appearing in v1.8.4.1) addresses this by making the "dot" command
the last line in the function.

Unfortunately the FreeBSD /bin/sh may also execute some statements
in the script run by the "dot" command that appear after the
troublesome "return".  The fix in 99855ddf does not address this
problem.

For example, if you have script1.sh with these contents:

run_script2() {
        . "$(dirname -- "$0")/script2.sh"
        _e=$?
        echo only this line should show
        [ $_e -eq 5 ] || echo expected status 5 got $_e
        return 3
}
run_script2
e=$?
[ $e -eq 3 ] || { echo expected status 3 got $e; exit 1; }

And script2.sh with these contents:

if [ 5 -gt 3 ]; then
        return 5
fi
case bad in *)
        echo always shows
esac
echo should not get here
! :

When running script1.sh (e.g. '/bin/sh script1.sh' or './script1.sh'
after making it executable), the expected output from a POSIX shell
is simply the single line:

only this line should show

However, when run using FreeBSD's /bin/sh, the following output
appears instead:

should not get here
expected status 3 got 1

Not only did the lines following the "dot" command in the run_script2
function in script1.sh get skipped, but additional lines in script2.sh
following the "return" got executed -- but not all of them (e.g. the
"echo always shows" line did not run).

These issues can be avoided by not using a top-level "return" in
script2.sh.  If script2.sh is changed to this:

main() {
        if [ 5 -gt 3 ]; then
                return 5
        fi
        case bad in *)
                echo always shows
        esac
        echo should not get here
        ! :
}
main

Then it behaves the same when using FreeBSD's /bin/sh as when using
other more POSIX compliant /bin/sh implementations.

We fix the git-rebase--*.sh scripts in a similar fashion by moving
the top-level code that contains "return" statements into its own
function and then calling that as the last line in the script.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-17 10:13:29 -07:00
Johannes Schindelin
2ec943a028 fixup! Merge pull request #159 from kasal/config-c-warning
This commit replaces the Git for Windows-only patch by the patch
accepted upstream instead.

It was performed by the following shell commands:

	git revert -n 3c87ce5^2 &&
	git cherry-pick -n 06bdc23 &&
	git commit -s --fixup 3c87ce5

(and amending the commit with this commit message)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-17 11:23:32 -05:00
Johannes Schindelin
6845d53e87 fixup! MinGW: Update tests to handle a native eol of crlf 2014-04-16 17:55:39 -05:00
Stepan Kasal
5cb0a6d931 Merge pull request #122 from kblees/kb/long-paths-v2
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-16 16:34:38 +02:00
Stepan Kasal
50d3ca7563 Merge remote-tracking branch 'kblees/kb/fscache-v4-tentative-1.8.5' into thicket-1.8.5.2 2014-04-16 16:34:37 +02:00
Stepan Kasal
9406783204 Merge branch 'kb/hashmap-v5-minimal' into kb/fscache-v4-t1.8.5 2014-04-16 16:34:36 +02:00
Stepan Kasal
3c87ce59ec Merge pull request #159 from kasal/config-c-warning
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-16 16:34:35 +02:00
Stepan Kasal
7217f8ab52 Merge branch 'tag-contains'
This topic branch addresses out-of-memory errors in particular on
Windows, where the default stack space is not very large.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-16 16:34:34 +02:00
Stepan Kasal
61e063248c Merge pull request #126 from RomanBelinsky/master
fix date parsing error:  Update SVN.pm
2014-04-16 16:34:33 +02:00
Stepan Kasal
dea126f633 Merge pull request #115 from msysgit/tip4commit
Mention tip4commit
2014-04-16 16:34:31 +02:00
Stepan Kasal
e368c17d89 Merge 'poll-busy-wait' into HEAD 2014-04-16 16:34:30 +02:00
Stepan Kasal
a3686bb99e Merge 'normalize-win-paths' into HEAD 2014-04-16 16:34:29 +02:00
Stepan Kasal
873a1f515f Merge 'msvc-link-crt' into HEAD 2014-04-16 16:34:28 +02:00
Stepan Kasal
830b6ee9c0 Merge 'install-wincred' into HEAD 2014-04-16 16:34:27 +02:00
Stepan Kasal
be98ea89d3 Merge 'fix-is-exe' into HEAD 2014-04-16 16:34:26 +02:00
Stepan Kasal
6ce3472c31 Merge 'fix-externals' into HEAD 2014-04-16 16:34:25 +02:00
Stepan Kasal
01c0d7e358 Merge 'stash-reflog' into HEAD 2014-04-16 16:34:24 +02:00
Stepan Kasal
31199945c3 Merge 'http-msys-paths' into HEAD 2014-04-16 16:34:22 +02:00
Stepan Kasal
13716a83dd 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>
2014-04-16 16:34:21 +02:00
Stepan Kasal
0974fa1134 Merge 'win-tests-fixes' into HEAD 2014-04-16 16:34:20 +02:00
Stepan Kasal
48fef2d29c Merge branch 'some-CR-fixes'
This branch contains some hacks so that Git produces less CR, and then
some tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2014-04-16 16:34:19 +02:00
Stepan Kasal
52ee32dfb4 Merge 'grep-fixes' into HEAD 2014-04-16 16:34:18 +02:00
Stepan Kasal
d46df546a4 Merge 'pull-rebase-interactive' into HEAD 2014-04-16 16:34:17 +02:00