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

main branch rewritten as 00000000 #1217

Open
ppwwyyxx opened this issue Feb 11, 2024 · 0 comments
Open

main branch rewritten as 00000000 #1217

ppwwyyxx opened this issue Feb 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ppwwyyxx
Copy link

Description of the bug

  1. Create a commit locally with a branch name and create a PR from it
  2. Merge the PR on github. With fast-forward merge (no merge commit)
  3. In the local repo, do git commit --amend, then immediately save and exit. Do not apply any actual changes in the amend window.
  4. do git restack
  5. do git sync --pull

Expected behavior

No "rewritten as 000000" appears

Actual behavior

image

Version of rustc

rustc 1.73.0 (cc66ad468 2023-10-03)

Automated bug report

#### Software version

git-branchless 0.8.0

#### Command-line

```bash
/home/XXX/.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: 38, transaction ID: 25 (message: sync)
  1. RefUpdateEvent { timestamp: 1707671477.1453016, event_tx_id: EventTransactionId(25), ref_name: ReferenceName("refs/heads/redacted-ref-0"), old_oid: 79b98014e60919903c48c9971b3966322f994fa9, new_oid: 0000000000000000000000000000000000000000, message: None }
  2. RewriteEvent { timestamp: 1707671477.1720936, event_tx_id: EventTransactionId(25), old_commit_oid: 79b98014e60919903c48c9971b3966322f994fa9, new_commit_oid: 0000000000000000000000000000000000000000 }
  3. WorkingCopySnapshot { timestamp: 1707671477.1937, event_tx_id: EventTransactionId(25), head_oid: 79b98014e60919903c48c9971b3966322f994fa9, commit_oid: NonZeroOid(d07687388112a95fb07afb1cfaaba9dfc1a2b1e1), ref_name: None }
  4. RefUpdateEvent { timestamp: 1707671477.2118502, event_tx_id: EventTransactionId(25), ref_name: ReferenceName("HEAD"), old_oid: 79b98014e60919903c48c9971b3966322f994fa9, new_oid: 0c219685cd7ef34f297fc191650a03a8ca69df68, message: None }
:
% 0c21968 6m (rewritten as 00000000) (master) xxxxxxxx
Event ID: 37, transaction ID: 23 (message: restack)
  1. RefUpdateEvent { timestamp: 1707671457.734186, event_tx_id: EventTransactionId(23), ref_name: ReferenceName("refs/heads/redacted-ref-0"), old_oid: 154b1cbbbf6a8b2767e14aaef85976799d1459b0, new_oid: 79b98014e60919903c48c9971b3966322f994fa9, message: None }
:
% 0c21968 6m (rewritten as 79b98014) (master) xxxxxxxx
Event ID: 36, transaction ID: 22 (message: hook-post-rewrite)
  1. RewriteEvent { timestamp: 1707671457.6811366, event_tx_id: EventTransactionId(22), old_commit_oid: 154b1cbbbf6a8b2767e14aaef85976799d1459b0, new_commit_oid: 79b98014e60919903c48c9971b3966322f994fa9 }
:
% 0c21968 6m (rewritten as 79b98014) (master) xxxxxxxx
Event ID: 35, transaction ID: 21 (message: post-commit)
  1. CommitEvent { timestamp: 1707671456.0, event_tx_id: EventTransactionId(21), commit_oid: NonZeroOid(79b98014e60919903c48c9971b3966322f994fa9) }
:
% 0c21968 6m (rewritten as 154b1cbb) (master) xxxxxxxx
Event ID: 31, transaction ID: 20 (message: reword)
  1. RefUpdateEvent { timestamp: 1707671451.2447162, event_tx_id: EventTransactionId(20), ref_name: ReferenceName("refs/heads/redacted-ref-0"), old_oid: 0c219685cd7ef34f297fc191650a03a8ca69df68, new_oid: 154b1cbbbf6a8b2767e14aaef85976799d1459b0, message: None }
  2. RewriteEvent { timestamp: 1707671451.2619314, event_tx_id: EventTransactionId(20), old_commit_oid: 0c219685cd7ef34f297fc191650a03a8ca69df68, new_commit_oid: 154b1cbbbf6a8b2767e14aaef85976799d1459b0 }
  3. WorkingCopySnapshot { timestamp: 1707671451.2790852, event_tx_id: EventTransactionId(20), head_oid: 0c219685cd7ef34f297fc191650a03a8ca69df68, commit_oid: NonZeroOid(71683f298583a6df722ff286ae5dc6cd18a7a250), ref_name: None }
  4. RefUpdateEvent { timestamp: 1707671451.2962728, event_tx_id: EventTransactionId(20), ref_name: ReferenceName("HEAD"), old_oid: 0c219685cd7ef34f297fc191650a03a8ca69df68, new_oid: 154b1cbbbf6a8b2767e14aaef85976799d1459b0, message: None }
:
% 0c21968 6m (rewritten as 154b1cbb) (master) xxxxxxxx
```

Version of git-branchless

No response

Version of git

No response

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

1 participant