Subject: Re: Using Visual Studio Code to Debug/Trace Git?

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 13 Jan 2025 09:04:59 +0100

On Fri, Jan 10, 2025 at 03:38:51PM -0500, Ben Knoble wrote:
> 
> > 
> > Le 10 janv. 2025 à 12:16, Jon Forrest <[email-masked]> a écrit :
> > 
> > I'm interested in using Visual Studio Code to help understand
> > how git works. I'm thinking it would make it easy to see what
> > actually happens when git commands are run.
> > 
> > What I don't know is how to integrate git's build system into
> > Visual Studio Code. Has anybody tried this? If not, what tools
> > do you use to debug git?
> 
> AFAIK, it’s make (with some autoconf stuff) and C debuggers like
> gdb/lldb. But maybe someone has a better answer. I’d expect VS Code to
> support this pretty easily.

There are two ways to realize what you want right now:

  - Import the CMake build instructions that we have in
    "contrib/buildsystems". It has existed for a rather long time, but
    is not an officially supported way to build Git. It's also lacking a
    couple of features that you can expect from our Makefile, like
    building docs. It may be good enough though.

  - Generate a Visual Studio solution via Meson by installing Meson and
    then running `meson setup --backend=vs2022 build-msvc`. This has
    only landed in Git v2.48 and is thus really new. As such it is still
    marked experimental, but will become an official way to build Git
    and is more feature complete.

I'm aware of an issue with Visual Studio right now though when using it
with Meson that keeps it from working -- I'll send a patch series later
today to fix that issue, and then it should be a good way to build Git
on Windows via MSVC.

Patrick