FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add diff subcommand by SandrineP · Pull Request #87 · QuantStack/git2cpp · GitHub

Repository navigation

Add diff subcommand - #87

Merged
JohanMabille merged 4 commits into
QuantStack:mainfrom
SandrineP:diff_cmd
Feb 6, 2026
Merged

JohanMabille merged 4 commits into
QuantStack:mainfrom
SandrineP:diff_cmd

Conversation

Copy link
Copy Markdown
Collaborator

Add diff subcommand

SandrineP force-pushed the diff_cmd branch 3 times, most recently from 2acbb53 to e8e7b97 Compare February 5, 2026 10:01
SandrineP marked this pull request as ready for review February 5, 2026 10:09

Copy link
Copy Markdown
Member

When building locally on macos I see

/Users/iant/github/git2cpp/src/utils/common.cpp:114:23: error: implicit instantiation of undefined template 'std::basic_stringstream<char>'
  114 |     std::stringstream buffer;
      |                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__fwd/sstream.h:30:28: note: template is declared here
   30 | class _LIBCPP_TEMPLATE_VIS basic_stringstream;
      |                            ^
1 error generated.

To fix this I need to add #include <sstream> to the top of src/utils/common.cpp

Comment thread src/subcommand/checkout_subcommand.cpp Outdated
if (repo.state() != GIT_REPOSITORY_STATE_NONE)
{
throw std::runtime_error("Cannot checkout, repository is in unexpected state");
std::runtime_error("Cannot checkout, repository is in unexpected state");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It looks like was deleted by accident?

Comment thread src/subcommand/diff_subcommand.cpp Outdated

static int colour_printer([[maybe_unused]] const git_diff_delta* delta, [[maybe_unused]] const git_diff_hunk* hunk, const git_diff_line* line, void* payload)
{
bool* use_colour = reinterpret_cast<bool*>(payload);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think it would be better to store bool use_colour rather than bool*. As it stands, later in this function both *use_colour and use_colour (without the dereference) are used, and they can't both work correctly!

JohanMabille added the enhancement New feature or request label Feb 6, 2026
Comment thread src/subcommand/diff_subcommand.cpp Outdated
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
JohanMabille merged commit a61ab26 into QuantStack:main Feb 6, 2026
3 of 4 checks passed
SandrineP deleted the diff_cmd branch February 6, 2026 15:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL