Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] prepare for vfs 2.23.0 #165

Merged
merged 89 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
bab5997
reset --stdin: trim carriage return from the paths
Apr 5, 2017
b69a45d
Merge 'gvfs-preamble' into HEAD
dscho Jun 11, 2018
e1b981b
gvfs: start by adding the -gvfs suffix to the version
sanoursa Jan 24, 2017
2563c73
gvfs: ensure that the version is based on a GVFS tag
dscho Apr 4, 2017
4554016
gvfs: add a GVFS-specific header file
Jan 24, 2017
89db517
gvfs: add the core.gvfs config setting
Jan 24, 2017
6d04d74
Add a new run_hook_argv() function
dscho Nov 30, 2016
354f431
gvfs: add the feature to skip writing the index' SHA-1
Jan 24, 2017
30b8334
gvfs: allow "virtualizing" objects
Jan 10, 2017
1faf883
gvfs: add the feature that blobs may be missing
Jan 24, 2017
2fc0139
Hydrate missing loose objects in check_and_freshen()
Mar 15, 2017
d4452cd
gvfs: prevent files to be deleted outside the sparse checkout
May 18, 2016
be24102
Add support for read-object as a background process to retrieve missi…
Jul 18, 2017
de53474
gvfs: optionally skip reachability checks/upload pack during fetch
May 30, 2016
96f5fb7
sha1_file: when writing objects, skip the read_object_hook
dscho Sep 8, 2017
13cab54
gvfs: ensure all filters and EOL conversions are blocked
Jun 15, 2016
7400454
gvfs: add global command pre and post hook procs
May 24, 2016
5d916af
Allow hooks to be run before setup_git_directory()
dscho Mar 6, 2017
04c8e40
gvfs: introduce pre/post command hooks
Jan 24, 2017
a392dc2
sparse-checkout: update files with a modify/delete conflict
Feb 22, 2017
5497231
t0400: verify that the hook is called correctly from a subdirectory
dscho Mar 16, 2017
5fc8d66
sparse-checkout: avoid writing entries with the skip-worktree bit
Mar 1, 2017
7b48ce4
Pass PID of git process to hooks.
alepauly Apr 10, 2017
1881ca0
Fix reset when using the sparse-checkout feature.
Mar 15, 2017
3ed14fc
pre-command: always respect core.hooksPath
dscho Aug 7, 2017
663dae7
Merge 'read-object-hook' into HEAD
dscho Jun 11, 2018
f883a9e
Do not remove files outside the sparse-checkout
Apr 5, 2017
ab172f3
Merge 'pre-post-command-hooks' into HEAD
dscho Jun 11, 2018
49e748e
Merge 'sparse-checkout-fixes' into HEAD
dscho Jun 11, 2018
e3cda22
Add virtual file system settings and hook proc
benpeart Jan 11, 2018
e26a3d6
Teach ahead-behind and serialized status to play nicely together
jamill Jan 10, 2018
121ba4d
gvfs: refactor loading the core.gvfs config value
Apr 14, 2017
0bd1722
Update the virtualfilesystem support
benpeart Jun 7, 2018
429c91c
status: serialize to path
jeffhostetler Feb 2, 2018
3af6298
status: add status serialization mechanism
jeffhostetler Aug 22, 2017
e2f726c
cache-tree: remove use of strbuf_addf in update_one
Jul 3, 2017
42c04a8
virtualfilesystem: don't run the virtual file system hook if the inde…
benpeart Aug 1, 2018
c509573
status: reject deserialize in V2 and conflicts
jeffhostetler Feb 7, 2018
79b6713
Merge branch 'serialize_status_gvfs'
dscho Jun 11, 2018
1a265d5
virtualfilesystem: fix bug with symlinks being ignored
benpeart Sep 25, 2018
fc5fd70
Merge branch 'ahead-behind-and-serialized-status'
dscho Jun 11, 2018
0f399d9
virtualfilesystem: check if directory is included
Oct 9, 2018
8af3c56
vfs: fix case where directories not handled correctly
jamill Nov 20, 2018
72f9763
status: fix rename reporting when using serialization cache
jeffhostetler Jul 25, 2018
03d95e4
commit: add generation to pop_most_recent_commit()
derrickstolee Jun 13, 2018
01204f2
Merge 'virtual-file-system-support'
dscho Jun 11, 2018
5b2954a
status: add comments for ahead_behind_flags in serialization
jeffhostetler Jul 25, 2018
9f8a237
Merge 'gvfs/ds/generation-numbers-update'
dscho Jun 11, 2018
747d824
serialize-status: serialize global and repo-local exclude file metadata
jeffhostetler Jul 20, 2018
1992851
Merge pull request #6 from jeffhostetler/gvfs-serialize-status-rename
jeffhostetler Jul 26, 2018
1a7161b
status: deserialization wait
jeffhostetler Jul 25, 2018
45765e0
Merge pull request #1 from jeffhostetler/gvfs-serialize-exclude
jeffhostetler Jul 27, 2018
77eb3dc
rebase/stash: make post-command hook work again
dscho Oct 12, 2018
d0aa714
Merge pull request #7 from jeffhostetler/gvfs-status-serialize-wait
jeffhostetler Jul 31, 2018
91f22cd
fsck: use ERROR_MULTI_PACK_INDEX
derrickstolee Sep 24, 2018
942b4e9
Merge pull request #36 Avoid `sane_execvp` in `git rebase` and `git s…
derrickstolee Oct 12, 2018
fc67644
Merge pull request #24 Match multi-pack-index feature from upstream
dscho Oct 18, 2018
ac60c41
gvfs:trace2:data: add trace2 tracing around read_object_process
jeffhostetler Sep 26, 2018
a3984b6
gvfs:trace2:data: status deserialization information
jeffhostetler Sep 26, 2018
a7395f0
gvfs:trace2:data: status serialization
jeffhostetler Jan 7, 2019
7af5ff7
gvfs:trace2:data: add vfs stats
jeffhostetler Nov 19, 2018
b6ffec1
trace2: refactor setting process starting time
jeffhostetler Apr 15, 2019
0298ec3
send-pack: do not check for sha1 file when GVFS_MISSING_OK set
Nov 16, 2018
73fa1d0
trace2:gvfs:experiment: clear_ce_flags_1
jeffhostetler Apr 30, 2019
3e59597
gvfs: block unsupported commands when running in a GVFS repo
benpeart Dec 6, 2018
a41de17
Merge pull request #68 send-pack do not check for sha1 file when GVFS…
Nov 27, 2018
0dc88f7
trace2:gvfs:experiment: traverse_trees
jeffhostetler Apr 30, 2019
5d57947
BRANCHES.md: Add explanation of branches and using forks
Jul 27, 2018
00628cc
Merge pull request #91 from benpeart/block-commands
benpeart Dec 13, 2018
1182936
trace2:gvfs:experiment: report_tracking
jeffhostetler Apr 30, 2019
036b953
Merge pull request #98 Add explanation of branches and using forks
Dec 19, 2018
57e48bc
trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache
jeffhostetler Jun 14, 2019
b51c8df
trace2:gvfs:experiment: read-cache: time read/write of cache-tree ext…
jeffhostetler Jul 9, 2019
a535e98
trace2:gvfs:experiment: add prime_cache_tree region
jeffhostetler Jun 3, 2019
97f3dde
trace2:gvfs:experiment: add region to apply_virtualfilesystem()
jeffhostetler Jul 16, 2019
f4b52fb
trace2:gvfs:experiment: add region around unpack_trees()
jeffhostetler Jul 16, 2019
726a408
trace2:gvfs:experiment: add region to cache_tree_fully_valid()
jeffhostetler Jul 16, 2019
f85bf4d
trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() …
jeffhostetler Jul 16, 2019
8ed9097
trace2:gvfs:experiment: increase default event depth for unpack-tree …
jeffhostetler Jul 25, 2019
c675ec4
merge-recursive: avoid confusing logic in was_dirty()
dscho May 21, 2019
a69cbbe
trace2:gvfs:experiment: add data for check_updates() in unpack_trees()
jeffhostetler Jul 25, 2019
0c0917b
merge-recursive: add some defensive coding to was_dirty()
dscho May 21, 2019
c12bd0e
Trace2:gvfs:experiment: capture more 'tracking' details
jeffhostetler Jul 26, 2019
5fd767a
merge-recursive: teach was_dirty() about the virtualfilesystem
dscho May 21, 2019
d762feb
Merge branch 'vfs-trace2'
jeffhostetler Apr 23, 2019
5bcf4cd
status: deserialize with -uno does not print correct hint
jeffhostetler Jun 25, 2019
bbfe83c
Merge branch 'virtualfilesystem-and-merge-recursive'
dscho May 21, 2019
bd42007
Merge pull request #157 from jeffhostetler/vfs-222-status-cache-untra…
jeffhostetler Jun 26, 2019
50a7847
backwards-compatibility: support the post-indexchanged hook
dscho May 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions BRANCHES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Branches used in this repo
==========================

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.

