[PATCH V2 1/2] diff: add the --output option

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Jul 9 19:17:06 CDT 2013


On 10 juil. 2013, at 01:20, Ahmed S. Darwish wrote:

> On Wed, Jul 10, 2013 at 12:10:20AM +0200, Pierre-Yves David wrote:
>> 
>> But why are you adding it to diff only ? Output of any Mercurial
>> commands can get corrupted. And multiple other commands export
>> diff (log -p, export, …) A global setting would make more sense.
>> 
> 
> I don't think shelving code using `hg log -p' is that common, but
> I might be wrong. `export' and `cat' already have their own --output
> option.
> 
>> However, I would be sad to see such flag added when the shell is to
>> blame. 
> 
> I can understand your concern, but for good or bad PowerShell is
> now the defacto shell for Windows 7+ machines :-(
> 
> The `--output FORMAT' option is already available for several other
> commands; I don't think adding it for `hg diff' would break __any__
> expectations.

The fact that cat and export already have this --output option changes things and should be reminded in the commit message.

This move the question from "adding an new --output flag" to "extending the --output flag to diff" and this seems much more reasonable.

Notes that in cat and export the option may be formatted. How that transpose to diff ? (not a blocking question, imho)

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list