On Sat, May 03, 2008 at 06:54:10PM -0700, Junio C Hamano wrote: > > .... It seems like pp_title_line should perhaps just be checking > > for fmt == CMIT_FMT_EMAIL, but I'm not sure if that would break anything > > else,... > > Yeah, your patch obviously would fix the caller, as subject and > after_subject should not be given unless you are doing FMT_EMAIL. But I > also think we should not even look at subject and after_subject unless fmt > is CMIT_FMT_EMAIL inside pp_title_line(). It took a look, and that feels a little wrong, too; we end up with a function that ignores half of its parameters based on the value of one of the other parameters, which makes me feel that it really should be two separate functions. So maybe there is some heavier refactoring to be done there. In general, I think pretty_print has gotten a bit messy because of the increase in the number of formats. We might do better to turn it "inside out": rather than going sequentially through and switching each stage on the format type, make a set of good utility functions and have each format type implemented as a function that builds out of the utility primitives. I also think we can turn several of the formats into --pretty=format: aliases, which should make the code a lot simpler. I had also wanted to add a few features (one of them was giving pretty printing more context of the tree walk, so you could do things like --pretty=format:'Patch X/Y: %s' where X and Y would be substitutions for "current number in walk" and "total number in walk." I can try to take a look at that sometime in the next week or so, though I expect it is major enough surgery to be for the next release cycle. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html