D6490: commit: add --force flag to close branch from a non-head changeset

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Fri Jun 21 12:42:34 EDT 2019


mharbison72 added a comment.


  In D6490#95686 <https://phab.mercurial-scm.org/D6490#95686>, @khanchi97 wrote:
  
  > In D6490#95355 <https://phab.mercurial-scm.org/D6490#95355>, @markand wrote:
  >
  >> In D6490#95328 <https://phab.mercurial-scm.org/D6490#95328>, @mharbison72 wrote:
  >>
  >>> In D6490#95305 <https://phab.mercurial-scm.org/D6490#95305>, @pulkit wrote:
  >>>
  >>>> I think adding a `--force` flag to `hg commit` is not a nice option. force can mean a lot of things and here except in closing the non-head changeset, it is no-op. 
  >>>> For example, I am in middle of a rebase, tried to commit, it says rebase in progress. I see there is a --force flag, I try to use that to force the commit.
  >>>> We can do one of the following:
  >>>>
  >>>> 1. maybe a more specific flag name like `--allow-close-branch` or something like that
  >>>> 2. a config option instead of a flag name
  >>>
  >>> Fair point.  Specific is better.
  >>> I'd suggest `--force-close-branch` as a standalone flag (i.e. you don't need to also use `--close-branch`; it wasn't clear to me if that's what you meant).  `--allow-close-branch` and `--close-branch` don't seem different enough to remember the difference.
  >>
  >> Just my $0.02.
  >> I think that `hg commit` already has many options that do not even belong to committing (such as -A, --close-branch). Let's not add an option that is not related to commit. To my opinion closing a branch should be done with `hg branch` not commit (unfortunately this was never the case). Anyway if you really want to do it with commit, I would suggest that `--close-branch` takes an optional argument rather than adding a new option. This makes UX a bit more convenient
  >> e.g.
  >>
  >>   hg commit --close-branch --force-close-branch (not that)
  >>   hg commit --close-branch forced (or force or something like that)
  >
  > I think it's a little hard to make user understand (by providing a hint like "use `force` arg with `--close-branch`") that you need to provide an argument as compared to just providing a standalone flag `--force-close-branch` as @mharbison72 suggested. I do agree with you that it would make +1 in the no. of flags which don't make sense with `hg commit`. What do you say?
  
  What if you mark it `(ADVANCED)` so that it doesn't show in the help without a `-v`?  Then the hint informs the user when it might be needed, otherwise they don't need to see it all the time.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6490/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6490

To: khanchi97, #hg-reviewers, mharbison72
Cc: martinvonz, markand, pulkit, mharbison72, mercurial-devel


More information about the Mercurial-devel mailing list