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.44.0 #630

Merged
merged 197 commits into from
Feb 28, 2024
Merged

Rebase to v2.44.0 #630

merged 197 commits into from
Feb 28, 2024

Conversation

vdye
Copy link
Collaborator

@vdye vdye commented Feb 27, 2024

Rebase of vfs-2.43.0 onto the latest Git for Windows release (v2.44.0.windows.1). Other than some minor conflicts & header changes, I only had to make one real change (adding a permissions: block to the release creation step of build-git-installers.yml, since GITHUB_TOKEN is now read-only by default).

Successful release build: link

Range diff vs. vfs-2.43.0
  1:  a974b140e7e =   1:  08acea8cbf7 reset --stdin: trim carriage return from the paths
  2:  ad8d0b9e683 !   2:  a75168a73b0 gvfs: start by adding the -gvfs suffix to the version
    @@ GIT-VERSION-GEN
      #!/bin/sh
      
      GVF=GIT-VERSION-FILE
    --DEF_VER=v2.43.0
    -+DEF_VER=v2.43.0.vfs.0.0
    +-DEF_VER=v2.44.0
    ++DEF_VER=v2.44.0.vfs.0.0
      
      LF='
      '
  3:  fca083a25fd !   3:  1db481ce86b gvfs: ensure that the version is based on a GVFS tag
    @@ GIT-VERSION-GEN
     @@ GIT-VERSION-GEN: if test -f version
      then
      	VN=$(cat version) || VN="$DEF_VER"
    - elif test -d ${GIT_DIR:-.git} -o -f .git &&
    + elif { test -d "${GIT_DIR:-.git}" || test -f .git; } &&
     -	VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) &&
     +	VN=$(git describe --match "v[0-9]*vfs*" HEAD 2>/dev/null) &&
      	case "$VN" in
  4:  d78de08d4bd =   4:  7cc11e5cd32 gvfs: add a GVFS-specific header file
  5:  3556ea040b1 =   5:  656515f4136 gvfs: add the core.gvfs config setting
  6:  ccf7f70ff59 =   6:  2ad35f3e596 gvfs: add the feature to skip writing the index' SHA-1
  7:  1aa12488ce1 =   7:  69804bb0632 gvfs: add the feature that blobs may be missing
  8:  e44e823fa28 =   8:  08e1394797f gvfs: prevent files to be deleted outside the sparse checkout
  9:  f4de9c9245d =   9:  8f948063f65 gvfs: optionally skip reachability checks/upload pack during fetch
 10:  4728ebcc650 =  10:  425f60c8ed4 gvfs: ensure all filters and EOL conversions are blocked
 11:  9c2a07a19a3 =  11:  180933810bd gvfs: allow "virtualizing" objects
 12:  22066333557 =  12:  6829117a64e Hydrate missing loose objects in check_and_freshen()
 13:  b7c8f6e7c07 =  13:  41d24c3022a sha1_file: when writing objects, skip the read_object_hook
 14:  841fbcf104d =  14:  c10e77da347 gvfs: add global command pre and post hook procs
 15:  7d495f88c08 =  15:  5a78b0cdd62 t0400: verify that the hook is called correctly from a subdirectory
 16:  d589761797d =  16:  bcbcbb1c7e1 Pass PID of git process to hooks.
 17:  82294a93745 =  17:  2135705af70 pre-command: always respect core.hooksPath
 18:  e53d8d9f31b =  18:  8173d74ba67 sparse-checkout: update files with a modify/delete conflict
 19:  a3c5312fd64 =  19:  5cf57938570 sparse-checkout: avoid writing entries with the skip-worktree bit
 20:  31ec87619e6 =  20:  9fea45ae4fe Do not remove files outside the sparse-checkout
 21:  a147bf0918e !  21:  203814b133b send-pack: do not check for sha1 file when GVFS_MISSING_OK set
    @@ Commit message
     
      ## send-pack.c ##
     @@
    + #include "date.h"
      #include "gettext.h"
      #include "hex.h"
    - #include "refs.h"
     +#include "gvfs.h"
      #include "object-store-ll.h"
      #include "pkt-line.h"
 22:  a25fe519c1b =  22:  9f0e5f92d0d cache-tree: remove use of strbuf_addf in update_one
 23:  30a0f59f942 !  23:  d724e71925e gvfs: block unsupported commands when running in a GVFS repo
    @@ git.c: static struct cmd_struct commands[] = {
     -	{ "repack", cmd_repack, RUN_SETUP },
     +	{ "repack", cmd_repack, RUN_SETUP | BLOCK_ON_GVFS_REPO },
      	{ "replace", cmd_replace, RUN_SETUP },
    + 	{ "replay", cmd_replay, RUN_SETUP },
      	{ "rerere", cmd_rerere, RUN_SETUP },
    - 	{ "reset", cmd_reset, RUN_SETUP },
     @@ git.c: static struct cmd_struct commands[] = {
      	{ "stash", cmd_stash, RUN_SETUP | NEED_WORK_TREE },
      	{ "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
 24:  094e64e9393 =  24:  40bf6bdc2e6 worktree: allow in Scalar repositories
 25:  a7dea34e2eb =  25:  a202667840a gvfs: allow overriding core.gvfs
 26:  543775e1f08 =  26:  12b66632d06 BRANCHES.md: Add explanation of branches and using forks
 27:  ff2514c3baa =  27:  81dc570c885 Add virtual file system settings and hook proc
 28:  23e0749dd79 =  28:  8c1e2c850ef virtualfilesystem: don't run the virtual file system hook if the index has been redirected
 29:  4a58f5adfe9 =  29:  456cdb53e24 virtualfilesystem: check if directory is included
 30:  9fda9ad8172 =  30:  3e677ad52d6 backwards-compatibility: support the post-indexchanged hook
 31:  457e6a4df56 =  31:  9e268843229 gvfs: verify that the built-in FSMonitor is disabled
 32:  112fa44e526 =  32:  a3f9c230b39 status: add status serialization mechanism
 33:  e8e29af029b =  33:  afa8244ae37 Teach ahead-behind and serialized status to play nicely together
 34:  5779892550a =  34:  b9a54bf736e status: serialize to path
 35:  631b36502aa =  35:  9adbd522e38 status: reject deserialize in V2 and conflicts
 36:  69f28807dc0 =  36:  3f92ef4b1f5 serialize-status: serialize global and repo-local exclude file metadata
 37:  46da1e99df2 =  37:  3533ff3e2f2 status: deserialization wait
 38:  dc54eb4dfa6 =  38:  4f0dc9551f0 merge-recursive: avoid confusing logic in was_dirty()
 39:  8e008505bff =  39:  a6513c48f1a merge-recursive: add some defensive coding to was_dirty()
 40:  a31e2c58723 !  40:  62073556915 merge-recursive: teach was_dirty() about the virtualfilesystem
    @@ merge-recursive.c
      #include "merge-recursive.h"
     +#include "virtualfilesystem.h"
      
    - #include "advice.h"
      #include "alloc.h"
    + #include "cache-tree.h"
     @@ merge-recursive.c: static int was_dirty(struct merge_options *opt, const char *path)
      {
      	struct cache_entry *ce;
 41:  daa14a814c3 =  41:  f37bdd5aa94 status: deserialize with -uno does not print correct hint
 42:  a6bf6f10467 =  42:  25c3e0b4ecb fsmonitor: check CE_FSMONITOR_VALID in ce_uptodate
 43:  e8099de4c93 =  43:  d23c6d3d43a fsmonitor: add script for debugging and update script for tests
 44:  10bf9c11a5a =  44:  7788fa91d95 status: disable deserialize when verbose output requested.
 45:  c48f9a9265c =  45:  da3a0631d54 t7524: add test for verbose status deserialzation
 46:  ca53dad7a4d =  46:  bc53d5282db deserialize-status: silently fallback if we cannot read cache file
 47:  56c9f6e7457 =  47:  cbd50404fbe gvfs:trace2:data: add trace2 tracing around read_object_process
 48:  c400ad0a0f0 =  48:  e77727e7d72 gvfs:trace2:data: status deserialization information
 49:  2bd8a8b2a4f =  49:  69bc46aa01d gvfs:trace2:data: status serialization
 50:  5f31f1b1c4e =  50:  375bcec8825 gvfs:trace2:data: add vfs stats
 51:  2bd6834f19e =  51:  6c017b4a8c1 trace2: refactor setting process starting time
 52:  d51366d5ab7 =  52:  50541e7274d trace2:gvfs:experiment: clear_ce_flags_1
 53:  a1f300ea1de =  53:  e84e9bbf100 trace2:gvfs:experiment: report_tracking
 54:  33229f6bba7 =  54:  7d833880f8b trace2:gvfs:experiment: read_cache: annotate thread usage in read-cache
 55:  ed99b1b7943 =  55:  2e92c186789 trace2:gvfs:experiment: read-cache: time read/write of cache-tree extension
 56:  d68452cd696 =  56:  f9a546e1a88 trace2:gvfs:experiment: add region to apply_virtualfilesystem()
 57:  025fd6a8182 =  57:  8a09e08d230 trace2:gvfs:experiment: add region around unpack_trees()
 58:  a90ad70eeec =  58:  2424bb01579 trace2:gvfs:experiment: add region to cache_tree_fully_valid()
 59:  a7682145141 =  59:  dfa422ca12c trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() and report_tracking()
 60:  9f23c0fa6d8 =  60:  d9fbd93535d trace2:gvfs:experiment: increase default event depth for unpack-tree data
 61:  af18d6b0051 =  61:  ee1ef573aec trace2:gvfs:experiment: add data for check_updates() in unpack_trees()
 62:  c9403b87c58 =  62:  41c5b125445 Trace2:gvfs:experiment: capture more 'tracking' details
 63:  93ed390ecb5 =  63:  49870a50a05 credential: set trace2_child_class for credential manager children
 64:  f9ff1804283 =  64:  f6fca70aa52 sub-process: do not borrow cmd pointer from caller
 65:  2224c09d1ff =  65:  327886ffef1 sub-process: add subprocess_start_argv()
 66:  b6216597571 =  66:  154bddbd1d1 sha1-file: add function to update existing loose object cache
 67:  c9a3d2862ca =  67:  99bb46ecc11 packfile: add install_packed_git_and_mru()
 68:  4fb7e705915 =  68:  1095cd42be6 index-pack: avoid immediate object fetch while parsing packfile
 69:  ac8e9f9b20d !  69:  5c54630ff0c gvfs-helper: create tool to fetch objects using the GVFS Protocol
    @@ Makefile: scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
     
      ## config.c ##
     @@
    - #include "worktree.h"
    + #include "wildmatch.h"
      #include "ws.h"
      #include "write-or-die.h"
     +#include "transport.h"
    @@ gvfs-helper.c (new)
     +#include "tempfile.h"
     +#include "oidset.h"
     +#include "dir.h"
    ++#include "url.h"
     +#include "abspath.h"
     +#include "progress.h"
     +#include "trace2.h"
 70:  0d67b3b5ab5 =  70:  f3dc228a1d9 sha1-file: create shared-cache directory if it doesn't exist
 71:  412fe9cd273 =  71:  73a6cc3f419 gvfs-helper: better handling of network errors
 72:  4512d14cbc3 =  72:  ca24fc3908d gvfs-helper-client: properly update loose cache with fetched OID
 73:  2f700e605c1 =  73:  0f79deb5c9a gvfs-helper: V2 robust retry and throttling
 74:  a6e9d9e86c0 =  74:  a5e5deec5e7 gvfs-helper: expose gvfs/objects GET and POST semantics
 75:  5d60e526f60 =  75:  08fc2eea45d gvfs-helper: dramatically reduce progress noise
 76:  49dce2c3743 =  76:  c503dd52086 gvfs-helper-client.h: define struct object_id
 77:  4a8e7400b5a =  77:  531ffc5d4bf gvfs-helper: handle pack-file after single POST request
 78:  a037644be53 =  78:  ca192b7e289 test-gvfs-prococol, t5799: tests for gvfs-helper
 79:  cb005dba97f =  79:  1f348460f67 gvfs-helper: move result-list construction into install functions
 80:  34c9ff09150 =  80:  1528d924d0f t5799: add support for POST to return either a loose object or packfile
 81:  b83f2f26dca =  81:  03298f94d16 t5799: cleanup wc-l and grep-c lines
 82:  a2ffa643a85 =  82:  08188f98a33 gvfs-helper: verify loose objects after write
 83:  9e324387f37 =  83:  6a55d771b0d t7599: create corrupt blob test
 84:  69a82cee38f =  84:  05c4105e4b2 gvfs-helper: add prefetch support
 85:  303a0088c10 =  85:  328ac49d29b gvfs-helper: add prefetch .keep file for last packfile
 86:  8168ff201bd =  86:  3bd3ff1ce42 gvfs-helper: do one read in my_copy_fd_len_tail()
 87:  c03629fd310 =  87:  85b6d4409ab gvfs-helper: move content-type warning for prefetch packs
 88:  1538ce2707c =  88:  f71d33481b5 fetch: use gvfs-helper prefetch under config
 89:  ccb306f6880 =  89:  f7524212420 gvfs-helper: better support for concurrent packfile fetches
 90:  a2156c964e7 =  90:  0f68cb63e8b remote-curl: do not call fetch-pack when using gvfs-helper
 91:  dfb5b012b06 !  91:  d356ff2db87 fetch: reprepare packs before checking connectivity
    @@ Commit message
         Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
     
      ## builtin/fetch.c ##
    +@@
    + #include "transport.h"
    + #include "gvfs.h"
    + #include "gvfs-helper-client.h"
    ++#include "packfile.h"
    + #include "run-command.h"
    + #include "parse-options.h"
    + #include "sigchain.h"
     @@ builtin/fetch.c: static int store_updated_refs(struct display_state *display_state,
      
      		opt.exclude_hidden_refs_section = "fetch";
 92:  b4526b7a149 =  92:  0dac5bba024 gvfs-helper: retry when creating temp files
 93:  91cdad9e947 =  93:  21294264fc2 sparse: avoid warnings about known cURL issues in gvfs-helper.c
 94:  ff3e440fb09 =  94:  14738b60f81 gvfs-helper: add --max-retries to prefetch verb
 95:  99bd372a63f =  95:  1865729d47e t5799: add tests to detect corrupt pack/idx files in prefetch
 96:  a1076987d14 =  96:  4243dfc84e8 gvfs-helper: ignore .idx files in prefetch multi-part responses
 97:  3347e588dad =  97:  ac616872e02 maintenance: care about gvfs.sharedCache config
 98:  a6b2e7ddf5e =  98:  76cd2f05c35 unpack-trees:virtualfilesystem: Improve efficiency of clear_ce_flags
 99:  29ffc42a452 =  99:  d3cc9520d78 homebrew: add GitHub workflow to release Cask
100:  fa5fa71f744 = 100:  baa69bfac7b Adding winget workflows
101:  f627d1cc9b9 = 101:  144571175cc Disable the `monitor-components` workflow in msft-git
102:  e4fb0a66b22 = 102:  0c9f22e9b9e .github: enable windows builds on microsoft fork
103:  2dc2755ab23 = 103:  5a3a699e883 release: create initial Windows installer build workflow
104:  c68b447119a = 104:  a751ad03a07 help: special-case HOST_CPU `universal`
105:  dbbb38b4fe9 = 105:  55fe1c43843 release: add Mac OSX installer build
106:  7fa18cd96c2 = 106:  1015e36c8dd release: build unsigned Ubuntu .deb package
107:  9fa8d8e1787 = 107:  5c21313642b release: add signing step for .deb package
113:  a12eb00ec0c = 108:  6ceeebe94d4 update-microsoft-git: create barebones builtin
115:  476e9687262 = 109:  9fa2c36a632 update-microsoft-git: Windows implementation
119:  56ca1c28af5 = 110:  eeb8fb8e432 update-microsoft-git: use brew on macOS
121:  c81223680b7 = 111:  6f05ba947cd .github: update ISSUE_TEMPLATE.md for microsoft/git
122:  f3f3e30981c ! 112:  c7a83319cc8 .github: update PULL_REQUEST_TEMPLATE.md
    @@ .github/PULL_REQUEST_TEMPLATE.md
     -Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
     -to conveniently send your Pull Requests commits to our mailing list.
     -
    +-For a single-commit pull request, please *leave the pull request description
    +-empty*: your commit message itself should describe your changes.
    +-
     -Please read the "guidelines for contributing" linked above!
     +This fork contains changes specific to monorepo scenarios. If you are an
     +external contributor, then please detail your reason for submitting to
124:  8ee8ea0f362 ! 113:  61747ce6689 Adjust README.md for microsoft/git
    @@ README.md
     -string translations (localization l10) should see [po/README.md][]
     -(a `po` file is a Portable Object file that holds the translations).
     -
    --To subscribe to the list, send an email with just "subscribe git" in
    --the body to majordomo@vger.kernel.org (not the Git list). The mailing
    +-To subscribe to the list, send an email to <git+subscribe@vger.kernel.org>
    +-(see https://subspace.kernel.org/subscribing.html for details). The mailing
     -list archives are available at <https://lore.kernel.org/git/>,
    --<http://marc.info/?l=git> and other archival sites.
    +-<https://marc.info/?l=git> and other archival sites.
     -The core git mailing list is plain text (no HTML!).
     -
     -Issues which are security relevant should be disclosed privately to
117:  38fb62411d6 = 114:  68954302010 git_config_set_multivar_in_file_gently(): add a lock timeout
118:  200a0e0f9c4 = 115:  955384e917a scalar: set the config write-lock timeout to 150ms
120:  ed3b89a39b2 = 116:  50b32c9ad23 scalar: add docs from microsoft/scalar
123:  fd18ac997e2 = 117:  93ca0480da4 scalar (Windows): use forward slashes as directory separators
125:  037027e03bc = 118:  ddd637c8966 scalar: add retry logic to run_git()
126:  392824f0e86 = 119:  99041725874 scalar: support the `config` command for backwards compatibility
127:  aa6747a780c = 120:  453d4ebbdc4 scalar: implement a minimal JSON parser
128:  7d6c79df512 = 121:  a56de780d13 scalar clone: support GVFS-enabled remote repositories
129:  836ea6779e8 = 122:  9cc3bf9bf9b test-gvfs-protocol: also serve smart protocol
130:  7ab1b72dc1a = 123:  107a31f508d gvfs-helper: add the `endpoint` command
131:  2355926e788 = 124:  8708a4b499f dir_inside_of(): handle directory separators correctly
132:  8724aa9597a = 125:  bc239e7ba52 scalar: disable authentication in unattended mode
133:  501d792a7a9 = 126:  20105daaeaf scalar: do initialize `gvfs.sharedCache`
134:  f70311e5acd = 127:  6ec6b87837d scalar diagnose: include shared cache info
135:  4e919839921 = 128:  80f9ccf677d scalar: only try GVFS protocol on https:// URLs
136:  68220bc892e = 129:  894fd6f9c77 scalar: verify that we can use a GVFS-enabled repository
137:  aec7f5e8918 = 130:  de5319c6ac5 scalar: add the `cache-server` command
138:  e7f533d819c = 131:  7aaefa97134 scalar: add a test toggle to skip accessing the vsts/info endpoint
139:  4f9b0606d7c = 132:  2e09e47efff scalar: adjust documentation to the microsoft/git fork
140:  fd68d278238 = 133:  728bf67b847 scalar: enable untracked cache unconditionally
141:  ab3184f0f78 = 134:  7386dd1587f scalar: parse `clone --no-fetch-commits-and-trees` for backwards compatibility
142:  1339fd6ffea = 135:  03accb7e741 scalar diagnose: accommodate Scalar's Functional Tests
143:  ee54857b00b = 136:  e960ac079a6 ci: run Scalar's Functional Tests
144:  34c210a3de9 = 137:  99b9b65ebbd scalar: upgrade to newest FSMonitor config setting
145:  92c86aa4e85 = 138:  f80613fbc44 abspath: make strip_last_path_component() global
146:  8cc95bc32ab = 139:  e0cbc012f8a scalar: .scalarCache should live above enlistment
147:  146c8517d8b = 140:  ab0c7dea38c add/rm: allow adding sparse entries when virtual
148:  c147171eb90 = 141:  8577cb1b820 sparse-checkout: add config to disable deleting dirs
149:  4832a77af7e = 142:  ee5b0c3fa97 diff: ignore sparse paths in diffstat
150:  7d11cafd7a6 = 143:  e4ec64e03a4 repo-settings: enable sparse index by default
151:  7ee263f7b7f = 144:  12f176c914b diff(sparse-index): verify with partially-sparse
152:  b5689de6b44 = 145:  914a9938708 stash: expand testing for `git stash -u`
153:  b2b0d532322 = 146:  5f9ba58b8fa sequencer: avoid progress when stderr is redirected
154:  9229e503b62 = 147:  ffd7346ab3d sparse: add vfs-specific precautions
155:  c9ceb957862 = 148:  a74960ee1cd reset: fix mixed reset when using virtual filesystem
108:  7563d72a389 ! 149:  3d959687d87 release: create draft GitHub release with packages & installers
    @@ .github/workflows/build-git-installers.yml: jobs:
     +
     +  create-github-release:
     +    runs-on: ubuntu-latest
    -+    needs: [validate-installers]
    ++    permissions:
    ++      contents: write
    ++    needs:
    ++      - create-linux-artifacts
    ++      - create-macos-artifacts
    ++      - windows_artifacts
     +    if: |
     +      success() ||
     +        (needs.create-linux-artifacts.result == 'skipped' &&
109:  6872758f115 ! 150:  7acf5f5c5a4 build-git-installers: publish gpg public key
    @@ Commit message
     
      ## .github/workflows/build-git-installers.yml ##
     @@ .github/workflows/build-git-installers.yml: jobs:
    -   create-github-release:
    -     runs-on: ubuntu-latest
    -     needs: [validate-installers]
    +       - create-linux-artifacts
    +       - create-macos-artifacts
    +       - windows_artifacts
     +    env:
     +      AZURE_VAULT: ${{ secrets.AZURE_VAULT }}
     +      GPG_PUBLIC_KEY_SECRET_NAME: ${{ secrets.GPG_PUBLIC_KEY_SECRET_NAME }}
110:  d6e810c6458 = 151:  6cd4ad42f68 release: continue pestering until user upgrades
111:  7046a8e8d8a = 152:  0035b9fb363 Makefile: allow specifying GIT_BUILT_FROM_COMMIT
112:  aff19d56907 = 153:  7db2e99a330 dist: archive HEAD instead of HEAD^{tree}
114:  03c9452401a = 154:  9e989ee6c05 release: include GIT_BUILT_FROM_COMMIT in MacOS build
116:  ab2a0e540c3 ! 155:  23dd028c961 release: add installer validation
    @@ .github/workflows/build-git-installers.yml: jobs:
     +
        create-github-release:
          runs-on: ubuntu-latest
    -     needs: [validate-installers]
    +     permissions:
    +       contents: write
    +-    needs:
    +-      - create-linux-artifacts
    +-      - create-macos-artifacts
    +-      - windows_artifacts
    ++    needs: [validate-installers]
    +     env:
    +       AZURE_VAULT: ${{ secrets.AZURE_VAULT }}
    +       GPG_PUBLIC_KEY_SECRET_NAME: ${{ secrets.GPG_PUBLIC_KEY_SECRET_NAME }}
156:  2a05783877b = 156:  c8fe603ba93 credential: add new interactive config option
157:  0ae4ac7f664 = 157:  a7642ea8ed8 maintenance: add custom config to background jobs
158:  8336d804668 = 158:  f1896c9f5e0 scalar: configure maintenance during 'reconfigure'
159:  5cadc4cf231 = 159:  3fba5cb5498 t5300: confirm failure of git index-pack when non-idx suffix requested
160:  ae6e1c9f61c = 160:  ea013edf31e index-pack: disable rev-index if index file has non .idx suffix
161:  b216189f8ea = 161:  57a95987e1f sparse-index.c: fix use of index hashes in expand_index
162:  18c885da65e = 162:  187c9b08573 t1092: add test for untracked files and directories
163:  722968053f0 <   -:  ----------- trace2: redact passwords from https:// URLs by default
164:  e8eec34e7f8 <   -:  ----------- t0211: test URL redacting in PERF format
165:  ff13c046860 <   -:  ----------- trace2: fix signature of trace2_def_param() macro
166:  8548168d1da <   -:  ----------- t0212: test URL redacting in EVENT format
167:  52c75ccf0f3 <   -:  ----------- t0210,t0211: unset SANITIZE_LEAK

Kevin Willford and others added 30 commits February 26, 2024 14:22
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>

gvfs: refactor loading the core.gvfs config value

This code change makes sure that the config value for core_gvfs
is always loaded before checking it.

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>

Update for 2023-02-27: This feature was upstreamed as the index.skipHash
config option. This resulted in some changes to the struct and some of
the setup code. In particular, the config reading was moved to
prepare_repo_settings(), so the core.gvfs bit check was moved there,
too.

Signed-off-by: Derrick Stolee <derrickstolee@github.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>
While performing a fetch with a virtual file system we know that there
will be missing objects and we don't want to download them just because
of the reachability of the commits.  We also don't want to download a
pack file with commits, trees, and blobs since these will be downloaded
on demand.

This flag will skip the first connectivity check and by returning zero
will skip the upload pack. It will also skip the second connectivity
check but continue to update the branches to the latest commit ids.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Ensure all filters and EOL conversions are blocked when running under
GVFS so that our projected file sizes will match the actual file size
when it is hydrated on the local machine.

Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
The idea is to allow blob objects to be missing from the local repository,
and to load them lazily on demand.

After discussing this idea on the mailing list, we will rename the feature
to "lazy clone" and work more on this.

Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
Hydrate missing loose objects in check_and_freshen() when running
virtualized. Add test cases to verify read-object hook works when
running virtualized.

This hook is called in check_and_freshen() rather than
check_and_freshen_local() to make the hook work also with alternates.

Helped-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
If we are going to write an object there is no use in calling
the read object hook to get an object from a potentially remote
source.  We would rather just write out the object and avoid the
potential round trip for an object that doesn't exist.

This change adds a flag to the check_and_freshen() and
freshen_loose_object() functions' signatures so that the hook
is bypassed when the functions are called before writing loose
objects. The check for a local object is still performed so we
don't overwrite something that has already been written to one
of the objects directories.

Based on a patch by Kevin Willford.

Signed-off-by: Johannes Schindelin <johasc@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>
Suggested by Ben Peart.

Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
Signed-off-by: Alejandro Pauly <alpauly@microsoft.com>
We need to respect that config setting even if we already know that we
have a repository, but have not yet read the config.

The regression test was written by Alejandro Pauly.

2021-10-30: Recent movement of find_hook() into hook.c required moving this
change from run-command.c.

Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
When using the sparse-checkout feature, the file might not be on disk
because the skip-worktree bit is on.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
When using the sparse-checkout feature git should not write to the working
directory for files with the skip-worktree bit on.  With the skip-worktree
bit on the file may or may not be in the working directory and if it is
not we don't want or need to create it by calling checkout_entry.

There are two callers of checkout_target.  Both of which check that the
file does not exist before calling checkout_target.  load_current which
make a call to lstat right before calling checkout_target and
check_preimage which will only run checkout_taret it stat_ret is less than
zero.  It sets stat_ret to zero and only if !stat->cached will it lstat
the file and set stat_ret to something other than zero.

This patch checks if skip-worktree bit is on in checkout_target and just
returns so that the entry doesn't not end up in the working directory.
This is so that apply will not create a file in the working directory,
then update the index but not keep the working directory up to date with
the changes that happened in the index.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
String formatting can be a performance issue when there are
hundreds of thousands of trees.

Change to stop using the strbuf_addf and just add the strings
or characters individually.

There are a limited number of modes so added a switch for the
known ones and a default case if something comes through that
are not a known one for git.

In one scenario regarding a huge worktree, this reduces the
time required for a `git checkout <branch>` from 44 seconds
to 38 seconds, i.e. it is a non-negligible performance
improvement.

Signed-off-by: Kevin Willford <kewillf@microsoft.com>
The following commands and options are not currently supported when working
in a GVFS repo.  Add code to detect and block these commands from executing.

1) fsck
2) gc
4) prune
5) repack
6) submodule
8) update-index --split-index
9) update-index --index-version (other than 4)
10) update-index --[no-]skip-worktree
11) worktree

