[Commented On] D10893: amend: add a useless initial version of `amend -r REV `
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Tue Jun 22 16:43:00 UTC 2021
Alphare added a comment.
In D10893#166666 <https://phab.mercurial-scm.org/D10893#166666>, @martinvonz wrote:
> Thanks for the quick review. I sent this out early to get feedback on the idea -- particularly on the fact that we'll have `hg amend --continue` and `hg amend --abort` -- before I wasted time going too far in the wrong direction.
Now that I think of it I'm not entirely certain what the intermediate step for amend will be used for. Will it just be in case of rebase conflicts or is there more to it?
> Yes, exactly, I had intended for it to auto-rebase.
I meant to clarify that it would not auto-rebase more than the stack (like other heads that are descendants of the amended changeset).
> Sure, I can add a `--no-rebase` flag too. When would you want that?
This would be for small adjustments that have no real impact on what I'm currently working on, I can just throw the amends one after the other. It's pretty niche, but not hard to implement so I thought I'd ask.
> By the way, I suppose we may want a `hg amend --stop` as well, but I probably won't implement that any time soon.
That would be a good idea, maybe we could discuss why it's hard to implement it (if it's the case), but that shouldn't be a blocker for this patch.
> I initially called it `hg amend --into`, but then someone (in an unrelated discussion) mentioned `hg amend -i` yesterday and I thought that users might confuse `hg amend --into` and `hg amend -i`. I think most users think of the feature as `hg amend -r`, so I switched to that.
Good point.
> My reason for initially calling it `--into` is that the command works on two revisions: the working copy and the target commit. Most hg commands default to working on the working copy and use `-r` to change that (for example, `hg branch` and `hg topic` change the branch name in the working copy by default, but you can change the branch/topic of other commits by passing `-r`). `hg amend` defaults to amending from the working copy and into the parent of the working copy. It seems unlikely that we'll add support for amending from an arbitrary commit into an ancestor of that commit. If we ever do that, we can make that `hg amend --from abc123 --into abc123^^` and keep `-r` as a deprecated alias for `--into`.
> Sounds okay?
This sounds okay to me.
>> - Maybe plug into `hg continue/abort` and suggest using it first, then `hg amend --continue/abort`?
>>
>> As a nit, I'd say the `.t` test should be using `(known-bad-output !)` and/or `(missing-correct-output !)` to better signal what is expected than the TODO.
>
> Ah, good point. Those are new enough that I haven't gotten used to using them yet. Will update the patch.
Thanks for updating the patch. I'm going to let a few days go by just to let people give their thoughts as this is a pretty impactful feature, but this looks good to me overall.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10893/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10893
To: martinvonz, #hg-reviewers
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210622/3c8b8e47/attachment-0002.html>
More information about the Mercurial-patches
mailing list