Commit Graph

56331 Commits

Author SHA1 Message Date
Johannes Schindelin
f2a16a29ca mingw: avoid warnings when casting HANDLEs to int
HANDLE is defined internally as a void *, but in many cases it is
actually guaranteed to be a 32-bit integer. In these cases, GCC should
not warn about a cast of a pointer to an integer of a different type
because we know exactly what we are doing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:19 +01:00
Johannes Schindelin
43eccde89f mingw: avoid redefining S_* constants
When compiling with MSys2's compiler, these constants are already defined.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:18 +01:00
Johannes Schindelin
6ba4a5ba67 compat/winansi: support compiling with MSys2
MSys2 already defines the _CONSOLE_FONT_INFOEX structure.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:16 +01:00
Johannes Schindelin
b1299c2692 compat/mingw: support MSys2-based MinGW build
The excellent MSys2 project brings a substantially updated MinGW
environment including newer GCC versions and new headers. To support
compiling Git, let's special-case the new MinGW (tell-tale: the
_MINGW64_VERSION_MAJOR constant is defined).

Note: this commit only addresses compile failures, not compile warnings
(that task is left for a future patch).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:15 +01:00
Johannes Schindelin
542adba47a nedmalloc: 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 the FORCEINLINE definition so
as not to affect other platforms.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:14 +01:00
Johannes Schindelin
a89f5d918d config.mak.uname: supporting 64-bit MSys2
This just makes things compile, the test suite needs extra tender loving
care in addition to this change. We will address these issues in later
commits.

While at it, also allow building MSys2 Git (i.e. a Git that uses MSys2's
POSIX emulation layer).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:12 +01:00
Johannes Schindelin
c063bf79f6 config.mak.uname: support MSys2
For a long time, Git for Windows lagged behind Git's 2.x releases because
the Git for Windows developers wanted to let that big jump coincide with
a well-needed jump away from MSys to MSys2.

To understand why this is such a big issue, it needs to be noted that
many parts of Git are not written in portable C, but instead Git relies
on a POSIX shell and Perl to be available.

To support the scripts, Git for Windows has to ship a minimal POSIX
emulation layer with Bash and Perl thrown in, and when the Git for
Windows effort started in August 2007, this developer settled on using
MSys, a stripped down version of Cygwin. Consequently, the original name
of the project was "msysGit" (which, sadly, caused a *lot* of confusion
because few Windows users know about MSys, and even less care).

To compile the C code of Git for Windows, MSys was used, too: it sports
two versions of the GNU C Compiler: one that links implicitly to the
POSIX emulation layer, and another one that targets the plain Win32 API
(with a few convenience functions thrown in).  Git for Windows'
executables are built using the latter, and therefore they are really
just Win32 programs. To discern executables requiring the POSIX
emulation layer from the ones that do not, the latter are called MinGW
(Minimal GNU for Windows) when the former are called MSys executables.

This reliance on MSys incurred challenges, too, though: some of our
changes to the MSys runtime -- necessary to support Git for Windows
better -- were not accepted upstream, so we had to maintain our own
fork. Also, the MSys runtime was not developed further to support e.g.
UTF-8 or 64-bit, and apart from lacking a package management system
until much later (when mingw-get was introduced), many packages provided
by the MSys/MinGW project lag behind the respective source code
versions, in particular Bash and OpenSSL. For a while, the Git for
Windows project tried to remedy the situation by trying to build newer
versions of those packages, but the situation quickly became untenable,
especially with problems like the Heartbleed bug requiring swift action
that has nothing to do with developing Git for Windows further.