Signed-off-by: Ben Peart <benpeart@microsoft.com>
The 'git worktree' command was marked as BLOCK_ON_GVFS_REPO because it
does not interact well with the virtual filesystem of VFS for Git. When
a Scalar clone uses the GVFS protocol, it enables the
GVFS_BLOCK_COMMANDS flag, since commands like 'git gc' do not work well
with the GVFS protocol.

However, 'git worktree' works just fine with the GVFS protocol since it
isn't doing anything special. It copies the sparse-checkout from the
current worktree, so it does not have performance issues.

This is a highly requested option.

The solution is to stop using the BLOCK_ON_GVFS_REPO option and instead
add a special-case check in cmd_worktree() specifically for a particular
bit of the 'core_gvfs' global variable (loaded by very early config
reading) that corresponds to the virtual filesystem. The bit that most
closely resembled this behavior was non-obviously named, but does
provide a signal that we are in a Scalar clone and not a VFS for Git
clone. The error message is copied from git.c, so it will have the same
output as before if a user runs this in a VFS for Git clone.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
We found a user who had set "core.gvfs = false" in their global
config. This should not have been necessary, but it also should not
have caused a problem. However, it did.

The reason is that gvfs_load_config_value() is called from config.c
when reading config key/value pairs from all the config files. The
local config should override the global config, and this is done by
config.c reading the global config first then reading the local
config. However, our logic only allowed writing the core_gvfs
variable once.

