Граф коммитов

99482 Коммитов

Автор SHA1 Сообщение Дата
Johannes Schindelin 57e2b1eb0a Merge branch 'always-reword-merge-c'
During a `rebase -r`, when a `merge -c` is executed that can
fast-forward, we *still* want to edit the commit message. Let's force
this *not* to fast-forward instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:35 +02:00
Junio C Hamano a5f717840f Merge branch 'ds/object-info-for-prefetch-fix' into jch
* ds/object-info-for-prefetch-fix:
  sha1-file: split OBJECT_INFO_FOR_PREFETCH

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:35 +02:00
Johannes Schindelin 66cec40145 Merge pull request #2203 from dscho/fix-racy-fsmonitor-gfw
Fix racy fsmonitor

The `t7519-status-fsmonitor.sh` tests became a *lot* more flaky with the
recent fsmonitor fix (`js/fsmonitor-refresh-after-discarding-index`).
That fix, however, did not introduce the flakiness, but it just made it
much more likely to be hit. And it seemed to be hit *only* on Windows.

The reason, though, is that the fsmonitor feature failed to mark the
in-memory index as changed, i.e. in need of writing, and it was the
`has_racy_timestamp()` test that hid this bug in most cases (although a
lot less on Windows, where the files' mtimes are actually a lot more
accurate than on Linux).

This fixes https://github.com/gitgitgadget/git/issues/197

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:35 +02:00
Johannes Schindelin 92d02c8a45 Merge 'drop-rebase--am.sh'
This topic branch cleans up some left-overs that were forgotten when
removing the scripted `git rebase`.

As these patches are based on top of v2.22.0-rc1 (which *did* drop the
scripted `git-rebase.sh`), instead of v2.21.0 (on which the current `master`
of Git for Windows is based, and which did *not* yet drop the scripted
`git rebase`) it does not make sense to try to backport them to
`master`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:34 +02:00
Johannes Schindelin 2aa2ef1c7e Merge branch 'close-graph-everywhere'
This topic branch is a backport of
https://github.com/gitgitgadget/git/pull/208, which avoids a lock
contention in `git gc --auto` where the `git gc` process holds a read
lock to the `commit-graph` file (if `core.commitgraph=true`) and the
spawned `git commit-graph write` (if `gc.writecommitgraph=true`) tries
to overwrite it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:34 +02:00
Johannes Schindelin 2ae2e3c3f6 Merge pull request #2149 from dscho/gcc-8-gfw
Make Git for Windows compile with GCC 8.x
2019-05-31 12:25:34 +02:00
Johannes Schindelin 2674b8afd0 Merge branch 'robustify-is-hidden-tests'
In Git for Windows, there is an option to mark the .git directory as
hidden. Our test cases verify this by using the system utility
`attrib.exe`.

This file name is unfortunately quite generic, and overlaps with a
Unix-y utility that might be hiding the system one in the `PATH`.

Let's specify explicitly which `attrib` to use.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:34 +02:00
Johannes Schindelin 2c79b2334c Merge branch 'fflush-in-git-clean'
After writing to `stdout` and before reading from `stdin`, it is a good
idea to flush the former.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:34 +02:00
Johannes Schindelin cee5247bfa Merge branch 'avoid-pipes-in-svn-tests'
It is a good idea in general to avoid pipes in test cases, as it makes
things more debuggable to have files to inspect (instead of ephemereal
piped data that is long gone).

