Skip to content

[vcpkg_from_git] Add --skip-repo to git lfs install#51092

Merged
BillyONeal merged 2 commits intomicrosoft:masterfrom
helmesjo:git-lfs-skip-repo
Apr 15, 2026
Merged

[vcpkg_from_git] Add --skip-repo to git lfs install#51092
BillyONeal merged 2 commits intomicrosoft:masterfrom
helmesjo:git-lfs-skip-repo

Conversation

@helmesjo
Copy link
Copy Markdown
Contributor

@helmesjo helmesjo commented Apr 10, 2026

git lfs install --local --force was installing hooks (that are AFAICT unnecessary for a headless build fetch, nothing is ever pushed) into the temp clone. This in turn fails when core.hooksPath points to an existing dir/symlink. In particular, having git lfs install touch user configurations can be considered quite intrusive.

Specifically, from the docs:

Perform the following actions to ensure that Git LFS is setup properly:

* Set up the clean and smudge filters under the name "lfs" in the global
Git config.
* Install a pre-push hook to run git-lfs-pre-push(1) for the current
repository, if run from inside one. If "core.hooksPath" is configured in
any Git configuration (and supported, i.e., the installed Git version is
at least 2.9.0), then the pre-push hook will be installed to that
directory instead.

From git lfs install -h:

--skip-repo:
  Skips installation of hooks into the local repository; use if you want to
  install the LFS filters but not make changes to the hooks.  It is valid to use
  --local, --global, or --system in conjunction with this option.

Example error:

     │ File: C:\Users\<user>\<project>\.vcpkg\buildtrees\<dependency-w-lfs>\git-lfs-install-x64-windows-static-md-err.log
─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ mkdir C:\Users\<user>\.githooks: Cannot create a file when that file already exists.
   2 │ To resolve this, either:
   3 │   1: run `git lfs update --manual` for instructions on how to merge hooks.
   4 │   2: run `git lfs update --force` to overwrite your hook.

git lfs install --local --force was installing hooks (unneeded
for a headless build fetch) into the temp clone. This fails when
core.hooksPath points to an existing dir/symlink.

--skip-repo installs only the required LFS filters, skipping hooks.
@helmesjo helmesjo changed the title [vcpkg_from_git] add --skip-repo to git lfs install [vcpkg_from_git] Add --skip-repo to git lfs install Apr 10, 2026
BillyONeal
BillyONeal previously approved these changes Apr 10, 2026
@BillyONeal BillyONeal enabled auto-merge (squash) April 10, 2026 20:28
@BillyONeal
Copy link
Copy Markdown
Member

Thanks!

@BillyONeal BillyONeal disabled auto-merge April 11, 2026 00:31
@BillyONeal BillyONeal marked this pull request as draft April 11, 2026 00:31
@BillyONeal
Copy link
Copy Markdown
Member

Looks like there are build failures. Some are baseline issues that are fixed in these:

but some are not.

@BillyONeal BillyONeal dismissed their stale review April 11, 2026 00:32

Build failures need to be investigated.

@helmesjo
Copy link
Copy Markdown
Contributor Author

helmesjo commented Apr 13, 2026

Looks like there are build failures. Some are baseline issues that are fixed in these:

but some are not.

AFAICT none of the failures (and ports) use/invoke COMMAND "${GIT}" lfs install --local --force --skip-repo (at least not directly), and all of them seem to be FILE_CONFLICTS (that seem to be solved by the PRs you referenced). Was there any of them in particular that you could point me towards?

@BillyONeal
Copy link
Copy Markdown
Member

Hmmmm I think I got confused by how Azure DevOps and GitHub are connected to each other; the "checks" tab listed a whole lot more failures. Pushed a merge with those baseline fixes to see if that fixes it.

@helmesjo helmesjo marked this pull request as ready for review April 14, 2026 14:56
@helmesjo
Copy link
Copy Markdown
Contributor Author

helmesjo commented Apr 14, 2026

Sigh... What caused the full rebuild? Should I not have clicked "ready for reaview"? :)
FYI the previous builds all passed.

Copy link
Copy Markdown
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@BillyONeal BillyONeal merged commit 05aff28 into microsoft:master Apr 15, 2026
14 of 16 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.

2 participants