Put the guards against multiple assignments of core_gvfs into
gvfs_config_is_set() instead, because that will fix the problem
_and_ keep multiple calls to gvfs_config_is_set() from slowing down.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
On index load, clear/set the skip worktree bits based on the virtual
file system data. Use virtual file system data to update skip-worktree
bit in unpack-trees. Use virtual file system data to exclude files and
folders not explicitly requested.

Update 2022-04-05: disable the "present-despite-SKIP_WORKTREE" file removal
behavior when 'core.virtualfilesystem' is enabled.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
…x has been redirected

Fixes git#13

Some git commands spawn helpers and redirect the index to a different
location.  These include "difftool -d" and the sequencer
(i.e. `git rebase -i`, `git cherry-pick` and `git revert`) and others.
In those instances we don't want to update their temporary index with
our virtualization data.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
Add check to see if a directory is included in the virtualfilesystem
before checking the directory hashmap.  This allows a directory entry
like foo/ to find all untracked files in subdirectories.
When our patches to support that hook were upstreamed, the hook's name
was eliciting some reviewer suggestions, and it was renamed to
`post-index-change`. These patches (with the new name) made it into
v2.22.0.

However, VFSforGit users may very well have checkouts with that hook
installed under the original name.

To support this, let's just introduce a hack where we look a bit more
closely when we just failed to find the `post-index-change` hook, and
allow any `post-indexchanged` hook to run instead (if it exists).
vdye and others added 16 commits February 26, 2024 16:53
Implement workflow to create GitHub release with attached `git` installers
Add basic installer validation to release pipeline for Windows, macOS, and
Linux (Debian package only). Validation runs the installers/any necessary
setup and checks that the installed version matches the expected version.
Fixes for MacOS release build & build options
This adds a new builtin, `git update-microsoft-git`, that executes the platform-specific upgrade steps to get the latest version of `microsoft-git`.

