From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Teemu Likonen <tlikonen@iki.fi>, git@vger.kernel.org
Subject: Re: BUG: "git checkout" displays Q-escaped commit titles
Date: Sun, 4 May 2008 15:45:41 -0400 [thread overview]
Message-ID: <20080504194541.GD13029@sigill.intra.peff.net> (raw)
In-Reply-To: <7vlk2qsukd.fsf@gitster.siamese.dyndns.org>
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
prev parent reply other threads:[~2008-05-04 19:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 13:39 BUG: "git checkout" displays Q-escaped commit titles Teemu Likonen
2008-05-02 14:05 ` Jeff King
2008-05-04 1:54 ` Junio C Hamano
2008-05-04 19:45 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080504194541.GD13029@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tlikonen@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).