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 sl says "there are 4 abandoned commits" but git restack says "No abandoned commits to restack" #1081

Closed
ppwwyyxx opened this issue Sep 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ppwwyyxx
Copy link

Description of the bug

The end of git sl says:

hint: there are 4 abandoned commits in your commit graph
hint: to fix this, run: git restack
hint: disable this hint by running: git config --global branchless.hint.smartlogFixAbandoned false

However, when I run git restack:

No abandoned commits to restack.
branchless: processing 1 update: branch msh-dev
Finished restacking branches.

Therefore the hint always stays and I cannot get rid of it (unless I disable this feature).

I don't know how I enter this state, but any tools/commands that can help fix this state is appreciated.

Expected behavior

git sl and git restack should agree with each other

Actual behavior

$  git restack
No abandoned commits to restack.
branchless: processing 1 update: branch msh-dev
Finished restacking branches.
⋮
✕ 065fc06 15h (rewritten as 00000000) (main) 
┣━┓
┃ ◯ 1229fc1 7h 
┣━┓
┃ ◯ 6ce2918 7h 
┃ ┃
┃ ◯ 008b91f 4h 
┃ ┣━┓
┃ ┃ ◯ 56325a5 4h 
┃ ┃ ┃
┃ ┃ ◯ 696cc1c 4h 
┃ ┃ ┃
┃ ┃ ◯ 211aa85 4h 
┃ ┃
┃ ◯ b5ed1d2 2h 
┃ ┃
┃ ◯ 144faca 5m 
┃ ┃
┃ ● 076b3d8 5m 
┣━┓
┃ ◯ c666f4c 7h 
┃
◯ d8850f4 7h faithful-schedule
hint: there are 4 abandoned commits in your commit graph
hint: to fix this, run: git restack
hint: disable this hint by running: git config --global branchless.hint.smartlogFixAbandoned false

(commit message hidden)

Version of rustc

rustc 1.72.1 (d5c2e9c34 2023-09-13)

Automated bug report

Software version

git-branchless 0.8.0

Operating system

Linux 5.4.210-4-velinux1-amd64

Command-line

/home/wyx/.cargo/bin/git-branchless bug-report 

Environment variables

SHELL=/bin/zsh
EDITOR=nvim

Git version

> git version 
git version 2.25.1

Hooks

Show 7 hooks
Hook post-applypatch
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook post-applypatch "$@"
## END BRANCHLESS CONFIG
Hook post-checkout
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook post-checkout "$@"
## END BRANCHLESS CONFIG
Hook post-commit
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook post-commit "$@"
## END BRANCHLESS CONFIG
Hook post-merge
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook post-merge "$@"
## END BRANCHLESS CONFIG
Hook post-rewrite
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook post-rewrite "$@"
## END BRANCHLESS CONFIG
Hook pre-auto-gc
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook pre-auto-gc "$@"
## END BRANCHLESS CONFIG
Hook reference-transaction
#!/bin/sh
## START BRANCHLESS CONFIG

# Avoid canceling the reference transaction in the case that `branchless` fails
# for whatever reason.
git branchless hook reference-transaction "$@" || (
echo 'branchless: Failed to process reference transaction!'
echo 'branchless: Some events (e.g. branch updates) may have been lost.'
echo 'branchless: This is a bug. Please report it.'
)
## END BRANCHLESS CONFIG

Events

Show 5 events
Event ID: 210, transaction ID: 129 (message: restack)
  1. RefUpdateEvent { timestamp: 1696030618.7204208, event_tx_id: EventTransactionId(129), ref_name: ReferenceName("refs/heads/msh-dev"), old_oid: 065fc065424deb90e96001e6b5956d374430145a, new_oid: 065fc065424deb90e96001e6b5956d374430145a, message: None }
