Page MenuHomePhabricator

Fix arc land on odd/modern git-svn checkouts
AcceptedPublic

Authored by asherkin on Sep 17 2018, 2:42 PM.

Details

Summary

The current code assumes git-svn is always working from a remote called
trunk, but if the repository is initialized without the -T option it
will instead be called git-svn, and if --prefix is used (which is
set by default to origin/ in Git 2+) the remote name will have the
specified prefix as well.

Instead, look at the fetch target refspec set in the git-svn config.

Fixes T13293.

Test Plan

arc land without errors (or manually creating a trunk branch) from a
checkout made with Git 2.18.0 (verified this manually on a non--T
checkout as well).

Diff Detail

Repository
rARC Arcanist
Branch
git-svn-modern (branched from master)
Lint
Lint OK
Unit
Unit Tests OK
Build Status
Buildable 20843
Build 28350: Run Core Tests
Build 28349: arc lint + arc unit

Event Timeline

asherkin created this revision.Sep 17 2018, 2:42 PM
asherkin requested review of this revision.Sep 17 2018, 2:42 PM
epriestley requested changes to this revision.Tue, May 14, 2:24 PM

Can you file a task for this that has step-by-step reproduction instructions (e.g., run this command, then run this command, here's where the thing breaks before this change)? I think this change is likely fine, I'm just not confident I'll be able to reproduce the issue when this refactors during T13098.

This revision now requires changes to proceed.Tue, May 14, 2:24 PM
asherkin added inline comments.Mon, May 20, 2:15 PM
src/workflow/ArcanistLandWorkflow.php
319–320

Re-visiting this after the testing today, I'm not 100% confident this is actually going to behave correctly with multiple git-svn remotes or tracking branches, but neither are something I've ever used with it.

epriestley accepted this revision.Wed, May 22, 4:30 PM

Thanks, T13293 makes this much clearer.

src/workflow/ArcanistLandWorkflow.php
319–320

I'm comfortable waiting for this to explode somewhere, multiple git-svn remotes seems wildly ambitious.

This revision is now accepted and ready to land.Wed, May 22, 4:30 PM