arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`git sync --pull` leaves files in the index

jwatzman opened this issue · comments

Description of the bug

Under certain circumstances -- I have not quite figured out what causes it -- git sync --pull will succeed just fine, but after it finishes, the index won't be empty (even though it was empty before the sync). The changes against HEAD seem to be reverts of some recent commits -- as if the git commit structure got updated correctly, but the working tree and index did not?

I am not a git guru so I could be misreading something!

Expected behavior

After a sync, if my working tree and index were clean before, they should be clean after.

Actual behavior

In some cases (not 100% of the time), they are not clean.

Version of rustc

No response

Automated bug report

Software version

git-branchless 0.7.1

Operating system

macOS 13.4 (Darwin 22.5.0)

Command-line

/opt/homebrew/bin/git-branchless bug-report 

Environment variables

SHELL=/bin/zsh
EDITOR=vim

Git version

> git version 
git version 2.41.0

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: 1419, transaction ID: 1346 (message: branch)
  1. RefUpdateEvent { timestamp: 1686739297.462531, event_tx_id: EventTransactionId(1346), ref_name: ReferenceName("refs/heads/redacted-ref-0"), old_oid: 68ad4b34b39d7b665004c2776d5ec4798deb6aee, new_oid: 0000000000000000000000000000000000000000, message: None }
:
@ 76d5d09 5m (> master) xxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
o 7a084ed 5m (redacted-ref-1) xxxx xxxx xx
Event ID: 1417, transaction ID: 1341 (message: reset)
  1. RefUpdateEvent { timestamp: 1686739290.385243, event_tx_id: EventTransactionId(1341), ref_name: ReferenceName("HEAD"), old_oid: 76d5d090db8fa51223239c912fc43228ac814816, new_oid: 76d5d090db8fa51223239c912fc43228ac814816, message: None }
  2. RefUpdateEvent { timestamp: 1686739290.385243, event_tx_id: EventTransactionId(1341), ref_name: ReferenceName("refs/heads/master"), old_oid: 76d5d090db8fa51223239c912fc43228ac814816, new_oid: 76d5d090db8fa51223239c912fc43228ac814816, message: None }
:
@ 76d5d09 5m (> master) xxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
o 7a084ed 5m (redacted-ref-1) xxxx xxxx xx
Event ID: 1406, transaction ID: 1337 (message: sync)
  1. RefUpdateEvent { timestamp: 1686739277.051268, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/remotes/redacted-ref-2"), old_oid: 0000000000000000000000000000000000000000, new_oid: fa517a79eaad3443a2c2683faf28b1b2771cefab, message: None }
  2. RefUpdateEvent { timestamp: 1686739277.167022, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/remotes/redacted-ref-3"), old_oid: 53196e32522253154d56ff560226b9386fbbaa6e, new_oid: f08caf2e93e0110cc81199ede1dc69da7fc36300, message: None }
  3. RefUpdateEvent { timestamp: 1686739277.315578, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/remotes/redacted-ref-4"), old_oid: 0000000000000000000000000000000000000000, new_oid: 30c55b3219dfb915a025824f0f5f15390de7d84c, message: None }
  4. RefUpdateEvent { timestamp: 1686739277.359187, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/remotes/redacted-ref-5"), old_oid: 0000000000000000000000000000000000000000, new_oid: 1ff87c00aaeadc4129d023198eae4c4cf6bd4bcc, message: None }
  5. RefUpdateEvent { timestamp: 1686739277.394718, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/remotes/redacted-ref-6"), old_oid: 0000000000000000000000000000000000000000, new_oid: e4a78b2eafe86c05a4ea0afc939e3685a8659384, message: None }
  6. RefUpdateEvent { timestamp: 1686739277.434314, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/remotes/redacted-ref-7"), old_oid: 0000000000000000000000000000000000000000, new_oid: e8573875612ff7ecf93c76d2214e78c498fb9ced, message: None }
  7. RefUpdateEvent { timestamp: 1686739277.477877, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("redacted-ref-8"), old_oid: 0000000000000000000000000000000000000000, new_oid: 3f04a93ad3f6305d377bb6036563e36965078e7d, message: None }
  8. RefUpdateEvent { timestamp: 1686739279.098663, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("refs/heads/redacted-ref-1"), old_oid: 2bada8a26e4ee3569244c43988c164e2524a54fc, new_oid: 7a084edd0b85639886f08deb92513cce033216ac, message: None }
  9. RewriteEvent { timestamp: 1686739279.126598, event_tx_id: EventTransactionId(1337), old_commit_oid: 2bada8a26e4ee3569244c43988c164e2524a54fc, new_commit_oid: 7a084edd0b85639886f08deb92513cce033216ac }
  10. WorkingCopySnapshot { timestamp: 1686739279.163436, event_tx_id: EventTransactionId(1337), head_oid: 76d5d090db8fa51223239c912fc43228ac814816, commit_oid: NonZeroOid(02b431fdcc591bd0a9874da2e6ed8c24339c0199), ref_name: None }
  11. RefUpdateEvent { timestamp: 1686739279.232308, event_tx_id: EventTransactionId(1337), ref_name: ReferenceName("HEAD"), old_oid: 76d5d090db8fa51223239c912fc43228ac814816, new_oid: 76d5d090db8fa51223239c912fc43228ac814816, message: None }
:
@ 76d5d09 5m (> master) xxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
o 7a084ed 5m (redacted-ref-1) xxxx xxxx xx
Event ID: 1405, transaction ID: 1335 (message: checkout)
  1. RefUpdateEvent { timestamp: 1686739273.218729, event_tx_id: EventTransactionId(1335), ref_name: ReferenceName("HEAD"), old_oid: 76d5d090db8fa51223239c912fc43228ac814816, new_oid: 3f04a93ad3f6305d377bb6036563e36965078e7d, message: None }
:
@ 76d5d09 5m (> master) xxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
o 7a084ed 5m (redacted-ref-1) xxxx xxxx xx
Event ID: 1404, transaction ID: 1329 (message: reference-transaction)
  1. RefUpdateEvent { timestamp: 1686739256.564985, event_tx_id: EventTransactionId(1329), ref_name: ReferenceName("refs/remotes/redacted-ref-9"), old_oid: 095fcef3e84d8b9aca39d59ce72b59e53ae8053f, new_oid: 0000000000000000000000000000000000000000, message: None }
:
@ 76d5d09 5m (> master) xxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
o 7a084ed 5m (redacted-ref-1) xxxx xxxx xx

Version of git-branchless

No response

Version of git

No response

This is probably the same as #838. Can you try installing the latest development version and see if your issue persists?

Ah yeah that does sound like the same issue. Installed from git 367205d and haven't had it happen again this morning. Given both of those, I'll close this out since it seems already fixed (and will ping back here if I see it again).

Thanks for your help here, as well as all your work on this tool! The hg changeset evolution flow is really great, and I love having it back in the git world (and outside FB)!