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

Rebase to v2.38.0 #533

Merged
merged 195 commits into from
Oct 5, 2022
Merged

Rebase to v2.38.0 #533

merged 195 commits into from
Oct 5, 2022

Conversation

dscho
Copy link
Member

@dscho dscho commented Sep 16, 2022

Range-diff relative to `vfs-2.37.3`
  • 1: 8e3669d = 1: cbda0fc reset --stdin: trim carriage return from the paths

  • 2: 43a66d8 ! 2: 8d54217 gvfs: start by adding the -gvfs suffix to the version

    @@ GIT-VERSION-GEN
      #!/bin/sh
      
      GVF=GIT-VERSION-FILE
    --DEF_VER=v2.37.3
    -+DEF_VER=v2.37.3.vfs.0.0
    +-DEF_VER=v2.38.0-rc0
    ++DEF_VER=v2.38.0.vfs.0.0
      
      LF='
      '
  • 3: 77f508a = 3: 62974be gvfs: ensure that the version is based on a GVFS tag

  • 4: 056ca18 = 4: ed9c60a gvfs: add a GVFS-specific header file

  • 5: d5ce986 = 5: 9828d07 gvfs: add the core.gvfs config setting

  • 6: bd9d315 = 6: 59ce798 gvfs: add the feature to skip writing the index' SHA-1

  • 7: 999cb17 = 7: 2a37457 gvfs: add the feature that blobs may be missing

  • 8: c8cc895 = 8: aed0cdf gvfs: prevent files to be deleted outside the sparse checkout

  • 9: 783ad42 = 9: f19dea0 gvfs: optionally skip reachability checks/upload pack during fetch

  • 10: cafc706 = 10: fa1a731 gvfs: ensure all filters and EOL conversions are blocked

  • 11: d20acb4 = 11: 9f3d939 gvfs: allow "virtualizing" objects

  • 12: 50ba19c = 12: 1a4a541 Hydrate missing loose objects in check_and_freshen()

  • 122: 708ab2b = 13: 425673a cmake: optionally build scalar, too

  • 123: aa5950b = 14: af6589c ci: also run the scalar tests

  • 158: 19b27b3 ! 15: 0a7848e sparse-checkout: add config to disable deleting dirs

    @@ Documentation/config/index.txt
      	Entry" section. This reduces index load time on multiprocessor
     
      ## builtin/sparse-checkout.c ##
    -@@ builtin/sparse-checkout.c: static int sparse_checkout_list(int argc, const char **argv)
    +@@ builtin/sparse-checkout.c: static int sparse_checkout_list(int argc, const char **argv, const char *prefix)
      
      static void clean_tracked_sparse_directories(struct repository *r)
      {
  • 160: e783358 = 16: 9b281f4 diff: ignore sparse paths in diffstat

  • 169: 9395014 = 17: b06c20e sequencer: avoid progress when stderr is redirected

  • 13: 2ccca99 ! 18: 327dd3a sha1_file: when writing objects, skip the read_object_hook

    @@ object-file.c: static int write_loose_object(const struct object_id *oid, char *
      }
      
      static int freshen_packed_object(const struct object_id *oid)
    +@@ object-file.c: int stream_loose_object(struct input_stream *in_stream, size_t len,
    + 		die(_("deflateEnd on stream object failed (%d)"), ret);
    + 	close_loose_object(fd, tmp_file.buf);
    + 
    +-	if (freshen_packed_object(oid) || freshen_loose_object(oid)) {
    ++	if (freshen_packed_object(oid) || freshen_loose_object(oid, 1)) {
    + 		unlink_or_warn(tmp_file.buf);
    + 		goto cleanup;
    + 	}
     @@ object-file.c: int write_object_file_flags(const void *buf, size_t len,
      	 */
      	write_object_file_prepare(the_hash_algo, buf, len, type, oid, hdr,
  • 14: 0e69f8b = 19: 6f2a13e gvfs: add global command pre and post hook procs

  • 15: 810765d = 20: f5f4e75 t0400: verify that the hook is called correctly from a subdirectory

  • 16: 9bacc54 = 21: 81d822b Pass PID of git process to hooks.

  • 17: bc255a9 = 22: d4be59a pre-command: always respect core.hooksPath

  • 18: c2fbb88 = 23: 3eebbaf sparse-checkout: update files with a modify/delete conflict

  • 19: b0dbec1 = 24: 47edf2c sparse-checkout: avoid writing entries with the skip-worktree bit

  • 20: 7a24c7b = 25: 4f9c504 Do not remove files outside the sparse-checkout

  • 21: 57768b0 = 26: ea7cf7a gvfs: refactor loading the core.gvfs config value

  • 22: 0330be2 = 27: 0c6482d send-pack: do not check for sha1 file when GVFS_MISSING_OK set

  • 23: ffbb357 = 28: 47932ce cache-tree: remove use of strbuf_addf in update_one

  • 24: e1f5ec2 ! 29: 83acfe7 gvfs: block unsupported commands when running in a GVFS repo

    @@ git.c: static struct cmd_struct commands[] = {
      	{ "verify-tag", cmd_verify_tag, RUN_SETUP },
      	{ "version", cmd_version },
      	{ "whatchanged", cmd_whatchanged, RUN_SETUP },
    --	{ "worktree", cmd_worktree, RUN_SETUP | NO_PARSEOPT },
    -+	{ "worktree", cmd_worktree, RUN_SETUP | NO_PARSEOPT | BLOCK_ON_GVFS_REPO },
    +-	{ "worktree", cmd_worktree, RUN_SETUP },
    ++	{ "worktree", cmd_worktree, RUN_SETUP | BLOCK_ON_GVFS_REPO },
      	{ "write-tree", cmd_write_tree, RUN_SETUP },
      };
      
  • 25: 0b76560 = 30: 240abce gvfs: allow overriding core.gvfs

  • 26: 7b9670e = 31: 46d3fee BRANCHES.md: Add explanation of branches and using forks

  • 27: 9ca2e5d = 32: 528127a Add virtual file system settings and hook proc

  • 28: 6a01dec = 33: 396915d virtualfilesystem: don't run the virtual file system hook if the index has been redirected

  • 29: 180f98e = 34: 57686c1 virtualfilesystem: fix bug with symlinks being ignored

  • 30: b09e24e = 35: 5741181 virtualfilesystem: check if directory is included

  • 31: d4f9adc = 36: 4dff1a8 vfs: fix case where directories not handled correctly

  • 32: 9c83e33 = 37: e8d8827 backwards-compatibility: support the post-indexchanged hook

  • 33: c1ac949 = 38: ea1ce87 gvfs: verify that the built-in FSMonitor is disabled

  • 34: b5cd85b < -: ------------ merge-ort: ignore skip-worktree bit with virtual filesystem

  • 35: 3ce006c ! 39: 2d007c6 status: add status serialization mechanism

    @@ pkt-line.h: void packet_write(int fd_out, const char *buf, size_t size);
      int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
     +int packet_write_gently(const int fd_out, const char *buf, size_t size);
      int write_packetized_from_fd_no_flush(int fd_in, int fd_out);
    - int write_packetized_from_buf_no_flush(const char *src_in, size_t len, int fd_out);
    - 
    + int write_packetized_from_buf_no_flush_count(const char *src_in, size_t len,
    + 					     int fd_out, int *packet_counter);
     
      ## t/t7522-serialized-status.sh (new) ##
     @@
  • 36: 64e4ba5 = 40: 58434f7 Teach ahead-behind and serialized status to play nicely together

  • 37: 9d1b66b = 41: 5e60d7a status: serialize to path

  • 38: 457ac8f = 42: c8bd7a4 status: reject deserialize in V2 and conflicts

  • 39: e97b379 = 43: 46ec0f6 status: fix rename reporting when using serialization cache

  • 40: 0fbc45c = 44: 03aa602 serialize-status: serialize global and repo-local exclude file metadata

  • 41: 52559f9 = 45: ed8c247 status: deserialization wait

  • 42: 6c9e24f = 46: 5ff86c2 merge-recursive: avoid confusing logic in was_dirty()

  • 43: b664fc5 = 47: 8da7a42 merge-recursive: add some defensive coding to was_dirty()

  • 44: 4b135fb = 48: 0c4705d merge-recursive: teach was_dirty() about the virtualfilesystem

  • 45: 0a6a8e4 = 49: 7334628 status: deserialize with -uno does not print correct hint

  • 46: a605f42 = 50: 0e8b0ad wt-status-deserialize: fix crash when -v is used

  • 47: af9746c = 51: a3eb4de fsmonitor: check CE_FSMONITOR_VALID in ce_uptodate

  • 48: e51f0ba = 52: 8a929ea fsmonitor: add script for debugging and update script for tests

  • 49: a364631 = 53: 0d1f6e8 status: disable deserialize when verbose output requested.

  • 50: 7ef85d7 = 54: b409aaf t7524: add test for verbose status deserialzation

  • 51: b0b3d04 = 55: 49948a4 deserialize-status: silently fallback if we cannot read cache file

  • 52: 431f97c = 56: 32a4e87 gvfs:trace2:data: add trace2 tracing around read_object_process

  • 53: ed366c6 = 57: 9293bbf gvfs:trace2:data: status deserialization information

  • 54: d64cb33 = 58: e7d24b5 gvfs:trace2:data: status serialization

  • 55: 092c22c = 59: 6d56c0c gvfs:trace2:data: add vfs stats

  • 56: 8fd92a2 = 60: 62a42a4 trace2: refactor setting process starting time

  • 57: be80116 = 61: 8e03410 trace2:gvfs:experiment: clear_ce_flags_1

  • 58: 616e63e = 62: a047080 trace2:gvfs:experiment: report_tracking

  • 59: 62c9575 = 63: 957f46b trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache

  • 60: 50d46b9 = 64: e182281 trace2:gvfs:experiment: read-cache: time read/write of cache-tree extension

  • 61: f19721a = 65: efbce4b cache-tree: use r instead of the_repository in Trace2

  • 62: 7087898 = 66: 016a14c trace2:gvfs:experiment: add region to apply_virtualfilesystem()

  • 63: 0f6523a = 67: b3e78be trace2:gvfs:experiment: add region around unpack_trees()

  • 64: b246a42 = 68: b2aa9e0 trace2:gvfs:experiment: add region to cache_tree_fully_valid()

  • 65: 9652bc6 = 69: 1059afc trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() and report_tracking()

  • 66: bfdee90 = 70: 69a18e2 trace2:gvfs:experiment: increase default event depth for unpack-tree data

  • 67: 9474f66 = 71: 09fa7ef trace2:gvfs:experiment: add data for check_updates() in unpack_trees()

  • 68: 05eba7b = 72: 21a619e Trace2:gvfs:experiment: capture more 'tracking' details

  • 69: c5c3ff5 = 73: 1b198f2 credential: set trace2_child_class for credential manager children

  • 70: b7b80c6 = 74: 57d14b2 sub-process: do not borrow cmd pointer from caller

  • 71: 9026ccd ! 75: d6cac4d sub-process: add subprocess_start_argv()

    @@ sub-process.c
      #include "pkt-line.h"
     +#include "quote.h"
      
    - int cmd2process_cmp(const void *unused_cmp_data,
    + int cmd2process_cmp(const void *cmp_data UNUSED,
      		    const struct hashmap_entry *eptr,
     @@ sub-process.c: int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, co
      	return 0;
  • 72: 4cfa048 = 76: 39a74a3 sha1-file: add function to update existing loose object cache

  • 73: f8d9631 = 77: 1529f48 packfile: add install_packed_git_and_mru()

  • 74: 4378254 = 78: e849dc2 index-pack: avoid immediate object fetch while parsing packfile

  • 75: 60aecde = 79: 287ac47 gvfs-helper: create tool to fetch objects using the GVFS Protocol

  • 76: 35f4f0e = 80: 350a99d gvfs-helper: fix race condition when creating loose object dirs

  • 77: 1e43dde = 81: ec24566 sha1-file: create shared-cache directory if it doesn't exist

  • 78: cc6476f = 82: 4c752d2 gvfs-helper: better handling of network errors

  • 79: e4090e5 = 83: 8ddce84 gvfs-helper-client: properly update loose cache with fetched OID

  • 80: ee5ea0d = 84: e2eea6c gvfs-helper: V2 robust retry and throttling

  • 81: b878ad0 = 85: 022e16a gvfs-helper: expose gvfs/objects GET and POST semantics

  • 82: 9d63d64 = 86: 7fc8af6 gvfs-helper: dramatically reduce progress noise

  • 83: 1244391 = 87: 4605a7d gvfs-helper-client.h: define struct object_id

  • 84: 32dc122 = 88: 592ba43 gvfs-helper: handle pack-file after single POST request

  • 85: 761c9b6 = 89: f6c2784 test-gvfs-prococol, t5799: tests for gvfs-helper

  • 86: d9ed18b = 90: e576970 gvfs-helper: move result-list construction into install functions

  • 87: 735f5d1 = 91: ff6fa29 t5799: add support for POST to return either a loose object or packfile

  • 88: d7be282 = 92: c562a11 t5799: cleanup wc-l and grep-c lines

  • 89: 9c2c440 = 93: e2e8145 gvfs-helper: verify loose objects after write

  • 90: a612a0f = 94: fb21132 t7599: create corrupt blob test

  • 91: 2b499ce = 95: 1065f33 gvfs-helper: add prefetch support

  • 92: cf506d5 = 96: f0f1acf gvfs-helper: add prefetch .keep file for last packfile

  • 93: 32b0299 = 97: ac87c1a gvfs-helper: do one read in my_copy_fd_len_tail()

  • 94: dbebe4a = 98: ce5b521 gvfs-helper: move content-type warning for prefetch packs

  • 95: bff999f = 99: 256ecf2 fetch: use gvfs-helper prefetch under config

  • 96: 6d86a19 = 100: 63c0a28 gvfs-helper: better support for concurrent packfile fetches

  • 97: ac11a53 = 101: a707e73 remote-curl: do not call fetch-pack when using gvfs-helper

  • 98: e2aaf16 = 102: 13c62d6 fetch: reprepare packs before checking connectivity

  • 99: c5dbf6f = 103: 953cd07 gvfs-helper: retry when creating temp files

  • 100: 542ae72 = 104: aecb17b sparse: avoid warnings about known cURL issues in gvfs-helper.c

  • 101: 3579e13 = 105: 093c68c upload-pack: fix race condition in error messages

  • 102: 7fb5061 = 106: e20c882 maintenance: care about gvfs.sharedCache config

  • 103: acd912b = 107: 1490e0e unpack-trees:virtualfilesystem: Improve efficiency of clear_ce_flags

  • 104: a5e818d = 108: 3352cf5 homebrew: add GitHub workflow to release Cask

  • 105: 6c96ece = 109: 6780bbc Adding winget workflows

  • 106: 3c6f113 = 110: aff7866 Add workflow for apt-get release

  • 107: a44252e = 111: 3949b1f Disable the monitor-components workflow in msft-git

  • 108: fdbc226 = 112: 61068f0 release: create initial Windows installer build workflow

  • 109: 0e0e157 = 113: a075bde release: add Mac OSX installer build

  • 110: df11aa3 = 114: 0264267 release: build unsigned Ubuntu .deb package

  • 111: fe6951a = 115: 3ff9d0c release: add signing step for .deb package

  • 112: 4d9c0c1 = 116: 425e840 update-microsoft-git: create barebones builtin

  • 113: 3fa6028 = 117: 1adcadb release: create draft GitHub release with packages & installers

  • 114: 91137c6 = 118: c84e52f update-microsoft-git: Windows implementation

  • 115: 970b183 = 119: 2398c30 release: continue pestering until user upgrades

  • 116: 285c9dc = 120: a45e4c6 update-microsoft-git: use brew on macOS

  • 117: 06e2f8d = 121: 8dcdb2e Makefile: allow specifying GIT_BUILT_FROM_COMMIT

  • 118: 2e6196b = 122: f789608 .github: update ISSUE_TEMPLATE.md for microsoft/git

  • 119: cd9d5ff = 123: 0538110 dist: archive HEAD instead of HEAD^{tree}

  • 120: 33453f9 = 124: 66afeaa .github: update PULL_REQUEST_TEMPLATE.md

  • 121: 4f994de = 125: cd5e3d2 release: include GIT_BUILT_FROM_COMMIT in MacOS build

  • 124: 5805305 < -: ------------ scalar: enable built-in FSMonitor on register

  • 125: 8c5472f < -: ------------ scalar unregister: stop FSMonitor daemon

  • 134: a306cc1 = 126: 94fdc64 Adjust README.md for microsoft/git

  • 174: 07768fc = 127: fdbcb53 release: add installer validation

  • 126: c40f530 = 128: bf45de7 git_config_set_multivar_in_file_gently(): add a lock timeout

  • 127: 555890a ! 129: ff0dee2 scalar: set the config write-lock timeout to 150ms

    @@ Commit message
     
      ## contrib/scalar/scalar.c ##
     @@ contrib/scalar/scalar.c: static int set_recommended_config(int reconfigure)
    - 		 */
    - 		{ "core.fsmonitor", "true" },
    - #endif
    + 		{ "core.autoCRLF", "false" },
    + 		{ "core.safeCRLF", "false" },
    + 		{ "fetch.showForcedUpdates", "false" },
     +		{ "core.configWriteLockTimeoutMS", "150" },
      		{ NULL, NULL },
      	};
  • 128: d85aa29 = 130: 43c010b scalar: add docs from microsoft/scalar

  • 129: 9e4017e = 131: 0d917ba scalar: allow installing the command

  • 130: 06c3619 = 132: 98c9957 scalar: allow building and installing the documentation

  • 131: a9e5ff9 = 133: e50bec0 git help: special-case scalar

  • 132: 7c8d105 = 134: 5d0618a scalar: implement the help subcommand

  • 133: 558699e ! 135: e2898b3 scalar: move it out of contrib/

    @@ Documentation/Makefile: MAN1_TXT += git.txt
     +
      # man5 / man7 guides (note: new guides should also be added to command-list.txt)
      MAN5_TXT += gitattributes.txt
    - MAN5_TXT += githooks.txt
    + MAN5_TXT += gitformat-bundle.txt
     
      ## contrib/scalar/scalar.txt => Documentation/scalar.txt ##
     @@ Documentation/scalar.txt: SEE ALSO
    @@ contrib/scalar/Makefile (deleted)
     -
     -.PHONY: $(GITLIBS) all clean test docs install install-doc install-html FORCE
     
    - ## contrib/scalar/README.md (deleted) ##
    -@@
    --# Scalar - an opinionated repository management tool
    --
    --Scalar is an add-on to Git that helps users take advantage of advanced
    --performance features in Git. Originally implemented in C# using .NET Core,
    --based on the learnings from the VFS for Git project, most of the techniques
    --developed by the Scalar project have been integrated into core Git already:
    --
    --* partial clone,
    --* commit graphs,
    --* multi-pack index,
    --* sparse checkout (cone mode),
    --* scheduled background maintenance,
    --* etc
    --
    --This directory contains the remaining parts of Scalar that are not (yet) in
    --core Git.
    --
    --## Roadmap
    --
    --The idea is to populate this directory via incremental patch series and
    --eventually move to a top-level directory next to `gitk-git/` and to `git-gui/`. The
    --current plan involves the following patch series:
    --
    --- `scalar-the-beginning`: The initial patch series which sets up
    --  `contrib/scalar/` and populates it with a minimal `scalar` command that
    --  demonstrates the fundamental ideas.
    --
    --- `scalar-c-and-C`: The `scalar` command learns about two options that can be
    --  specified before the command, `-c <key>=<value>` and `-C <directory>`.
    --
    --- `scalar-diagnose`: The `scalar` command is taught the `diagnose` subcommand.
    --
    --- `scalar-and-builtin-fsmonitor`: The built-in FSMonitor is enabled in `scalar
    --  register` and in `scalar clone`, for an enormous performance boost when
    --  working in large worktrees. This patch series necessarily depends on Jeff
    --  Hostetler's FSMonitor patch series to be integrated into Git.
    --
    --- `scalar-gentler-config-locking`: Scalar enlistments are registered in the
    --  user's Git config. This usually does not represent any problem because it is
    --  rare for a user to register an enlistment. However, in Scalar's functional
    --  tests, Scalar enlistments are created galore, and in parallel, which can lead
    --  to lock contention. This patch series works around that problem by re-trying
    --  to lock the config file in a gentle fashion.
    --
    --- `scalar-extra-docs`: Add some extensive documentation that has been written
    --  in the original Scalar project (all subject to discussion, of course).
    --
    --- `optionally-install-scalar`: Now that Scalar is feature (and documentation)
    --  complete and is verified in CI builds, let's offer to install it.
    --
    --- `move-scalar-to-toplevel`: Now that Scalar is complete, let's move it next to
    --  `gitk-git/` and to `git-gui/`, making it a top-level command.
    --
    --The following two patch series exist in Microsoft's fork of Git and are
    --publicly available. There is no current plan to upstream them, not because I
    --want to withhold these patches, but because I don't think the Git community is
    --interested in these patches.
    --
    --There are some interesting ideas there, but the implementation is too specific
    --to Azure Repos and/or VFS for Git to be of much help in general (and also: my
    --colleagues tried to upstream some patches already and the enthusiasm for
    --integrating things related to Azure Repos and VFS for Git can be summarized in
    --very, very few words).
    --
    --These still exist mainly because the GVFS protocol is what Azure Repos has
    --instead of partial clone, while Git is focused on improving partial clone:
    --
    --- `scalar-with-gvfs`: The primary purpose of this patch series is to support
    --  existing Scalar users whose repositories are hosted in Azure Repos (which
    --  does not support Git's partial clones, but supports its predecessor, the GVFS
    --  protocol, which is used by Scalar to emulate the partial clone).
    --
    --  Since the GVFS protocol will never be supported by core Git, this patch
    --  series will remain in Microsoft's fork of Git.
    --
    --- `run-scalar-functional-tests`: The Scalar project developed a quite
    --  comprehensive set of integration tests (or, "Functional Tests"). They are the
    --  sole remaining part of the original C#-based Scalar project, and this patch
    --  adds a GitHub workflow that runs them all.
    --
    --  Since the tests partially depend on features that are only provided in the
    --  `scalar-with-gvfs` patch series, this patch cannot be upstreamed.
    -
      ## contrib/scalar/t/Makefile (deleted) ##
     @@
     -# Import tree-wide shared Makefile behavior and libraries
    @@ contrib/scalar/t/Makefile (deleted)
     -	@echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
     -
     -clean-except-prove-cache:
    --	$(RM) -r 'trash directory'.* '$(TEST_RESULTS_DIRECTORY_SQ)'
    +-	$(RM) -r 'trash directory'.*
     -	$(RM) -r valgrind/bin
     -
     -clean: clean-except-prove-cache
  • 135: 2308984 ! 136: be45bd5 scalar (Windows): use forward slashes as directory separators

    @@ scalar.c: static void setup_enlistment_directory(int argc, const char **argv,
     +#ifdef GIT_WINDOWS_NATIVE
     +	convert_slashes(path.buf);
     +#endif
    - 	do {
    - 		const size_t len = path.len;
      
    + 	/* check if currently in enlistment root with src/ workdir */
    + 	len = path.len;
  • 136: 007d7af ! 137: 2d2de8f scalar: add retry logic to run_git()

    @@ Commit message
     
      ## scalar.c ##
     @@ scalar.c: static void setup_enlistment_directory(int argc, const char **argv,
    - 	setup_git_directory();
    + 	strbuf_release(&path);
      }
      
     +static int git_retries = 3;
  • 137: 40cceaf = 138: 432eb90 scalar: support the config command for backwards compatibility

  • 138: f9e4940 = 139: 276743f scalar: implement a minimal JSON parser

  • 139: 4b90ce8 ! 140: 149ccd2 scalar clone: support GVFS-enabled remote repositories

    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
         Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
     
    - ## scalar.c ##
    + ## diagnose.c ##
     @@
    + #include "strvec.h"
      #include "object-store.h"
    - #include "simple-ipc.h"
    - #include "fsmonitor-ipc.h"
    + #include "packfile.h"
    ++#include "config.h"
    + 
    + struct archive_dir {
    + 	const char *path;
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	struct strvec archiver_args = STRVEC_INIT;
    + 	char **argv_copy = NULL;
    + 	int stdout_fd = -1, archiver_fd = -1;
    ++	char *cache_server_url = NULL;
    + 	struct strbuf buf = STRBUF_INIT;
    + 	int res, i;
    + 	struct archive_dir archive_dirs[] = {
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	get_version_info(&buf, 1);
    + 
    + 	strbuf_addf(&buf, "Repository root: %s\n", the_repository->worktree);
    ++
    ++	git_config_get_string("gvfs.cache-server", &cache_server_url);
    ++	strbuf_addf(&buf, "Cache Server: %s\n\n",
    ++		    cache_server_url ? cache_server_url : "None");
    ++
    + 	get_disk_info(&buf);
    + 	write_or_die(stdout_fd, buf.buf, buf.len);
    + 	strvec_pushf(&archiver_args,
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	free(argv_copy);
    + 	strvec_clear(&archiver_args);
    + 	strbuf_release(&buf);
    ++	free(cache_server_url);
    + 
    + 	return res;
    + }
    +
    + ## scalar.c ##
    +@@
    + #include "dir.h"
    + #include "packfile.h"
    + #include "help.h"
     +#include "json-parser.h"
      
    - /*
    -  * Remove the deepest subdirectory in the provided path string. Path must not
    + static void setup_enlistment_directory(int argc, const char **argv,
    + 				       const char * const *usagestr,
     @@ scalar.c: static int set_config(const char *fmt, ...)
      	return res;
      }
    @@ scalar.c: static int cmd_clone(int argc, const char **argv)
      	return res;
      }
      
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	time_t now = time(NULL);
    - 	struct tm tm;
    - 	struct strbuf path = STRBUF_INIT, buf = STRBUF_INIT;
    -+	char *cache_server_url = NULL;
    - 	int res = 0;
    - 
    - 	argc = parse_options(argc, argv, NULL, options,
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	get_version_info(&buf, 1);
    - 
    - 	strbuf_addf(&buf, "Enlistment root: %s\n", the_repository->worktree);
    -+
    -+	git_config_get_string("gvfs.cache-server", &cache_server_url);
    -+	strbuf_addf(&buf, "Cache Server: %s\n\n",
    -+		    cache_server_url ? cache_server_url : "None");
    - 	get_disk_info(&buf);
    - 	write_or_die(stdout_fd, buf.buf, buf.len);
    - 	strvec_pushf(&archiver_args,
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	strbuf_release(&zip_path);
    - 	strbuf_release(&path);
    - 	strbuf_release(&buf);
    -+	free(cache_server_url);
    - 
    - 	return res;
    - }
  • 140: 85d4595 = 141: 941dc46 test-gvfs-protocol: also serve smart protocol

  • 141: f529c3f = 142: 366a499 gvfs-helper: add the endpoint command

  • 142: ec0c194 = 143: 7eb0cc9 dir_inside_of(): handle directory separators correctly

  • 143: bdd52d7 ! 144: a58a6b9 scalar: disable authentication in unattended mode

    @@ t/t9099-scalar.sh: test_description='test the `scalar` command'
     +GIT_ASKPASS=true
     +export GIT_ASKPASS
     +
    - test_lazy_prereq BUILTIN_FSMONITOR '
    - 	git version --build-options | grep -q "feature:.*fsmonitor--daemon"
    + test_expect_success 'scalar shows a usage' '
    + 	test_expect_code 129 scalar -h
      '
  • 144: a605233 ! 145: 4117c35 scalar: do initialize gvfs.sharedCache

    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## Documentation/scalar.txt ##
    -@@ Documentation/scalar.txt: scalar - an opinionated repository management tool
    +@@ Documentation/scalar.txt: scalar - A tool for managing large Git repositories
      SYNOPSIS
      --------
      [verse]
    @@ Documentation/scalar.txt: cloning. If the HEAD at the remote did not point at an
      ~~~~
      
     
    + ## diagnose.c ##
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	struct strvec archiver_args = STRVEC_INIT;
    + 	char **argv_copy = NULL;
    + 	int stdout_fd = -1, archiver_fd = -1;
    +-	char *cache_server_url = NULL;
    ++	char *cache_server_url = NULL, *shared_cache = NULL;
    + 	struct strbuf buf = STRBUF_INIT;
    + 	int res, i;
    + 	struct archive_dir archive_dirs[] = {
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	strbuf_addf(&buf, "Repository root: %s\n", the_repository->worktree);
    + 
    + 	git_config_get_string("gvfs.cache-server", &cache_server_url);
    +-	strbuf_addf(&buf, "Cache Server: %s\n\n",
    +-		    cache_server_url ? cache_server_url : "None");
    ++	git_config_get_string("gvfs.sharedCache", &shared_cache);
    ++	strbuf_addf(&buf, "Cache Server: %s\nLocal Cache: %s\n\n",
    ++		    cache_server_url ? cache_server_url : "None",
    ++		    shared_cache ? shared_cache : "None");
    + 
    + 	get_disk_info(&buf);
    + 	write_or_die(stdout_fd, buf.buf, buf.len);
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	strvec_clear(&archiver_args);
    + 	strbuf_release(&buf);
    + 	free(cache_server_url);
    ++	free(shared_cache);
    + 
    + 	return res;
    + }
    +
      ## scalar.c ##
     @@
    - #include "fsmonitor-ipc.h"
    + #include "help.h"
      #include "json-parser.h"
      
     +static int is_unattended(void) {
     +	return git_env_bool("Scalar_UNATTENDED", 0);
     +}
     +
    - /*
    -  * Remove the deepest subdirectory in the provided path string. Path must not
    -  * include a trailing path separator. Returns 1 if parent directory found,
    + static void setup_enlistment_directory(int argc, const char **argv,
    + 				       const char * const *usagestr,
    + 				       const struct option *options,
     @@ scalar.c: static int run_git(const char *arg, ...)
      	return res;
      }
    @@ scalar.c: static int run_git(const char *arg, ...)
     +	return *absolute;
     +}
     +
    - static int set_recommended_config(int reconfigure)
    - {
    - 	struct {
    + struct scalar_config {
    + 	const char *key;
    + 	const char *value;
     @@ scalar.c: static int supports_gvfs_protocol(const char *url, char **cache_server_url)
      	return 0; /* error out quietly */
      }
    @@ scalar.c: static int cmd_clone(int argc, const char **argv)
      	return res;
      }
      
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	time_t now = time(NULL);
    - 	struct tm tm;
    - 	struct strbuf path = STRBUF_INIT, buf = STRBUF_INIT;
    --	char *cache_server_url = NULL;
    -+	char *cache_server_url = NULL, *shared_cache = NULL;
    - 	int res = 0;
    - 
    - 	argc = parse_options(argc, argv, NULL, options,
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	strbuf_addf(&buf, "Enlistment root: %s\n", the_repository->worktree);
    - 
    - 	git_config_get_string("gvfs.cache-server", &cache_server_url);
    --	strbuf_addf(&buf, "Cache Server: %s\n\n",
    --		    cache_server_url ? cache_server_url : "None");
    -+	git_config_get_string("gvfs.sharedCache", &shared_cache);
    -+	strbuf_addf(&buf, "Cache Server: %s\nLocal Cache: %s\n\n",
    -+		    cache_server_url ? cache_server_url : "None",
    -+		    shared_cache ? shared_cache : "None");
    - 	get_disk_info(&buf);
    - 	write_or_die(stdout_fd, buf.buf, buf.len);
    - 	strvec_pushf(&archiver_args,
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	strbuf_release(&path);
    - 	strbuf_release(&buf);
    - 	free(cache_server_url);
    -+	free(shared_cache);
    - 
    - 	return res;
    - }
     @@ scalar.c: int cmd_main(int argc, const char **argv)
      	struct strbuf scalar_usage = STRBUF_INIT;
      	int i;
  • 145: 0bfc0eb ! 146: f9722c3 scalar diagnose: include shared cache info

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## scalar.c ##
    -@@ scalar.c: static int dir_file_stats(struct object_directory *object_dir, void *data)
    + ## diagnose.c ##
    +@@ diagnose.c: static int dir_file_stats(struct object_directory *object_dir, void *data)
      	return 0;
      }
      
    @@ scalar.c: static int dir_file_stats(struct object_directory *object_dir, void *d
      static int count_files(char *path)
      {
      	DIR *dir = opendir(path);
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    - 	    (res = add_directory_to_archiver(&archiver_args, ".git/objects/info", 0)))
    - 		goto diagnose_cleanup;
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 	char **argv_copy = NULL;
    + 	int stdout_fd = -1, archiver_fd = -1;
    + 	char *cache_server_url = NULL, *shared_cache = NULL;
    +-	struct strbuf buf = STRBUF_INIT;
    ++	struct strbuf buf = STRBUF_INIT, path = STRBUF_INIT;
    + 	int res, i;
    + 	struct archive_dir archive_dirs[] = {
    + 		{ ".git", 0 },
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
    + 		}
    + 	}
      
     +	if (shared_cache) {
     +		strbuf_reset(&buf);
  • 146: 7747b09 = 147: 0794f78 scalar: only try GVFS protocol on https:// URLs

  • 147: 849dd61 = 148: 366f932 scalar: verify that we can use a GVFS-enabled repository

  • 148: ac2fa88 ! 149: 67e245a scalar: add the cache-server command

    @@ Documentation/scalar.txt: delete <enlistment>::
     
      ## scalar.c ##
     @@
    - #include "simple-ipc.h"
    - #include "fsmonitor-ipc.h"
    + #include "packfile.h"
    + #include "help.h"
      #include "json-parser.h"
     +#include "remote.h"
      
  • 149: 582a1aa = 150: b580f26 scalar: add a test toggle to skip accessing the vsts/info endpoint

  • 150: d175f17 = 151: 0cb165c scalar: adjust documentation to the microsoft/git fork

  • 151: 6b11af7 = 152: 86a52d5 scalar: enable untracked cache unconditionally

  • 152: b632a5e = 153: 0bbe6df scalar: parse clone --no-fetch-commits-and-trees for backwards compatibility

  • 153: 8d433fd = 154: d1f22a3 scalar: put docs back where they are expected

  • 154: 377405c ! 155: c41caf9 scalar diagnose: accommodate Scalar's Functional Tests

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## scalar.c ##
    -@@ scalar.c: static int cmd_diagnose(int argc, const char **argv)
    + ## diagnose.c ##
    +@@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
      		goto diagnose_cleanup;
      	}
      
    --	if (!res)
    --		fprintf(stderr, "\n"
    --		       "Diagnostics complete.\n"
    --		       "All of the gathered info is captured in '%s'\n",
    --		       zip_path.buf);
    -+	if (!res) {
    -+		strbuf_reset(&buf);
    -+		strbuf_addf(&buf, "\n"
    -+			    "Diagnostics complete.\n"
    -+			    "All of the gathered info is captured in '%s'\n",
    -+			    zip_path.buf);
    -+		write_or_die(stdout_fd, buf.buf, buf.len);
    -+		write_or_die(2, buf.buf, buf.len);
    -+	}
    +-	fprintf(stderr, "\n"
    +-		"Diagnostics complete.\n"
    +-		"All of the gathered info is captured in '%s'\n",
    +-		zip_path->buf);
    ++	strbuf_reset(&buf);
    ++	strbuf_addf(&buf, "\n"
    ++		    "Diagnostics complete.\n"
    ++		    "All of the gathered info is captured in '%s'\n",
    ++		    zip_path->buf);
    ++	write_or_die(stdout_fd, buf.buf, buf.len);
    ++	write_or_die(2, buf.buf, buf.len);
      
      diagnose_cleanup:
      	if (archiver_fd >= 0) {
  • 155: 5e70cf8 = 156: 7a92c7f ci: run Scalar's Functional Tests

  • 156: 5baef4b ! 157: e24d5e5 scalar: upgrade to newest FSMonitor config setting

    @@ scalar.c: static int set_recommended_config(int reconfigure)
     +	}
     +
      	for (i = 0; config[i].key; i++) {
    - 		if ((reconfigure && config[i].overwrite_on_reconfigure) ||
    - 		    git_config_get_string(config[i].key, &value)) {
    + 		if (set_scalar_config(config + i, reconfigure))
    + 			return error(_("could not configure %s=%s"),
  • 157: 1bd40eb ! 158: 190ee7b setup: add discover_git_directory_reason()

    @@ cache.h: void set_git_work_tree(const char *tree);
     +	GIT_DIR_HIT_MOUNT_POINT = -2,
     +	GIT_DIR_INVALID_GITFILE = -3,
     +	GIT_DIR_INVALID_OWNERSHIP = -4,
    -+	GIT_DIR_INVALID_FORMAT = -5,
    -+	GIT_DIR_CWD_FAILURE = -6,
    ++	GIT_DIR_DISALLOWED_BARE = -5,
    ++	GIT_DIR_INVALID_FORMAT = -6,
    ++	GIT_DIR_CWD_FAILURE = -7,
     +};
     +enum discovery_result discover_git_directory_reason(struct strbuf *commondir,
     +						    struct strbuf *gitdir);
    @@ cache.h: void setup_work_tree(void);
      char *prefix_path(const char *prefix, int len, const char *path);
     
      ## setup.c ##
    -@@ setup.c: static int ensure_valid_ownership(const char *gitfile,
    - 	return data.is_safe;
    +@@ setup.c: static const char *allowed_bare_repo_to_string(
    + 	return NULL;
      }
      
     -enum discovery_result {
    @@ setup.c: static int ensure_valid_ownership(const char *gitfile,
     -	GIT_DIR_HIT_CEILING = -1,
     -	GIT_DIR_HIT_MOUNT_POINT = -2,
     -	GIT_DIR_INVALID_GITFILE = -3,
    --	GIT_DIR_INVALID_OWNERSHIP = -4
    +-	GIT_DIR_INVALID_OWNERSHIP = -4,
    +-	GIT_DIR_DISALLOWED_BARE = -5,
     -};
     -
      /*
  • 161: 26726f1 ! 159: 995f2ac scalar reconfigure: help users remove buggy repos

    @@ scalar.c: static int cmd_reconfigure(int argc, const char **argv)
     -			res = -1;
     -		} else {
     -			git_config_clear();
    +-
    +-			the_repository = &r;
    +-			r.commondir = commondir.buf;
    +-			r.gitdir = gitdir.buf;
    +-
    +-			if (set_recommended_config(1) < 0)
    +-				res = -1;
     +			failed = -1;
     +			goto loop_end;
     +		}
    @@ scalar.c: static int cmd_reconfigure(int argc, const char **argv)
     +		the_repository = &r;
     +		r.commondir = commondir.buf;
     +		r.gitdir = gitdir.buf;
    - 
    --			the_repository = &r;
    --			r.commondir = commondir.buf;
    --			r.gitdir = gitdir.buf;
    ++
     +		if (set_recommended_config(1) < 0)
     +			failed = -1;
    - 
    --			if (set_recommended_config(1) < 0)
    --				res = -1;
    ++
     +loop_end:
     +		if (failed) {
     +			res = failed;
  • 159: cab7dd6 = 160: cf75cc0 add/rm: allow adding sparse entries when virtual

  • 162: 9bec239 = 161: a4e6e86 t7524: test no longer fails

  • 163: 61c7ea9 ! 162: a40849a repo-settings: enable sparse index by default

    @@ Commit message
     
      ## repo-settings.c ##
     @@ repo-settings.c: void prepare_repo_settings(struct repository *r)
    - 	repo_cfg_bool(r, "fetch.writecommitgraph", &r->settings.fetch_write_commit_graph, 0);
    + 	/* Boolean config or default, does not cascade (simple)  */
      	repo_cfg_bool(r, "pack.usesparse", &r->settings.pack_use_sparse, 1);
      	repo_cfg_bool(r, "core.multipackindex", &r->settings.core_multi_pack_index, 1);
     -	repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 0);
  • 164: 7f9b71d = 163: 2177d8f dir: add path_matches_cone_mode_pattern_list()

  • 165: b2871a8 = 164: 7456efd diff(sparse-index): verify with partially-sparse

  • 166: beabdb7 = 165: 3d38c50 p2000: explicitly turn off sparse index

  • 167: 22c8f59 ! 166: ee124ed p2000: add new commands

    @@ Commit message
         Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
     
      ## t/perf/p2000-sparse-operations.sh ##
    -@@ t/perf/p2000-sparse-operations.sh: test_perf_on_all git blame $SPARSE_CONE/f3/a
    - test_perf_on_all git read-tree -mu HEAD
    +@@ t/perf/p2000-sparse-operations.sh: test_perf_on_all git read-tree -mu HEAD
      test_perf_on_all git checkout-index -f --all
      test_perf_on_all git update-index --add --remove $SPARSE_CONE/a
    + test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
     +test_perf_on_all git sparse-checkout reapply
      
      test_done
  • 168: 2028beb = 167: d9a9888 stash: expand testing for git stash -u

  • 170: 8c4c2ad = 168: 322aa50 sparse: add vfs-specific precautions

  • 171: e1487fa = 169: 30aea28 t0001: drop memory-leak check

  • 172: 7ea6add = 170: b6ac0cf maintenance: delete stale lock files

  • 173: 1cd624d = 171: 72fa83f reset: fix mixed reset when using virtual filesystem

  • 175: 2f75d8a < -: ------------ unpack-trees: fix sparse directory recursion check

The most relevant pieces are:

  • 124: 5805305 < -: ------------ scalar: enable built-in FSMonitor on register

This made it upstream (in a fundamentally different shape) as 3f1917d.

  • 125: 8c5472f < -: ------------ scalar unregister: stop FSMonitor daemon

Likewise this, as ec4c231.

  • 175: 2f75d8a < -: ------------ unpack-trees: fix sparse directory recursion check

And this made it upstream virtually unchanged, as 037f8ea.

The bulk of the range-diff is due to the cmd_diagnose() logic of scalar.c now having moved to diagnose.c.

@dscho
Copy link
Member Author

dscho commented Sep 16, 2022

Minor change since I posted that range-diff, necessary to let the code compile (res was previously potentially uninitialized).

@dscho dscho changed the title Rebase to v2.38.0 [DO NOT MERGE YET] Rebase to v2.38.0 Sep 16, 2022
@derrickstolee
Copy link
Collaborator

I was looking at the patches that we are carrying forward for opportunities to upstream, but I see some other things that we might want to just drop instead:

  • 2177d8f creates a new method that is not used anywhere except as called by the existing path_matches_pattern_list(). Dropping this should have no effect.
  • 3d38c50 could merge with a40849a, since it is only required if we upstream that new default.
  • ee124ed adds the git sparse-checkout reapply to the perf tests, but isn't super-critical and could be dropped. (We already have the add/set subcommands tested from upstream.)
  • Consider squashing a4e6e86 into 49948a4.
  • We can see if we can revert 30aea28 now that some leak stuff may have stabilized upstream.

I should check the following and either upstream them or drop them:

  • 9b281f4 seems to be important for the git merge integration but somehow it wasn't necessary upstream.
  • b6ac0cf deletes stale maintenance locks. With a configurable time period, this might work upstream.

@dscho
Copy link
Member Author

dscho commented Sep 20, 2022

I was looking at the patches that we are carrying forward for opportunities to upstream,

@derrickstolee thank you so much! TBH while I had meant to look at the patches in detail, I had completely forgotten by the time I had crossed the ocean. I appreciate your attention very, very much!

but I see some other things that we might want to just drop instead:

  • 2177d8f creates a new method that is not used anywhere except as called by the existing path_matches_pattern_list(). Dropping this should have no effect.

  • 3d38c50 could merge with a40849a, since it is only required if we upstream that new default.

  • ee124ed adds the git sparse-checkout reapply to the perf tests, but isn't super-critical and could be dropped. (We already have the add/set subcommands tested from upstream.)

  • Consider squashing a4e6e86 into 49948a4.

  • We can see if we can revert 30aea28 now that some leak stuff may have stabilized upstream.

I looked through all of those and agree with all of your suggestions. I added the corresponding fixup!s.

I should check the following and either upstream them or drop them:

  • 9b281f4 seems to be important for the git merge integration but somehow it wasn't necessary upstream.

  • b6ac0cf deletes stale maintenance locks. With a configurable time period, this might work upstream.

Good thinking! I'll keep these commits for the time being, as a reminder.

One thing that I would like to call to your attention (in particular the attention of @derrickstolee and @vdye!): Due to the changes of 65f6a9e, scalar no longer detects any enlistment when the current directory is a sibling of <enlistment>/src/ (nor when the current directory is deeper inside that sibling tree).

This made a test case fail that we added originally, where we specifically verify that scalar -C test-repo/out register finds the enlistment at test-repo and registers that as new Scalar repository.

I've addressed this via f914ffd, essentially reversing the test case to verify that we do not find the enlistment in that scenario.

But the longer I think about it, the more certain I become that this is not what we need, as it is a hard-to-explain behavior when scalar -C test-repo/src register works, likewise for -C test-repo, but not for -C test-repo/out.

In fact, I have come to believe that we need to fix this, also in upstream, so that scalar -C test-repo/out register works again.

@vdye what do you think?

@derrickstolee
Copy link
Collaborator

derrickstolee commented Sep 20, 2022

One thing that I would like to call to your attention (in particular the attention of @derrickstolee and @vdye!): Due to the changes of 65f6a9e, scalar no longer detects any enlistment when the current directory is a sibling of <enlistment>/src/ (nor when the current directory is deeper inside that sibling tree).

This made a test case fail that we added originally, where we specifically verify that scalar -C test-repo/out register finds the enlistment at test-repo and registers that as new Scalar repository.

I've addressed this via f914ffd, essentially reversing the test case to verify that we do not find the enlistment in that scenario.

But the longer I think about it, the more certain I become that this is not what we need, as it is a hard-to-explain behavior when scalar -C test-repo/src register works, likewise for -C test-repo, but not for -C test-repo/out.

In fact, I have come to believe that we need to fix this, also in upstream, so that scalar -C test-repo/out register works again.

This was a purposeful change upstream to simplify the enlistment selection process. To my mind, the only thing we really need is to be able to say scalar delete <repo> when the Git repository is really in <repo>/src. The "sibling of src" pattern you are talking about seems confusing and not super-valuable. @vdye pointed out on the mailing list that the previous technique of looking for enlistments that way also violated GIT_CEILING_DIRECTORIES.

Keep in mind that "the enlistment" is significantly less important in Scalar than in VFS for Git. VFS for Git needs it because the .gvfs directory is next to src.

@dscho
Copy link
Member Author

dscho commented Sep 20, 2022

Keep in mind that "the enlistment" is significantly less important in Scalar than in VFS for Git. VFS for Git needs it because the .gvfs directory is next to src.

How certain are we that there are no existing users calling something like scalar diagnose from <enlistment>/out?

@dscho
Copy link
Member Author

dscho commented Sep 20, 2022

The "sibling of src" pattern you are talking about seems confusing and not super-valuable.

It sure simplifies things if we do not have to support this.

I tried for almost an hour to make it work, here is my work-in-progress, and I failed so far. Will be very happy to abandon this effort 😁.

@dscho
Copy link
Member Author

dscho commented Sep 22, 2022

Range-diff relative to `tentative/vfs-2.38.0-rc0-clean` (which is tree-same to 34a5d8a, i.e. the pre-rebase-to-rc1 state)
  • 1: cbda0fc = 1: f8957f2 reset --stdin: trim carriage return from the paths

  • 2: 8d54217 ! 2: 229357a gvfs: start by adding the -gvfs suffix to the version

    @@ GIT-VERSION-GEN
      #!/bin/sh
      
      GVF=GIT-VERSION-FILE
    --DEF_VER=v2.38.0-rc0
    +-DEF_VER=v2.38.0-rc1
     +DEF_VER=v2.38.0.vfs.0.0
      
      LF='
  • 3: 62974be = 3: 345cc07 gvfs: ensure that the version is based on a GVFS tag

  • 4: ed9c60a = 4: 33e2eab gvfs: add a GVFS-specific header file

  • 5: 9828d07 = 5: 11b0ebd gvfs: add the core.gvfs config setting

  • 6: 59ce798 = 6: 376659f gvfs: add the feature to skip writing the index' SHA-1

  • 7: 2a37457 = 7: 814c917 gvfs: add the feature that blobs may be missing

  • 8: aed0cdf = 8: 397b596 gvfs: prevent files to be deleted outside the sparse checkout

  • 9: f19dea0 = 9: 552d9ad gvfs: optionally skip reachability checks/upload pack during fetch

  • 10: fa1a731 = 10: 87ccdf8 gvfs: ensure all filters and EOL conversions are blocked

  • 11: 9f3d939 = 11: 6cc32f9 gvfs: allow "virtualizing" objects

  • 12: 1a4a541 = 12: 52e1bb5 Hydrate missing loose objects in check_and_freshen()

  • 16: 327dd3a = 13: b80275e sha1_file: when writing objects, skip the read_object_hook

  • 17: 6f2a13e = 14: 314d757 gvfs: add global command pre and post hook procs

  • 18: f5f4e75 = 15: 1d8a390 t0400: verify that the hook is called correctly from a subdirectory

  • 19: 81d822b = 16: ab59885 Pass PID of git process to hooks.

  • 20: d4be59a = 17: 76b83bd pre-command: always respect core.hooksPath

  • 21: 3eebbaf = 18: d97e8fe sparse-checkout: update files with a modify/delete conflict

  • 22: 47edf2c = 19: 156d558 sparse-checkout: avoid writing entries with the skip-worktree bit

  • 23: 4f9c504 = 20: fc401f3 Do not remove files outside the sparse-checkout

  • 24: ea7cf7a = 21: 2dc8fd5 gvfs: refactor loading the core.gvfs config value

  • 25: 0c6482d = 22: dbef733 send-pack: do not check for sha1 file when GVFS_MISSING_OK set

  • 26: 47932ce = 23: 0dbef78 cache-tree: remove use of strbuf_addf in update_one

  • 27: 83acfe7 = 24: a9567e9 gvfs: block unsupported commands when running in a GVFS repo

  • 28: 240abce = 25: 973af03 gvfs: allow overriding core.gvfs

  • 29: 46d3fee = 26: 3894288 BRANCHES.md: Add explanation of branches and using forks

  • 30: 528127a = 27: 3d040b2 Add virtual file system settings and hook proc

  • 31: 396915d = 28: 4774888 virtualfilesystem: don't run the virtual file system hook if the index has been redirected

  • 32: 57686c1 = 29: 2b25884 virtualfilesystem: fix bug with symlinks being ignored

  • 33: 5741181 = 30: 761f0d2 virtualfilesystem: check if directory is included

  • 34: 4dff1a8 = 31: d79a383 vfs: fix case where directories not handled correctly

  • 35: e8d8827 = 32: 7c495b0 backwards-compatibility: support the post-indexchanged hook

  • 36: ea1ce87 = 33: ec3557a gvfs: verify that the built-in FSMonitor is disabled

  • 37: 2d007c6 = 34: 4bccec4 status: add status serialization mechanism

  • 38: 58434f7 = 35: 8bd3aa7 Teach ahead-behind and serialized status to play nicely together

  • 39: 5e60d7a = 36: e643278 status: serialize to path

  • 40: c8bd7a4 = 37: 7011585 status: reject deserialize in V2 and conflicts

  • 41: 46ec0f6 = 38: 813cfbb status: fix rename reporting when using serialization cache

  • 42: 03aa602 = 39: 462ae79 serialize-status: serialize global and repo-local exclude file metadata

  • 43: ed8c247 = 40: 6c1dfea status: deserialization wait

  • 44: 5ff86c2 = 41: 7a0662a merge-recursive: avoid confusing logic in was_dirty()

  • 45: 8da7a42 = 42: 4263051 merge-recursive: add some defensive coding to was_dirty()

  • 46: 0c4705d = 43: 2673a6c merge-recursive: teach was_dirty() about the virtualfilesystem

  • 47: 7334628 = 44: 720b495 status: deserialize with -uno does not print correct hint

  • 48: 0e8b0ad = 45: a634b2e wt-status-deserialize: fix crash when -v is used

  • 49: a3eb4de = 46: 97fe878 fsmonitor: check CE_FSMONITOR_VALID in ce_uptodate

  • 50: 8a929ea = 47: 46539db fsmonitor: add script for debugging and update script for tests

  • 51: 0d1f6e8 = 48: 837a720 status: disable deserialize when verbose output requested.

  • 52: b409aaf = 49: 40ef284 t7524: add test for verbose status deserialzation

  • 67: fa4312c = 50: 2235cda deserialize-status: silently fallback if we cannot read cache file

  • 68: d476433 = 51: 81ab88c gvfs:trace2:data: add trace2 tracing around read_object_process

  • 69: 46b4f1e = 52: eb8518a gvfs:trace2:data: status deserialization information

  • 70: c87ef84 = 53: ad76c54 gvfs:trace2:data: status serialization

  • 71: 1694591 = 54: e1ff4e8 gvfs:trace2:data: add vfs stats

  • 72: 09772f8 = 55: cfb1c95 trace2: refactor setting process starting time

  • 73: 8faa437 = 56: ddcd40b trace2:gvfs:experiment: clear_ce_flags_1

  • 74: 812d4b4 = 57: 4979fe6 trace2:gvfs:experiment: report_tracking

  • 75: 627cb6b = 58: 0b11872 trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache

  • 76: 8cb4fb7 = 59: 9d8b655 trace2:gvfs:experiment: read-cache: time read/write of cache-tree extension

  • 77: 07e0dd3 = 60: cc8b41c cache-tree: use r instead of the_repository in Trace2

  • 78: a92d665 = 61: d9adafd trace2:gvfs:experiment: add region to apply_virtualfilesystem()

  • 79: 44098ae = 62: e21f3c6 trace2:gvfs:experiment: add region around unpack_trees()

  • 80: 65b5495 = 63: 245aace trace2:gvfs:experiment: add region to cache_tree_fully_valid()

  • 81: 79f67b8 = 64: 21024b4 trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() and report_tracking()

  • 82: 8af1a59 = 65: 6f63e2b trace2:gvfs:experiment: increase default event depth for unpack-tree data

  • 83: 1c295d4 = 66: 7464b2e trace2:gvfs:experiment: add data for check_updates() in unpack_trees()

  • 84: 1b152a4 = 67: f4038a7 Trace2:gvfs:experiment: capture more 'tracking' details

  • 85: 2d4f10e = 68: 6059841 credential: set trace2_child_class for credential manager children

  • 86: 8a1ced6 = 69: 30cdb2e sub-process: do not borrow cmd pointer from caller

  • 87: 9467474 = 70: 8199c50 sub-process: add subprocess_start_argv()

  • 88: 0a2e28e = 71: 67b631e sha1-file: add function to update existing loose object cache

  • 89: c56e022 = 72: 94d0ce6 packfile: add install_packed_git_and_mru()

  • 90: cbfef64 = 73: c890d7c index-pack: avoid immediate object fetch while parsing packfile

  • 91: 3c62776 ! 74: 5fb8abd gvfs-helper: create tool to fetch objects using the GVFS Protocol

    @@ Makefile: else
      	REMOTE_CURL_PRIMARY = git-remote-http$X
      	REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
      	REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
    -@@ Makefile: contrib/scalar/scalar$X: $(SCALAR_OBJECTS) GIT-LDFLAGS $(GITLIBS)
    +@@ Makefile: scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
      	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
      		$(filter %.o,$^) $(LIBS)
      
  • 92: 3f14026 = 75: 13536cb gvfs-helper: fix race condition when creating loose object dirs

  • 93: 3bbcb1b = 76: 6bf77d5 sha1-file: create shared-cache directory if it doesn't exist

  • 94: a1d0367 = 77: 3621a88 gvfs-helper: better handling of network errors

  • 95: 8b02b70 = 78: a7d1b39 gvfs-helper-client: properly update loose cache with fetched OID

  • 96: daabf4c = 79: e0698ab gvfs-helper: V2 robust retry and throttling

  • 97: c4c8410 = 80: cd0b677 gvfs-helper: expose gvfs/objects GET and POST semantics

  • 98: 6141a2d = 81: d7ac5ad gvfs-helper: dramatically reduce progress noise

  • 99: 4aa5c71 = 82: 915d046 gvfs-helper-client.h: define struct object_id

  • 100: 94fd83d = 83: aa93f51 gvfs-helper: handle pack-file after single POST request

  • 101: 19e4e92 = 84: 13fbde0 test-gvfs-prococol, t5799: tests for gvfs-helper

  • 102: 7de13d8 = 85: ce3e6d4 gvfs-helper: move result-list construction into install functions

  • 103: a9ec1e0 = 86: d5a675d t5799: add support for POST to return either a loose object or packfile

  • 104: 488802f = 87: 278a742 t5799: cleanup wc-l and grep-c lines

  • 105: bc0cbf1 = 88: 7b2284e gvfs-helper: verify loose objects after write

  • 106: 6539ce4 = 89: 75b909b t7599: create corrupt blob test

  • 107: cd04e57 = 90: 49350ca gvfs-helper: add prefetch support

  • 108: 160fdfa = 91: ee93e2e gvfs-helper: add prefetch .keep file for last packfile

  • 109: 8a1c8a1 = 92: 2040889 gvfs-helper: do one read in my_copy_fd_len_tail()

  • 110: d57064a = 93: 233ec66 gvfs-helper: move content-type warning for prefetch packs

  • 111: af1beab = 94: 991e157 fetch: use gvfs-helper prefetch under config

  • 112: b015f1a = 95: 2f375f0 gvfs-helper: better support for concurrent packfile fetches

  • 113: 1a4e256 = 96: ac39117 remote-curl: do not call fetch-pack when using gvfs-helper

  • 114: f4d6cf6 = 97: 279f762 fetch: reprepare packs before checking connectivity

  • 115: 23067e3 = 98: 5f6f7c6 gvfs-helper: retry when creating temp files

  • 116: ceb9e7a = 99: d1ba32e sparse: avoid warnings about known cURL issues in gvfs-helper.c

  • 117: 0a44906 = 100: 1e672b4 upload-pack: fix race condition in error messages

  • 118: e33b7a1 = 101: fbe9e66 maintenance: care about gvfs.sharedCache config

  • 119: 35cf556 = 102: 61aceaa unpack-trees:virtualfilesystem: Improve efficiency of clear_ce_flags

  • 120: ee0313d = 103: 833eabe homebrew: add GitHub workflow to release Cask

  • 121: cb38a6d = 104: 578252a Adding winget workflows

  • 122: 2f922d0 = 105: 6f53b6f Add workflow for apt-get release

  • 123: 70219a9 = 106: d98be00 Disable the monitor-components workflow in msft-git

  • 124: 74e6ffe = 107: 32770eb release: create initial Windows installer build workflow

  • 125: e50768d = 108: d7b1f6f release: add Mac OSX installer build

  • 126: b3415e0 = 109: 33121ce release: build unsigned Ubuntu .deb package

  • 127: cdebde2 = 110: 51fa2a9 release: add signing step for .deb package

  • 129: b628805 = 111: bfc8ec3 release: create draft GitHub release with packages & installers

  • 128: fe81670 = 112: 907dbe4 update-microsoft-git: create barebones builtin

  • 131: acb62ed = 113: 4a312d4 release: continue pestering until user upgrades

  • 130: 213cda7 = 114: 51e47d6 update-microsoft-git: Windows implementation

  • 133: 06b7876 = 115: 7ac5958 Makefile: allow specifying GIT_BUILT_FROM_COMMIT

  • 132: e8d26a9 = 116: f1d700d update-microsoft-git: use brew on macOS

  • 135: 6797420 = 117: 52c484f dist: archive HEAD instead of HEAD^{tree}

  • 134: 7453d98 = 118: ff18618 .github: update ISSUE_TEMPLATE.md for microsoft/git

  • 137: af83ccd = 119: 634a94f release: include GIT_BUILT_FROM_COMMIT in MacOS build

  • 136: 6df5b15 = 120: bdb821d .github: update PULL_REQUEST_TEMPLATE.md

  • 139: 70c8126 = 121: f047624 release: add installer validation

  • 53: dc07149 = 122: dd0292a maintenance: make unregister idempotent

  • 54: b3e9863 = 123: cd50d56 cmake: optionally build scalar, too

  • 55: 0bf41b2 = 124: 6be1479 ci: also run the scalar tests

  • 56: 3fbc77e = 125: 1727c22 git_config_set_multivar_in_file_gently(): add a lock timeout

  • 57: 8740613 ! 126: 149f1be scalar: set the config write-lock timeout to 150ms

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
     
    - ## contrib/scalar/scalar.c ##
    -@@ contrib/scalar/scalar.c: static int set_recommended_config(int reconfigure)
    + ## scalar.c ##
    +@@ scalar.c: static int set_recommended_config(int reconfigure)
      		{ "core.autoCRLF", "false" },
      		{ "core.safeCRLF", "false" },
      		{ "fetch.showForcedUpdates", "false" },
    @@ contrib/scalar/scalar.c: static int set_recommended_config(int reconfigure)
      		{ NULL, NULL },
      	};
      	int i;
    -@@ contrib/scalar/scalar.c: static int set_recommended_config(int reconfigure)
    +@@ scalar.c: static int set_recommended_config(int reconfigure)
      
      static int toggle_maintenance(int enable)
      {
  • 58: 6caab7b = 127: 83a1aaf scalar: add docs from microsoft/scalar

  • 138: 5d49fe4 = 128: 46727f3 Adjust README.md for microsoft/git

  • 64: eca2762 = 129: 1a00c04 scalar (Windows): use forward slashes as directory separators

  • 65: 879236e = 130: 00517ea scalar: add retry logic to run_git()

  • 66: 0e84c35 = 131: a532143 scalar: support the config command for backwards compatibility

  • 13: 0a7848e = 132: a34bd61 sparse-checkout: add config to disable deleting dirs

  • 161: ffa72ef = 133: a7408cf add/rm: allow adding sparse entries when virtual

  • 14: 9b281f4 = 134: 2968dfc diff: ignore sparse paths in diffstat

  • 162: e5586d1 = 135: 63c791a repo-settings: enable sparse index by default

  • 163: fbac511 = 136: 742849c diff(sparse-index): verify with partially-sparse

  • 164: e21e17f = 137: 7956812 stash: expand testing for git stash -u

  • 15: b06c20e = 138: e6453f3 sequencer: avoid progress when stderr is redirected

  • 59: 268fce8 (included as part of upstream: 7b5c93c) < -: ------------ scalar: allow installing the command

  • 60: 5555fd5 (included as part of upstream: 7b5c93c) < -: ------------ scalar: allow building and installing the documentation

  • 61: 54f277e (upstream: dd9603e) < -: ------------ git help: special-case scalar

  • 62: c69c30c (upstream: 951759d)< -: ------------ scalar: implement the help subcommand

  • 63: 22b7e73 (included as part of upstream: 7b5c93c) < -: ------------ scalar: move it out of contrib/

  • 165: a2c733c = 139: a13ecce sparse: add vfs-specific precautions

  • 166: f88462f = 140: 03673cf maintenance: delete stale lock files

  • 167: 339fff8 = 141: be7d521 reset: fix mixed reset when using virtual filesystem

  • -: ------------ > 142: eb1d78a scalar: make the build rule more generic

  • 140: 10da61b ! 143: 4237f66 scalar: implement a minimal JSON parser

    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## Makefile ##
    -@@ Makefile: all:: $(FUZZ_OBJS)
    +@@ Makefile: GIT_OBJS += git.o
    + .PHONY: git-objs
    + git-objs: $(GIT_OBJS)
      
    - FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
    - 
    --SCALAR_OBJS := scalar.o
    -+SCALAR_OBJS := scalar.o json-parser.o
    - 
    - PROGRAMS += scalar$(X)
    - BINDIR_PROGRAMS_NEED_X += scalar
    ++SCALAR_OBJS := json-parser.o
    + SCALAR_OBJS += scalar.o
    + .PHONY: scalar-objs
    + scalar-objs: $(SCALAR_OBJS)
     
      ## contrib/buildsystems/CMakeLists.txt ##
     @@ contrib/buildsystems/CMakeLists.txt: target_link_libraries(git-sh-i18n--envsubst common-main)
  • 141: cbbaca7 = 144: c40ac09 scalar clone: support GVFS-enabled remote repositories

  • 142: c92d287 = 145: 6e724e0 test-gvfs-protocol: also serve smart protocol

  • 143: 83a7bbb = 146: 2145fbc gvfs-helper: add the endpoint command

  • 144: 89729e1 = 147: 94fe5f4 dir_inside_of(): handle directory separators correctly

  • 145: 05df3fd ! 148: 24cd6ad scalar: disable authentication in unattended mode

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## t/t9099-scalar.sh ##
    -@@ t/t9099-scalar.sh: test_description='test the `scalar` command'
    - GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab ../cron.txt,launchctl:true,schtasks:true"
    + ## t/t9210-scalar.sh ##
    +@@ t/t9210-scalar.sh: test_description='test the `scalar` command'
    + GIT_TEST_MAINT_SCHEDULER="crontab:test-tool crontab cron.txt,launchctl:true,schtasks:true"
      export GIT_TEST_MAINT_SCHEDULER
      
     +# Do not write any files outside the trash directory
  • 146: c38c305 = 149: 8ee6216 scalar: do initialize gvfs.sharedCache

  • 147: c23a991 ! 150: d2bec2f scalar diagnose: include shared cache info

    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
      ## diagnose.c ##
    -@@ diagnose.c: static int dir_file_stats(struct object_directory *object_dir, void *data)
    - 	return 0;
    +@@ diagnose.c: static unsigned char get_dtype(struct dirent *e, struct strbuf *path)
    + 	return dtype;
      }
      
     +static void dir_stats(struct strbuf *buf, const char *path)
    @@ diagnose.c: static int dir_file_stats(struct object_directory *object_dir, void
     +	closedir(dir);
     +}
     +
    - static int count_files(char *path)
    + static int count_files(struct strbuf *path)
      {
    - 	DIR *dir = opendir(path);
    + 	DIR *dir = opendir(path->buf);
     @@ diagnose.c: int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode)
      	char **argv_copy = NULL;
      	int stdout_fd = -1, archiver_fd = -1;
  • 148: 66d7e12 = 151: 4f0be50 scalar: only try GVFS protocol on https:// URLs

  • 149: 10c877a ! 152: 72f2770 scalar: verify that we can use a GVFS-enabled repository

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## t/t9099-scalar.sh ##
    -@@ t/t9099-scalar.sh: test_expect_success UNZIP 'scalar diagnose' '
    + ## t/t9210-scalar.sh ##
    +@@ t/t9210-scalar.sh: test_expect_success UNZIP 'scalar diagnose' '
      	grep "^Total: [1-9]" out
      '
      
  • 150: 036a8fd = 153: d3d70a9 scalar: add the cache-server command

  • 151: 2f9998f = 154: 244eabc scalar: add a test toggle to skip accessing the vsts/info endpoint

  • 152: 5c054a5 ! 155: f0a0abf scalar: adjust documentation to the microsoft/git fork

    @@ Commit message
     
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
     
    - ## Documentation/scalar/getting-started.md ##
    -@@ Documentation/scalar/getting-started.md: Creating a new Scalar clone
    + ## contrib/scalar/docs/getting-started.md ##
    +@@ contrib/scalar/docs/getting-started.md: Creating a new Scalar clone
      ---------------------------------------------------
      
      The `clone` verb creates a local enlistment of a remote repository using the
    @@ Documentation/scalar/getting-started.md: Creating a new Scalar clone
      
      ```
      scalar clone [options] <url> [<dir>]
    -@@ Documentation/scalar/getting-started.md: in `<path>`.
    +@@ contrib/scalar/docs/getting-started.md: in `<path>`.
      These options allow a user to customize their initial enlistment.
      
      * `--full-clone`: If specified, do not initialize the sparse-checkout feature.
    @@ Documentation/scalar/getting-started.md: in `<path>`.
      
      The options below are not intended for use by a typical user. These are
     
    - ## Documentation/scalar/index.md ##
    -@@ Documentation/scalar/index.md: these features for that repo (except partial clone) and start running suggested
    + ## contrib/scalar/docs/index.md ##
    +@@ contrib/scalar/docs/index.md: these features for that repo (except partial clone) and start running suggested
      maintenance in the background using
      [the `git maintenance` feature](https://git-scm.com/docs/git-maintenance).
      
    @@ Documentation/scalar/index.md: these features for that repo (except partial clon
      
      Documentation
      -------------
    -@@ Documentation/scalar/index.md: Documentation
    +@@ contrib/scalar/docs/index.md: Documentation
      
      * [Troubleshooting](troubleshooting.md):
        Collect diagnostic information or update custom settings. Includes
    @@ Documentation/scalar/index.md: Documentation
      * [The Philosophy of Scalar](philosophy.md): Why does Scalar work the way
        it does, and how do we make decisions about its future?
     
    - ## Documentation/scalar/philosophy.md ##
    -@@ Documentation/scalar/philosophy.md: Scalar only to configure those new settings. In particular, we ported
    + ## contrib/scalar/docs/philosophy.md ##
    +@@ contrib/scalar/docs/philosophy.md: Scalar only to configure those new settings. In particular, we ported
      features like background maintenance to Git to make Scalar simpler and
      make Git more powerful.
      
    @@ Documentation/scalar/philosophy.md: Scalar only to configure those new settings.
      Using `scalar register` on an existing Git repository will give you these
      benefits:
     
    - ## Documentation/scalar/troubleshooting.md ##
    -@@ Documentation/scalar/troubleshooting.md: files for that repository. This includes:
    + ## contrib/scalar/docs/troubleshooting.md ##
    +@@ contrib/scalar/docs/troubleshooting.md: files for that repository. This includes:
      
      As the `diagnose` command completes, it provides the path of the resulting
      zip file. This zip can be attached to bug reports to make the analysis easier.
  • 153: 75fe0ca = 156: f021b73 scalar: enable untracked cache unconditionally

  • 154: a667a6a = 157: c79d276 scalar: parse clone --no-fetch-commits-and-trees for backwards compatibility

  • 155: 56ab0ab < -: ------------ scalar: put docs back where they are expected

  • 156: 1191568 = 158: 337c63f scalar diagnose: accommodate Scalar's Functional Tests

  • 157: c2533bd = 159: 420538d ci: run Scalar's Functional Tests

  • 158: 3968661 = 160: c1e7a6d scalar: upgrade to newest FSMonitor config setting

  • 159: a7edb9a = 161: eb1306a setup: add discover_git_directory_reason()

  • 160: 195c08b = 162: 6c3c7af scalar reconfigure: help users remove buggy repos

Two things are notable in addition to the upstreamed commits 268fce8, 5555fd5, 54f277e, c69c30c and 22b7e73 (some of which were admittedly transmogrified quite a bit):

  • 56ab0ab is no longer needed, as the part of 22b7e73 that moved the Scalar documentation out of contrib/scalar/ never made it upstream, in fact, not even d85aa29 made it there

  • eb1d78a is needed because 7b5c93c inadvertently converted the $(SCALAR_OBJECTS) part of the scalar$X Makefile rule to scalar.o instead of $(SCALAR_OBJS).

@dscho
Copy link
Member Author

dscho commented Sep 22, 2022

I needed to revert two Scalar commits, still, to make this work (they did not conflict, but are obsolete now that Scalar moved out of contrib/scalar/, and cause problems).

@vdye
Copy link
Collaborator

vdye commented Sep 22, 2022

Two things are notable in addition to the upstreamed commits 268fce8, 5555fd5, 54f277e, c69c30c and 22b7e73 (some of which were admittedly transmogrified quite a bit):

  • 56ab0ab is no longer needed, as the part of 22b7e73 that moved the Scalar documentation out of contrib/scalar/ never made it upstream, in fact, not even d85aa29 made it there

These commits weren't upstreamed because the documentation was intentionally consolidated into only Documentation/scalar.txt and Documentation/technical/scalar.txt. The way I see them distributed is:

  • faq.md - a lot of this information exists across the two upstream documents, but I think the "Why does scalar clone create a <repo>/src folder?" answer might be nice to include in either the command doc or the design doc (not sure which makes more sense).
  • getting-started.md largely seems like a slightly more guided repetition of the command document. Was there something here you wanted to see in the other docs?
  • index.md appears to mainly be used to route users to other documentation pages, it seems unnecessary?
  • philosophy.md was (along with the original README.md) were the basis for Documentation/technical/scalar.txt. If there's anything in philosophy.md that isn't already in the design doc, please let me know!
  • troubleshooting.md mostly repeats documentation already in Documentation/scalar.txt and Documentation/git-diagnose.txt. A possible (upstreamable) improvement here would be to have the scalar diagnose documentation directly reference git diagnose (and its corresponding man page), especially if we ever intend to deprecate scalar diagnose in favor of git diagnose.

Overall, I still think it's more consistent with upstream to drop these Markdown files, incorporating the important bits into either the command documentation or design doc. I'm happy to do that, but I'll also gladly let someone else do it. 🙂

  • eb1d78a is needed because 7b5c93c inadvertently converted the $(SCALAR_OBJECTS) part of the scalar$X Makefile rule to scalar.o instead of $(SCALAR_OBJS).

This wasn't unintentional, it was done because it seemed more consistent with other, similar targets (e.g. git-imap-send$X, git-http-fetch$X, git-http-push$X, etc.) at the time. If more objects were ever added to "Scalar", my intention was to switch to using $(SCALAR_OBJS) as you did. So, I think your solution is correct, but I'd fold it into 4237f66 (scalar: implement a minimal JSON parser) instead of creating a standalone commit.

@derrickstolee
Copy link
Collaborator

Two things are notable in addition to the upstreamed commits 268fce8, 5555fd5, 54f277e, c69c30c and 22b7e73 (some of which were admittedly transmogrified quite a bit):

  • 56ab0ab is no longer needed, as the part of 22b7e73 that moved the Scalar documentation out of contrib/scalar/ never made it upstream, in fact, not even d85aa29 made it there

These commits weren't upstreamed because the documentation was intentionally consolidated into only Documentation/scalar.txt and Documentation/technical/scalar.txt. The way I see them distributed is:

  • faq.md - a lot of this information exists across the two upstream documents, but I think the "Why does scalar clone create a <repo>/src folder?" answer might be nice to include in either the command doc or the design doc (not sure which makes more sense).
  • getting-started.md largely seems like a slightly more guided repetition of the command document. Was there something here you wanted to see in the other docs?
  • index.md appears to mainly be used to route users to other documentation pages, it seems unnecessary?
  • philosophy.md was (along with the original README.md) were the basis for Documentation/technical/scalar.txt. If there's anything in philosophy.md that isn't already in the design doc, please let me know!
  • troubleshooting.md mostly repeats documentation already in Documentation/scalar.txt and Documentation/git-diagnose.txt. A possible (upstreamable) improvement here would be to have the scalar diagnose documentation directly reference git diagnose (and its corresponding man page), especially if we ever intend to deprecate scalar diagnose in favor of git diagnose.

Overall, I still think it's more consistent with upstream to drop these Markdown files, incorporating the important bits into either the command documentation or design doc. I'm happy to do that, but I'll also gladly let someone else do it. 🙂

These docs are also linked from places like microsoft/scalar and their markdown-rendered view is nicer for readers on GitHub. We should keep them in the same location for the vfs-2.38.0 rebase, but shortly after we should replace the files with links to the appropriate docs so existing links can still be followed. Then, we can have that review complete and merged for the eventual vfs-2.38.1 rebase.

@dscho
Copy link
Member Author

dscho commented Sep 27, 2022

Range-diff relative to the -rc1 rebase
  • 1: f8957f2 = 1: 2573638 reset --stdin: trim carriage return from the paths

  • 2: 229357a ! 2: 30db2e4 gvfs: start by adding the -gvfs suffix to the version

    @@ GIT-VERSION-GEN
      #!/bin/sh
      
      GVF=GIT-VERSION-FILE
    --DEF_VER=v2.38.0-rc1
    +-DEF_VER=v2.38.0-rc2
     +DEF_VER=v2.38.0.vfs.0.0
      
      LF='
  • 3: 345cc07 = 3: 918b8ec gvfs: ensure that the version is based on a GVFS tag

  • 4: 33e2eab = 4: 892ee07 gvfs: add a GVFS-specific header file

  • 5: 11b0ebd = 5: 03bc362 gvfs: add the core.gvfs config setting

  • 6: 376659f = 6: ff0718b gvfs: add the feature to skip writing the index' SHA-1

  • 7: 814c917 = 7: e594349 gvfs: add the feature that blobs may be missing

  • 8: 397b596 = 8: 53f990b gvfs: prevent files to be deleted outside the sparse checkout

  • 9: 552d9ad = 9: cb2780d gvfs: optionally skip reachability checks/upload pack during fetch

  • 10: 87ccdf8 = 10: 35ef123 gvfs: ensure all filters and EOL conversions are blocked

  • 11: 6cc32f9 = 11: 8e514f8 gvfs: allow "virtualizing" objects

  • 12: 52e1bb5 = 12: 2f3f7b7 Hydrate missing loose objects in check_and_freshen()

  • 13: b80275e = 13: 7b08a15 sha1_file: when writing objects, skip the read_object_hook

  • 14: 314d757 = 14: 5d1b297 gvfs: add global command pre and post hook procs

  • 15: 1d8a390 = 15: 5b73984 t0400: verify that the hook is called correctly from a subdirectory

  • 16: ab59885 = 16: bdd0c83 Pass PID of git process to hooks.

  • 17: 76b83bd = 17: 4d7ba37 pre-command: always respect core.hooksPath

  • 18: d97e8fe = 18: ab928d8 sparse-checkout: update files with a modify/delete conflict

  • 19: 156d558 = 19: c7f233f sparse-checkout: avoid writing entries with the skip-worktree bit

  • 20: fc401f3 = 20: fc24658 Do not remove files outside the sparse-checkout

  • 21: 2dc8fd5 = 21: f174787 gvfs: refactor loading the core.gvfs config value

  • 22: dbef733 = 22: 4913641 send-pack: do not check for sha1 file when GVFS_MISSING_OK set

  • 23: 0dbef78 = 23: d39e27d cache-tree: remove use of strbuf_addf in update_one

  • 24: a9567e9 = 24: 564b489 gvfs: block unsupported commands when running in a GVFS repo

  • 25: 973af03 = 25: 8c5272e gvfs: allow overriding core.gvfs

  • 26: 3894288 = 26: 93a2c24 BRANCHES.md: Add explanation of branches and using forks

  • 27: 3d040b2 = 27: e53ecaf Add virtual file system settings and hook proc

  • 28: 4774888 = 28: 5b54357 virtualfilesystem: don't run the virtual file system hook if the index has been redirected

  • 29: 2b25884 = 29: 2a74f07 virtualfilesystem: fix bug with symlinks being ignored

  • 30: 761f0d2 = 30: 2229959 virtualfilesystem: check if directory is included

  • 31: d79a383 = 31: f4c4111 vfs: fix case where directories not handled correctly

  • 32: 7c495b0 = 32: 2773ce7 backwards-compatibility: support the post-indexchanged hook

  • 33: ec3557a = 33: f0540ca gvfs: verify that the built-in FSMonitor is disabled

  • 34: 4bccec4 = 34: 271b667 status: add status serialization mechanism

  • 35: 8bd3aa7 = 35: e9cea56 Teach ahead-behind and serialized status to play nicely together

  • 36: e643278 = 36: 466cb61 status: serialize to path

  • 37: 7011585 = 37: 81c8285 status: reject deserialize in V2 and conflicts

  • 38: 813cfbb = 38: 404d778 status: fix rename reporting when using serialization cache

  • 39: 462ae79 = 39: e94ea93 serialize-status: serialize global and repo-local exclude file metadata

  • 40: 6c1dfea = 40: eceb5f5 status: deserialization wait

  • 41: 7a0662a = 41: b5dfbd0 merge-recursive: avoid confusing logic in was_dirty()

  • 42: 4263051 = 42: 6449c0d merge-recursive: add some defensive coding to was_dirty()

  • 43: 2673a6c = 43: 095395d merge-recursive: teach was_dirty() about the virtualfilesystem

  • 44: 720b495 = 44: 3c30693 status: deserialize with -uno does not print correct hint

  • 45: a634b2e = 45: d3cc052 wt-status-deserialize: fix crash when -v is used

  • 46: 97fe878 = 46: 219de48 fsmonitor: check CE_FSMONITOR_VALID in ce_uptodate

  • 47: 46539db = 47: f4a0202 fsmonitor: add script for debugging and update script for tests

  • 48: 837a720 = 48: ac50b3a status: disable deserialize when verbose output requested.

  • 49: 40ef284 = 49: ec53119 t7524: add test for verbose status deserialzation

  • 50: 2235cda = 50: c82ecd9 deserialize-status: silently fallback if we cannot read cache file

  • 51: 81ab88c = 51: 2d038cc gvfs:trace2:data: add trace2 tracing around read_object_process

  • 52: eb8518a = 52: 8ba178c gvfs:trace2:data: status deserialization information

  • 53: ad76c54 = 53: b649435 gvfs:trace2:data: status serialization

  • 54: e1ff4e8 = 54: 65827a9 gvfs:trace2:data: add vfs stats

  • 55: cfb1c95 = 55: 264b255 trace2: refactor setting process starting time

  • 56: ddcd40b = 56: 5fdeb99 trace2:gvfs:experiment: clear_ce_flags_1

  • 57: 4979fe6 = 57: 050adf8 trace2:gvfs:experiment: report_tracking

  • 58: 0b11872 = 58: 3aa0bc3 trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache

  • 59: 9d8b655 = 59: 68328ae trace2:gvfs:experiment: read-cache: time read/write of cache-tree extension

  • 60: cc8b41c = 60: d9c2e69 cache-tree: use r instead of the_repository in Trace2

  • 61: d9adafd = 61: 5fc33ed trace2:gvfs:experiment: add region to apply_virtualfilesystem()

  • 62: e21f3c6 = 62: 8b5f6ae trace2:gvfs:experiment: add region around unpack_trees()

  • 63: 245aace = 63: 556474f trace2:gvfs:experiment: add region to cache_tree_fully_valid()

  • 64: 21024b4 = 64: bfe94a3 trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() and report_tracking()

  • 65: 6f63e2b = 65: e319f45 trace2:gvfs:experiment: increase default event depth for unpack-tree data

  • 66: 7464b2e = 66: 1e69dd8 trace2:gvfs:experiment: add data for check_updates() in unpack_trees()

  • 67: f4038a7 = 67: ed8dc97 Trace2:gvfs:experiment: capture more 'tracking' details

  • 68: 6059841 = 68: 7f6a121 credential: set trace2_child_class for credential manager children

  • 69: 30cdb2e = 69: 515c157 sub-process: do not borrow cmd pointer from caller

  • 70: 8199c50 = 70: e1d5f8d sub-process: add subprocess_start_argv()

  • 71: 67b631e = 71: 535b081 sha1-file: add function to update existing loose object cache

  • 72: 94d0ce6 = 72: 454b0dd packfile: add install_packed_git_and_mru()

  • 73: c890d7c = 73: 1fa62d2 index-pack: avoid immediate object fetch while parsing packfile

  • 74: 5fb8abd = 74: 1df4a18 gvfs-helper: create tool to fetch objects using the GVFS Protocol

  • 75: 13536cb = 75: 952b85a gvfs-helper: fix race condition when creating loose object dirs

  • 76: 6bf77d5 = 76: 8a7d0c6 sha1-file: create shared-cache directory if it doesn't exist

  • 77: 3621a88 = 77: 5021407 gvfs-helper: better handling of network errors

  • 78: a7d1b39 = 78: b611189 gvfs-helper-client: properly update loose cache with fetched OID

  • 79: e0698ab = 79: ce66f36 gvfs-helper: V2 robust retry and throttling

  • 80: cd0b677 = 80: 1a0045c gvfs-helper: expose gvfs/objects GET and POST semantics

  • 81: d7ac5ad = 81: 9970f8d gvfs-helper: dramatically reduce progress noise

  • 82: 915d046 = 82: c8ddca2 gvfs-helper-client.h: define struct object_id

  • 83: aa93f51 = 83: d9cd246 gvfs-helper: handle pack-file after single POST request

  • 84: 13fbde0 = 84: e02aa74 test-gvfs-prococol, t5799: tests for gvfs-helper

  • 85: ce3e6d4 = 85: 96019a0 gvfs-helper: move result-list construction into install functions

  • 86: d5a675d = 86: fa9fbc0 t5799: add support for POST to return either a loose object or packfile

  • 87: 278a742 = 87: 6220e4c t5799: cleanup wc-l and grep-c lines

  • 88: 7b2284e = 88: 66b2a9d gvfs-helper: verify loose objects after write

  • 89: 75b909b = 89: 3fb01f0 t7599: create corrupt blob test

  • 90: 49350ca = 90: 8237117 gvfs-helper: add prefetch support

  • 91: ee93e2e = 91: bb01e6e gvfs-helper: add prefetch .keep file for last packfile

  • 92: 2040889 = 92: 234d2b2 gvfs-helper: do one read in my_copy_fd_len_tail()

  • 93: 233ec66 = 93: 8d9a606 gvfs-helper: move content-type warning for prefetch packs

  • 94: 991e157 = 94: 7f3f9e3 fetch: use gvfs-helper prefetch under config

  • 95: 2f375f0 = 95: d8295e5 gvfs-helper: better support for concurrent packfile fetches

  • 96: ac39117 = 96: 0d35efd remote-curl: do not call fetch-pack when using gvfs-helper

  • 97: 279f762 = 97: fb73af9 fetch: reprepare packs before checking connectivity

  • 98: 5f6f7c6 = 98: e5315b6 gvfs-helper: retry when creating temp files

  • 99: d1ba32e = 99: 869d296 sparse: avoid warnings about known cURL issues in gvfs-helper.c

  • 100: 1e672b4 = 100: 13522ec upload-pack: fix race condition in error messages

  • 101: fbe9e66 = 101: 6c4b105 maintenance: care about gvfs.sharedCache config

  • 102: 61aceaa = 102: d7365ab unpack-trees:virtualfilesystem: Improve efficiency of clear_ce_flags

  • 103: 833eabe = 103: 8b6b13a homebrew: add GitHub workflow to release Cask

  • 104: 578252a = 104: 14e1b15 Adding winget workflows

  • 105: 6f53b6f = 105: 7cd2b4c Add workflow for apt-get release

  • 106: d98be00 = 106: aa7b7a7 Disable the monitor-components workflow in msft-git

  • 107: 32770eb = 107: 4553e3b release: create initial Windows installer build workflow

  • 108: d7b1f6f = 108: 6532f2c release: add Mac OSX installer build

  • 109: 33121ce = 109: 868bba6 release: build unsigned Ubuntu .deb package

  • 110: 51fa2a9 = 110: 9b2ad70 release: add signing step for .deb package

  • 111: bfc8ec3 = 111: 92f75c2 release: create draft GitHub release with packages & installers

  • 113: 4a312d4 = 112: 7e781cc release: continue pestering until user upgrades

  • 115: 7ac5958 = 113: f076d59 Makefile: allow specifying GIT_BUILT_FROM_COMMIT

  • 117: 52c484f = 114: ea1b82b dist: archive HEAD instead of HEAD^{tree}

  • 112: 907dbe4 = 115: 0d782d8 update-microsoft-git: create barebones builtin

  • 114: 51e47d6 = 116: c90308c update-microsoft-git: Windows implementation

  • 116: f1d700d = 117: 8a3ccc3 update-microsoft-git: use brew on macOS

  • 118: ff18618 = 118: 0fcc535 .github: update ISSUE_TEMPLATE.md for microsoft/git

  • 120: bdb821d = 119: 5c596ca .github: update PULL_REQUEST_TEMPLATE.md

  • 119: 634a94f = 120: 1fc8dbe release: include GIT_BUILT_FROM_COMMIT in MacOS build

  • 122: dd0292a = 121: a9b6d9e maintenance: make unregister idempotent

  • 128: 46727f3 = 122: 4be62fb Adjust README.md for microsoft/git

  • 121: f047624 = 123: a51271d release: add installer validation

  • 123: cd50d56 < -: ------------ cmake: optionally build scalar, too

  • 124: 6be1479 < -: ------------ ci: also run the scalar tests

  • 132: a34bd61 = 124: d6c075f sparse-checkout: add config to disable deleting dirs

  • 133: a7408cf = 125: f2c941c add/rm: allow adding sparse entries when virtual

  • 134: 2968dfc = 126: f6d64a2 diff: ignore sparse paths in diffstat

  • 135: 63c791a = 127: 1dbb506 repo-settings: enable sparse index by default

  • 136: 742849c = 128: 7879ae6 diff(sparse-index): verify with partially-sparse

  • 137: 7956812 = 129: 104dde9 stash: expand testing for git stash -u

  • 138: e6453f3 = 130: 804a2e6 sequencer: avoid progress when stderr is redirected

  • 139: a13ecce = 131: be0df0c sparse: add vfs-specific precautions

  • 140: 03673cf = 132: 7680630 maintenance: delete stale lock files

  • 141: be7d521 = 133: c97bebf reset: fix mixed reset when using virtual filesystem

  • 125: 1727c22 = 134: 64b7c60 git_config_set_multivar_in_file_gently(): add a lock timeout

  • 126: 149f1be = 135: 1025b91 scalar: set the config write-lock timeout to 150ms

  • 127: 83a1aaf ! 136: 5781f89 scalar: add docs from microsoft/scalar

    @@ contrib/scalar/docs/getting-started.md (new)
     +  a remote with many branches. Any `git fetch` commands after the clone will
     +  still ask for all branches.
     +
    -+* `--no-prefetch`: Use this option to not prefetch commits after clone. This
    -+  is not recommended for anyone planning to use their clone for history
    -+  traversal. Use of this option will make commands like `git log` or
    -+  `git pull` extremely slow and is therefore not recommended.
    -+
     +Removing a Scalar Clone
     +-----------------------
     +
  • 129: 1a00c04 = 137: 05451d9 scalar (Windows): use forward slashes as directory separators

  • 130: 00517ea = 138: 9b0b54e scalar: add retry logic to run_git()

  • 131: a532143 = 139: 1e26821 scalar: support the config command for backwards compatibility

  • 142: eb1d78a = 140: 4a31c84 scalar: make the build rule more generic

  • 143: 4237f66 = 141: a180552 scalar: implement a minimal JSON parser

  • 144: c40ac09 = 142: 666bfe4 scalar clone: support GVFS-enabled remote repositories

  • 145: 6e724e0 = 143: 5742b57 test-gvfs-protocol: also serve smart protocol

  • 146: 2145fbc = 144: 89fb6d8 gvfs-helper: add the endpoint command

  • 147: 94fe5f4 = 145: 0304898 dir_inside_of(): handle directory separators correctly

  • 148: 24cd6ad = 146: a451442 scalar: disable authentication in unattended mode

  • 149: 8ee6216 = 147: 37766d5 scalar: do initialize gvfs.sharedCache

  • 150: d2bec2f = 148: 596fd2c scalar diagnose: include shared cache info

  • 151: 4f0be50 = 149: 250eee5 scalar: only try GVFS protocol on https:// URLs

  • 152: 72f2770 = 150: 3a7cd04 scalar: verify that we can use a GVFS-enabled repository

  • 153: d3d70a9 = 151: dd63f57 scalar: add the cache-server command

  • 154: 244eabc = 152: 0514bec scalar: add a test toggle to skip accessing the vsts/info endpoint

  • 155: f0a0abf = 153: 54d5bb0 scalar: adjust documentation to the microsoft/git fork

  • 156: f021b73 = 154: 9e42573 scalar: enable untracked cache unconditionally

  • 157: c79d276 = 155: 613b762 scalar: parse clone --no-fetch-commits-and-trees for backwards compatibility

  • 158: 337c63f = 156: 6d8c499 scalar diagnose: accommodate Scalar's Functional Tests

  • 159: 420538d = 157: fffca00 ci: run Scalar's Functional Tests

  • 160: c1e7a6d = 158: 5efc5ca scalar: upgrade to newest FSMonitor config setting

  • 161: eb1306a = 159: cd4705e setup: add discover_git_directory_reason()

  • 162: 6c3c7af = 160: 6b3961c scalar reconfigure: help users remove buggy repos

  • 163: a4a7682 < -: ------------ fixup! ci: also run the scalar tests

  • 164: 05d07d7 < -: ------------ fixup! cmake: optionally build scalar, too

  • 165: 07c45f0 < -: ------------ fixup! scalar: add docs from microsoft/scalar

Kevin Willford and others added 9 commits October 3, 2022 20:01
While using the reset --stdin feature on windows path added may have a
\r at the end of the path that wasn't getting removed so didn't match
the path in the index and wasn't reset.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Saeed Noursalehi <sanoursa@microsoft.com>
Since we really want to be based on a `.vfs.*` tag, let's make sure that
there was a new-enough one, i.e. one that agrees with the first three
version numbers of the recorded default version.

This prevents e.g. v2.22.0.vfs.0.<some-huge-number>.<commit> from being
used when the current release train was not yet tagged.

It is important to get the first three numbers of the version right
because e.g. Scalar makes decisions depending on those (such as assuming
that the `git maintenance` built-in is not available, even though it
actually _is_ available).

Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
This header file will accumulate GVFS-specific definitions.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
This does not do anything yet. The next patches will add various values
for that config setting that correspond to the various features
offered/required by GVFS.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
This takes a substantial amount of time, and if the user is reasonably
sure that the files' integrity is not compromised, that time can be saved.

Git no longer verifies the SHA-1 by default, anyway.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Prevent the sparse checkout to delete files that were marked with
skip-worktree bit and are not in the sparse-checkout file.

This is because everything with the skip-worktree bit turned on is being
virtualized and will be removed with the change of HEAD.

There was only one failing test when running with these changes that was
checking to make sure the worktree narrows on checkout which was
expected since we would no longer be narrowing the worktree.

Update 2022-04-05: temporarily set 'sparse.expectfilesoutsideofpatterns' in
test (until we start disabling the "remove present-despite-SKIP_WORKTREE"
behavior with 'core.virtualfilesystem' in a later commit).

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
This adds hard-coded call to GVFS.hooks.exe before and after each Git
command runs.

To make sure that this is only called on repositories cloned with GVFS, we
test for the tell-tale .gvfs.

2021-10-30: Recent movement of find_hook() to hook.c required moving these
changes out of run-command.c to hook.c.

Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
dscho and others added 25 commits October 4, 2022 23:03
With this change, we come a big step closer to feature parity with
Scalar: this allows cloning from Azure Repos (which do not support
partial clones at time of writing).

We use the just-implemented JSON parser to parse the response we got
from the `gvfs/config` endpoint; Please note that this response might,
or might not, contain information about a cache server. The presence or
absence of said cache server, however, has nothing to do with the
ability to speak the GVFS protocol (but the presence of the
`gvfs/config` endpoint does that).

An alternative considered during the development of this patch was to
perform simple string matching instead of parsing the JSON-formatted
data; However, this would have been fragile, as the response contains
free-form text (e.g. the repository's description) which might contain
parts that would confuse a simple string matcher (but not a proper JSON
parser).

Note: we need to limit the re-try logic in `git clone` to handle only
the non-GVFS case: the call to `set_config()` to un-set the partial
clone settings would otherwise fail because those settings would not
exist in the GVFS protocol case. This will at least give us a clearer
reason why such a fetch fails.

Co-authored-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
This comes in handy, as we want to verify that `scalar clone` also works
against a GVFS-enabled remote repository.

Note that we have to set `MSYS2_ENV_CONV_EXCL` to prevent MSYS2 from
mangling `PATH_TRANSLATED`: The value _does_ look like a Unix-style
path, but no, MSYS2 must not be allowed to convert that into a Windows
path: `http-backend` needs it in the unmodified form. (The MSYS2 runtime
comes in when `git` is run via `bin-wrappers/git`, which is a shell
script.)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We already have the `config` command that accesses the `gvfs/config`
endpoint.

To implement `scalar`, we also need to be able to access the `vsts/info`
endpoint. Let's add a command to do precisely that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, both the forward slash and the backslash are directory
separators. Which means that `a\b\c` really is inside `a/b`. Therefore,
we need to special-case the directory separators in the helper function
`cmp_icase()` that is used in the loop in `dir_inside_of()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Modified to remove call to is_unattended() that has not been implemented
yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This finalizes the port of the `QueryVstsInfo()` function: we already
taught `gvfs-helper` to access the `vsts/info` endpoint on demand, we
implemented proper JSON parsing, and now it is time to hook it all up.

To that end, we also provide a default local cache root directory. It
works the same way as the .NET version of Scalar: it uses

    C:\scalarCache on Windows,

    ~/.scalarCache/ on macOS and

    ~/.cache/scalar on Linux

Modified to include call to is_unattended() that was removed from a
previous commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Well, technically also the http:// protocol is allowed _when testing_...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Azure Repos does not support partial clones at the moment, but it does
support the GVFS protocol. To that end, the Microsoft fork of Git has a
`gvfs-helper` command that is optionally used to perform essentially the
same functionality as partial clone.

Let's verify that `scalar clone` detects that situation and enables the
GVFS helper.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This allows setting the GVFS-enabled cache server, or listing the one(s)
associated with the remote repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In Scalar's functional tests, we do not do anything with authentication.
Therefore, we do want to avoid accessing the `vsts/info` endpoint
because it requires authentication even on otherwise public
repositories.

Let's introduce the environment variable `SCALAR_TEST_SKIP_VSTS_INFO`
which can be set to `true` to simply skip that step (and force the
`url_*` style repository IDs instead of `id_*` whenever possible).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Scalar in Microsoft's Git fork can do a little more than Scalar in
upstream Git: in Microsoft's Git, it supports the GVFS protocol so that
Scalar can clone from Azure DevOps.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Those tests specifically verify that the `.zip` file path is shown on
`stdout`. Let's do that again, under the assumption that there are
scripts out there that rely on this behavior.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…atibility

This option does not do anything anymore, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Scalar's Functional Test suite is pretty comprehensive, and caught more
than just one bug in the built-in FSMonitor that was missed by Git's own
test suite.

To benefit from this test suite, automatically run it on the `vfs-*`
and `features/*` branches.

Note: for simplicity, we're building Git from scratch in all matrix
jobs.

Also note: for speed, we are using `git-sdk-64-minimal`, even if it
lacks the `/bin/install` that we need to install Git's files; We're
providing a minimal shell script shim instead. Also, we do not need to
bother with the Tcl/Tk parts, therefore we're skipping them, too.

Finally, we use GIT_FORCE_UNTRACKED_CACHE in the functional tests, to
give the untracked cache a thorough work-out.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Prepare `scalar` to use the GVFS protocol instead of partial clone
(required to support Azure Repos).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There are many reasons why discovering a Git directory may fail. In
particular, 8959555 (setup_git_directory(): add an owner check for
the top-level directory, 2022-03-02) added ownership checks as a
security precaution.

Callers attempting to set up a Git directory may want to inform the user
about the reason for the failure. For that, expose the enum
discovery_result from within setup.c and into cache.h where
discover_git_directory() is defined.

I initially wanted to change the return type of discover_git_directory()
to be this enum, but several callers rely upon the "zero means success".
The two problems with this are:

1. The zero value of the enum is actually GIT_DIR_NONE, so nonpositive
   results are errors.

2. There are multiple successful states, so some positive results are
   successful.

Instead of updating all callers immediately, add a new method,
discover_git_directory_reason(), and convert discover_git_directory() to
be a thin shim on top of it.

Because there are extra checks that discover_git_directory_reason() does
after setup_git_directory_gently_1(), there are other modes that can be
returned for failure states. Add these modes to the enum, but be sure to
explicitly add them as BUG() states in the switch of
setup_git_directory_gently().

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
When FSMonitor was upstreamed, the 'core.useBuiltinFSMonitor' config was
deprecated and replaced with an overload of the 'core.fsmonitor' config
(i.e., if a boolean value was specified in 'core.fsmonitor', it is treated
the way 'core.useBuiltinFSMonitor' originally was). Because 'scalar
register' actively sets that config, use it to upgrade the deprecated config
setting.

Co-authored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
Run the comprehensive Scalar Functional Tests as part of CI and PR
builds.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When running 'scalar reconfigure -a', such as at install time, Scalar
has warning messages about the repository missing (or not containing a
.git directory). Failures can also happen while trying to modify the
repository-local config for that repository.

These warnings may seem confusing to users who don't understand what
they mean or how to stop them.

Add a warning that instructs the user how to remove the warning in
future installations.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
This allows fixing settings after a Scalar upgrade, or after botching
the enlistments configuration.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…s remove buggy repos

When running 'scalar reconfigure -a', such as at install time, Scalar
has warning messages about the repository missing (or not containing a
.git directory). Failures can also happen while trying to modify the
repository-local config for that repository.

These warnings may seem confusing to users who don't understand what
they mean or how to stop them.

Add a warning that instructs the user how to remove the warning in
future installations.
…-and-fix-built-in-fsmonitor

Fix the built-in FSMonitor, and run Scalar's Functional Tests as part of the automated builds
This is random stuff that probably all got upstream in the meantime.
@dscho
Copy link
Member Author

dscho commented Oct 4, 2022

  • eb1d78a is needed because 7b5c93c inadvertently converted the $(SCALAR_OBJECTS) part of the scalar$X Makefile rule to scalar.o instead of $(SCALAR_OBJS).

This wasn't unintentional, it was done because it seemed more consistent with other, similar targets (e.g. git-imap-send$X, git-http-fetch$X, git-http-push$X, etc.) at the time. If more objects were ever added to "Scalar", my intention was to switch to using $(SCALAR_OBJS) as you did. So, I think your solution is correct, but I'd fold it into 4237f66 (scalar: implement a minimal JSON parser) instead of creating a standalone commit.

Whoops. @vdye my apologies, I had totally missed this PR comment :-(

I've force-pushed an update. Range-diff:

  • 1: 29ab4c8 < -: ------------ scalar: make the build rule more generic

  • 2: 8acbe14 ! 1: 8a07593 scalar: implement a minimal JSON parser

    @@ Makefile: GIT_OBJS += git.o
      SCALAR_OBJS += scalar.o
      .PHONY: scalar-objs
      scalar-objs: $(SCALAR_OBJS)
    +@@ Makefile: $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS
    + 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
    + 		$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
    + 
    +-scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
    ++scalar$X: $(SCALAR_OBJS) GIT-LDFLAGS $(GITLIBS)
    + 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
    + 		$(filter %.o,$^) $(LIBS)
    + 
     
      ## contrib/buildsystems/CMakeLists.txt ##
     @@ contrib/buildsystems/CMakeLists.txt: target_link_libraries(git-sh-i18n--envsubst common-main)
  • 3: d5fa170 = 2: 2a31739 scalar clone: support GVFS-enabled remote repositories

  • 4: d017b2f = 3: 43da238 test-gvfs-protocol: also serve smart protocol

  • 5: e9cbf38 = 4: 986e70a gvfs-helper: add the endpoint command

  • 6: 9453c09 = 5: 392ec51 dir_inside_of(): handle directory separators correctly

  • 7: 85cae32 = 6: 13601c0 scalar: disable authentication in unattended mode

  • 8: 302a995 = 7: 3d24fa0 scalar: do initialize gvfs.sharedCache

  • 9: 87a4b4b = 8: dd32726 scalar diagnose: include shared cache info

  • 10: e9ca6b1 = 9: e8e1ccd scalar: only try GVFS protocol on https:// URLs

  • 11: 8006952 = 10: 34c7005 scalar: verify that we can use a GVFS-enabled repository

  • 12: 13d0e01 = 11: 8b6c934 scalar: add the cache-server command

  • 13: 653faab = 12: 35399e2 scalar: add a test toggle to skip accessing the vsts/info endpoint

  • 14: e76ce89 = 13: 3c9f070 scalar: adjust documentation to the microsoft/git fork

  • 15: eb54b76 = 14: 7dd5eee scalar: enable untracked cache unconditionally

  • 16: d515de9 = 15: d2ecb32 scalar: parse clone --no-fetch-commits-and-trees for backwards compatibility

  • 17: a42e0c6 = 16: 2f982c5 scalar diagnose: accommodate Scalar's Functional Tests

  • 18: c606410 = 17: cd6bb91 ci: run Scalar's Functional Tests

  • 19: 9780116 = 18: ad8b522 scalar: upgrade to newest FSMonitor config setting

  • 20: c73543c = 19: 417393e setup: add discover_git_directory_reason()

  • 21: 175a0de = 20: 288400b scalar reconfigure: help users remove buggy repos

@dscho
Copy link
Member Author

dscho commented Oct 4, 2022

I pushed a v2.38.0.vfs.0.0 tag that we can consider for the vfs-2.38.0 branch and the pre-release. It includes the rebase of #536, so please take a look at the diff.

Whoa, I had also missed this... @derrickstolee sorry!

After rebasing tentative/vfs-2.38.0, I now also cherry-picked the --no-src changes and force-pushed an updated tag. Here is the build-git-installers run.

@dscho dscho merged commit ffd33cf into microsoft:vfs-2.38.0 Oct 5, 2022
@dscho dscho deleted the tentative/vfs-2.38.0 branch October 5, 2022 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.