git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Give %as and %cs meaning for pretty format

From
Nathan Panike <nathan.panike@gmail.com>
Date
Aug 28, 2008, 11:09 UTC
Message-ID
<d77df1110808280409t561de23ay49741f7088ed1f58@mail.gmail.com>
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
Message 1 of 1 in “Give %as and %cs meaning for pretty format”
  1. 2/2 Give %as and %cs meaning for pretty formatNathan Panike, Aug 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.