Commit Graph

107799 Commits

Author SHA1 Message Date
Johannes Schindelin
eb9ca54f6e README.md: Add a Windows-specific preamble
Includes touch-ups by Philip Oakley.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-17 08:11:13 +01:00
Derrick Stolee
a00d33ef7d CONTRIBUTING.md: add guide for first-time contributors
Getting started contributing to Git can be difficult on a Windows
machine. CONTRIBUTING.md contains a guide to getting started, including
detailed steps for setting up build tools, running tests, and
submitting patches to upstream.

[includes an example by Pratik Karki how to submit v2, v3, v4, etc.]

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
2020-03-17 08:11:12 +01:00
Johannes Schindelin
4fa61685ee Modify the Code of Conduct for Git for Windows
The Git project followed suite and added their Code of Conduct, based on
the Contributors' Covenant v1.4.

We edit it slightly to reflect Git for Windows' particulars.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-17 08:11:12 +01:00
Johannes Schindelin
c2fe03aab1 Start the merging-rebase to v2.26.0-rc2
This commit starts the rebase of 5abc82c39a to b2afad88145d
2020-03-17 08:10:18 +01:00
Junio C Hamano
6c85aac65f Git 2.26-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-16 12:46:32 -07:00
Junio C Hamano
74f172e39e Merge branch 'en/test-cleanup'
Test fixes.

* en/test-cleanup:
  t6022, t6046: fix flaky files-are-updated checks
2020-03-16 12:43:30 -07:00
Junio C Hamano
e96327c947 Merge branch 'es/outside-repo-errmsg-hints'
An earlier update to show the location of working tree in the error
message did not consider the possibility that a git command may be
run in a bare repository, which has been corrected.

* es/outside-repo-errmsg-hints:
  prefix_path: show gitdir if worktree unavailable
2020-03-16 12:43:29 -07:00
Emily Shaffer
5c20398699 prefix_path: show gitdir if worktree unavailable
If there is no worktree at present, we can still hint the user about
Git's current directory by showing them the absolute path to the Git
directory. Even though the Git directory doesn't make it as easy to
locate the worktree in question, it can still help a user figure out
what's going on while developing a script.

This fixes a segmentation fault introduced in e0020b2f
("prefix_path: show gitdir when arg is outside repo", 2020-02-14).

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
[jc: added minimum tests, with help from Szeder Gábor]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-15 09:35:46 -07:00
Elijah Newren
70e24186c0 t6022, t6046: fix flaky files-are-updated checks
Several tests wanted to verify that files were actually modified by a
merge, which it would do by checking that the mtime was updated.  In
order to avoid problems with the merge completing so fast that the mtime
at the beginning and end of the operation was the same, these tests
would first set the mtime of a file to something "old".  This "old"
value was usually determined as current system clock minus one second,
truncated to the nearest integer.  Unfortunately, it appears the system
clock and filesystem clock are different and comparing across the two
runs into race problems resulting in flaky tests.

From https://stackoverflow.com/questions/14392975/timestamp-accuracy-on-ext4-sub-millsecond:

    date will call the gettimeofday system call which will always return
    the most accurate time available based on the cached kernel time,
    adjusted by the CPU cycle time if available to give nanosecond
    resolution. The timestamps stored in the file system however, are
    only based on the cached kernel time. ie The time calculated at the
    last timer interrupt.

and from https://apenwarr.ca/log/20181113:

    Does mtime get set to >= the current time?

    No, this depends on clock granularity. For example, gettimeofday()
    can return times in microseconds on my system, but ext4 rounds
    timestamps down to the previous ~10ms (but not exactly 10ms)
    increment, with the surprising result that a newly-created file is
    almost always created in the past:

      $ python -c "
      import os, time
      t0 = time.time()
      open('testfile', 'w').close()
      print os.stat('testfile').st_mtime - t0
      "

      -0.00234484672546

