[PATCH v4 4/7] pretty: allow showing specific trailers

2018-12-08 Thread Anders Waldenborg
Adds a new "key=X" option to "%(trailers)" which will cause it to only print trailer lines which match any of the specified keys. Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 8 + pretty.c | 47 ++

[PATCH v4 3/7] pretty: single return path in %(trailers) handling

2018-12-08 Thread Anders Waldenborg
No functional change intended. This change may not seem useful on its own, but upcoming commits will do memory allocation in there, and a single return path makes deallocation easier. Signed-off-by: Anders Waldenborg --- pretty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v4 0/7] %(trailers) improvements in pretty format

2018-12-08 Thread Anders Waldenborg
Updated since v3: * multiple 'key=' matches any * allow overriding implicit 'only' when using key * minor grammar and spelling fixes * documentation restructuring * Helper functions for parsing options Anders Waldenborg (7): doc: group pretty-format.txt placeholders descriptions pretty

[PATCH v4 6/7] strbuf: separate callback for strbuf_expand:ing literals

2018-12-08 Thread Anders Waldenborg
Expanding '%n' and '%xNN' is generic functionality, so extract that from the pretty.c formatter into a callback that can be reused. No functional change intended Signed-off-by: Anders Waldenborg --- pretty.c | 16 +--- strbuf.c | 21 + strbuf.h | 8 3

[PATCH v4 5/7] pretty: add support for "valueonly" option in %(trailers)

2018-12-08 Thread Anders Waldenborg
ilers:key=Signed-off-by,valueonly)' 88182 will show: > upload-pack: fix broken if/else chain in config callback > Jeff King > Junio C Hamano Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 2 ++ pretty.c | 3 ++- t/t4205-log-pretty-format

[PATCH v4 1/7] doc: group pretty-format.txt placeholders descriptions

2018-12-08 Thread Anders Waldenborg
The placeholders can be grouped into three kinds: * literals * affecting formatting of later placeholders * expanding to information in commit Also change the list to a definition list (using '::') Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 235

[PATCH v4 2/7] pretty: allow %(trailers) options with explicit value

2018-12-08 Thread Anders Waldenborg
to override defaults from future options. Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 14 ++ pretty.c | 32 +++- t/t4205-log-pretty-formats.sh| 18 ++ 3 files changed, 55 insertions(+), 9

[PATCH v4 7/7] pretty: add support for separator option in %(trailers)

2018-12-08 Thread Anders Waldenborg
allowing it to be things that are otherwise hard to type such as %x00, or comma and end-parenthesis which would break parsing. E.g: $ git log --pretty='%(trailers:key=Reviewed-by,valueonly,separator=%x00)' Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 9

Re: [PATCH v3 2/5] pretty: allow showing specific trailers

2018-11-25 Thread Anders Waldenborg
Junio C Hamano writes: > I was confused by the "only" stuff. > > When you give a key (or two), they cannot possibly name non-trailer > lines, so while it may be possible to ask "oh, by the way, I also > want non-trailer lines in addition to signed-off-by and cc lines", > the value of being able

Re: [PATCH v3 2/5] pretty: allow showing specific trailers

2018-11-25 Thread Anders Waldenborg
Junio C Hamano writes: > Also, use of 'key=' automatically turns on 'only' as described, and > I tend to agree that it would a convenient default mode (i.e. when > picking certain trailers only with this mechanism, it is likely that > the user is willing to use %(subject) etc. to fill in what

[PATCH v3 0/5] %(trailers) improvements in pretty format

2018-11-18 Thread Anders Waldenborg
s * Rename function to strbuf_expand_literal_cb * cocci suggested fixes Anders Waldenborg (5): pretty: single return path in %(trailers) handling pretty: allow showing specific trailers pretty: add support for "valueonly" option in %(trailers) strbuf: separate callback for strbuf_expand:ing

[PATCH v3 1/5] pretty: single return path in %(trailers) handling

2018-11-18 Thread Anders Waldenborg
No functional change intended. This change may not seem useful on its own, but upcoming commits will do memory allocation in there, and a single return path makes deallocation easier. Signed-off-by: Anders Waldenborg --- pretty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v3 4/5] strbuf: separate callback for strbuf_expand:ing literals

2018-11-18 Thread Anders Waldenborg
Expanding '%n' and '%xNN' is generic functionality, so extract that from the pretty.c formatter into a callback that can be reused. No functional change intended Signed-off-by: Anders Waldenborg --- pretty.c | 16 +--- strbuf.c | 21 + strbuf.h | 8 3

[PATCH v3 5/5] pretty: add support for separator option in %(trailers)

2018-11-18 Thread Anders Waldenborg
allowing it to be things that are otherwise hard to type as %x00, or comma and end-parenthesis which would break parsing. E.g: $ git log --pretty='%(trailers:key=Reviewed-by,valueonly,separator=%x00)' Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 13 +--- pretty.c

[PATCH v3 3/5] pretty: add support for "valueonly" option in %(trailers)

2018-11-18 Thread Anders Waldenborg
ilers:key=Signed-off-by,valueonly)' 88182 will show: > upload-pack: fix broken if/else chain in config callback > Jeff King > Junio C Hamano Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 2 ++ pretty.c | 2 ++ t/t4205-log-pretty-format

[PATCH v3 2/5] pretty: allow showing specific trailers

2018-11-18 Thread Anders Waldenborg
Adds a new "key=X" option to "%(trailers)" which will cause it to only print trailers lines which match the specified key. Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 17 +-- pretty.c | 31

