git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nathan Panike" <nathan.panike@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 2/2] Give %as and %cs meaning for pretty format
Date: Thu, 28 Aug 2008 06:09:46 -0500	[thread overview]
Message-ID: <d77df1110808280409t561de23ay49741f7088ed1f58@mail.gmail.com> (raw)

After this patch, if one does, for example

git log -1 --pretty=format:"%as %h" e83c5163316f89bfb

one gets

2005-04-07 e83c516

and if one does

git log -1 --pretty=format:"%cs %h" e83c5163316f89bfb

one gets

2005-04-07 e83c516

Signed-off-by: Nathan W. Panike <nathan.panike@gmail.com>
---
 pretty.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pretty.c b/pretty.c
index 33ef34a..b1319a8 100644
--- a/pretty.c
+++ b/pretty.c
@@ -388,6 +388,9 @@ static size_t format_person_part(struct strbuf
*sb, char part,
        case 'i':       /* date, ISO 8601 */
                strbuf_addstr(sb, show_date(date, tz, DATE_ISO8601));
                return placeholder_len;
+       case 's':       /* date, short */
+               strbuf_addstr(sb, show_date(date, tz, DATE_SHORT));
+               return placeholder_len;
        }

 skip:
-- 
1.6.0.1

                 reply	other threads:[~2008-08-28 11:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=d77df1110808280409t561de23ay49741f7088ed1f58@mail.gmail.com \
    --to=nathan.panike@gmail.com \
    --cc=git@vger.kernel.org \
    /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).