So, instead of trying to compare across what are effectively two
different clocks, just avoid using the system clock.  Any new updates to
files have to give an mtime at least as big as what is already in the
file, so we could define "old" as one second before the mtime found in
the file before the merge starts.  But, to avoid problems with leap
seconds, ntp updates, filesystems that only provide two second
resolution, and other such weirdness, let's just pick an hour before the
mtime found in the file before the merge starts.

Also, clarify in one test where we check the mtime of different files
that it really was intentional.  I totally forgot the reasons for that
and assumed it was a bug when asked.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-13 13:06:47 -07:00
Junio C Hamano
30e9940356 Hopefully the final batch before -rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-12 14:36:00 -07:00
Junio C Hamano
b4f0038525 Merge branch 'en/rebase-backend'
Band-aid fixes for two fallouts from switching the default "rebase"
backend.

* en/rebase-backend:
  git-rebase.txt: highlight backend differences with commit rewording
  sequencer: clear state upon dropping a become-empty commit
  i18n: unmark a message in rebase.c
2020-03-12 14:28:01 -07:00
Elijah Newren
120b1eb731 git-rebase.txt: highlight backend differences with commit rewording
As noted by Junio:
    Back when "git am" was written, it was not considered a bug that the
    "git am --resolved" option did not offer the user a chance to update
    the log message to match the adjustment of the code the user made,
    but honestly, I'd have to say that it is a bug in "git am" in that
    over time it wasn't adjusted to the new world order where we
    encourage users to describe what they did when the automation
    hiccuped by opening an editor.  These days, even when automation
    worked well (e.g. a clean auto-merge with "git merge"), we open an
    editor.  The world has changed, and so should the expectations.

