Commit Graph

31759 Commits

Author SHA1 Message Date
Johannes Schindelin
96570be714 Rebasing merge to junio/next (a028561)
Previous rebasing merge: 319312f0c1
e printer. As
this is generated during test 3 substitute an alternate prefix to avoid this.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-02 15:15:11 -05:00
Erik Faye-Lund
ef4f950136 MSVC: require pton and ntop emulation
Without this, git-daemon cannot be built with Microsoft Visual C++.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:13:18 -05:00
Karsten Blees
a894c9a895 MSVC: fix winansi.c compile errors
Some constants (such as LF_FACESIZE) are undefined with -DNOGDI (set in the
Makefile), and CONSOLE_FONT_INFOEX is available in MSVC, but not in MinGW.

Cast FARPROC to PGETCURRENTCONSOLEFONTEX to suppress MSVC compiler warning.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:13:17 -05:00
Erik Faye-Lund
26469e3967 MSVC: fix poll-related macro redefines
This seems to be related to the poll-emulation... I see that these things
are guarded by an "#if(_WIN32_WINNT >= 0x0600)" in <winsock2.h>, which
means it's supported for Windows Vista and above... We still support
Windows XP, so it seems someone has set this too high :)

I'd prefer to set this from the Makefile, but this generates a warning in
compat/win32/poll.c about redefining a macro (poll.c wants it to be 0x502,
which is Windows XP with SP2, rather than 0x501 which is normal Windows
XP).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:13:15 -05:00
Vincent van Ravesteijn
323bf8effb MSVC: Remove unneeded header stubs
These headers are no longer needed since they are no longer
unnecessarily included in git-compat-util.h.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:59 -05:00
Vincent van Ravesteijn
b717602fa9 Compile fix for MSVC: Include <io.h>
This include is needed for _commit(..) which is used in mingw.h.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:58 -05:00
Vincent van Ravesteijn
934e193989 Compile fix for MSVC: Do not include sys/resources.h
Do not include header files when compiling with MSVC that do not
exist and which are also not included when compiling with MINGW.
A direct consequence is that git can be compiled again with MSVC
because the missing "sys/resources.h" is no longer included.

Instead of current

	#ifndef mingw32 is the only one that is strange
        ... everything for systems that is not strange ...
        #else
        ... include mingw specific tweaks ...
        #endif
        #ifdef msvc is also strange
        ... include msvc specific tweaks ...
        #endif

it turns things around and says what it wants to achieve in a more direct
way, i.e.

	#if mingw32
        #include "compat/mingw.h"
	#elif msvc
        #include "compat/msvc.h"
	#else
        ... all the others ...
	#endif

which makes it look simpler.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:57 -05:00
Johannes Schindelin
970192de1f Handle the branch.<name>.rebase value 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:56 -05:00
Johannes Schindelin
65f4e87aaa Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:54 -05:00
Johannes Sixt
22621b1aa2 Windows: define S_ISUID properly
8fb3ad76 (fast-import: prevent producing bad delta) introduced the first
use of S_ISUID. Since before this commit the value was irrelevant, we had
only a dummy definition in mingw.h. But beginning with this commit the
macro must expand to a reasonable value. Make it so.

We do not change S_ISGID from the value 0 because it is used in path.c
(via FORCE_DIR_SET_GID) to set the mode on directories in a manner that
is not supported on Windows, and 0 is the right value in this case.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:53 -05:00
Evgeny Pashkin
be51338063 Fixed wrong path delimiter in exe finding
On Windows XP3 in git bash
git clone git@github.com:octocat/Spoon-Knife.git
cd Spoon-Knife
git gui
menu Remote\Fetch from\origin
error: cannot spawn git: No such file or directory
error: could not run rev-list

if u run
git fetch --all
it worked normal in git bash or gitgui tools

In second version CreateProcess get 'C:\Git\libexec\git-core/git.exe' in
first version - C:/Git/libexec/git-core/git.exe and not executes (unix
slashes)

after fixing C:\Git\libexec\git-core\git.exe or
C:/Git/libexec/git-core\git.exe it works normal

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:52 -05:00
Johannes Schindelin
c3f7c8fc90 gitweb (SyntaxHighlighter): interpret #l<line-number>
It is pretty convenient to refer to a line number by appending, say,
highlighter, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:51 -05:00
Johannes Schindelin
dd57f97e87 Only switch on the line number toggle when highlighting is activated
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:50 -05:00
Johannes Schindelin
9e9e5f808e Gitweb: add support for Alex Gorbatchev's SyntaxHighlighter in Javascript
Gitweb is not exactly what you would call server-friendly, so let's
offload one more task onto the client.

