All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Will Palmer <wmpalmer@gmail.com>, git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit]
Date: Sun, 25 Apr 2010 22:38:13 -0500	[thread overview]
Message-ID: <20100426033813.GA30544@progeny.tock> (raw)
In-Reply-To: <20100426033147.GB14421@coredump.intra.peff.net>

Jeff King wrote:
> On Sun, Apr 25, 2010 at 10:11:37PM -0500, Jonathan Nieder wrote:
>
>> Here’s an alternative implementation of the more controversial half of
>> your patch, for your amusement.  The big downside is that it requires
>> one to specify --abbrev-commit before the --format option.
>
> That is not insurmountable, as we could just check after the parsing
> stage. But there is a worse problem:
>
>> +static void abbreviate_commit_hashes(char *fmt)
>> +{
>> +	char *p;
>> +	for (p = fmt; p != NULL; p = strchr(p + 1, '%')) {
>> +		p++;
>> +		switch (*p) {
>> +		case 'H':
>> +			*p = 'h';
>> +			break;
>> +		case 'P':
>> +			*p = 'p';
>> +			break;
>> +		case 'T':
>> +		default:
>> +			break;
>> +		}
>> +	}
>> +}
>
> You parse '%%H' incorrectly.

I’m pretty sure I don’t.

> I would really rather not see ad-hoc
> parsers for the format like this, but rather use or extend strbuf_expand
> as appropriate. That would make things less painful if and when we
> decide to tweak the syntax.

However, this point still applies.

Jonathan

  reply	other threads:[~2010-04-26  3:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 21:56 [PATCH v2 0/3] pretty: format aliases Will Palmer
2010-04-25 21:56 ` [PATCH v2 1/3] pretty: add conditional %C?colorname placeholders Will Palmer
2010-04-25 21:56   ` [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit] Will Palmer
2010-04-25 21:56     ` [PATCH v2 3/3] pretty: add aliases for pretty formats Will Palmer
2010-04-26  7:25       ` Jonathan Nieder
2010-04-26  8:15         ` Will Palmer
2010-04-26 22:11         ` Will Palmer
2010-04-26  3:11     ` [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit] Jonathan Nieder
2010-04-26  3:31       ` Jeff King
2010-04-26  3:38         ` Jonathan Nieder [this message]
2010-04-26  3:41           ` Jonathan Nieder
2010-04-26  3:45             ` Jeff King
2010-04-26  3:42           ` Jeff King
2010-04-26  7:47       ` Will Palmer
2010-04-26  9:53         ` Jonathan Nieder
2010-04-26  9:58           ` [PATCH 1/4] t4201 (shortlog): guard setup with test_expect_success Jonathan Nieder
2010-04-26  9:59           ` [PATCH 2/4] t4201 (shortlog): Test output format with multiple authors Jonathan Nieder
2010-04-26  9:59           ` [PATCH 3/4] shortlog: Document and test --format option Jonathan Nieder
2010-04-26 10:00           ` [PATCH 4/4] pretty: Respect --abbrev option Jonathan Nieder
2010-04-26 10:13           ` [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit] Will Palmer
2010-04-26 10:19             ` Jonathan Nieder
2010-04-26 10:23               ` Will Palmer
2010-04-26 10:28                 ` Jonathan Nieder
2010-04-26  2:13   ` [PATCH v2 1/3] pretty: add conditional %C?colorname placeholders Jonathan Nieder
2010-04-26  3:26     ` Jeff King
2010-04-26  4:14       ` Jonathan Nieder
2010-04-26 14:28         ` Jeff King

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=20100426033813.GA30544@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=wmpalmer@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.