Junio also suggested providing a workaround such as allowing --no-edit
together with git rebase --continue, but that should probably be done in
a patch after the git-2.26.0 release.  For now, just document the known
difference in the Behavioral Differences section.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-11 12:11:08 -07:00
Elijah Newren
9a1b7474d6 sequencer: clear state upon dropping a become-empty commit
In commit e98c4269c8 ("rebase (interactive-backend): fix handling of
commits that become empty", 2020-02-15), the merge backend was changed
to drop commits that did not start empty but became so after being
applied (because their changes were a subset of what was already
upstream).  This new code path did not need to go through the process of
creating a commit, since we were dropping the commit instead.
Unfortunately, this also means we bypassed the clearing of the
CHERRY_PICK_HEAD and MERGE_MSG files, which if there were no further
commits to cherry-pick would mean that the rebase would end but assume
there was still an operation in progress.  Ensure that we clear such
state files when we decide to drop the commit.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-11 12:11:05 -07:00
Jiang Xin
937d143630 i18n: unmark a message in rebase.c
Commit v2.25.0-4-ge98c4269c8 (rebase (interactive-backend): fix handling
of commits that become empty, 2020-02-15) marked "{drop,keep,ask}" for
translation, but this message should not be changed.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-11 11:39:01 -07:00
Junio C Hamano
a56d361f66 Merge branch 'ds/sparse-add'
Test fix.

* ds/sparse-add:
  t1091: don't grep for `strerror()` string
2020-03-11 10:58:16 -07:00
Junio C Hamano
5fa9169ced Merge branch 'dr/push-remote-ref-update'
Code clean-up.

* dr/push-remote-ref-update:
  remote: drop "explicit" parameter from remote_ref_for_branch()
2020-03-11 10:58:16 -07:00
Junio C Hamano
cdef998b46 Merge branch 'jc/doc-single-h-is-for-help'
Both "git ls-remote -h" and "git grep -h" give short usage help,
like any other Git subcommand, but it is not unreasonable to expect
that the former would behave the same as "git ls-remote --head"
(there is no other sensible behaviour for the latter).  The
documentation has been updated in an attempt to clarify this.

* jc/doc-single-h-is-for-help:
  Documentation: clarify that `-h` alone stands for `help`
2020-03-11 10:58:16 -07:00
Johannes Schindelin
fa211ac08e Merge branch 'git-gui--askpass-utf-8'
This fixes the problem where Git was not receiving non-ASCII characters
correctly in `git-gui--askpass`'s answer.

This used to be https://github.com/git-for-windows/git/pull/2542, but
due to this maintainer's mistake, that PR was closed instead of updated
;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-11 11:23:07 +01:00
Luke Bonanomi
a7be4f45df git-gui--askpass: coerce answers to UTF-8 on Windows
This addresses the issue where Git for Windows asks the user for a
password, no credential helper is available, and then Git fails to pick
up non-ASCII characters from the Git GUI helper.

This can be verified e.g. via

	echo host=http://abc.com |
	git -c credential.helper= credential fill

and then pasting some umlauts.

The underlying reason is that Git for Windows tries to communicate using
the UTF-8 encoding no matter what the actual current code page is. So
let's indulge Git for Windows and do use that encoding.

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

Signed-off-by: Luke Bonanomi <lbonanomi@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-11 11:14:52 +01:00
Johannes Schindelin
e0fbc270ec Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
v2.26.0-rc1.windows.1
2020-03-10 20:41:32 +01:00
Johannes Schindelin
dd01fda983 Merge branch 'phase-out-reset-stdin'
This topic branch re-adds the deprecated --stdin/-z options to `git
reset`. Those patches were overridden by a different set of options in
the upstream Git project before we could propose `--stdin`.

We offered this in MinGit to applications that wanted a safer way to
pass lots of pathspecs to Git, and these applications will need to be
adjusted.

Instead of `--stdin`, `--pathspec-from-file=-` should be used, and
instead of `-z`, `--pathspec-file-nul`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:32 +01:00
Johannes Schindelin
cfa782bb42 Merge pull request #1354 from dscho/phase-out-show-ignored-directory-gracefully
Phase out `--show-ignored-directory` gracefully
2020-03-10 20:41:31 +01:00
Johannes Schindelin
2cb7e64d39 Merge branch 'status-no-lock-index'
This branch allows third-party tools to call `git status
--no-lock-index` to avoid lock contention with the interactive Git usage
of the actual human user.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:30 +01:00
Johannes Schindelin
e82f2f6add Merge pull request #1170 from dscho/mingw-kill-process
Handle Ctrl+C in Git Bash nicely

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:30 +01:00
Johannes Schindelin
985dd4ec18 Merge branch 'busybox-w32'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:29 +01:00
Johannes Schindelin
4861720f7d Merge pull request #1897 from piscisaureus/symlink-attr
Specify symlink type in .gitattributes
2020-03-10 20:41:28 +01:00
Johannes Schindelin
871ffc1ec5 Merge 'docker-volumes-are-no-symlinks'
This was pull request #1645 from ZCube/master

Support windows container.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:27 +01:00
Johannes Schindelin
a892eea31a Merge branch 'kblees/kb/symlinks' 2020-03-10 20:41:27 +01:00
Johannes Schindelin
4ab7f8d059 Merge branch 'msys2' 2020-03-10 20:41:26 +01:00
Johannes Schindelin
b03f8b30f4 Merge branch 'long-paths' 2020-03-10 20:41:26 +01:00
Johannes Schindelin
40700f0eeb Merge branch 'dont-clean-junctions-fscache'
We already avoid traversing NTFS junction points in `git clean -dfx`.
With this topic branch, we do that when the FSCache is enabled, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:25 +01:00
Derrick Stolee
8c469d321e Merge branch 'fscache-and-sparse-checkout'
When updating the skip-worktree bits in the index to align with new
values in a sparse-checkout file, Git scans the entire working
directory with lstat() calls. In a sparse-checkout, many of these
lstat() calls are for paths that do not exist.

Enable the fscache feature during this scan.

In a local test of a repo with ~2.2 million paths, updating the index
with `git read-tree -m -u HEAD` with a sparse-checkout file containing
only `/.gitattributes` improved from 2-3 minutes to 15-20 seconds.

More work could be done to stop running lstat() calls when recursing
into directories that are known to not exist.
2020-03-10 20:41:24 +01:00
Johannes Schindelin
ae90dd90f7 Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
fscache: teach fscache to use NtQueryDirectoryFile
2020-03-10 20:41:24 +01:00
Johannes Schindelin
bfe573757c Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
fscache: make fscache_enable() thread safe
2020-03-10 20:41:23 +01:00
Johannes Schindelin
bb3998a25d Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'
This brings substantial wins in performance because the FSCache is now
per-thread, being merged to the primary thread only at the end, so we do
not have to lock (except while merging).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:23 +01:00
Johannes Schindelin
977ff0cbe4 Merge pull request #1910 from benpeart/fscache_statistics-gfw
fscache: add fscache hit statistics
2020-03-10 20:41:22 +01:00
Johannes Schindelin
c26bee70a9 Merge pull request #1914 from benpeart/free-fscache-after-add-gfw
At the end of the add command, disable and free the fscache
2020-03-10 20:41:22 +01:00
Johannes Schindelin
fad8bd3da3 Merge pull request #1911 from benpeart/git_test_fscache-gfw
fscache: add GIT_TEST_FSCACHE support
2020-03-10 20:41:21 +01:00
Johannes Schindelin
f91cc49982 Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
status: disable and free fscache at the end of the status command
2020-03-10 20:41:20 +01:00
Johannes Schindelin
81ad2c1ad9 Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
fscache: use FindFirstFileExW to avoid retrieving the short name
2020-03-10 20:41:20 +01:00
Johannes Schindelin
c854c13a0b Merge pull request #1827 from benpeart/fscache_refresh_index
Enable the filesystem cache (fscache) in refresh_index().
2020-03-10 20:41:19 +01:00
Johannes Schindelin
b9b1ce4312 Merge pull request #1468 from atetubou/fscache_checkout_flush
checkout.c: enable fscache for checkout again

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:18 +01:00
Johannes Schindelin
400468468a Merge pull request #1426 from atetubou/fetch_pack
fetch-pack.c: enable fscache for stats under .git/objects
2020-03-10 20:41:18 +01:00
Johannes Schindelin
6da6cd1eac Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fscache
dir.c: make add_excludes aware of fscache during status
2020-03-10 20:41:17 +01:00
Johannes Schindelin
0f3d22c4ac Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_fscache
add: use preload-index and fscache for performance
2020-03-10 20:41:17 +01:00
Johannes Schindelin
7db4b1aaf8 Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
fscache: add not-found directory cache to fscache
2020-03-10 20:41:16 +01:00
Johannes Schindelin
88f1b28d46 Merge branch 'fscache' 2020-03-10 20:41:16 +01:00
Johannes Schindelin
d8fea5556a Merge 'add-p-many-files'
This topic branch allows `add -p` and `add -i` with a large number of
files. It is kind of a hack that was never really meant to be
upstreamed. Let's see if we can do better in the built-in `add -p`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:15 +01:00
Johannes Schindelin
dd3b5f83e0 Merge branch 'gitk-and-git-gui-patches'
These are Git for Windows' Git GUI and gitk patches. We will have to
decide at some point what to do about them, but that's a little lower
priority (as Git GUI seems to be unmaintained for the time being, and
the gitk maintainer keeps a very low profile on the Git mailing list,
too).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2020-03-10 20:41:14 +01:00
Johannes Schindelin
6031657685 Merge branch 'ready-for-upstream'
This is the branch thicket of patches in Git for Windows that are
considered ready for upstream. To keep them in a ready-to-submit shape,
they are kept as close to the beginning of the branch thicket as
possible.
2020-03-10 20:41:14 +01:00