Skip to content

Conversation

@blairconrad
Copy link
Contributor

Closes #133.

Builds on #182. Only the most recent commit is relevant here.

I'd had this in-flight as part of #182, but split out when I saw #180.

Some patches do not modify an existing file in place.
Instead they add, remove, or rename a file.
This is a "non-modified patch", and will commute with
everything in the stack.

If all patches are non-modified, then no changes will be absorbed, so
warn the user and stop processing. Even users that auto-stage changes
will be warned, since they would've run git-absorb with the expectation
that it would do something.

Otherwise, if only some patches are non-modified, we can continue
processing with a warning. In this case, do not warn users who
auto-stage changes, since they may routinely keep untracked files in
their working directory.

Before this,

1. users who did not auto-stage were warned when nothing was staged.
   We have a more explicit warning and early exit above now.
2. there were staged changes (auto-staged or not) and all the patches
   were non-modified, we'd warn "Could not find a commit to fix up",
   which is accurate, but not as informative.
@blairconrad
Copy link
Contributor Author

I'm not trying to compete with #180, but decided to show the PR for consideration, as it presents an alternative way to provide the information to the user (indicating what can be done with the base, rather than just saying what it is; users who don't use --base may not have noticed there's a concept of a base yet), and also handles a stack that walks back to the root of the repo.

I'm happy to withdraw in favour of #180. @arielf212, if any of the bits are useful, please take them.

@tummychow tummychow merged commit c338416 into tummychow:master Apr 13, 2025
6 checks passed
@blairconrad blairconrad deleted the what-next branch April 13, 2025 23:26
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.

Print base revision for rebase

2 participants