Commit Graph

3 Commits

Author SHA1 Message Date
Saurabh Singh
6317ba0ca2 amend: replace with the fbamend extension
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.

Reviewed By: farnz

Differential Revision: D10320739

fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
2018-10-11 06:59:23 -07:00
Phil Cohen
758d99f8d5 fbamend: add the ability for amends to automatically restack if there won't be conflicts
Summary:
This uses the --noconflict flag added in the previous diff to make auto-restacking, as long as there aren't conflicts or a mergedriver run, trivial.

It creates the `amend.autorestack` flag with four options:

- `never`: never attempt to restack.
- `only-trivial`: restack only if the manifest is unchanged (the old behavior). We can remove this after the rollout.
- `no-conflict`: restack if there won't be merge conflicts.
- `always`: always attempt to restack.

Reviewed By: DurhamG

Differential Revision: D8721726

fbshipit-source-id: 620c08f6082033272dde35cb27b199615f16a787
2018-07-19 16:06:25 -07:00
Phil Cohen
0be0108bed rebase: replace --tool :abort with rebase --noconflict
Summary:
I was thinking about what we need to enable automatic restacking on non-conflicting amends (see the next diff), but I realized the --tool :abort tool I implemented in D8493065 doesn't really work well for this for three reasons:

- It can't handle the case of mergedriver having to run, which is the other reason we'd have to break out of IMM.
- It hard-codes the merge tool. The user might want to specify another tool that doesn't recreate conflicts or solves them differently.
- It'd force callers to detect if IMM will be used (to prevent an on-disk merge hapening by mistake). A flag can implement this much more easily.
- As I learned when writing D8493065, it would require hardcoded logic in every command anyway to support the non-IMM case. (Just raising an abort will leave most commands with an interrupted state.)

So, I think we should replace it with this flag to make auto-restacking work very reliably (we could add it to graft, too). If there was some big demand for --tool :abort we could always add it back in the future.

Reviewed By: quark-zju

Differential Revision: D8701897

fbshipit-source-id: ea3b92d0a224a8ce43edb120b53bec241d92a61d
2018-07-02 11:36:46 -07:00