git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 13, 2025, 08:04 UTC
Message-ID
<Z4TJIzVc4Ib2QyPV@pks.im>
In-Reply-To
<A53D82B2-4F5F-4BCA-9C85-88B2A89139DC@gmail.com>
On Fri, Jan 10, 2025 at 03:38:51PM -0500, Ben Knoble wrote:
Show 15 quoted lines
> 
> > 
> > Le 10 janv. 2025 à 12:16, Jon Forrest <nobozo@gmail.com> 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
Previous: Ben KnobleNext: Jon Forrest
Message 3 of 5 in “Using Visual Studio Code to Debug/Trace Git?”
  1. Jon ForrestJan 10, 2025
  2. Ben KnobleJan 10, 2025
  3. Patrick SteinhardtJan 13, 2025
  4. Jon ForrestJan 13, 2025
  5. Jon ForrestFeb 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.