On Windows, this means running `git update-git-for-windows` which was updated to use the `microsoft/git` releases page, when appropriate. See git#321 for details.

On macOS, this means running a sequence of `brew` commands. These are adapted from the `UpgradeVerb` in `microsoft/scalar`, with an important simplification: we don't need to differentiate between the `scalar` and `scalar-azrepos` cask.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
…-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.
When scripts or background maintenance wish to perform HTTP(S) requests,
there is a risk that our stored credentials might be invalid. At the
moment, this causes the credential helper to ping the user and block the
process. Even if the credential helper does not ping the user, Git falls
back to the 'askpass' method, which includes a direct ping to the user
via the terminal.

Even setting the 'core.askPass' config as something like 'echo' will
causes Git to fallback to a terminal prompt. It uses
git_terminal_prompt(), which finds the terminal from the environment and
ignores whether stdin has been redirected. This can also block the
process awaiting input.

Create a new config option to prevent user interaction, favoring a
failure to a blocked process.

The chosen name, 'credential.interactive', is taken from the config
option used by Git Credential Manager to already avoid user
interactivity, so there is already one credential helper that integrates
with this option. However, older versions of Git Credential Manager also
accepted other string values, including 'auto', 'never', and 'always'.
The modern use is to use a boolean value, but we should still be
careful that some users could have these non-booleans. Further, we
should respect 'never' the same as 'false'. This is respected by the
implementation and test, but not mentioned in the documentation.