To enable this, put something like this into your gitweb_config.perl:

	$feature{'syntaxhighlighter_js'}{'default'} = [{
		url => '/SyntaxHighlighter/',
		style => 'Django',
		theme => 'FadeToGrey'
	}];

and clone git://github.com/alexgorbatchev/SyntaxHighlighter into the
directory you specified via the 'url' parameter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:49 -05:00
Karsten Blees
15205be18f MinGW: disable CRT command line globbing
MingwRT listens to _CRT_glob to decide if __getmainargs should
perform globbing, with the default being that it should.
Unfortunately, __getmainargs globbing is sub-par; for instance
patterns like "*.c" will only match c-sources in the current
directory.

Disable __getmainargs' command line wildcard expansion, so these
patterns will be left untouched, and handled by Git's superior
built-in globbing instead.

MSVC defaults to no globbing, so we don't need to do anything
in that case.

This fixes t5505 and t7810.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:48 -05:00
Karsten Blees
b52a68830d Win32: move main macro to a function
The code in the MinGW main macro is getting more and more complex, move to
a separate initialization function for readabiliy and extensibility.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:46 -05:00
Karsten Blees
f2a4c12c38 Win32: fix potential multi-threading issue
...by removing a static buffer in do_stat_internal.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:45 -05:00
Karsten Blees
48ba8e74d1 Win32 dirent: improve dirent implementation
Improve the dirent implementation by removing the relics that were once
necessary to plug into the now unused MinGW runtime, in preparation for
Unicode file name support.

Move FindFirstFile to opendir, and FindClose to closedir, with the
following implications:
- DIR.dd_name is no longer needed
- chdir(one); opendir(relative); chdir(two); readdir() works as expected
  (i.e. lists one/relative instead of two/relative)
- DIR.dd_handle is a valid handle for the entire lifetime of the DIR struct
- thus, all checks for dd_handle == INVALID_HANDLE_VALUE and dd_handle == 0
  have been removed
- the special case that the directory has been fully read (which was
  previously explicitly tracked with dd_handle == INVALID_HANDLE_VALUE &&
  dd_stat != 0) is now handled implicitly by the FindNextFile error
  handling code (if a client continues to call readdir after receiving
  NULL, FindNextFile will continue to fail with ERROR_NO_MORE_FILES, to
  the same effect)
- extracting dirent data from WIN32_FIND_DATA is needed in two places, so
  moved to its own method
- GetFileAttributes is no longer needed. The same information can be
  obtained from the FindFirstFile error code, which is ERROR_DIRECTORY if
  the name is NOT a directory (-> ENOTDIR), otherwise we can use
  err_win_to_posix (e.g. ERROR_PATH_NOT_FOUND -> ENOENT). The
  ERROR_DIRECTORY case could be fixed in err_win_to_posix, but this
  probably breaks other functionality.

Removes the ERROR_NO_MORE_FILES check after FindFirstFile (this was
fortunately a NOOP (searching for '*' always finds '.' and '..'),
otherwise the subsequent code would have copied data from an uninitialized
buffer).

Changes malloc to git support function xmalloc, so opendir will die() if
out of memory, rather than failing with ENOMEM and letting git work on
incomplete directory listings (error handling in dir.c is quite sparse).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:44 -05:00
Karsten Blees
da28481a35 Win32 dirent: clarify #include directives
Git-compat-util.h is two dirs up, and already includes <dirent.h> (which
is the same as "dirent.h" due to -Icompat/win32 in the Makefile).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:43 -05:00
Karsten Blees
d4aeefbc5d 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>
2011-11-02 15:12:42 -05:00
Karsten Blees
1b76646c73 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>
2011-11-02 15:12:41 -05:00
Karsten Blees
4945dccdc5 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>
2011-11-02 15:12:40 -05:00
Erik Faye-Lund
560b2f7357 Revert "MinGW: Add missing file mode bit defines"
This reverts commit 5ff1232f63.
2011-11-02 15:12:39 -05:00
Sebastian Schuberth
d278064270 submodule: Fix t7400, t7405, t7406 for msysGit
Again, avoid using echo (which issues DOS line endings on msysGit) to not mix
with Unix line-endings issued by git built-ins, even if this is at the cost of
calling an external executable (cat) instead of a shell built-in (echo).
2011-11-02 15:12:38 -05:00
Pat Thoyts
cec0acdcb7 t5407: Fix line-ending dependency in post-rewrite.args
On msysGit creating the post-rewrite.args file using 'echo' has different
line endings from the expected comparison. Using perl normalizes the line
endings for each generated file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-02 15:12:36 -05:00
Sebastian Schuberth
ac2f2c1582 submodule: Use cat instead of echo to avoid DOS line-endings
In msysGit, echo used in scripts outputs DOS line-endings while built-ins
use Unix line-endings in their output. This causes t7508-status to fail
due to mixed line endings in the output of git status (which calls
git-submodule).

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2011-11-02 15:12:35 -05:00
Pat Thoyts
3ca0a67d6f t3102: Windows filesystems may not use a literal asterisk in filenames.
Exclude these tests when using MINGW.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-02 15:12:34 -05:00
Johannes Schindelin
92b7d50743 Disable test on MinGW that challenges its bash quoting
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:33 -05:00
Johannes Schindelin
ebe00057fa MinGW: Skip test redirecting to fd 4
... because that does not work in MinGW.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:32 -05:00
Erik Faye-Lund
d90dee0cec mingw: do not hide bare repositories
As reported in msysGit issue 450 the recent change to set the windows
hidden attribute on the .git directory is being applied to bare git
directories. This patch excludes bare repositories.

Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2011-11-02 15:12:31 -05:00
Gregor Uhlenheuer
19954b2b85 Git.pm: Use stream-like writing in cat_blob()
This commit fixes the issue with the handling of large files causing an
'Out of memory' perl exception. Instead of reading and writing the whole
blob at once now the blob is written in small pieces.

The problem was raised and discussed in this mail to the msysGit mailing
list: http://thread.gmane.org/gmane.comp.version-control.msysgit/12080

Signed-off-by: Gregor Uhlenheuer <kongo2002@googlemail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:30 -05:00
Johannes Schindelin
a3eb612f70 Amend "git grep -O -i: if the pager is 'less', pass the '-i' option"
This change was left in the stash, for some reason. Squash this in with
the next rebasing merge.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:29 -05:00
Johannes Schindelin
5a530133d6 git grep -O -i: if the pager is 'less', pass the '-i' option
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:28 -05:00
Johannes Schindelin
ad9b06cbb9 Handle new t1501 test case properly with MinGW
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:26 -05:00
Johannes Schindelin
9185631d00 Do not compile compat/**/*.c with -Wold-style-definition
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:25 -05:00
Johannes Schindelin
a2cda2f3c6 Fix old-style function declaration
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:24 -05:00
Johannes Schindelin
5ff6a66e7f Make CFLAGS more strict
This is a gcc-ism, but as we use gcc exclusively, we can use them.

Taken from one of Junio's mails. (Reminded to cherry-pick this patch
by one of Karsten Blees' mails.)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:23 -05:00
Johannes Schindelin
3e870a0da4 grep -I: do not bother to read known-binary files
Incidentally, this makes grep -I respect the "binary" attribute (actually,
the "-text" attribute, but "binary" implies that).

Since the attributes are not thread-safe, we now need to switch off
threading if -I was passed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:22 -05:00
Johannes Schindelin
cfe6430df8 Let deny.currentBranch=updateInstead ignore submodules
They are not affected by the update anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:21 -05:00
Johannes Schindelin
08293dfd3c add -e: ignore dirty submodules
We cannot add untracked/modified files in submodules anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:20 -05:00
Johannes Schindelin
21098cf6ef 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>
2011-11-02 15:12:19 -05:00
Johannes Schindelin
adfbbb2bb2 Gitweb: make line number toggling work for Firefox and Safari
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:17 -05:00
Johannes Schindelin
62b255f6e9 gitweb: Allow line number toggling with Javascript
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:16 -05:00
Johannes Schindelin
54db428060 Give commit message reencoding for output on MinGW a chance
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:15 -05:00
Karsten Blees
917200f363 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>
2011-11-02 15:12:14 -05:00
Karsten Blees
4117f56941 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>
2011-11-02 15:12:13 -05:00
Karsten Blees
0d16a58577 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>
2011-11-02 15:12:12 -05:00
Karsten Blees
f93cb107fa Enable color output in Windows cmd.exe
Git requires the TERM environment variable to be set for all color*
settings. Simulate the TERM variable if it is not set (default on Windows).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:11 -05:00
Chris West (Faux)
0a9bbaddda Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2011-11-02 15:12:10 -05:00
Johannes Schindelin
905a8767d8 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-11-02 15:12:08 -05:00