This also seemed to work around a problem where MSYS2' Perl would
segfault which may, or may not, still be present today.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:33 +02:00
Johannes Schindelin 96669ec846 Merge branch 'address-coverity-reports'
Coverity pointed out a couple of bugs, and here are fixes for some of
them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:33 +02:00
Johannes Schindelin cc6739f87d Merge pull request #2170 from dscho/gitk-long-cmdline
Fix gitk (long cmdline)
2019-05-31 12:25:33 +02:00
Johannes Schindelin 700362b57c Merge branch 'fsync-object-files-always'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:33 +02:00
Johannes Schindelin 49356b1bd8 Merge branch 'spawn-with-spaces'
This topic branch conflicts with the next change that will change the
way we call `CreateProcessW()`. So let's merge it early, to avoid merge
conflicts during a merge (because we would have to resolve this with
every single merging-rebase).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:33 +02:00
Johannes Schindelin 9db90527bd Merge branch 'clean-long-paths'
This addresses https://github.com/git-for-windows/git/issues/521

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:32 +02:00
Johannes Schindelin 5ecab343d6 Merge branch 'mingw-home'
The environment variable `HOME` is not exactly a native concept on
Windows, but Git and its scripts rely heavily on it. Make sure that it
is set (using a default that is sensible in most cases, and can easily
be overridden by setting the user-wide environment variable `HOME`
explicitly, before starting Git).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:32 +02:00
Johannes Schindelin 8c2c8881ff Merge branch 'gettext-force-utf-8-on-windows'
The idea of the C runtime on Windows as to what a locale is does not
mesh well with the idea Git has. So let's just ignore the C runtime.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:32 +02:00
Johannes Schindelin 4c3e1d9fa1 Merge branch 'mingw-avoid-illegal-filenames'
MSYS2 inherits the trick from Cygwin to pretend that filenames can
contain characters that are illegal on Windows (by mapping them to a
private Unicode page). As long as we stay safely within the MSYS2 realm
(Bash, GNU make, Perl) that is fine, so technically this change is not
needed. But it is a lot more elegant not to rely on this.

Besides, the suffix `.new` is a lot more intuitive than the suffix
`+`...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:32 +02:00
Johannes Schindelin 2553275534 Merge branch 'mingw-stack-smashing-protector'
This is GCC's attempt at making things less predictable and thereby
reduce the attack surface for malware.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:32 +02:00
Johannes Schindelin 78b1d32d67 Merge branch 'mingw-manifest'
Windows executables can be configured to make use of certain Windows
features only via a so-called "manifest", i.e. a specific, embedded
resource. This manifest is also necessary to determine the Windows
version reliably.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:31 +02:00
Johannes Schindelin c54537ce9d Merge branch 'munmap-before-ext-diff'
This topic branch fixes the usage pattern where files are still held
open with an exclusive lock when an external program is asked to open
those very same files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:31 +02:00
Johannes Schindelin 17b5778623 Merge branch 'ansi-unicode'
This patch series teaches Git's source code to use the Unicode variants
of the Win32 API functions explicitly, which makes things less magical
and more robust.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 12:25:31 +02:00
Johannes Schindelin 7691a90988 kwset: allow building with GCC 8
The kwset functionality makes use of the obstack code, which expects to
be handed a function that can allocate large chunks of data. It expects
that function to accept a `size` parameter of type `long`.

This upsets GCC 8 on Windows, because `long` does not have the same
bit size as `size_t` there.

Now, the proper thing to do would be to switch to `size_t`. But this
would make us deviate from the "upstream" code even further, making it
hard to synchronize with newer versions, and also it would be quite
involved because that `long` type is so invasive in that code.