The implementation for the Git interactions takes place within
credential_getpass(). The method prototype is modified to return an
'int' instead of 'void'. This allows us to detect that no attempt was
made to fill the given credential, changing the single caller slightly.

Also, a new trace2 region is added around the interactive portion of the
credential request. This provides a way to measure the amount of time
spent in that region for commands that _are_ interactive. It also makes
a conventient way to test that the config option works with
'test_region'.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Add test case to demonstrate that `git index-pack -o <idx-path> pack-path`
fails if <idx-path> does not end in ".idx" when `--rev-index` is
enabled.

In e37d0b8 (builtin/index-pack.c: write reverse indexes, 2021-01-25)
we learned to create `.rev` reverse indexes in addition to `.idx` index
files.  The `.rev` file pathname is constructed by replacing the suffix
on the `.idx` file.  The code assumes a hard-coded "idx" suffix.

In a8dd7e0 (config: enable `pack.writeReverseIndex` by default, 2023-04-12)
reverse indexes were enabled by default.

If the `-o <idx-path>` argument is used, the index file may have a
different suffix.  This causes an error when it tries to create the
reverse index pathname.

The test here demonstrates the failure.  (The test forces `--rev-index`
to avoid interaction with `GIT_TEST_NO_WRITE_REV_INDEX` during CI runs.)

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
At the moment, some background jobs are getting blocked on credentials
during the 'prefetch' task. This leads to other tasks, such as
incremental repacks, getting blocked. Further, if a user manages to fix
their credentials, then they still need to cancel the background process
before their background maintenance can continue working.

