[llvm-dev] Workflow to commit changes using git alone (?)
Joan Lluch via llvm-dev
llvm-dev at lists.llvm.org
Sat Nov 9 23:50:29 PST 2019
> On 10 Nov 2019, at 07:00, Mehdi AMINI <joker.eph at gmail.com> wrote:
> recipe is not correct in the absolute: the delta from master does not mean it contains exactly what you want, you seem to assume that master didn't evolve between the time "patchbranch" was created.
I’m doing it this way to make sure that master /actually/ contains “exactly what I want” (!). Of course the remote master could have evolved slightly during such steps, but that’s a cat-and-mouse game, that I don’t think that can be easily avoided (at least to my knowledge): We use Phabricator to get patches reviewed and this implies that new commits should be based on what we post there. If master has evolved significantly since the review, then a patch update should be sent to Phabricator anyway for further review. Also tests must be run again while master continues evolving. Ultimately, the commit that gets sent to Github must be strictly based on what we got reviewed on Phabricator. My procedure only attempts to enforce that the ‘delta’ commit that I push is predictable, and exactly the one that I previously posted on Phabricator.
The procedure stated on the docs https://llvm.org/docs/Phabricator.html#committing-a-change <https://llvm.org/docs/Phabricator.html#committing-a-change> suggests using ‘arcanist’ to create a ‘diferential’ branch based on master and the Phabricator revision number. The 'arc patch’ command is used for that. To my understanding, the problem is the same: creating that branch may take a few seconds, and while doing so, master can evolve too. The docs even suggest re-running the tests before pushing, which gives even more time for master to have changed.
(Said that, maybe I’m not fully getting ‘git', because I only used it in the past with small teams and no need for cross-reviews, so everything was pretty straightforward: pulling what others did, merging working branches with master, eventually resolving conflicts, and then pushing)
Since you suggest that my “recipe” is not correct, I would appreciate that you elaborate on the correct one, which is why I opened this subject to begin with.
Thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev