Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-29 Thread Nguyen Thai Ngoc Duy
On Sat, Sep 29, 2012 at 12:54 PM, Junio C Hamano gits...@pobox.com wrote: I like how callers not doing a reflog walk do not have to pay the price to do the extra allocating. We could further limit it to only when --grep-reflog is in effect, but I guess that would mean wading through

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-29 Thread Jeff King
On Fri, Sep 28, 2012 at 10:54:29PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: + if (opt-reflog_info) { + strbuf_addstr(buf, reflog ); + get_reflog_message(buf, opt-reflog_info); + strbuf_addch(buf, '\n'); + strbuf_addstr(buf,

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-29 Thread Junio C Hamano
Nguyen Thai Ngoc Duy pclo...@gmail.com writes: reflog, in terms of both the number of commits and message length, is usually short enough that slowdown does not really show, especially when used with git-log, an interactive command. You shouldn't do things you can easily tell you do not need

[PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Nguyễn Thái Ngọc Duy
Similar to --author/--committer which filters commits by author and committer header fields. --grep-reflog adds a fake reflog header to commit and a grep filter to search on that line. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- On Fri, Sep 28, 2012 at 12:09 AM, Junio C Hamano

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Nguyễn Thái Ngọc Duy
On Sat, Sep 29, 2012 at 12:55 AM, Junio C Hamano gits...@pobox.com wrote: For that to happen, the code _must_ know what kind of headers we would support; discarding the existing enum is going in a wrong direction. Or what kind of manipulation is required for a header. The caller can decide if

[PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Nguyễn Thái Ngọc Duy
Similar to --author/--committer which filters commits by author and committer header fields. --grep-reflog adds a fake reflog header to commit and a grep filter to search on that line. All rules to --author/--committer apply except no timestamp stripping. Signed-off-by: Nguyễn Thái Ngọc Duy

Re: [PATCH 2/3] revision: add --grep-reflog to filter commits by reflog messages

2012-09-28 Thread Junio C Hamano
Jeff King p...@peff.net writes: +if (opt-reflog_info) { +strbuf_addstr(buf, reflog ); +get_reflog_message(buf, opt-reflog_info); +strbuf_addch(buf, '\n'); +strbuf_addstr(buf, commit-buffer); +} +if (buf.len) +retval =