[RFC] Amend commit messages
Jason Harris
jason at jasonfharris.com
Wed Feb 23 05:53:04 CST 2011
On Feb 23, 2011, at 12:31 PM, Gilles Moris wrote:
> On Wednesday 23 February 2011 11:18:44 am Jason Harris wrote:
>> From a personal point of view I just think we should have the option
>> --amend to the commit command that basically does:
>>
>> hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip
>>
>> Just like it says in http://mercurial.selenic.com/wiki/GitConcepts.
>>
>> This gets around probably 60% of the problems.
>>
>> I mean git users use this and they are not killing themselves with it. In
>> fact I implemented exactly this option in MacHg and its wonderful...
>
> Coming back on the name.
>
> I actually hesitated to call the command "amend" because it could be confused
> with the "git commit --amend" (though I don't know git that much).
> But after thinking about it:
> - amend is option of git commit, not a comand
> - "amend" highlight the fact that there is already something pre-existing that
> we'll complement. Not history edition which leave no traces.
> - For this reason, may be git would have rather call that git commit --edit
Hmmm.... Amend in the dictionary has this definition:
verb [ trans. ]
make minor changes in (a text) in order to make it fairer, more accurate, or more up-to-date : the rule was amended to apply only to nonmembers.
• modify formally, as a legal document or legislative bill : did she amend her original will later on? pressuring Panama to amend its banking laws.
• make better; improve : if you can amend or alter people's mind-set.
• archaic put right : a few things had gone wrong, but these had been amended.
DERIVATIVES
amendable adjective
amender noun
Thesaurus: Amend [verb]
the membership application was recently amended: revise, alter, change, modify, qualify, adapt, adjust; edit, copyedit, rewrite, redraft, rephrase, reword, rework, revamp.
Thus really "amending" the commit is the intended action that most users have I think. Edit in general to me has a connotation of more serious edits of previous things... So personally I think the option name --amend is fairly good, since it applies to the content and the message.
I could however, easily see a command "edit" though. eg:
hg edit --rev 562
Which would bring up a message editor with the current message of 562 and allow changes to it. (This should of course only work in the liquid bits unless --force is used...) other obvious options would be --date and --author
(In fact in MacHg the only reason why I have not added this yet, is that I plan to roll all of the history editing stuff into one layout where you can move hunks around, change messages, split changesets, collapse changesets, etc. etc. All by dragging and dropping. Doing this means basically one doesn't need to have a GUI interface to MercurialQueues... Or at least this is the plan...)
Cheers,
Jas
More information about the Mercurial-devel
mailing list