Skip to content

Commit dc10476

Browse files
committed
Merge branch 'microsoft/vfs-2.35.0'
We actually only need the FSMonitor... Signed-off-by: Johannes Schindelin <[email protected]>
2 parents e2edaba + 04a260a commit dc10476

File tree

104 files changed

+14052
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+14052
-268
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
- [ ] I was not able to find an [open](https://github.com/git-for-windows/git/issues?q=is%3Aopen) or [closed](https://github.com/git-for-windows/git/issues?q=is%3Aclosed) issue matching what I'm seeing
1+
- [ ] I was not able to find an [open](https://github.com/microsoft/git/issues?q=is%3Aopen)
2+
or [closed](https://github.com/microsoft/git/issues?q=is%3Aclosed) issue matching
3+
what I'm seeing, including in [the `git-for-windows/git` tracker](https://github.com/git-for-windows/git/issues).
24

35
### Setup
46

5-
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
7+
- Which version of `microsoft/git` are you using? Is it 32-bit or 64-bit?
68

79
```
810
$ git --version --build-options
911
1012
** insert your machine's response here **
1113
```
1214

13-
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
15+
Are you using Scalar or VFS for Git?
16+
17+
** insert your answer here **
18+
19+
If VFS for Git, then what version?
1420

1521
```
16-
$ cmd.exe /c ver
22+
$ gvfs version
1723
1824
** insert your machine's response here **
1925
```
2026

21-
- What options did you set as part of the installation? Or did you choose the
22-
defaults?
27+
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
2328

2429
```
25-
# One of the following:
26-
> type "C:\Program Files\Git\etc\install-options.txt"
27-
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
28-
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
29-
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
30-
$ cat /etc/install-options.txt
30+
$ cmd.exe /c ver
3131
3232
** insert your machine's response here **
3333
```
@@ -58,7 +58,11 @@ $ cat /etc/install-options.txt
5858

5959
** insert here **
6060

61-
- If the problem was occurring with a specific repository, can you provide the
62-
URL to that repository to help us with testing?
61+
- If the problem was occurring with a specific repository, can you specify
62+
the repository?
6363

64-
** insert URL here **
64+
* [ ] Public repo: **insert URL here**
65+
* [ ] Windows monorepo
66+
* [ ] Office monorepo
67+
* [ ] Other Microsoft-internal repo: **insert name here**
68+
* [ ] Other internal repo.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
Thanks for taking the time to contribute to Git!
22

3-
Those seeking to contribute to the Git for Windows fork should see
4-
http://gitforwindows.org/#contribute on how to contribute Windows specific
5-
enhancements.
6-
7-
If your contribution is for the core Git functions and documentation
8-
please be aware that the Git community does not use the github.com issues
9-
or pull request mechanism for their contributions.
10-
11-
Instead, we use the Git mailing list ([email protected]) for code and
12-
documentation submissions, code reviews, and bug reports. The
13-
mailing list is plain text only (anything with HTML is sent directly
14-
to the spam folder).
15-
16-
Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
17-
to conveniently send your Pull Requests commits to our mailing list.
18-
19-
For a single-commit pull request, please *leave the pull request description
20-
empty*: your commit message itself should describe your changes.
21-
22-
Please read the "guidelines for contributing" linked above!
3+
This fork contains changes specific to monorepo scenarios. If you are an
4+
external contributor, then please detail your reason for submitting to
5+
this fork:
6+
7+
* [ ] This is an early version of work already under review upstream.
8+
* [ ] This change only applies to interactions with Azure DevOps and the
9+
GVFS Protocol.
10+
* [ ] This change only applies to the virtualization hook and VFS for Git.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update Homebrew Tap
2+
on:
3+
release:
4+
types: [released]
5+
6+
permissions:
7+
id-token: write # required for Azure login via OIDC
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
environment: release
13+
steps:
14+
- id: version
15+
name: Compute version number
16+
run: |
17+
echo "result=$(echo $GITHUB_REF | sed -e "s/^refs\/tags\/v//")" >>$GITHUB_OUTPUT
18+
- id: hash
19+
name: Compute release asset hash
20+
uses: mjcheetham/[email protected]
21+
with:
22+
asset: /git-(.*)\.pkg/
23+
hash: sha256
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Log into Azure
26+
uses: azure/login@v2
27+
with:
28+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
29+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
30+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
31+
- name: Retrieve token
32+
id: token
33+
run: |
34+
az keyvault secret show \
35+
--name ${{ secrets.HOMEBREW_TOKEN_SECRET_NAME }} \
36+
--vault-name ${{ secrets.AZURE_VAULT }} \
37+
--query "value" -o tsv >token &&
38+
# avoid outputting the token under `set -x` by using `sed` instead of `echo`
39+
sed s/^/::add-mask::/ <token &&
40+
sed s/^/result=/ <token >>$GITHUB_OUTPUT &&
41+
rm token
42+
- name: Update scalar Cask
43+
uses: mjcheetham/[email protected]
44+
with:
45+
token: ${{ steps.token.outputs.result }}
46+
tap: microsoft/git
47+
name: microsoft-git
48+
type: cask
49+
version: ${{ steps.version.outputs.result }}
50+
sha256: ${{ steps.hash.outputs.result }}
51+
alwaysUsePullRequest: false

.github/workflows/release-winget.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "release-winget"
2+
on:
3+
release:
4+
types: [released]
5+
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag name to release'
10+
required: true
11+
12+
permissions:
13+
id-token: write # required for Azure login via OIDC
14+
15+
env:
16+
TAG_NAME: ${{ github.event.inputs.tag }}
17+
18+
jobs:
19+
release:
20+
runs-on: windows-latest
21+
environment: release
22+
steps:
23+
- name: Log into Azure
24+
uses: azure/login@v2
25+
with:
26+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
27+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
28+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
29+
30+
- name: Publish manifest with winget-create
31+
run: |
32+
# Enabling stop on error and tracing
33+
Set-PSDebug -Trace 2
34+
$ErrorActionPreference = "Stop"
35+
$PSNativeCommandErrorActionPreference = "Stop"
36+
37+
if ($env:TAG_NAME -eq "") {
38+
# Get latest release
39+
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
40+
41+
# Set the tag name environment variable
42+
$env:TAG_NAME = $github.release.tag_name
43+
44+
# Get download URLs
45+
$asset_x64 = $github.release.assets | Where-Object -Property name -match '64-bit.exe$'
46+
$asset_arm64 = $github.release.assets | Where-Object -Property name -match 'arm64.exe$'
47+
$asset_x64_url = $asset_x64.browser_download_url
48+
$asset_arm64_url = $asset_arm64.browser_download_url
49+
} else {
50+
# Get release object by its tag
51+
$env:GH_TOKEN = ${{ toJson(secrets.GITHUB_TOKEN) }}
52+
$github = (gh release view -R microsoft/git $env:TAG_NAME --json tagName,assets --jq '{tag_name: .tagName, assets: .assets}') | ConvertFrom-Json
53+
54+
# Get download URLs
55+
$asset_x64 = $github.assets | Where-Object -Property name -match '64-bit.exe$'
56+
$asset_arm64 = $github.assets | Where-Object -Property name -match 'arm64.exe$'
57+
$asset_x64_url = $asset_x64.url
58+
$asset_arm64_url = $asset_arm64.url
59+
}
60+
61+
# Remove 'v' and 'vfs' from the version
62+
$env:TAG_NAME -match 'v(.*?)vfs\.(.*)'
63+
$version = $Matches[1] + $Matches[2]
64+
65+
# Download wingetcreate and create manifests
66+
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
67+
.\wingetcreate.exe update Microsoft.Git `
68+
-v $version `
69+
-o . `
70+
-u "$($asset_x64_url)|x64|machine" `
71+
"$($asset_x64_url)|x64|user" `
72+
"$($asset_arm64_url)|arm64|machine" `
73+
"$($asset_arm64_url)|arm64|user"
74+
75+
# Download the token from Azure Key Vault and mask it in the logs
76+
az keyvault secret download --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --file token.txt
77+
Write-Host -NoNewLine "::add-mask::$(Get-Content token.txt)"
78+
79+
# Submit the manifest to the winget-pkgs repository
80+
$manifestDirectory = "$PWD\manifests\m\Microsoft\Git\$version"
81+
.\wingetcreate.exe submit -t "$(Get-Content token.txt)" $manifestDirectory
82+
shell: powershell

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
/git-gc
7575
/git-get-tar-commit-id
7676
/git-grep
77+
/git-gvfs-helper
7778
/git-hash-object
7879
/git-help
7980
/git-hook
@@ -173,6 +174,7 @@
173174
/git-unpack-file
174175
/git-unpack-objects
175176
/git-update-index
177+
/git-update-microsoft-git
176178
/git-update-ref
177179
/git-update-server-info
178180
/git-upload-archive

BRANCHES.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Branches used in this repo
2+
==========================
3+
4+
The document explains the branching structure that we are using in the VFSForGit repository as well as the forking strategy that we have adopted for contributing.
5+
6+
Repo Branches
7+
-------------
8+
9+
1. `vfs-#`
10+
11+
These branches are used to track the specific version that match Git for Windows with the VFSForGit specific patches on top. When a new version of Git for Windows is released, the VFSForGit patches will be rebased on that windows version and a new gvfs-# branch created to create pull requests against.
12+
13+
#### Examples
14+
15+
```
16+
vfs-2.27.0
17+
vfs-2.30.0
18+
```
19+
20+
The versions of git for VFSForGit are based on the Git for Windows versions. v2.20.0.vfs.1 will correspond with the v2.20.0.windows.1 with the VFSForGit specific patches applied to the windows version.
21+
22+
2. `vfs-#-exp`
23+
24+
These branches are for releasing experimental features to early adopters. They
25+
should contain everything within the corresponding `vfs-#` branch; if the base
26+
branch updates, then merge into the `vfs-#-exp` branch as well.
27+
28+
Tags
29+
----
30+
31+
We are using annotated tags to build the version number for git. The build will look back through the commit history to find the first tag matching `v[0-9]*vfs*` and build the git version number using that tag.
32+
33+
Full releases are of the form `v2.XX.Y.vfs.Z.W` where `v2.XX.Y` comes from the
34+
upstream version and `Z.W` are custom updates within our fork. Specifically,
35+
the `.Z` value represents the "compatibility level" with VFS for Git. Only
36+
increase this version when making a breaking change with a released version
37+
of VFS for Git. The `.W` version is used for minor updates between major
38+
versions.
39+
40+
Experimental releases are of the form `v2.XX.Y.vfs.Z.W.exp`. The `.exp`
41+
suffix indicates that experimental features are available. The rest of the
42+
version string comes from the full release tag. These versions will only
43+
be made available as pre-releases on the releases page, never a full release.
44+
45+
Forking
46+
-------
47+
48+
A personal fork of this repository and a branch in that repository should be used for development.
49+
50+
These branches should be based on the latest vfs-# branch. If there are work in progress pull requests that you have based on a previous version branch when a new version branch is created, you will need to move your patches to the new branch to get them in that latest version.
51+
52+
#### Example
53+
54+
```
55+
git clone <personal fork repo URL>
56+
git remote add ms https://github.com/Microsoft/git.git
57+
git checkout -b my-changes ms/vfs-2.20.0 --no-track
58+
git push -fu origin HEAD
59+
```

Documentation/config.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ include::config/gui.adoc[]
448448

449449
include::config/guitool.adoc[]
450450

451+
include::config/gvfs.adoc[]
452+
451453
include::config/help.adoc[]
452454

453455
include::config/http.adoc[]

Documentation/config/core.adoc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ Version 2 uses an opaque string so that the monitor can return
111111
something that can be used to determine what files have changed
112112
without race conditions.
113113

114+
core.virtualFilesystem::
115+
If set, the value of this variable is used as a command which
116+
will identify all files and directories that are present in
117+
the working directory. Git will only track and update files
118+
listed in the virtual file system. Using the virtual file system
119+
will supersede the sparse-checkout settings which will be ignored.
120+
See the "virtual file system" section of linkgit:githooks[5].
121+
114122
core.trustctime::
115123
If false, the ctime differences between the index and the
116124
working tree are ignored; useful when the inode change time
@@ -737,6 +745,55 @@ core.multiPackIndex::
737745
single index. See linkgit:git-multi-pack-index[1] for more
738746
information. Defaults to true.
739747

748+
core.gvfs::
749+
Enable the features needed for GVFS. This value can be set to true
750+
to indicate all features should be turned on or the bit values listed
751+
below can be used to turn on specific features.
752+
+
753+
--
754+
GVFS_SKIP_SHA_ON_INDEX::
755+
Bit value 1
756+
Disables the calculation of the sha when writing the index
757+
GVFS_MISSING_OK::
758+
Bit value 4
759+
Normally git write-tree ensures that the objects referenced by the
760+
directory exist in the object database. This option disables this check.
761+
GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT::
762+
Bit value 8
763+
When marking entries to remove from the index and the working
764+
directory this option will take into account what the
765+
skip-worktree bit was set to so that if the entry has the
766+
skip-worktree bit set it will not be removed from the working
767+
directory. This will allow virtualized working directories to
768+
detect the change to HEAD and use the new commit tree to show
769+
the files that are in the working directory.
770+
GVFS_FETCH_SKIP_REACHABILITY_AND_UPLOADPACK::
771+
Bit value 16
772+
While performing a fetch with a virtual file system we know
773+
that there will be missing objects and we don't want to download
774+
them just because of the reachability of the commits. We also
775+
don't want to download a pack file with commits, trees, and blobs
776+
since these will be downloaded on demand. This flag will skip the
777+
checks on the reachability of objects during a fetch as well as
778+
the upload pack so that extraneous objects don't get downloaded.
779+
GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS::
780+
Bit value 64
781+
With a virtual file system we only know the file size before any
782+
CRLF or smudge/clean filters processing is done on the client.
783+
To prevent file corruption due to truncation or expansion with
784+
garbage at the end, these filters must not run when the file
785+
is first accessed and brought down to the client. Git.exe can't
786+
currently tell the first access vs subsequent accesses so this
787+
flag just blocks them from occurring at all.
788+
GVFS_PREFETCH_DURING_FETCH::
789+
Bit value 128
790+
While performing a `git fetch` command, use the gvfs-helper to
791+
perform a "prefetch" of commits and trees.
792+
--
793+
794+
core.useGvfsHelper::
795+
TODO
796+
740797
core.sparseCheckout::
741798
Enable "sparse checkout" feature. See linkgit:git-sparse-checkout[1]
742799
for more information.

Documentation/config/gvfs.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
gvfs.cache-server::
2+
TODO
3+
4+
gvfs.sharedcache::
5+
TODO

0 commit comments

Comments
 (0)