Update the background schedules for our four scheduler integrations to
include these config options via '-c' options:

 * 'credential.interactive=false' will stop Git and some credential
   helpers from prompting in the UI (assuming the '-c' parameters are
   carried through and respected by GCM).

 * 'core.askPass=true' will replace the text fallback for a username
   and password into the 'true' command, which will return a success in
   its exit code, but Git will treat the empty string returned as an
   invalid password and move on.

We can do some testing that the credentials are passed, at least in the
systemd case due to writing the service files.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
In ac8acb4 (sparse-index: complete partial expansion, 2022-05-23),
'expand_index()' was updated to expand the index to a given pathspec.
However, the 'path_matches_pattern_list()' method used to facilitate this
has the side effect of initializing or updating the index hash variables
('name_hash', 'dir_hash', and 'name_hash_initialized'). This operation is
performed on 'istate', though, not 'full'; as a result, the initialized
hashes are later overwritten when copied from 'full'. To ensure the correct
hashes are in 'istate' after the index expansion, change the arg used in
'path_matches_pattern_list()' from 'istate' to 'full'.

Note that this does not fully solve the problem. If 'istate' does not have
an initialized 'name_hash' when its contents are copied to 'full',
initialized hashes will be copied back into 'istate' but
'name_hash_initialized' will be 0. Therefore, we also need to copy
'full->name_hash_initialized' back to 'istate' after the index expansion is
complete.