Repo Branches
-------------

1. master

This will track the Git for Windows repository master branch

2. vfs

Would like to use this branch as an ever-green branch that continually rebases the VFSForGit changes onto a windows ever-green branch that is on the core/master, so that we can detect when the patches for VFSForGit have issues or if we have a new version patches sent upstream git we can regenerate this branch.

3. vs/master

This tracks with the Git for Windows repository vs/master branch and are the generated files for using a Visual Studio solution.

4. vfs-#

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.

#### Examples

```
vfs-2.20.0
vfs-2.20.1
```

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.

Tags
----

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.

Forking
-------

A personal fork of this repository and a branch in that repository should be used for development.

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.

#### Example

```
git clone <personal fork repo URL>
git remote add ms https://github.com/Microsoft/git.git
git checkout -b my-changes ms/vfs-2.20.0 --no-track
git push -fu origin HEAD
```
50 changes: 50 additions & 0 deletions Documentation/config/core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ core.fsmonitor::
avoiding unnecessary processing of files that have not changed.
See the "fsmonitor-watchman" section of linkgit:githooks[5].

core.virtualFilesystem::
If set, the value of this variable is used as a command which
will identify all files and directories that are present in
the working directory. Git will only track and update files
listed in the virtual file system. Using the virtual file system
will supersede the sparse-checkout settings which will be ignored.
See the "virtual file system" section of linkgit:githooks[5].

