Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git rebase -i "fixup" strands a bunch of commits after squashing #1088

Open
cshinaver opened this issue Oct 9, 2023 · 5 comments · May be fixed by #1098 or #1419
Open

git rebase -i "fixup" strands a bunch of commits after squashing #1088

cshinaver opened this issue Oct 9, 2023 · 5 comments · May be fixed by #1098 or #1419
Labels
bug Something isn't working

Comments

@cshinaver
Copy link

Description of the bug

I saw on the wiki that interactive rebase is fully supported, but when I "fixup"'d multiple commits with git rebase -i, all the interim commits were rewritten and stranded. The smartlog shows all of these commits as separate branches with useless commit messages.

➜  repo git:(9b123ddbd9) git smartlog
⋮
◇ c6e6dba 2h (master) add cache (#37637)
┣━┓
┃ ◯ 8aee19e 6m # This is a combination of 2 commits. # This is the 1st commit message:
┣━┓
┃ ◯ 9b7ce05 6m # This is a combination of 4 commits. # This is the 1st commit message:
┣━┓
┃ ◯ c941dd5 6m # This is a combination of 5 commits. # This is the 1st commit message:
┣━┓
┃ ◯ efeb7ad 6m # This is a combination of 3 commits. # This is the 1st commit message:
┣━┓
┃ ◯ 9cbe061 6m # This is a combination of 6 commits. # This is the 1st commit message:
┣━┓
┃ ◯ bbf1d40 6m # This is a combination of 8 commits. # This is the 1st commit message:
┣━┓
┃ ◯ c45bab2 6m # This is a combination of 7 commits. # This is the 1st commit message:
┣━┓
┃ ◯ 38c3f4b 6m # This is a combination of 9 commits. # This is the 1st commit message:
┣━┓
┃ ◯ e777063 6m # This is a combination of 10 commits. # This is the 1st commit message:
┣━┓
┃ ◯ 0bf8ab5 6m # This is a combination of 13 commits. # This is the 1st commit message:
┣━┓
┃ ◯ 5917b7b 6m # This is a combination of 11 commits. # This is the 1st commit message:
┣━┓
┃ ◯ d03e265 6m # This is a combination of 12 commits. # This is the 1st commit message:
┣━┓
┃ ◯ 0b8b5ff 6m # This is a combination of 14 commits. # This is the 1st commit message:

Expected behavior

I expected the fixup commits to be hidden from the smartlog and only the remaining rewritten commit to be present.

Actual behavior

No response

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.8.0

Version of git

git version 2.37.1 (Apple Git-137.1)

@cshinaver cshinaver added the bug Something isn't working label Oct 9, 2023
@erooke
Copy link

erooke commented Oct 10, 2023

I also have been running into this issue. The closest discussion I've found on this is here but the solution listed therein (git restack --merge "draft()") did not seem to accomplish anything.

@cshinaver
Copy link
Author

I've been doing more experimenting with this. I think the problem is changing 1 commit vs changing multiple commits.

Things that worked with interactive rebase:

  • moving a single commit around the tree (while the last commit is checked out or middle commit checked out)
  • fixup of a single commit
  • squash of a single commit

Problems:

  • Fixup of 2 commits (one gets stranded with the "rewritten" message
  • trying to do 2 operations to a single commit (move and fixup)

cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 12, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 12, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 12, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 12, 2023
cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Oct 12, 2023
@arxanas
Copy link
Owner

arxanas commented Oct 21, 2023

Thanks for reporting. If I recall correctly, this has been an outstanding (but untracked) bug since the first versions of git-branchless. The commits are marked live by the post-commit hook and not properly cleanup (although there seems to be more detailed analysis in #1089 that I haven't read yet).

@arxanas
Copy link
Owner

arxanas commented Oct 29, 2023

It's worth noting that, after the fact, you could probably hide the fixup commits with an invocation something like git hide 'stack() & message("This is a combination")'.

cshinaver pushed a commit to cshinaver/git-branchless that referenced this issue Nov 14, 2023
chf2117 pushed a commit to chf2117/git-branchless that referenced this issue Oct 10, 2024
@chf2117
Copy link

chf2117 commented Oct 10, 2024

@cshinaver Stealing your work :) Let me know if you want it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants