-
-
Notifications
You must be signed in to change notification settings - Fork 90
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 branchless sync --pull not pulling main branch #355
Comments
Hi @tp-woven, thanks for reporting. This is more of a specification bug than an implementation bug.
Some edge cases:
If you're interested in making the above fix, let me know and I can walk you through the process in more detail. |
Thanks for the detailed response! I'll try to find some time to take a look at this and get in touch if I need help (but things have been kinda busy here, so not sure when I can get around to it... 😅) |
(Original reporter here, from a different account this time...) I tried digging around the code a bit to see what it would look like to implement what you suggested. Going through
So before I spend too much time going down the wrong rabbit hole, I was wondering if you could elaborate a bit on what you had in mind. Thanks! 🙇 |
@talpr I actually exposed git-branchless/git-branchless-lib/src/git/repo.rs Lines 1613 to 1620 in c96a3ac
See also https://github.com/arxanas/git-branchless/wiki/Coding#the-git-module. If we need to expose more functionality, then, by default, we would want to add our own wrappers over |
OK, gotcha. I'll sync with the repo again and go with that approach. Thanks! |
For people who want this to happen, wrap
This isn't as sophisticated as the above suggestions but works well enough. |
Description of the bug
When I run
git branchless sync --pull
, it fetches the "main" branch from the remote and pulls it into my "feature" branches, but it does not update the "main" branch itself.For example: (irrelevant branches and logs were removed for simplicity)
Expected behavior
The main branch should be "pulled" and updated to reference the latest remote ref. In the example above, I would have expected
main
to also be moved to3aafdf4
(same asorigin/main
).Actual behavior
The main branch is unaffected by
sync
and needs to bepull
ed manually.Version of
git-branchless
git-branchless 0.3.12
Version of
git
git version 2.25.1
Version of
rustc
rustc 1.60.0-nightly (bd3cb5256 2022-01-16)
Automated bug report
Software version
git-branchless 0.3.12
Operating system
Linux 5.4.0-1045-aws
Command-line
Environment variables
Git version
Events
Show 5 events
Event ID: 179, transaction ID: 188
RefUpdateEvent { timestamp: 1649820518.0892587, event_tx_id: EventTransactionId(188), ref_name: "refs/heads/redacted-ref-0", old_oid: a1ac01f8528c336b64f41e54baeb3d430f6f5dc5, new_oid: 0602d383e956d811831245264a8d3c13a755ffc3, message: None }
RewriteEvent { timestamp: 1649820518.1151667, event_tx_id: EventTransactionId(188), old_commit_oid: a1ac01f8528c336b64f41e54baeb3d430f6f5dc5, new_commit_oid: 0602d383e956d811831245264a8d3c13a755ffc3 }
RefUpdateEvent { timestamp: 1649820518.1572192, event_tx_id: EventTransactionId(188), ref_name: "HEAD", old_oid: f6217c426cf6693939cee29e4e8e993201b0d901, new_oid: f6217c426cf6693939cee29e4e8e993201b0d901, message: None }
Event ID: 178, transaction ID: 186
CommitEvent { timestamp: 1649719008.0, event_tx_id: EventTransactionId(186), commit_oid: NonZeroOid(f6217c426cf6693939cee29e4e8e993201b0d901) }
Event ID: 177, transaction ID: 185
RefUpdateEvent { timestamp: 1649720107.489089, event_tx_id: EventTransactionId(185), ref_name: "HEAD", old_oid: 5b7a8c03ebbfff54b2189b1f0d65f1c33b7e574a, new_oid: 5b7a8c03ebbfff54b2189b1f0d65f1c33b7e574a, message: None }
Event ID: 176, transaction ID: 183
RefUpdateEvent { timestamp: 1646609831.5132928, event_tx_id: EventTransactionId(183), ref_name: "HEAD", old_oid: 5b7a8c03ebbfff54b2189b1f0d65f1c33b7e574a, new_oid: 5b7a8c03ebbfff54b2189b1f0d65f1c33b7e574a, message: None }
Event ID: 175, transaction ID: 182
RefUpdateEvent { timestamp: 1646609831.4847836, event_tx_id: EventTransactionId(182), ref_name: "refs/heads/redacted-ref-3", old_oid: 0000000000000000000000000000000000000000, new_oid: 5b7a8c03ebbfff54b2189b1f0d65f1c33b7e574a, message: None }
The text was updated successfully, but these errors were encountered: