Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT
On Fri, Sep 30, 2016 at 12:56:39PM +0200, SZEDER Gábor wrote: > > Nice. I use date=short in some of my aliases and switching to this is > > nicer. I assume this turns into "%(as)"? > > > > What about documenting this in pretty-formats.txt? > > Here you go :) > > > http://public-inbox.org/git/1444235305-8718-1-git-send-email-sze...@ira.uka.de/ The review on that thread is basically "do we want to add every abbreviation under the sun, or do we want to come up with a better placeholder scheme?". And that has come up several other times (e.g., Ted's recent %gt placeholder). I _do_ think that's the right way forward, but as nobody has been pushing it that way, and these things come up from time to time, maybe we should just accept it and add the ones people want in the interim. It's not like it makes the situation significantly worse, or harder to migrate to %(authordate:short). -Peff
Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT
On Fri, Sep 30, 2016 at 3:56 AM, SZEDER Gábor wrote: >> On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: >> > There's no way to do this short of "%ad" and --date=short, >> > but that limits you to having a single date format in the >> > output. >> > >> > This would possibly be better done with something more like >> > "%ad(short)". >> > >> > Signed-off-by: Jeff King >> > --- >> > pretty.c | 3 +++ >> > 1 file changed, 3 insertions(+) >> > >> > diff --git a/pretty.c b/pretty.c >> > index 493edb0..c532c17 100644 >> > --- a/pretty.c >> > +++ b/pretty.c >> > @@ -727,6 +727,9 @@ static size_t format_person_part(struct strbuf *sb, >> > char part, >> > case 'I': /* date, ISO 8601 strict */ >> > strbuf_addstr(sb, show_ident_date(&s, >> > DATE_MODE(ISO8601_STRICT))); >> > return placeholder_len; >> > + case 's': >> > + strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT))); >> > + return placeholder_len; >> > } >> > >> > skip: >> > -- >> > 2.10.0.566.g5365f87 >> > >> >> Nice. I use date=short in some of my aliases and switching to this is >> nicer. I assume this turns into "%(as)"? >> >> What about documenting this in pretty-formats.txt? > > Here you go :) > > > http://public-inbox.org/git/1444235305-8718-1-git-send-email-sze...@ira.uka.de/ > Nice, thanks! Regards, Jake
Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT
> On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: > > There's no way to do this short of "%ad" and --date=short, > > but that limits you to having a single date format in the > > output. > > > > This would possibly be better done with something more like > > "%ad(short)". > > > > Signed-off-by: Jeff King > > --- > > pretty.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/pretty.c b/pretty.c > > index 493edb0..c532c17 100644 > > --- a/pretty.c > > +++ b/pretty.c > > @@ -727,6 +727,9 @@ static size_t format_person_part(struct strbuf *sb, > > char part, > > case 'I': /* date, ISO 8601 strict */ > > strbuf_addstr(sb, show_ident_date(&s, > > DATE_MODE(ISO8601_STRICT))); > > return placeholder_len; > > + case 's': > > + strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT))); > > + return placeholder_len; > > } > > > > skip: > > -- > > 2.10.0.566.g5365f87 > > > > Nice. I use date=short in some of my aliases and switching to this is > nicer. I assume this turns into "%(as)"? > > What about documenting this in pretty-formats.txt? Here you go :) http://public-inbox.org/git/1444235305-8718-1-git-send-email-sze...@ira.uka.de/
Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT
On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: > There's no way to do this short of "%ad" and --date=short, > but that limits you to having a single date format in the > output. > > This would possibly be better done with something more like > "%ad(short)". > > Signed-off-by: Jeff King > --- > pretty.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/pretty.c b/pretty.c > index 493edb0..c532c17 100644 > --- a/pretty.c > +++ b/pretty.c > @@ -727,6 +727,9 @@ static size_t format_person_part(struct strbuf *sb, char > part, > case 'I': /* date, ISO 8601 strict */ > strbuf_addstr(sb, show_ident_date(&s, > DATE_MODE(ISO8601_STRICT))); > return placeholder_len; > + case 's': > + strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT))); > + return placeholder_len; > } > > skip: > -- > 2.10.0.566.g5365f87 > Nice. I use date=short in some of my aliases and switching to this is nicer. I assume this turns into "%(as)"? What about documenting this in pretty-formats.txt? Thanks, Jake
[PATCH 1/5] pretty: allow formatting DATE_SHORT
There's no way to do this short of "%ad" and --date=short, but that limits you to having a single date format in the output. This would possibly be better done with something more like "%ad(short)". Signed-off-by: Jeff King --- pretty.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pretty.c b/pretty.c index 493edb0..c532c17 100644 --- a/pretty.c +++ b/pretty.c @@ -727,6 +727,9 @@ static size_t format_person_part(struct strbuf *sb, char part, case 'I': /* date, ISO 8601 strict */ strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(ISO8601_STRICT))); return placeholder_len; + case 's': + strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT))); + return placeholder_len; } skip: -- 2.10.0.566.g5365f87