Wishlist: the ability to correct wrong commit messages.

Arne Babenhauserheide arne_bab at web.de
Tue Jul 2 08:43:03 UTC 2019


Alan Mackenzie <acm at muc.de> writes:

> Hello, Arne.
>
> On Mon, Jul 01, 2019 at 21:37:01 +0200, Arne Babenhauserheide wrote:

>> But evolve provides a similar concept while being more scalable and
>> allowing actual restructuring of the history, like renaming named
>> branches and changing the order of commits.
>
> I've had a look at the documentation for evolve, and I'm afraid I'm not
> optimistic about it.  A key feature of Mercurial is that it's both
> user-friendly and learner-friendly.  I've spent something over an hour
> trying to find anything relevant to correcting a commit message, and
> found nothing.

The essence is:


hg update "<revision with wrong message>"
hg amend -m "<new message>"
hg evolve


And I think amend is missing a keyword argument -r, because my
expectation was that I can simply use


hg amend -r "<revision>" -m "<new message>" # does not work (yet?)
hg evolve


> Instead there's LOTS of broadening-your-horizons documentation -
> explanations of concepts, like "Obsolesence":
>
>     "Everything else in this document depends on understanding
>     obsolesence".
>
> That's neither beginniner friendly nor user friendly.  I don't want to
> spend precious time "understanding obsolesence", I just want to be
> swutting-well rescued, to quote Douglas Adams.  That is, get my commit
> message fixed.

Same for me, and this is what Mercurial typically provides:


$ hg help -e evolve
… 
list of commands:

 amend         combine a changeset with updates and replace it with a new one
 evolve        solve troubled changesets in your repository
 fold          fold multiple revisions into a single one
 metaedit      edit commit information
 next          update to next child revision
 obslog        show the obsolescence history of the specified revisions
 pdiff         show diff combining committed and uncommited changes
 pick          move a commit on the top of working directory parent and
               updates to it.
 previous      update to parent revision
 prune         mark changesets as obsolete or succeeded by another changeset
 pstatus       show status combining committed and uncommited changes
 rewind        rewind a stack of changesets to a previous state
 split         split a changeset into smaller changesets
 touch         create successors identical to their predecessors but the
               changeset ID
 uncommit      move changes from parent revision to working directory


$ hg amend --help
hg amend [OPTION]... [FILE]...

aliases: refresh

combine a changeset with updates and replace it with a new one

    Commits a new changeset incorporating both the changes to the given files
    and all the changes from the current parent changeset into the repository.

    See 'hg commit' for details about committing changes.

    If you don't specify -m, the parent's message will be reused.

    If --extract is specified, the behavior of 'hg amend' is reversed: Changes
    to selected files in the checked out revision appear again as uncommitted
    changed in the working directory.

    Returns 0 on success, 1 if nothing changed.

options ([+] can be repeated):

 -A --addremove           mark new/missing files as added/removed before
                          committing
 -a --all                 match all files
 -e --edit                invoke editor on commit messages
    --extract             extract changes from the commit to the working copy
    --patch               make changes to wdir parent by editing patch
    --close-branch        mark a branch as closed, hiding it from the branch
                          list
 -s --secret              use the secret phase for committing
 -n --note TEXT           store a note on amend
 -I --include PATTERN [+] include names matching the given patterns
 -X --exclude PATTERN [+] exclude names matching the given patterns
 -m --message TEXT        use text as commit message
 -l --logfile FILE        read commit message from file
 -d --date DATE           record the specified date as commit date
 -u --user USER           record the specified user as committer
 -D --current-date        record the current date as commit date
 -U --current-user        record the current user as committer
 -i --interactive         use interactive mode

(some details hidden, use --verbose to show complete help)


$ hg evolve --help
…
options ([+] can be repeated):

 -n --dry-run           do not perform actions, just print what would be done
    --confirm           ask for confirmation before performing the action
 -A --any               also consider troubled changesets unrelated to current
                        working directory
 -r --rev REV [+]       solves troubles of these revisions
    --phase-divergent   solves only phase-divergent changesets
    --content-divergent solves only content-divergent changesets
    --orphan            solves only orphan changesets (default)
 -a --all               evolve all troubled changesets related to the current
                        working directory and its descendants (default)
    --update            update to the head of evolved changesets
 -c --continue          continue an interrupted evolution
    --stop              stop the interrupted evolution
    --abort             abort the interrupted evolution
 -l --list              provide details on troubled changesets in the repo
 -t --tool TOOL         specify merge tool


Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1076 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20190702/f355c504/attachment.asc>


More information about the Mercurial mailing list