[PATCH] graft: new "--graftmessage" option, for better graft documentation

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Dec 28 22:48:27 CST 2012


On 29 déc. 2012, at 00:40, Yann E. MORIN wrote:

> Pierre-Yves, All,
> 
> On Saturday 29 December 2012 Pierre-Yves David wrote:
>> On 28 déc. 2012, at 16:15, Martin Rieser wrote:
>> 
>>> # HG changeset patch
>>> # User Martin Rieser
>>> # Date 1356625537 -3600
>>> # Branch stable
>>> # Node ID 9f82b5abaa7e56ce561e2c385c4607136a49e838
>>> # Parent  777084ac84167e3bdea45b5c00de1106cca36eef
>>> graft: new "--graftmessage" option, for better graft documentation.
>>> 
>>> With this option the person who uses the graft function, can add some
>>> additional text to the commit message.
>>> With this new graft option it is not required to open an editor to
>>> change the commit message.
>> 
>> What the trouble with opening an editor?
>> 
>> Why would we need a new command switch.
> 
> The same as we have for 'commit':
>  -m --message TEXT        use text as commit message
> 
> It can be usefull for automated commits.
> 
> For example, I auto-commit (via crontab) a few files in my ${HOME} repository
> (eg. my user crontab itself, my ~/.bash_history, and so on...), and auto-push
> so my repository server has it.
> 
> For graft, it can be used by a build-bot to try and test backporting bug
> fixes to a stable branch (eg. by looking at keywords in the commit message,
> the build-bot may attempt the graft and build it), and if OK, send a mail
> for the project leader to pul the new changeset the next morning...
> 
> In this case (not suer it's Martin's use-case), it can be usefull to set
> the commit message on the command line, as it's all scripted.

If you are in a script context, you should be able to forge the new message in a temporary file and pass it to a --logfile option. (or even use a custom editor that does that)

If you are a user you should survivre et editor invocation.

I'm still not very convinced that this usecase deserve a specific flag.

However it seems like graft does not have -l/--logfile option. Adding one would make sense in my opinion.

-- 
Pierre-Yves


More information about the Mercurial-devel mailing list