:
X 065fc06 15h (rewritten as 00000000) (msh-dev) xxx xxxxxxxxxx xxxx
|\
| o 1229fc1 7h xxxx xxxxxxxxx xxxx
|\
| o 6ce2918 7h (redacted-ref-0) xxxx xxxxxx xxxxxxx xxxx xxxxxxxxxx
| |
| o 008b91f 4h (redacted-ref-1) xxxxx xxxxxxxxx xxxxx xxxxx
| |\
| | o 56325a5 4h xxxx xxxxx xxxx xxxxxxxxxx
| | |
| | o 696cc1c 4h xxx xxxxxxxxxx xxx xx xxxx
| | |
| | o 211aa85 4h xxxx xxxx
| |
| o b5ed1d2 2h (redacted-ref-2) xxx xxxxxxxxx xxxxxx
| |
| o 144faca 9m xxxxx xxxxxxxxx xxxx x xxxxxxxxx xxxxxx
| |
| @ 076b3d8 9m xxx xxxxxxxxx xxxxx xx xxxxxxx
|\
| o c666f4c 7h (redacted-ref-3) xxxxxxxxxxxxxx
|
o d8850f4 7h xxxxxxxxxxxxxxxxx
Event ID: 209, transaction ID: 128 (message: restack)
  1. RefUpdateEvent { timestamp: 1696030617.7008605, event_tx_id: EventTransactionId(128), ref_name: ReferenceName("refs/heads/msh-dev"), old_oid: 065fc065424deb90e96001e6b5956d374430145a, new_oid: 065fc065424deb90e96001e6b5956d374430145a, message: None }
:
X 065fc06 15h (rewritten as 00000000) (msh-dev) xxx xxxxxxxxxx xxxx
|\
| o 1229fc1 7h xxxx xxxxxxxxx xxxx
|\
| o 6ce2918 7h (redacted-ref-0) xxxx xxxxxx xxxxxxx xxxx xxxxxxxxxx
| |
| o 008b91f 4h (redacted-ref-1) xxxxx xxxxxxxxx xxxxx xxxxx
| |\
| | o 56325a5 4h xxxx xxxxx xxxx xxxxxxxxxx
| | |
| | o 696cc1c 4h xxx xxxxxxxxxx xxx xx xxxx
| | |
| | o 211aa85 4h xxxx xxxx
| |
| o b5ed1d2 2h (redacted-ref-2) xxx xxxxxxxxx xxxxxx
| |
| o 144faca 9m xxxxx xxxxxxxxx xxxx x xxxxxxxxx xxxxxx
| |
| @ 076b3d8 9m xxx xxxxxxxxx xxxxx xx xxxxxxx
|\
| o c666f4c 7h (redacted-ref-3) xxxxxxxxxxxxxx
|
o d8850f4 7h xxxxxxxxxxxxxxxxx
Event ID: 208, transaction ID: 127 (message: restack)
  1. RefUpdateEvent { timestamp: 1696030616.676665, event_tx_id: EventTransactionId(127), ref_name: ReferenceName("refs/heads/msh-dev"), old_oid: 065fc065424deb90e96001e6b5956d374430145a, new_oid: 065fc065424deb90e96001e6b5956d374430145a, message: None }
:
X 065fc06 15h (rewritten as 00000000) (msh-dev) xxx xxxxxxxxxx xxxx
|\
| o 1229fc1 7h xxxx xxxxxxxxx xxxx
|\
| o 6ce2918 7h (redacted-ref-0) xxxx xxxxxx xxxxxxx xxxx xxxxxxxxxx
| |
| o 008b91f 4h (redacted-ref-1) xxxxx xxxxxxxxx xxxxx xxxxx
| |\
| | o 56325a5 4h xxxx xxxxx xxxx xxxxxxxxxx
| | |
| | o 696cc1c 4h xxx xxxxxxxxxx xxx xx xxxx
| | |
| | o 211aa85 4h xxxx xxxx
| |
| o b5ed1d2 2h (redacted-ref-2) xxx xxxxxxxxx xxxxxx
| |
| o 144faca 9m xxxxx xxxxxxxxx xxxx x xxxxxxxxx xxxxxx
| |
| @ 076b3d8 9m xxx xxxxxxxxx xxxxx xx xxxxxxx
|\
| o c666f4c 7h (redacted-ref-3) xxxxxxxxxxxxxx
|
o d8850f4 7h xxxxxxxxxxxxxxxxx
Event ID: 207, transaction ID: 126 (message: restack)
  1. RefUpdateEvent { timestamp: 1696030614.5262668, event_tx_id: EventTransactionId(126), ref_name: ReferenceName("refs/heads/msh-dev"), old_oid: 065fc065424deb90e96001e6b5956d374430145a, new_oid: 065fc065424deb90e96001e6b5956d374430145a, message: None }