core.trustctime::
If false, the ctime differences between the index and the
working tree are ignored; useful when the inode change time
Expand Down Expand Up @@ -609,6 +617,48 @@ core.multiPackIndex::
single index. See link:technical/multi-pack-index.html[the
multi-pack-index design document].

core.gvfs::
Enable the features needed for GVFS. This value can be set to true
to indicate all features should be turned on or the bit values listed
below can be used to turn on specific features.
+
--
GVFS_SKIP_SHA_ON_INDEX::
Bit value 1
Disables the calculation of the sha when writing the index
GVFS_MISSING_OK::
Bit value 4
Normally git write-tree ensures that the objects referenced by the
directory exist in the object database. This option disables this check.
GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT::
Bit value 8
When marking entries to remove from the index and the working
directory this option will take into account what the
skip-worktree bit was set to so that if the entry has the
skip-worktree bit set it will not be removed from the working
directory. This will allow virtualized working directories to
detect the change to HEAD and use the new commit tree to show
the files that are in the working directory.
GVFS_FETCH_SKIP_REACHABILITY_AND_UPLOADPACK::
Bit value 16
While performing a fetch with a virtual file system we know
that there will be missing objects and we don't want to download
them just because of the reachability of the commits. We also
don't want to download a pack file with commits, trees, and blobs
since these will be downloaded on demand. This flag will skip the
checks on the reachability of objects during a fetch as well as
the upload pack so that extraneous objects don't get downloaded.
GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS::
Bit value 64
With a virtual file system we only know the file size before any
CRLF or smudge/clean filters processing is done on the client.
To prevent file corruption due to truncation or expansion with
garbage at the end, these filters must not run when the file
is first accessed and brought down to the client. Git.exe can't
currently tell the first access vs subsequent accesses so this
flag just blocks them from occurring at all.
--