Signed-off-by: Victoria Dye <vdye@github.com>
Teach index-pack to silently omit the reverse index if the
index file does not have the standard ".idx" suffix.

In e37d0b8 (builtin/index-pack.c: write reverse indexes, 2021-01-25)
we learned to create `.rev` reverse indexes in addition to `.idx` index
files.  The `.rev` file pathname is constructed by replacing the suffix
on the `.idx` file.  The code assumes a hard-coded "idx" suffix.

In a8dd7e0 (config: enable `pack.writeReverseIndex` by default, 2023-04-12)
reverse indexes were enabled by default.

If the `-o <idx-path>` argument is used, the index file may have a
different suffix.  This causes an error when it tries to create the
reverse index pathname.

Since we do not know why the user requested a non-standard suffix for
the index, we cannot guess what the proper corresponding suffix should
be for the reverse index.  So we disable it.

The t5300 test has been updated to verify that we no longer error
out and that the .rev file is not created.

TODO We could warn the user that we skipped it (perhaps only if they
TODO explicitly requested `--rev-index` on the command line).
TODO
TODO Ideally, we should add an `--rev-index-path=<path>` argument
TODO or change `--rev-index` to take a pathname.
TODO
TODO I'll leave these questions for a future series.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
The 'scalar reconfigure' command is intended to update registered repos
with the latest settings available. However, up to now we were not
reregistering the repos with background maintenance.

In particular, this meant that the background maintenance schedule would
not be updated if there are improvements between versions.

Be sure to register repos for maintenance during the reconfigure step.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Add a test verifying that sparse-checkout (with and without sparse index
enabled) treat untracked files & directories correctly when changing sparse
patterns. Specifically, it ensures that 'git sparse-checkout set'

* deletes empty directories outside the sparse cone
* does _not_ delete untracked files outside the sparse cone

Signed-off-by: Victoria Dye <vdye@github.com>
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
@jeffhostetler
Copy link
Collaborator

Looks fairly straight forward. Thanks!

@vdye vdye merged commit 25699f0 into microsoft:vfs-2.44.0 Feb 28, 2024
97 checks passed
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.

None yet