Page MenuHomePhabricator

`arc diff` changes current ref in local checkout
Closed, InvalidPublic

Description

When on a branch baz, running arc diff-ing changes the commit baz points to.

For example, if the branch points to

https://github.com/somechris/fabtest/commit/7667fcb04791428ada0434d7d4d8a33fd4f8515a

, running arc diff mangles the commit message, creates a new commit and uploads that to Phabricator. Afterwards the local baz ref points to a commit like

https://github.com/somechris/fabtest/commit/726bbe11bf883ea69f5fe10a92ebc3ba64cf4be7

. While the commits only differ in the commit message and metadata, arc diff's mangling of the baz ref makes commit's on top of the old baz no longer being on top of the new baz.


Example of running arc diff while on branch baz.

Before running arc diff (baz-orig and baz agree and are in the same subgraph):

. * d3b2f58 (quuz) quuz.txt
. * 83a041b (HEAD, baz-orig, baz) Add baz.txt
. * 855d3a1 (origin/master, origin/HEAD, master) Add foo10.txt

After running arc diff (baz-orig and baz no longer agree and are in the different subgraphs):

. * 8b9455d (HEAD, baz) Add baz.txt
. | * d3b2f58 (quuz) quuz.txt
. | * 83a041b (baz-orig) Add baz.txt
. |/
. * 855d3a1 (origin/master, origin/HEAD, master) Add foo10.txt

Commit 8b9455d has been created by arc diff and the local branch baz has been made to point to this commit.

Details

Reference
fl269

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 High.Sep 12 2014, 1:33 AM
flimport set Reference to fl269.

qchris wrote on 2014-05-01 17:32:56 (UTC)

It seems this again caused by a Phabricator default that does not match my workflow.
The problem can be overcome by using arc diff --merge.

mattflaschen wrote on 2014-05-01 20:19:29 (UTC)

@QChris, where did you learn about arc diff --merge? I don't see it in arc help diff, so there might be a documentation bug.

qchris wrote on 2014-05-02 13:01:29 (UTC)

@mattflaschen
Sorry. My comment in T296#5 makes absolutely no sense.
Setting history.immutable to true is what is required to get arc diff do the right thing.

mattflaschen wrote on 2014-05-03 04:44:15 (UTC)

qchris:

Setting history.immutable to true is what is required to get arc diff do the right thing.

Thanks. For future readers, this can be set on a per-working copy (--local), or per user (no --local) basis:

arc set-config --local history.immutable true (.git/arc/config)

or:

arc set-config history.immutable true (~/.arcrc)

importing issue status

flimport closed this task as Invalid.Sep 12 2014, 1:33 AM
flimport added a subscriber: QChris.