[llvm-dev] Phabricator picking up downstream commits from Github forks of llvm-project?

Martin Storsjö via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 30 00:56:33 PDT 2019


On Wed, 30 Oct 2019, Sameer Sahasrabuddhe via llvm-dev wrote:

> October 30, 2019 5:58 AM, "Alex L via llvm-dev" <llvm-dev at lists.llvm.org> wrote:
>
>> Oh, this explains it! Unfortunately one of our engineers made a mistake, and pushed the ref to
>> wrong remote while resolving a merge conflict on https://github.com/apple/llvm-project (pushed to
>> https://github.com/llvm/llvm-project instead of https://github.com/apple/llvm-project). I just
>> deleted the ref from the https://github.com/llvm/llvm-project. It's weird that Phabricator decided
>> to pick this up, since it's not in the usual refs/heads namespace. Hopefully now it will stop going
>> through those commits.
>> 
>> We will work on improving the process on our end to avoid mistakes like this in the future.
>
> What's a good way to avoid these mistakes?

One way that I use to avoid accidentally pushing to the wrong repo, is to 
make sure that the "origin" remote (which is set as the upstream for the 
master branch, where pushes would go implicitly) is set up via an url that 
is (to me) read-only.

When dealing with github, I don't have a stored authenticated session for 
https, so to me, https://github.com/llvm/llvm-project is read-only (or, if 
I try to push there, it'd prompt me for username/password, which I'd 
notice). When pushing to github, I use ssh as transport, with urls like 
git at github.com:llvm/llvm-project, and add this as a separate remote that I 
only use for pushing. That forces me to explicitly spell out e.g. "git 
push <read-write-remote-name> master" to push there.

If access to github via https is authenticated already, one can choose to 
set the origin remote to a git://github.com/llvm/llvm-project url instead, 
which always is read only.

None of this helps against accidentally doing "git push <accidentally 
wrong remote name> <other branch>" though.

// Martin



More information about the llvm-dev mailing list