Let's punt, and instead provide a super small wrapper around
`xmalloc()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:59:49 +02:00
Johannes Schindelin 9b294bf958 mingw: allow compiling with GCC 8 and DEVELOPER=1
The return type of the `GetProcAddress()` function is `FARPROC` which
evaluates to `long long int (*)()`, i.e. it cannot be cast to the
correct function signature by GCC 8.

To work around that, we first cast to `void *` and go on with our merry
lives.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:59:45 +02:00
Johannes Schindelin d6e4a926bf Merge branch 'program-data-config'
This branch introduces support for reading the "Windows-wide" Git
configuration from `%PROGRAMDATA%\Git\config`. As these settings are
intended to be shared between *all* Git-related software, that config
file takes an even lower precedence than `$(prefix)/etc/gitconfig`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:43 +02:00
Johannes Schindelin 20af8cb4bb Merge pull request #2148 from dscho/azure-pipelines-msvc
Let the MSVC build also be tested in the Azure Pipeline
2019-05-31 09:54:42 +02:00
Jeff Hostetler 481d6b9ce1 Merge branch 'visual-studio'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:42 +02:00
Jeff Hostetler ccc9fe4d78 Merge branch 'msvc'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:42 +02:00
Johannes Schindelin 9f09372011 Merge remote-tracking branch 'dscho/add-p' into add-p-g4w
Let's test this for a while.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:42 +02:00
Johannes Schindelin 47ca12331a Merge branch 'dont-spawn-gzip-in-archive'
This topic branch avoids spawning `gzip` when asking `git archive` to
create `.tar.gz` files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:42 +02:00
Johannes Schindelin 7ce2275021 Merge pull request #1915 from dscho/open-in-gdb
Add a helper function to start GDB that was already attached to the current process
2019-05-31 09:54:41 +02:00
Johannes Schindelin 321454c56f Merge pull request #1859 from dscho/funny-cased-cwd
Fix t0001 when the current working directory differs in case from the canonical form
2019-05-31 09:54:41 +02:00
Johannes Schindelin b2e77b485a Merge branch 'mingw-expand-absolute-user-path'
When compiling Git with a runtime prefix (so that it can be installed
into any location, finding its libexec/ directory relative to the
location of the `git` executable), it is convenient to provide
"absolute" Unix-y paths e.g. for http.sslCAInfo, and have those absolute
paths be resolved relative to the runtime prefix.

This patch makes it so for Windows. It is up for discussion whether we
want this for other platforms, too, as long as building with
RUNTIME_PREFIX.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:41 +02:00
Johannes Schindelin 127b17e4c4 Merge branch 'file-url-to-unc-path'
This topic branch teaches Git to accept UNC paths of the form
file://host/share/repository.git.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:41 +02:00
Johannes Schindelin 548d777c12 Merge branch 'test-unc-fetch'
Fix fetching from UNC paths.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:41 +02:00
Johannes Schindelin 96afad6955 Merge branch 'drive-prefix'
This topic branch allows us to specify absolute paths without the drive
prefix e.g. when cloning.

Example:

	C:\Users\me> git clone https://github.com/git/git \upstream-git

This will clone into a new directory C:\upstream-git, in line with how
Windows interprets absolute paths.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:41 +02:00
Phillip Wood 5202e1c5fd rebase -r: always reword merge -c
If a merge can be fast-forwarded then make sure that we still edit the
commit message if the user specifies -c. The implementation follows the
same pattern that is used for ordinary rewords that are fast-forwarded.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-31 09:54:40 +02:00
Johannes Schindelin c779ecba6c Merge pull request #996 from jeffhostetler/jeffhostetler/register_rename_src
diffcore-rename: speed up register_rename_src
2019-05-31 09:54:40 +02:00
Johannes Schindelin 0c22e06295 Merge branch 'gitdir-at-unc-root'
This fixes a bug where a .git directory at the root of a network share
(e.g. \\MYSERVER\sharedfolder\.git) was not handled correctly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:40 +02:00
Johannes Schindelin da09c67286 Merge 'fix-externals' into HEAD 2019-05-31 09:54:40 +02:00
Johannes Schindelin 43201af4ea 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>
2019-05-31 09:54:40 +02:00
Johannes Schindelin 257e52d5ba Merge branch 'reset-stdin'
This topic branch adds the (experimental) --stdin/-z options to `git
reset`. Those patches are still under review in the upstream Git project,
but are already merged in their experimental form into Git for Windows'
`master` branch, in preparation for a MinGit-only release.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:40 +02:00
Derrick Stolee 1793c79fd9 sha1-file: split OBJECT_INFO_FOR_PREFETCH
The OBJECT_INFO_FOR_PREFETCH bitflag was added to sha1-file.c in 0f4a4fb1
(sha1-file: support OBJECT_INFO_FOR_PREFETCH, 2019-03-29) and is used to
prevent the fetch_objects() method when enabled.

However, there is a problem with the current use. The definition of
OBJECT_INFO_FOR_PREFETCH is given by adding 32 to OBJECT_INFO_QUICK. This is
clearly stated above the definition (in a comment) that this is so
OBJECT_INFO_FOR_PREFETCH implies OBJECT_INFO_QUICK. The problem is that using
"flag & OBJECT_INFO_FOR_PREFETCH" means that OBJECT_INFO_QUICK also implies
OBJECT_INFO_FOR_PREFETCH.

Split out the single bit from OBJECT_INFO_FOR_PREFETCH into a new
OBJECT_INFO_SKIP_FETCH_OBJECT as the single bit and keep
OBJECT_INFO_FOR_PREFETCH as the union of two flags. This allows a clearer use
of flag checking while also keeping the implication of OBJECT_INFO_QUICK.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-05-31 09:54:39 +02:00
Johannes Schindelin 187f852792 mark_fsmonitor_valid(): mark the index as changed if needed
Without this bug fix, t7519's four "status doesn't detect unreported
modifications" test cases would fail occasionally (and, oddly enough,
*a lot* more frequently on Windows).

The reason is that these test cases intentionally use the side effect of
`git status` to re-write the index if any updates were detected: they
first clean the worktree, run `git status` to update the index as well
as show the output to the casual reader, then make the worktree dirty
again and expect no changes to reported if running with a mocked
fsmonitor hook.

The problem with this strategy was that the index was written during
said `git status` on the clean worktree for the *wrong* reason: not
because the index was marked as changed (it wasn't), but because the
recorded mtimes were racy with the index' own mtime.

As the mtime granularity on Windows is 100 nanoseconds (see e.g.
https://docs.microsoft.com/en-us/windows/desktop/SysInfo/file-times),
the mtimes of the files are often enough *not* racy with the index', so
that that `git status` call currently does not always update the index
(including the fsmonitor extension), causing the test case to fail.

The obvious fix: if we change *any* index entry's `CE_FSMONITOR_VALID`
flag, we should also mark the index as changed. That will cause the
index to be written upon `git status`, *including* an updated fsmonitor
extension.

Side note: Even though the reader might think that the t7519 issue
should be *much* more prevalent on Linux, given that the ext4 filesystem
(that seems to be used by every Linux distribution) stores mtimes in
nanosecond precision. However, ext4 uses `current_kernel_time()` (see
https://unix.stackexchange.com/questions/11599#comment762968_11599; it
is *amazingly* hard to find any proper source of information about such
ext4 questions) whose accuracy seems to depend on many factors but is
safely worse than the 100-nanosecond granularity of NTFS (again, it is
*horribly* hard to find anything remotely authoritative about this
question). So it seems that the racy index condition that hid the bug
fixed by this patch simply is a lot more likely on Linux than on
Windows. But not impossible ;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:39 +02:00
Johannes Schindelin 7549313819 rebase: fold git-rebase--common into the -p backend
The only remaining scripted part of `git rebase` is the
`--preserve-merges` backend. Meaning: there is little reason to keep the
"library of common rebase functions" as a separate file.

While moving the functions to `git-rebase--preserve-merges.sh`, we also
drop the `move_to_original_branch` function that is no longer used.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:39 +02:00
Derrick Stolee 017a691e59 packfile: close_all_packs to close_object_store
The close_all_packs() method is now responsible for more than just pack-files.
It also closes the commit-graph and the multi-pack-index. Rename the function
to be more descriptive of its larger role. The name also fits because the
input parameter is a raw_object_store.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2019-05-31 09:54:39 +02:00
Johannes Schindelin ec29454b2f mingw: make is_hidden tests in t0001/t5611 more robust
We should not actually expect the first `attrib.exe` in the PATH to
be the one we are looking for. Or that it is in the PATH, for that
matter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:39 +02:00
Johannes Schindelin d0c473d51d fill_stat_cache_info(): prepare for an fsmonitor fix
We will need to pass down the `struct index_state` to
`mark_fsmonitor_valid()` for an upcoming bug fix, and this here function
calls that there function, so we need to extend the signature of
`fill_stat_cache_info()` first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:39 +02:00
Johannes Schindelin 30699560a7 sequencer: the `am` and `rebase--interactive` scripts are gone
Update a code comment that referred to those files as if they were still
there.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:39 +02:00
Derrick Stolee c33a4f2a76 packfile: close commit-graph in close_all_packs
The close_all_packs() method is used to close all read handles to
pack-files and the multi-pack-index before running 'git gc --auto'.
This is particularly important on the Windows platform, where read
handles block any writes to those files. Replacing one of these
files with a rename() will fail in this situation.

The commit-graph also performs a rename, so is susceptable to this
problem. We are careful to close the commit-graph before writing,
but that doesn't work when a 'git fetch' (or similar) process runs
'git gc --auto' which may write a commit-graph.

Here, close the commit-graph as part of close_all_packs().

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2019-05-31 09:54:39 +02:00
Johannes Schindelin 29f83fdc17 .gitignore: there is no longer a built-in `git-rebase--interactive`
This went away in 0609b741a4 (rebase -i: combine rebase--interactive.c
with rebase.c, 2019-04-17).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-05-31 09:54:39 +02:00