Page MenuHomePhabricator

Arc does not allow to land a commit from a local master branch that is ahead of the remote's master onto the remote's master
Closed, DeclinedPublic

Description

For example when the looks like

  • c0e5f18 (HEAD, master) Add fileFoo
  • 032382e (origin/master, origin/HEAD) Add .arcconfig

'arc land master' fails with

Usage Exception: You can not land a branch onto itself -- you are trying to land 'master' onto 'master'. For more information on how to push changes, see 'Pushing and   Closing Revisions' in 'Arcanist User Guide: arc diff' in the documentation. You may be able to 'arc amend' instead.

Going into detached head mode, or switching to feature branches allows to recover.

Thereby arc /forces/ people into either detached head mode, or into using feature branches.
Forcing people to only using parts of git's features is bad :-(

Details

Reference
fl225

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

flimport raised the priority of this task from to Low.Sep 12 2014, 1:31 AM
flimport set Reference to fl225.

epriestley wrote on 2014-04-26 21:10:51 (UTC)

In the upstream:

  • https://secure.phabricator.com/T3855 - arc land should work when the current branch/bookmark and the target branch/bookmark are the same
    • This should work, it's just a priority issue and runs into a lot of complicated issues on Facebook's mercurial workflow with bookmarks.

In the meantime, a workflow which works in this case is:

First, optionally, run arc amend. This will update the commit message at HEAD to reflect the current state of the review on the web (for example, adding "Reviewed by: alincoln" if someone has accepted the change since you wrote the commit message). If you'd prefer to retain your commit message, you don't need to do this.

$ arc amend

Then, push normally:

$ git push

Almost all arc commands are conveniences. arc land is a convenience wrapper around "do some safety checks + rebase/merge + amend + push + delete local feature branch".

qchris wrote on 2014-04-26 21:33:41 (UTC)

First, we're told to not use git, as arc is the tool to do things.
When arc stumbles across simple tasks, we're told to use git again.

So our users need to learn and understand arc + git :-(

mattflaschen wrote on 2014-04-29 01:11:01 (UTC)

First, we're told to not use git, as arc is the tool to do things.

Who said not to use git at all? It obviously has to be used for some things. As far as I can tell, arc is intended to handle the most common network operations (land, patch, amend, etc.), and none of the local ones (e.g log), with maybe some rare exceptions like arc feature foo, which looks like an optional way to start a local branch.

So our users need to learn and understand arc + git :-(

I use feature branches anyway with Gerrit. That's the only way you automatically get a topic in the top left.

Beyond that, all abstractions are leaky to some degree. However, they can certainly be improved over time.

mattflaschen wrote on 2014-04-29 01:12:05 (UTC)

Forcing people to only using parts of git's features is bad :-(

Also, Gerrit definitely imposes conventions on git work too (e.g. only reviewing one commit at a time).

milimetric wrote on 2014-04-29 15:57:24 (UTC)

Forcing people to only using parts of git's features is bad :-(

Gerrit also basically disintegrates into a hot mess whenever it has to deal with merge commits.

I think we should state our points more as "this specific thing needs to be dealt with if we migrate to Phabricator" rather than general comments like the above. General statements will just start holy wars :)

Rush wrote on 2014-04-29 17:03:52 (UTC)

Not really adding much here, other than to say I've never used arc branch foo. I usually only bring arc into the fold when I need to get something into phabricator, that works well for me. I'm not sure what the overall perception of arc is, but my view is it's just glue between git and phabricator. It doesn't exclude needing to understand git, arc for me is no replacement. I'm not sure if that is anyones intention, I don't believe it is. Doing basic git things with arc I think is just a nicety, so there is always a need to understand git to use arc for code review. I actually don't view that as a positive or negative, just normal?

It would be more confusing to me to think of arc as some kind of git hiding proprietary interface. It doesn't preclude using git anymore than hub does for github I guess.

qchris wrote on 2014-05-01 14:18:38 (UTC)

@mattflaschen

First, we're told to not use git, as arc is the tool to do things.

Who said not to use git at all? It obviously has to be used for some things. As far as I can tell, arc is intended to handle the most common network operations (land, patch, amend, etc.)

So ... as you say “arc is intended to handle the most common network operations (land, [...]” ... this task is about arc land not working and that one has to fall-back to using git :-)

[...] That's the only way you automatically get a topic in the top left.

?
No. Push to refs/for/master/whateverTopicYouWant

If you don't use Arcanist, can u bypass the code-review by simply pushing the code?

Qgil added a comment.Mar 12 2015, 9:44 AM

Maybe this is a question to be asked in Phabricator upstream? In the context of Wikimedia, bypassing code review is not an option.

Ok, sorry. Maybe I was a bit confused after reading the arc amend / git push comment, for a sec I thought it is possible to bypass arc by simply git pushing to a phabricator archive without using arc diff. I remember the "Usage Exception: You can not land a branch onto itself -"... error message, my solution was arc feature "featurename" to bypass this little troublemaker *g

mmodell added a subscriber: mmodell.May 1 2015, 5:00 AM

@Xitec75: only project owners (people with +2 in gerrit) can bypass review. This is the case in gerrit as well. It's pretty much necessary for someone to be able to push.

greg added a subscriber: greg.May 24 2015, 8:41 AM

I don't think this is a blocker but should inform our documentation updates.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 9 2015, 3:18 PM
Qgil removed a subscriber: Qgil.Oct 22 2015, 8:25 AM
greg added a comment.Nov 4 2015, 7:24 PM
In T134#1306228, @greg wrote:

I don't think this is a blocker but should inform our documentation updates.

Per this, removing Gerrit-Migration project.

greg moved this task from To Triage to Backlog on the Differential board.
mmodell closed this task as Declined.Oct 31 2018, 7:37 PM