Page MenuHomePhabricator

When running "arc diff" on a range of commits, preserve the individual commits while still creating a single diff from them
Open, LowPublic

Description

When you run arc diff on a range of commits, we currently smush them all together and discard information.

For example, arc diff HEAD^^^^^ followed by arc patch produces a single local commit. Instead, it should produce 5 local commits.

Event Timeline

Enabling this by default sounds reasonable to me. It might let us merge the "Local Commits" table into the "Revision Update History" table too.

It will probably need some UI work to avoid being confusing. We might also need to start compressing the hunk table.

cburroughs changed the visibility from "All Users" to "Public (No Login Required)".Sep 8 2015, 10:08 PM
cburroughs added a subscriber: cburroughs.
lfaraone added a project: Restricted Project.Sep 10 2015, 8:49 AM

I tried manually doing the arc diff on each commit in a branch, and discovered I couldn't actually view a single commit in isolation. Comparing two adjacent diffs in the revision still seemed to show all of the file moves which had been done in the other commits.

@ccope Try running this over your branch:
git rebase -i --exec 'arc diff -C HEAD HEAD^' origin/master

@fooishbar That looks nifty, but I think what I did was functionally the same? I made a new branch at the base commit of my old branch, then repeatedly cherry-picked my old commits + ran arc diff.

@ccope: Yeah, (almost) functionally identical; just a bit slower. The 'almost' is that if you have a branched named T123 in order to automatically link revisions to tasks, your cherry-pick method will succeed (as the branch at time of 'arc diff' is T123), but the rebase method won't (as you'll be on a detached HEAD at the time).

This would be a useful feature as well for myself and the rest of my team. We also find the local commits quite useful.
Please add support to have each local commit translate into a revision update, as suggested at the top of the thread. That would be fantastic.

I tried to use the above rebase command, but it created a separate revision for each commit, instead of merging them into the same revision as different updates.

avivey renamed this task from Upload local commits in "arc diff --create" to Allow arc diff --create" to create a diff/revision out of each local commit.Dec 13 2016, 6:38 PM
avivey updated the task description. (Show Details)

Oh, that's actually a different task, I don't currently plan to implement that. Let me me rename this to be more clear...

epriestley renamed this task from Allow arc diff --create" to create a diff/revision out of each local commit to When running "arc diff" on a range of commits, preserve the individual commits while still creating a single diff from them.Dec 13 2016, 6:46 PM
epriestley updated the task description. (Show Details)
epriestley changed the edit policy from "All Users" to "Community (Project)".

Now I'm even more confused. This ticket still doesn't conform to modern Feature Requests rules :)

We already support uploading the local commits to Staging, but arc-patch doesn't use that information; I think we mentioned something about it in T8238, and in T182, which are the consumers of Revision information.

Do you consider this ticket just "make arc patch restore all local commits", or something more?

Do you consider this ticket just "make arc patch restore all local commits", or something more?

Very nearly just that -- it would probably also involve a way to view the individual commits from the web UI (e.g., on the "Commits" tab of a revision, the commit hash becomes a link to view just that commit).

I generally think this isn't terribly useful (which is why I haven't touched it in the last 4 years) but is something we should have from a completeness perspective (it's bad that arc diff + arc patch are a destructive operation when they don't need to be) and worth sorting out before trying to create revisions from branches/tags/refs, since it will be harder to fix after that and we'll probably see a lot more "push 20 different things to a branch and make a review out of it" behavior once you can create a revision from a branch.