Bug 254020 - `git-webkit pr` fails if main is checked out in another worktree
Summary: `git-webkit pr` fails if main is checked out in another worktree
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-16 07:09 PDT by Sam Sneddon [:gsnedders]
Modified: 2023-05-19 06:45 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2023-03-16 07:09:46 PDT
% ./Tools/Scripts/git-webkit pr 
fatal: cannot force update the branch 'main' checked out at '/Volumes/gsnedders/projects/Safari/OpenSource'
Failed to match 'main' to it's remote 'origin'
Comment 1 Sam Sneddon [:gsnedders] 2023-03-16 07:12:06 PDT
I'm not sure why we're trying to update main at all, rather than just relying on origin/main? I definitely don't expect 'git-webkit pr' when run from branch 'my-super-engineering' to modify my 'main' branch.
Comment 2 Radar WebKit Bug Importer 2023-03-23 07:10:15 PDT
<rdar://problem/107133130>
Comment 3 Sam Sneddon [:gsnedders] 2023-05-19 06:45:38 PDT
To be specific, we run ['/usr/bin/git', 'branch', '-f', 'main', 'remotes/origin/main']

I just almost filed a new bug about this; this is with `git-webkit pr --no-add --no-rebase --no-commit` the only place where we try and mutate any local branch, which we shouldn't be doing.

There's no good reason for `git-webkit pr` to be resetting a local branch.