Re: [PATCH] --count feature for git shortlog

2015-07-21 Thread Jakub Narębski
Lawrence Siebert wrote: > On Fri, Jul 3, 2015 at 10:31 AM, Junio C Hamano wrote: >> John Keeping writes: >>> Or even `git rev-list --count HEAD -- "$FILENAME"`. >> >> Ahh, OK. I didn't know we already had "rev-list --count". >> >> Then please disregard the suggestion to add the option to "log";

Re: [PATCH] --count feature for git shortlog

2015-07-03 Thread Lawrence Siebert
On Fri, Jul 3, 2015 at 10:31 AM, Junio C Hamano wrote: > John Keeping writes: > >> On Tue, Jun 30, 2015 at 02:10:49PM +0200, Johannes Schindelin wrote: >>> On 2015-06-29 18:46, Lawrence Siebert wrote: >>> >>> > I appreciate your help. Okay, That all makes sense. >>> > >>> > I would note that some

Re: [PATCH] --count feature for git shortlog

2015-07-03 Thread Junio C Hamano
John Keeping writes: > On Tue, Jun 30, 2015 at 02:10:49PM +0200, Johannes Schindelin wrote: >> On 2015-06-29 18:46, Lawrence Siebert wrote: >> >> > I appreciate your help. Okay, That all makes sense. >> > >> > I would note that something like: >> > git shortlog -s "$FILENAME: | cut -f 1 | pas

Re: [PATCH] --count feature for git shortlog

2015-07-01 Thread Junio C Hamano
Jeff King writes: > Note that this would not work with, say: > > git rev-list --use-bitmap-index --count HEAD -- Makefile > > as the bitmap index does not have enough information to do path limiting > (we should probably disallow this or fall back to the non-bitmap code > path, but right now we

Re: [PATCH] --count feature for git shortlog

2015-07-01 Thread Jeff King
On Tue, Jun 30, 2015 at 08:00:53PM -0700, Lawrence Siebert wrote: > The following doesn't currently run: `git rev-list --count > --use-bitmap-index HEAD` > > This is an optional parameter for rev-list from commit > aa32939fea9c8934b41efce56015732fa12b8247 which can't currently be used > because

Re: [PATCH] --count feature for git shortlog

2015-06-30 Thread Lawrence Siebert
Vincent, I'm ccing you because of --use-bitmap-index John, Johannes, I really appreciate both your thoughts. `git rev-list --count HEAD -- "$FILENAME"` runs noticeably faster then my patch code for `git shortlog --count`, git shortlog -s "$FILENAME" | cut -f 1 | paste -sd+ -|bc, and faster than

Re: [PATCH] --count feature for git shortlog

2015-06-30 Thread John Keeping
On Tue, Jun 30, 2015 at 02:10:49PM +0200, Johannes Schindelin wrote: > On 2015-06-29 18:46, Lawrence Siebert wrote: > > > I appreciate your help. Okay, That all makes sense. > > > > I would note that something like: > > git shortlog -s "$FILENAME: | cut -f 1 | paste -sd+ - | bc > > > > seems l

Re: [PATCH] --count feature for git shortlog

2015-06-30 Thread Johannes Schindelin
Hi Lawrence, On 2015-06-29 18:46, Lawrence Siebert wrote: > I appreciate your help. Okay, That all makes sense. > > I would note that something like: > git shortlog -s "$FILENAME: | cut -f 1 | paste -sd+ - | bc > > seems like it run much faster then: > > git log --oneline "$FILENAME" | wc -

Re: [PATCH] --count feature for git shortlog

2015-06-29 Thread Lawrence Siebert
My apologies, I misunderstood and thought rev-list didn't take filenames. Lawrence Siebert On Mon, Jun 29, 2015 at 10:04 AM, Junio C Hamano wrote: > Lawrence Siebert writes: > >> I was using it to sort files >> by commit count when provided a list of files, which git rev-list >> doesn't really

Re: [PATCH] --count feature for git shortlog

2015-06-29 Thread Junio C Hamano
Lawrence Siebert writes: > I was using it to sort files > by commit count when provided a list of files, which git rev-list > doesn't really work for. What makes you say rev-list does not work (perhaps 'really' is the key word there?) git rev-list --no-merges maint..master -- Makefile g

Re: [PATCH] --count feature for git shortlog

2015-06-29 Thread Lawrence Siebert
Junio, I appreciate your help. Okay, That all makes sense. I would note that something like: git shortlog -s "$FILENAME: | cut -f 1 | paste -sd+ - | bc seems like it run much faster then: git log --oneline "$FILENAME" | wc -l Which was why I was looking at shortlog. I was using it to sort

Re: [PATCH] --count feature for git shortlog

2015-06-28 Thread Junio C Hamano
Lawrence Siebert writes: > This is a new feature for short log, which lets you count commits on a per > file or repository basis easily. > > Currently if you want a total count of commits with shortlog, you would > need to add up each authors commits after using --summary. This adds a > -N / --c

[PATCH] --count feature for git shortlog

2015-06-28 Thread Lawrence Siebert
Signed-off-by: Lawrence Siebert --- t/t4201-shortlog.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 7600a3e..33ecb4a 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -194,4 +194,9 @@ test_expect_success 'shortlog with revis

[PATCH] --count feature for git shortlog

2015-06-28 Thread Lawrence Siebert
--summary is per author --count counts all Signed-off-by: Lawrence Siebert --- builtin/shortlog.c | 14 +- shortlog.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/builtin/shortlog.c b/builtin/shortlog.c index c0bab6a..4b79dc8 100644 --- a/builtin/sh

[PATCH] --count feature for git shortlog

2015-06-28 Thread Lawrence Siebert
This is a new feature for short log, which lets you count commits on a per file or repository basis easily. Currently if you want a total count of commits with shortlog, you would need to add up each authors commits after using --summary. This adds a -N / --count option to shortlog for this purpo