Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@satoqz
Copy link
Contributor

@satoqz satoqz commented May 29, 2025

Adds discarding unstaged changes line by line.

By default you'd have to confirm each line that you unstage separately when unstaging several lines at once. As that might get a little tedious, I've added a config option confirm_discard that lets you choose the granularity of when to ask for confirmation:

confirm_discard = "line"  # asks on files/hunks/lines
confirm_discard = "hunk"  # asks on files/hunks
confirm_discard = "file"  # asks on files
confirm_discard = "never" # never asks, scary

The default is "line", so you are asked to confirm no matter what you discard, which is backwards-compatible and probably the best for new users.

Curious what you think!

@codecov
Copy link

codecov bot commented May 31, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 6 lines in your changes missing coverage. Please review.

Project coverage is 88.44%. Comparing base (d7457cc) to head (68b9e49).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/ops/discard.rs 83.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #377      +/-   ##
==========================================
- Coverage   88.45%   88.44%   -0.02%     
==========================================
  Files          68       68              
  Lines        6851     6888      +37     
==========================================
+ Hits         6060     6092      +32     
- Misses        791      796       +5     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Owner

@altsem altsem left a comment

Choose a reason for hiding this comment

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

This is awesome! I'll merge it in. :)

@altsem altsem enabled auto-merge (rebase) May 31, 2025 11:22
@altsem altsem disabled auto-merge May 31, 2025 11:22
@altsem altsem merged commit 6b8cfde into altsem:master May 31, 2025
4 of 5 checks passed
@satoqz satoqz deleted the discard-line branch May 31, 2025 11:24
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.

2 participants