From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [RFC/PATCH] revision.c: add --format option for 'git log' Date: Sun, 22 Feb 2009 08:49:40 -0800 Message-ID: <7vtz6m1knv.fsf@gitster.siamese.dyndns.org> References: <1235230015-17641-1-git-send-email-felipe.contreras@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org To: Felipe Contreras X-From: git-owner@vger.kernel.org Sun Feb 22 17:51:15 2009 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1LbHXr-0004uL-KO for gcvg-git-2@gmane.org; Sun, 22 Feb 2009 17:51:12 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754167AbZBVQts (ORCPT ); Sun, 22 Feb 2009 11:49:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754152AbZBVQtr (ORCPT ); Sun, 22 Feb 2009 11:49:47 -0500 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:58062 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754150AbZBVQtq (ORCPT ); Sun, 22 Feb 2009 11:49:46 -0500 Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 6354F9CAE1; Sun, 22 Feb 2009 11:49:45 -0500 (EST) Received: from pobox.com (unknown [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 59BE59CAE0; Sun, 22 Feb 2009 11:49:42 -0500 (EST) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: CF18F3E8-0100-11DE-BAEE-B26E209B64D9-77302942!a-sasl-fastnet.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Felipe Contreras writes: > --format=:foo is a shorthand for --pretty=tformat:foo, otherwise this > new option acts just like --pretty=foo, except it's more intuitive for > users of 'git log'. It's been quite a long time since the earlier discussion, but I wonder why you need the colon before "foo" for this new shorthand. I *think* you are also introducing "--format=short" as a synonym to "--pretty=short", but I do not think it is necessary. > As discussed in the mailing list, this is implemented as an undocumented > option. Maybe somebody wants to document it. Needs trivial tests. > + } else if (!prefixcmp(arg, "--format=")) { > + char *modified = NULL; > + revs->verbose_header = 1; > + if (arg[9] == ':') { > + modified = xmalloc(strlen(arg+9) + 7 + 1); > + strcpy(modified, "tformat"); > + strcat(modified, arg+9); > + } > + get_commit_format(modified ? modified : arg+9, revs); > + free(modified); struct strbuf fmt = STRBUF_INIT; revs->verbose_header = 1; strbuf_addf(&fmt, "tformat:%s", arg + 9); get_commit_format(fmt.buf, revs); strbuf_release(&fmt); > } else if (!strcmp(arg, "--graph")) { > revs->topo_order = 1; > revs->rewrite_parents = 1; > -- > 1.6.1.3