core.sparseCheckout::
Enable "sparse checkout" feature. See section "Sparse checkout" in
linkgit:git-read-tree[1] for more information.
Expand Down
22 changes: 22 additions & 0 deletions Documentation/config/status.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,25 @@ status.submoduleSummary::
the --ignore-submodules=dirty command-line option or the 'git
submodule summary' command, which shows a similar output but does
not honor these settings.

status.deserializePath::
EXPERIMENTAL, Pathname to a file containing cached status results
generated by `--serialize`. This will be overridden by
`--deserialize=<path>` on the command line. If the cache file is
invalid or stale, git will fall-back and compute status normally.

status.deserializeWait::
EXPERIMENTAL, Specifies what `git status --deserialize` should do
if the serialization cache file is stale and whether it should
fall-back and compute status normally. This will be overridden by
`--deserialize-wait=<value>` on the command line.
+
--
* `fail` - cause git to exit with an error when the status cache file
is stale; this is intended for testing and debugging.
* `block` - cause git to spin and periodically retry the cache file
every 100 ms; this is intended to help coordinate with another git
instance concurrently computing the cache file.
* `no` - to immediately fall-back if cache file is stale. This is the default.
* `<timeout>` - time (in tenths of a second) to spin and retry.
--
35 changes: 35 additions & 0 deletions Documentation/git-status.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ ignored, then the directory is not shown, but all contents are shown.
update it afterwards if any changes were detected. Defaults to
`--lock-index`.

--serialize[=<path>]::
(EXPERIMENTAL) Serialize raw status results to a file or stdout
in a format suitable for use by `--deserialize`. If a path is
given, serialize data will be written to that path *and* normal
status output will be written to stdout. If path is omitted,
only binary serialization data will be written to stdout.

--deserialize[=<path>]::
(EXPERIMENTAL) Deserialize raw status results from a file or
stdin rather than scanning the worktree. If `<path>` is omitted
and `status.deserializePath` is unset, input is read from stdin.
--no-deserialize::
(EXPERIMENTAL) Disable implicit deserialization of status results
from the value of `status.deserializePath`.

<pathspec>...::
See the 'pathspec' entry in linkgit:gitglossary[7].

Expand Down Expand Up @@ -401,6 +416,26 @@ quoted as explained for the configuration variable `core.quotePath`
(see linkgit:git-config[1]).


SERIALIZATION and DESERIALIZATION (EXPERIMENTAL)
------------------------------------------------

The `--serialize` option allows git to cache the result of a
possibly time-consuming status scan to a binary file. A local
service/daemon watching file system events could use this to
periodically pre-compute a fresh status result.

Interactive users could then use `--deserialize` to simply
(and immediately) print the last-known-good result without
waiting for the status scan.

The binary serialization file format includes some worktree state
information allowing `--deserialize` to reject the cached data
and force a normal status scan if, for example, the commit, branch,
or status modes/options change. The format cannot, however, indicate
when the cached data is otherwise stale -- that coordination belongs
to the task driving the serializations.


CONFIGURATION
-------------

Expand Down
20 changes: 20 additions & 0 deletions Documentation/githooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,26 @@ and "0" meaning they were not.
Only one parameter should be set to "1" when the hook runs. The hook
running passing "1", "1" should not be possible.

virtualFilesystem
~~~~~~~~~~~~~~~~~~

"Virtual File System" allows populating the working directory sparsely.
The projection data is typically automatically generated by an external
process. Git will limit what files it checks for changes as well as which
directories are checked for untracked files based on the path names given.
Git will also only update those files listed in the projection.

