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

Add ```--abbrev-commit```, ```--format=oneline``` and ```--oneline``` to the log subcommand by SandrineP · Pull Request #118 · QuantStack/git2cpp · GitHub

Repository navigation

Add --abbrev-commit, --format=oneline and --oneline to the log subcommand - #118

Merged
ianthomas23 merged 3 commits into
QuantStack:mainfrom
SandrineP:log_oneline
Mar 11, 2026
Merged

ianthomas23 merged 3 commits into
QuantStack:mainfrom
SandrineP:log_oneline

Conversation

SandrineP commented Mar 10, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

Fix #91
Add --abbrev-commit, format=oneline and --oneline to the log subcommand
Add <rev> to the revparse subcommand
Add -annotate to the tag subcommand
(The last two ones being useful for the tests)

SandrineP added the enhancement New feature or request label Mar 10, 2026

codecov Bot commented Mar 10, 2026 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.40%. Comparing base (e0f7ab9) to head (b66f83d).
⚠️ Report is 45 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
- Coverage   86.83%   86.40%   -0.44%     
==========================================
  Files          60       60              
  Lines        2340     2420      +80     
  Branches      275      290      +15     
==========================================
+ Hits         2032     2091      +59     
- Misses        308      329      +21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ianthomas23 left a comment

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

Just one change requested, and a note about future work.

Comment thread src/subcommand/log_subcommand.cpp Outdated
Comment thread src/subcommand/revparse_subcommand.cpp Outdated

std::string message = commit.message();
while (!message.empty() && message.back() == '\n')
message.pop_back();

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

Please add surrounding curly braces

Comment thread src/subcommand/revparse_subcommand.cpp Outdated
if (!obj.has_value())
{
throw git_exception("bad revision '" + rev + "'", git2cpp_error_code::BAD_ARGUMENT);
return;

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

No need for return after throwing

Comment thread src/subcommand/revparse_subcommand.cpp Outdated
}
else

if (!m_revisions.empty())

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 you can use else if to avoid return statement in the previous if.

std::cout << git_oid_tostr_s(&oid) << std::endl;
}
return;
}

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

Using else here would avoid the need for the previous return statement

SandrineP force-pushed the log_oneline branch 2 times, most recently from 8e664af to 8ff057c Compare March 11, 2026 10:30
Comment thread src/subcommand/revparse_subcommand.cpp Outdated
Comment thread src/subcommand/revparse_subcommand.cpp Outdated
ianthomas23 merged commit 1ab489a into QuantStack:main Mar 11, 2026
5 of 6 checks passed
SandrineP deleted the log_oneline branch March 11, 2026 15:50
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.

Enhancement: git log --oneline

3 participants


Back | FazBrowse Home | New Git URL