Happily, in the meantime the MSys2 project (https://msys2.github.io/)
emerged, and was chosen to be the base of the Git for Windows 2.x. Just
like MSys, MSys2 is a stripped down version of Cygwin, but it is
actively kept up-to-date with Cygwin's source code.  Thereby, it already
supports Unicode internally, and it also offers the 64-bit support that
we yearned for since the beginning of the Git for Windows project.

MSys2 also ported the Pacman package management system from Arch Linux
and uses it heavily. This brings the same convenience to which Linux
users are used to from `yum` or `apt-get`, and to which MacOSX users are
used to from Homebrew or MacPorts, or BSD users from the Ports system,
to MSys2: a simple `pacman -Syu` will update all installed packages to
the newest versions currently available.

MSys2 is also *very* active, typically providing package updates
multiple times per week.

It still required a two-month effort to bring everything to a state
where Git's test suite passes, many more months until the first official
Git for Windows 2.x was released, and a couple of patches still await
their submission to the respective upstream projects. Yet without MSys2,
the modernization of Git for Windows would simply not have happened.

This commit lays the ground work to supporting MSys2-based Git builds.

Assisted-by: Waldek Maleska <weakcamel@users.github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-26 18:38:11 +01:00
Johannes Schindelin
2dad48b02d Start the merging-rebase to v2.7.0
Unlike the most recent merging-bases, the purpose of *this* merging
rebase is to clean up the branch structure a bit, including an early
merge-back of the Git for Windows patches we contributed upstream
in the past weeks. This should make it much easier to prepare the
next batches of patches to beam upstream.

In particular, we drop these commits:

- criss cross rename failure workaround

	It was merged in a different form upstream and we carried
	a bogus patch for a long time

- Special-case the MSYS2_TZ environment variable

	In the meantime, Git for Windows' fork of the MSYS2 runtime
	learned to pass on valid TZ values. So this work-around is
	no longer needed.

- am: Use cat instead of echo to avoid DOS line-endings (fixes t4150)

	`am` became a builtin last year, hence this patch is no longer
	necessary.

- Teach 'git pull' to handle --rebase=interactive
- Handle the branch.<name>.rebase value 'interactive'
- Teach 'git remote' that the config var branch.*.rebase can be 'interactive'

	The --rebase=interactive code we carried in Git for Windows for
	such a long time patched the shell version of `git pull`, but
	in the meantime upstream has a builtin version, so these changes
	were bogus. Even better: this developer ported the changes to
	the builtin `pull` and they were already accepted upstream.

- t9100: don't use symlinks with SVN on MINGW
- t0200: disable more tests with MSys2 that rely on locale.exe
- Skip t0204 for MinGW Git

	Turns out that these are actually no longer needed to pass the
	test suite.

- mingw: do not special-case .exe files anymore

	When submitting the batch of patches that fixes the test
	failures in Git for Windows' SDK, this patch was made obsolete
	by the patch that provided a putty.exe for testing that is
	*actually* a .exe (and no shell script).

- mingw: Prepare the TMP environment variable for shell scripts

	This patch was actually forward-ported to apply *after*
	Karsten's environment refactoring.

- mingw: Fix CVS-related tests
- t7800: configure $(pwd) for posix-paths on MINGW

	These patches were redone using the $PWD variable instead of
	re-overriding `pwd`.

- mingw (MSys1): enable support for perl regular expressions

	msysGit is dead. No need to carry a patch for it anymore.

This commit starts the rebase of abf3368 to fb59a3e

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 18:29:29 +01:00
Johannes Schindelin
8673bdbeeb fixup! mingw (MSys1): enable support for perl regular expressions
It is absolutely unnecessary to carry any msysGit-specific patches
in our fork. msysGit is dead, long live Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:31:36 +01:00
Johannes Schindelin
9e71342d58 fixup! mingw (MSys1): enable support for perl regular expressions
It is absolutely unnecessary to carry any msysGit-specific patches
in our fork. msysGit is dead, long live Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:31:00 +01:00
Johannes Schindelin
1b3740ae32 fixup! t7800: configure $(pwd) for posix-paths on MINGW
We just did this differently, using the $PWD variable.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:15:10 +01:00
Johannes Schindelin
0204f9162e fixup! mingw: Fix CVS-related tests
We did it differently: see "mingw: work around pwd issues in the tests".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:14:04 +01:00
Johannes Schindelin
25f81cb55c mingw: work around pwd issues in the tests
In Git for Windows' SDK, the tests are run using a Bash that relies on
the POSIX emulation layer MSYS2 (itself a friendly fork of Cygwin). As
such, paths in tests can be POSIX paths. As soon as those paths are
passed to git.exe (which does *not* use the POSIX emulation layer),
those paths are converted into Windows paths, though. This happens
for command-line parameters, but not when reading, say, config variables.

To help with that, the `pwd` command is overridden to return the Windows
path of the current working directory when testing Git on Windows.

However, when talking to anything using the POSIX emulation layer, it is
really much better to use POSIX paths because Windows paths contain a
colon after the drive letter that will easily be mistaken for the common
separator in path lists.

So let's just use the $PWD variable when the POSIX path is needed.

This lets t7800-difftool.sh, t9400-git-cvsserver-server.sh,
t9402-git-cvsserver-refs.sh and t9401-git-cvsserver-crlf.sh pass in Git
for Windows' SDK.

Note: the cvsserver tests require not only the `cvs` package (install
it into Git for Windows' SDK via `pacman -S cvs`) but also the Perl
SQLite bindings (install them into Git for Windows' SDK via
`cpan DBD::SQLite`).

This patch is based on earlier work by 마누엘 and Karsten Blees.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:13:42 +01:00
Johannes Schindelin
f45805d7b7 fixup! mingw: Prepare the TMP environment variable for shell scripts
This change is not actually needed any longer to pass the test suite.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:12:48 +01:00
Johannes Schindelin
6329eaac89 fixup! mingw: Prepare the TMP environment variable for shell scripts
This change is not actually needed any longer to pass the test suite.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:12:47 +01:00
Johannes Schindelin
4f38e72da0 fixup! mingw: do not special-case .exe files anymore
We did it differently, after all, before contributing the patches
upstream that make the test suite pass on Windows (see "mingw: fix
t5601-clone.sh").

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:12:33 +01:00
Johannes Schindelin
c894f09248 mingw: fix t5601-clone.sh
Since baaf233 (connect: improve check for plink to reduce false
positives, 2015-04-26), t5601 writes out a `plink.exe` for testing that
is actually a shell script. So the assumption that the `.exe` extension
implies that the file is *not* a shell script is now wrong.

Since there was no love for the idea of allowing `.exe` files to be
shell scripts on Windows, let's go the other way round: *make*
`plink.exe` a real `.exe`.

This fixes t5601-clone.sh in Git for Windows' SDK.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:12:32 +01:00
Johannes Schindelin
0166dabcdf fixup! Skip t0204 for MinGW Git
It would appear that this patch is unnecessary for the test suite
to pass on Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:06:30 +01:00
Johannes Schindelin
6c8fc0c618 fixup! t0200: disable more tests with MSys2 that rely on locale.exe
When contributing the minimal set of patches to make the test suite
pass on Windows, it turned out that this patch is not at all needed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:05:28 +01:00
Johannes Schindelin
28368e7474 fixup! t9100: don't use symlinks with SVN on MINGW
Turns out that this patch is not needed at all (this came up when
contributing the third batch of Windows-specific patches to upstream).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:03:14 +01:00
Johannes Schindelin
57aa24a183 fixup! Teach 'git remote' that the config var branch.*.rebase can be 'interactive'
This commit was redone in upstream Git and is therefore obsolete.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:01:35 +01:00
Johannes Schindelin
2ae7e33e0a fixup! Handle the branch.<name>.rebase value 'interactive'
This commit became obsolete when 'pull' became a builtin, and was
redone in a patch series to teach the builtin pull about
--rebase=interactive that has landed in upstream Git already.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:01:34 +01:00
Johannes Schindelin
692cbd4758 fixup! Teach 'git pull' to handle --rebase=interactive
This commit became obsolete when 'pull' became a builtin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:01:34 +01:00
Johannes Schindelin
fc48cb44e8 fixup! am: Use cat instead of echo to avoid DOS line-endings (fixes t4150)
This is no longer necessary since 'am' is a builtin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:01:33 +01:00
Johannes Schindelin
68d6667ac1 fixup! mingw: move MSys2 specific environment tweaks to setup_windows_environment
The TZ handling has become obsolete, so let's not refactor it into
setup_windows_environment at all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 17:00:11 +01:00
Johannes Schindelin
344c09a0b5 fixup! Special-case the MSYS2_TZ environment variable
It is no longer necessary, as Git for Windows' fork of the MSYS2
runtime knows to pass on POSIX-compliant timezones.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 16:59:59 +01:00
Johannes Schindelin
32d09cfdac fixup! Special-case the MSYS2_TZ environment variable
It is no longer necessary, as Git for Windows' fork of the MSYS2
runtime knows to pass on POSIX-compliant timezones.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 16:59:58 +01:00
Johannes Schindelin
e82d9c7bed fixup! criss cross rename failure workaround
This patch has been merged in a slightly different form, and the
left-over patch is bogus (and has not been caught for a long time
by this maintainer).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-26 16:59:58 +01:00
Johannes Schindelin
06d0ace55c squash! Enable support for perl regular expressions (LIBPCRE)
Replace commit message by:

mingw (MSys1): enable support for perl regular expressions

In msysGit, we do have libpcre.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-23 09:32:46 +01:00
Johannes Schindelin
21256564bf squash! Win32: support long paths
[jes: adjusted test number to avoid conflicts, reinstated && chain]
2016-01-21 13:43:43 +01:00
Johannes Schindelin
0070717bd1 Merge 'aslr' into HEAD
Address Space Layout Randomization (ASLR) allows executables' memory
layout to change at random between runs, and therefore offers a quite
decent protection against many attacks.

We enable ASLR because MSYS2's C compiler offers support for ASLR, and
whatever performance impact it has is neglible, according to
https://insights.sei.cmu.edu/cert/2014/02/differences-between-aslr-on-windows-and-linux.html

This merges the part of https://github.com/git-for-windows/git/pull/612
that does not break Git ;-)

This fixes https://github.com/git-for-windows/git/issues/608

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-21 13:29:08 +01:00
İsmail Dönmez
dea54431d6 Enable DEP and ASLR
Enable DEP (Data Execution Prevention) and ASLR (Address Space Layout
Randomization) support. This applies to both 32bit and 64bit builds
and makes it substantially harder to exploit security holes in Git by
offering a much more unpredictable attack surface.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-21 13:17:02 +01:00
İsmail Dönmez
bf2d5d8239 Don't let ld strip relocations
This is the first step for enabling ASLR (Address Space Layout
Randomization) support. We want to enable ASLR for better protection
against exploiting security holes in Git.

The problem fixed by this commit is that `ld.exe` seems to be stripping
relocations which in turn will break ASLR support. We just make sure
it's not stripping the main executable entry.

Signed-off-by: İsmail Dönmez <ismail@i10z.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-21 13:15:24 +01:00
Johannes Schindelin
a41b1481ba Merge pull request #606 from skvoboo/issue_598
Use GetFinalPathNameByHandleW instead of GetLongPathNameW to get full path
2016-01-21 13:06:23 +01:00
Anton Serbulov
3700315f0d mingw: fix getcwd when the parent directory cannot be queried
`GetLongPathName()` function may fail when it is unable to query
the parent directory of a path component to determine the long name
for that component. It happens, because of it uses `FindFirstFile()`
function for each next short part of path. The `FindFirstFile()`
requires `List Directory` and `Synchronize` desired access for a calling
process.

In case of lacking such permission for some part of path,
the `GetLongPathName()` returns 0 as result and `GetLastError()`
returns ERROR_ACCESS_DENIED.

`GetFinalPathNameByHandle()` function can help in such cases, because
it requires `Read Attributes` and `Synchronize` desired access to the
target path only.

The `GetFinalPathNameByHandle()` function was introduced on
`Windows Server 2008/Windows Vista`. So we need to load it dynamically.

`CreateFile()` parameters:
    `lpFileName` = path to the current directory
    `dwDesiredAccess` = 0 (it means `Read Attributes` and `Synchronize`)
    `dwShareMode` = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
                    (it prevents `Sharing Violation`)
    `lpSecurityAttributes` = NULL (default security attributes)
    `dwCreationDisposition` = OPEN_EXISTING
                              (required to obtain a directory handle)
    `dwFlagsAndAttributes` = FILE_FLAG_BACKUP_SEMANTICS
                             (required to obtain a directory handle)
    `hTemplateFile` = NULL (when opening an existing file or directory,
                            `CreateFile` ignores this parameter)

The string that is returned by `GetFinalPathNameByHandle()` function
uses the \\?\ syntax. To skip the prefix and convert backslashes
to slashes, the `normalize_ntpath()` mingw function will be used.

Note: `GetFinalPathNameByHandle()` function returns a final path.
It is the path that is returned when a path is fully resolved.
For example, for a symbolic link named "C:\tmp\mydir" that points to
"D:\yourdir", the final path would be "D:\yourdir".

Signed-off-by: Anton Serbulov <aserbulov@plesk.com>
2016-01-21 12:57:42 +06:00
Johannes Schindelin
78ce6bc19e fixup! Provide a dirname() function when NO_LIBGEN_H=YesPlease 2016-01-12 08:54:19 +01:00
Johannes Schindelin
8a71fd7ab0 Merge branch 'libgen-win'
This topic branch squashes the annoying compiler warning claiming that
`dirname()` was not declared.

For some strange reason, changing `basename()` to conform to POSIX does
not re-introduce https://github.com/git-for-windows/git/issues/494. This
developer assumes that the problem in the test suite were somehow fixed
in the meantime, but lacks the time to verify that claim...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-08 15:33:25 +01:00
Johannes Schindelin
7270857abc t0060: verify that basename() and dirname() work as expected
Unfortunately, some libgen implementations yield outcomes different from
what Git expects. For example, mingw-w64-crt provides a basename()
function, that shortens `path0/` to `path`!

So let's verify that the basename() and dirname() functions we use conform
to what Git expects.

Derived-from-code-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-06 16:01:45 +01:00
Johannes Schindelin
64cdd7c832 Provide a dirname() function when NO_LIBGEN_H=YesPlease
When there is no `libgen.h` to our disposal, we miss the `dirname()`
function.

So far, we only had one user of that function: credential-cache--daemon
(which was only compiled when Unix sockets are available, anyway). But
now we also have `builtin/am.c` as user, so we need it.

Since `dirname()` is a sibling of `basename()`, we simply put our very
own `gitdirname()` implementation next to `gitbasename()` and use it
if `NO_LIBGEN_H` has been set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-06 16:01:44 +01:00
Johannes Schindelin
51c8f38fbc compat/basename: make basename() conform to POSIX
According to POSIX, basename("/path/") should return "path", not
"path/". Likewise, basename(NULL) and basename("abc") should both
return ".".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-06 16:01:43 +01:00
Johannes Schindelin
ffcd315739 Refactor skipping DOS drive prefixes
Junio Hamano pointed out that there is an implicit assumption in pretty
much all the code calling has_dos_drive_prefix(): it assumes that the
DOS drive prefix is always two bytes long.

While this assumption is pretty safe, we can still make the code more
readable and less error-prone by introducing a function that skips the
DOS drive prefix safely.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-06 14:58:59 +01:00
Johannes Schindelin
eb5624e7fa fixup! fast-export: do not refer to non-existing marks 2016-01-05 15:02:07 +01:00
Johannes Schindelin
c6bfb28a9d Windows: force-recompile git.res for differing architectures
When git.rc is compiled into git.res, the result is actually dependent
on the architecture. That is, you cannot simply link a 32-bit git.res
into a 64-bit git.exe.

Therefore, to allow 32-bit and 64-bit builds in the same directory, we
let git.res depend on GIT-PREFIX so that it gets recompiled when
compiling for a different architecture (this works because the exec path
changes based on the architecture: /mingw32/libexec/git-core for 32-bit
and /mingw64/libexec/git-core for 64-bit).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-05 14:52:10 +01:00
Johannes Schindelin
b7006a8229 Merge branch 'rebase-i'
This works around the problem described in
https://github.com/git-for-windows/git/issues/542

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-05 14:51:17 +01:00
Johannes Schindelin
cfdb4c7d68 t3404: fix typo
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-05 14:51:15 +01:00
Johannes Schindelin
5dca2ea2bd Merge pull request #552 from duncansmart/fix-vcproj-gen
Fix Visual Studio .sln/.vcproj generation.
2016-01-05 14:51:13 +01:00
Philip Oakley
0846f91e59 engine.pl: ignore invalidcontinue.obj which is known to MSVC
Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better
POSIX compatibility, 2014-03-29) introduced invalidcontinue.obj
into the Makefile output, which was not parsed correctly by the
buildsystem. Ignore it, as it is known to Visual Studio and,
there is no matching source file.

Only substitute filenames ending with .o when generating the
source .c filename, otherwise a .cbj file may be expected.

Split the .o and .obj processing; 'make' does not produce .obj
files.

In the future there may be source files that produce .obj files
so keep the two issues (.obj files with & without source files)
separate.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Duncan Smart <duncan.smart@gmail.com>

(cherry picked from commit d01d71fe1aed67f4e3a5ab80eeadeaf525ad0846)
2016-01-05 14:51:10 +01:00
Johannes Schindelin
4a3bac0598 Merge branch 'git-wrapper-interpolate'
There was a bug in the wrapper where it would interpolate incorrectly if
the name of the environment variable to expand was longer than the value.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-05 14:51:08 +01:00
Johannes Schindelin
d913aeafbe git-wrapper: fix interpolation with short values
To be precise: when the value of the environment variable is shorter than
its name, we have to move the remaining bytes *after* expanding the
environment variable: we would look for the wrong name otherwise.

When the value is longer than the name, we still need to move the bytes
out of the way first, to avoid overwriting them with the interpolated
text.

This fixes https://github.com/git-for-windows/git/issues/509

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-05 14:51:06 +01:00
Johannes Schindelin
239f03df24 git-wrapper: make the interpolation code easier to understand
When moving bytes (because the name and the value of the environment
variable to interpolate differ in length), we introduce a variable to
unclutter the code and make it more obvious what is happening.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2016-01-05 14:51:05 +01:00