Lidong Yan <yldhome2d2@xxxxxxxxx> writes: > I’m proposing to add a .diff_optimize field to struct diff_options, which > would support three modes: DIFF_OPT_NONE, DIFF_OPT_DRY_RUN, > and DIFF_OPT_BUFFER. The appropriate value would be determined > before calling diff_flush(), potentially in repo_diff_setup(). > ... > However, I’m concerned that DIFF_OPT_BUFFER could lead to high memory > usage in Git, and I’m not entirely sure if this trade-off is justified. The DRY_RUN mode would make very good sense, and I agree with you that it is better to leave the BUFFER mode out. It is hard to do right (like, keeping up to certain small amount of diff in memory and then spill it to an external temporary file if we are getting too much), and the value to have it is questionable, especially in the initial attempt. Thanks.