Re: [PATCH v2 5/5] pretty: add support for separator option in %(trailers)

2018-11-05 Thread Anders Waldenborg
Junio C Hamano writes: > Anders Waldenborg writes: > >> @@ -1352,6 +1353,17 @@ static size_t format_commit_one(struct strbuf *sb, /* >> in UTF-8 */ >> arg++; >> >>

Re: [PATCH v2 4/5] pretty: extract fundamental placeholders to separate function

2018-11-05 Thread Anders Waldenborg
Junio C Hamano writes: > I do not think "fundamental" is the best name for this, but I agree > that it would be useful to split the helpers into one that is > "constant across commits" and the other one that is "per commit". Any suggestions for a better name? standalone? simple? invariant?

Re: [PATCH v2 2/5] pretty: allow showing specific trailers

2018-11-05 Thread Anders Waldenborg
Eric Sunshine writes: > Should the code tolerate a trailing colon? (Genuine question; it's > easy to do and would be more user-friendly.) I would make sense to allow the trailing colon, it is easy enough to just strip that away when reading the argument. However I'm not sure how that would fit

Re: [PATCH v2 0/5] %(trailers) improvements in pretty format

2018-11-04 Thread Anders Waldenborg
Eric Sunshine writes: > If "key" is for including particular trailers, intuition might lead > people to think that "nokey" is for excluding certain trailers. > Perhaps a different name for "nokey", such as "valueonly" or > "stripkey", would be better. Good point. I guess "valueonly" would be

[PATCH v2 3/5] pretty: add support for "nokey" option in %(trailers)

2018-11-04 Thread Anders Waldenborg
ilers:key=Signed-off-by,nokey)' 88182 will show: > upload-pack: fix broken if/else chain in config callback > Jeff King > Junio C Hamano Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 11 ++- pretty.c | 2 ++ t/t4205-

[PATCH v2 2/5] pretty: allow showing specific trailers

2018-11-04 Thread Anders Waldenborg
Adds a new "key=X" option to "%(trailers)" which will cause it to only print trailers lines which matches the specified key. Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 13 + pretty.c | 15 ++- t/t4205-l

[PATCH v2 4/5] pretty: extract fundamental placeholders to separate function

2018-11-04 Thread Anders Waldenborg
No functional change intended Signed-off-by: Anders Waldenborg --- pretty.c | 37 ++--- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/pretty.c b/pretty.c index f87ba4f18..9fdddce9d 100644 --- a/pretty.c +++ b/pretty.c @@ -1074,6 +1074,27

[PATCH v2 5/5] pretty: add support for separator option in %(trailers)

2018-11-04 Thread Anders Waldenborg
allowing it to be things that are otherwise hard to type as %x00, or command and end-parenthesis which would break parsing. E.g: $ git log --pretty='%(trailers:key=Reviewed-by,nokey,separator=%x00)' Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 13

[PATCH v2 1/5] pretty: single return path in %(trailers) handling

2018-11-04 Thread Anders Waldenborg
No functional change intended. This change may not seem useful on its own, but upcoming commits will do memory allocation in there, and a single return path makes deallocation easier. Signed-off-by: Anders Waldenborg --- pretty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v2 0/5] %(trailers) improvements in pretty format

2018-11-04 Thread Anders Waldenborg
This adds support for three new options to %(trailers): * key -- show only trailers with specified key * nokey -- don't show key part of trailers * separator -- allow specifying custom separator between trailers Anders Waldenborg (5): pretty: single return path in %(trailers) handling

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-31 Thread Anders Waldenborg
Jeff King writes: > On the other hand, if the rule were not "this affects the next > placeholder" but had a true ending mark, then we could make a real > parse-tree out of it, and format chunks of placeholders. E.g.: > > %(format:lpad=30,filename)%(subject) %(authordate)%(end) > > would pad

Re: [PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-29 Thread Anders Waldenborg
On Mon, Oct 29, 2018 at 3:14 PM Jeff King wrote: > Junio's review already covered my biggest question, which is why not > something like "%(trailers:key=ticket)". And likewise making things like > comma-separation options. Jeff, Junio, thanks! Your questions pretty much matches what I (and a

[PATCH] pretty: Add %(trailer:X) to display single trailer

2018-10-28 Thread Anders Waldenborg
ood commit > > Ticket: XYZ-123 running: $ git log --pretty="%H %s% (trailer:Ticket)" will give: > 123456789a Some good commit (Ticket: XYZ-123) Signed-off-by: Anders Waldenborg --- Documentation/pretty-formats.txt | 4 pretty.c | 16

Re: [PATCH] diff: Add diff.orderfile configuration variable

2013-10-25 Thread Anders Waldenborg
(Jonathan, sorry if you got this multiple times, it seems I forgot to Cc list) On Mon, Oct 21, 2013 at 8:40 PM, Jonathan Nieder jrnie...@gmail.com wrote: Should the git-diff(1) manpage get a note about this setting as well (perhaps in a new CONFIGURATION section)? I'll add a reference to the

[PATCH] diff: Add diff.orderfile configuration variable

2013-10-21 Thread Anders Waldenborg
diff.orderfile acts as a default for the -O command line option. Signed-off-by: Anders Waldenborg and...@0x63.nu --- Documentation/diff-config.txt | 4 +++ diff.c| 5 +++ t/t4056-diff-order.sh | 74 +++ 3 files changed