The hook is invoked when the configuration option core.virtualFilesystem
is set. It takes one argument, a version (currently 1).

The hook should output to stdout the list of all files in the working
directory that git should track. The paths are relative to the root
of the working directory and are separated by a single NUL. Full paths
('dir1/a.txt') as well as directories are supported (ie 'dir1/').

The exit status determines whether git will use the data from the
hook. On error, git will abort the command with an error message.

GIT
---
Part of the linkgit:git[1] suite
102 changes: 102 additions & 0 deletions Documentation/technical/read-object-protocol.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Read Object Process
^^^^^^^^^^^^^^^^^^^^^^^^^^^

The read-object process enables Git to read all missing blobs with a
single process invocation for the entire life of a single Git command.
This is achieved by using a packet format (pkt-line, see technical/
protocol-common.txt) based protocol over standard input and standard
output as follows. All packets, except for the "*CONTENT" packets and
the "0000" flush packet, are considered text and therefore are
terminated by a LF.

Git starts the process when it encounters the first missing object that
needs to be retrieved. After the process is started, Git sends a welcome
message ("git-read-object-client"), a list of supported protocol version
numbers, and a flush packet. Git expects to read a welcome response
message ("git-read-object-server"), exactly one protocol version number
from the previously sent list, and a flush packet. All further
communication will be based on the selected version.

The remaining protocol description below documents "version=1". Please
note that "version=42" in the example below does not exist and is only
there to illustrate how the protocol would look with more than one
version.

After the version negotiation Git sends a list of all capabilities that
it supports and a flush packet. Git expects to read a list of desired
capabilities, which must be a subset of the supported capabilities list,
and a flush packet as response:
------------------------
packet: git> git-read-object-client
packet: git> version=1
packet: git> version=42
packet: git> 0000
packet: git< git-read-object-server
packet: git< version=1
packet: git< 0000
packet: git> capability=get
packet: git> capability=have
packet: git> capability=put
packet: git> capability=not-yet-invented
packet: git> 0000
packet: git< capability=get
packet: git< 0000
------------------------
The only supported capability in version 1 is "get".

Afterwards Git sends a list of "key=value" pairs terminated with a flush
packet. The list will contain at least the command (based on the
supported capabilities) and the sha1 of the object to retrieve. Please
note, that the process must not send any response before it received the
final flush packet.

When the process receives the "get" command, it should make the requested
object available in the git object store and then return success. Git will
then check the object store again and this time find it and proceed.
------------------------
packet: git> command=get
packet: git> sha1=0a214a649e1b3d5011e14a3dc227753f2bd2be05
packet: git> 0000
------------------------

The process is expected to respond with a list of "key=value" pairs
terminated with a flush packet. If the process does not experience
problems then the list must contain a "success" status.
------------------------
packet: git< status=success
packet: git< 0000
------------------------

In case the process cannot or does not want to process the content, it
is expected to respond with an "error" status.
------------------------
packet: git< status=error
packet: git< 0000
------------------------

In case the process cannot or does not want to process the content as
well as any future content for the lifetime of the Git process, then it
is expected to respond with an "abort" status at any point in the
protocol.
------------------------
packet: git< status=abort
packet: git< 0000
------------------------

Git neither stops nor restarts the process in case the "error"/"abort"
status is set.

If the process dies during the communication or does not adhere to the
protocol then Git will stop the process and restart it with the next
object that needs to be processed.

After the read-object process has processed an object it is expected to
wait for the next "key=value" list containing a command. Git will close
the command pipe on exit. The process is expected to detect EOF and exit
gracefully on its own. Git will wait until the process has stopped.

A long running read-object process demo implementation can be found in
`contrib/long-running-read-object/example.pl` located in the Git core
repository. If you develop your own long running process then the
`GIT_TRACE_PACKET` environment variables can be very helpful for
debugging (see linkgit:git[1]).
Loading