How to prevent phabricator from eating my commit history

Viewed 8712

Here is the scenario that is pretty much annoying me.

Jack works in foobar a software house, Jack is a Working Programmer, he loves coding and commits frequently. Paul who is jack's manager tells him that we are going to start using a new code review tool, phabricator. Jack complies, Jack creates a local branch and starts working. He adds features and commits to his local branch very frequently. Now at the end of the day he sends a phabricator request.

arc diff development

John who is jacks team member reviews his code and accepts his changes. Now Jack opens the terminal and moves to his repository directory. Jack types the following command to close the revision and merge his code with the development branch.

arc land --onto development

He sees the following message

Landing current branch 'feature-awesome-features'.
Switched to branch development. Updating branch...
The following commit(s) will be landed:

b2ff76e  Added the foo to bar
33f33ba  Added a really important check which can destroy the project or save it
31a4c9a Added that new awesome feature
8cae3bf rewrote that awful code john wrote
bc54afb  bug fixes

Switched to branch feature-awesome-features. Identifying and merging...
Landing revision 'D1067: Added the awesome feature'...
Rebasing feature-awesome-features onto development
Already up-to-date.
Pushing change...

Now jack opens Github to see his code , his beautiful commits. but what he sees is pure horror all of his commits have been replaced by a single commit which basically says something like this

Summary: Added the awesome feature

Test Plan:  do foo bar testing

Reviewers: John

Reviewed By: John

CC: Paul

Differential Revision: http://phabricator.foobar.com/D1067

Now jack is sad, because he wants to see all of his commits, jack thinks that this commit makes him look like The Hoarder which he is not. He wants to fix this so he goes to ask a question on stackoverflow.

That how may he prevent phabricator from eating his commit history.
7 Answers

The modern answer to this question after some of the changes in the most recent updates to arcanist

In order to prevent the squash you have to use the new strategy syntax

arc land Dxyz --strategy merge

The old syntax of --merge or --squash has been replaced by --strategy

( See some background info in : https://secure.phabricator.com/T13547 )

--merge doesn't work as it creates a merge commit. I'v patched mine to have a --rebase that will do the right thing but I'm unsure if arc people would like to have this.

Here is what I do. It doesn't prevent the commit history from being squashed, but it allows you to rebase subsequent features onto the branches that were lost.

$ arc land --revision <feature1>

$ git branch -u master <feature2>

$ arc cascade

arc cascade will rebase all feature branches that were branched off of feature1

Related