Skip to content

Chore/sdk 2.21.1 lf migration - #377

Open
matt-edmondson wants to merge 3 commits into
mainfrom
chore/sdk-2.21.1-lf-migration
Open

Chore/sdk 2.21.1 lf migration#377
matt-edmondson wants to merge 3 commits into
mainfrom
chore/sdk-2.21.1-lf-migration

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

No description provided.

Adopt the SDK's synced style configuration and the metadata it derives from
it. The .gitattributes rewrite normalizes the repository to LF and routes
*.png through the Git LFS clean filter, so icon.png is now stored as a
pointer rather than 16 KB of raw bytes.

Add the direct package references the KTSU0006 transitive-package analyzer
requires for types already in use.
libgit2 implements neither the clean and smudge filters nor the hooks, and
Git LFS is built entirely out of those. For this application the half that
bites is the smudge filter: cloning through LibGit2Sharp writes each LFS
pointer to disk as its literal text, so a repository that tracks binaries
comes down looking like a set of three-line files rather than its content.

All git work now goes through GitCli, which starts the git command through
ktsu.RunCommand. Arguments are passed as a list rather than as one command
string, so paths containing spaces need no quoting, and RunIn uses git -C so
the process working directory is never mutated -- which is what keeps the
background fetches safe to run concurrently.

Notable call site changes:

- Clone, fetch and status move across directly. Pull becomes --ff-only. The
  old code performed a real merge, committed it unattended, and swallowed
  CheckoutConflictException, which left the working tree mid-conflict with
  nothing said about it.
- Repository discovery takes the parent of each .git directory rather than
  asking libgit2 for the working directory, and reads the remote with
  git remote get-url.
- The index enumeration behind the repository diff becomes git ls-files -z.
  NUL separation turns off the quoting git otherwise applies to unusual
  paths, so names arrive exactly as recorded.
- RepositoryNotFoundException was driving control flow in four places. Those
  become an explicit GitCli.IsRepository check.
- The log panel carried libgit2's debug trace. It now carries what git
  reported for each clone, fetch and pull, which is what someone watching
  that panel actually wants to see.

There are no credentials in this code any more: git uses the platform
credential helper, which also makes SSH remotes work.

Add ProjectDirector.Test, the repository's first test project. GitCliTests
pins both halves of the LFS guarantee -- a tracked binary is committed as a
pointer and comes back out of a clone as its content -- plus the repository
detection, tracked-file listing and remote lookup that replaced the exception
handling.

Also correct the solution configuration, which mapped Release to Debug, so
building Release produced a Debug binary.
Resolves the two files both sides touched:

- global.json keeps ktsu.Sdk 2.21.1. The incoming dependabot commit moved it
  2.18.0 -> 2.19.0, which this branch is already past.
- Directory.Packages.props keeps the pruned list, so LibGit2Sharp stays
  removed and ktsu.RunCommand stays, while taking the incoming OpenAI bump
  to 2.13.0.

Build and all 7 tests pass on the merged tree.
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.

1 participant