:
X 065fc06 15h (rewritten as 00000000) (msh-dev) xxx xxxxxxxxxx xxxx
|\
| o 1229fc1 7h xxxx xxxxxxxxx xxxx
|\
| o 6ce2918 7h (redacted-ref-0) xxxx xxxxxx xxxxxxx xxxx xxxxxxxxxx
| |
| o 008b91f 4h (redacted-ref-1) xxxxx xxxxxxxxx xxxxx xxxxx
| |\
| | o 56325a5 4h xxxx xxxxx xxxx xxxxxxxxxx
| | |
| | o 696cc1c 4h xxx xxxxxxxxxx xxx xx xxxx
| | |
| | o 211aa85 4h xxxx xxxx
| |
| o b5ed1d2 2h (redacted-ref-2) xxx xxxxxxxxx xxxxxx
| |
| o 144faca 9m xxxxx xxxxxxxxx xxxx x xxxxxxxxx xxxxxx
| |
| @ 076b3d8 9m xxx xxxxxxxxx xxxxx xx xxxxxxx
|\
| o c666f4c 7h (redacted-ref-3) xxxxxxxxxxxxxx
|
o d8850f4 7h xxxxxxxxxxxxxxxxx
Event ID: 206, transaction ID: 125 (message: restack)
  1. RefUpdateEvent { timestamp: 1696030314.9925008, event_tx_id: EventTransactionId(125), ref_name: ReferenceName("refs/heads/msh-dev"), old_oid: 065fc065424deb90e96001e6b5956d374430145a, new_oid: 065fc065424deb90e96001e6b5956d374430145a, message: None }
:
X 065fc06 15h (rewritten as 00000000) (msh-dev) xxx xxxxxxxxxx xxxx
|\
| o 1229fc1 7h xxxx xxxxxxxxx xxxx
|\
| o 6ce2918 7h (redacted-ref-0) xxxx xxxxxx xxxxxxx xxxx xxxxxxxxxx
| |
| o 008b91f 4h (redacted-ref-1) xxxxx xxxxxxxxx xxxxx xxxxx
| |\
| | o 56325a5 4h xxxx xxxxx xxxx xxxxxxxxxx
| | |
| | o 696cc1c 4h xxx xxxxxxxxxx xxx xx xxxx
| | |
| | o 211aa85 4h xxxx xxxx
| |
| o b5ed1d2 2h (redacted-ref-2) xxx xxxxxxxxx xxxxxx
| |
| o 144faca 9m xxxxx xxxxxxxxx xxxx x xxxxxxxxx xxxxxx
| |
| @ 076b3d8 9m xxx xxxxxxxxx xxxxx xx xxxxxxx
|\
| o c666f4c 7h (redacted-ref-3) xxxxxxxxxxxxxx
|
o d8850f4 7h xxxxxxxxxxxxxxxxx

Version of git-branchless

No response

Version of git

No response

@ppwwyyxx ppwwyyxx added the bug Something isn't working label Sep 29, 2023
@arxanas
Copy link
Owner

arxanas commented Oct 1, 2023

You might be able to work around this by running git unhide 065fc06. I haven't been able to figure out what situation will cause a rewrite to 00000000. One solution here might be to never consider public commits to be "rewritten".

@ppwwyyxx
Copy link
Author

I haven't been able to figure out what situation will cause a rewrite to 00000000

Repro steps at: #1217

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
Development

No branches or pull requests

2 participants