git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git shortlog: need a range!
@ 2006-11-28 20:20 Junio C Hamano
  2006-11-28 21:49 ` [PATCH] shortlog: remove range check René Scharfe
  2006-11-29  9:38 ` [BUG] git shortlog: need a range! Johannes Schindelin
  0 siblings, 2 replies; 3+ messages in thread
From: Junio C Hamano @ 2006-11-28 20:20 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

I just got this:

        $ git shortlog --since=Oct.20 --until=Nov.20 master
        fatal: Need a range!

Why isn't this a range?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] shortlog: remove range check
  2006-11-28 20:20 [BUG] git shortlog: need a range! Junio C Hamano
@ 2006-11-28 21:49 ` René Scharfe
  2006-11-29  9:38 ` [BUG] git shortlog: need a range! Johannes Schindelin
  1 sibling, 0 replies; 3+ messages in thread
From: René Scharfe @ 2006-11-28 21:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, git

Don't force the user to specify more than one revision parameter,
thus making git-shortlog behave more like git-log.
'git-shortlog master' will now produce the expected results; the
other end of the range simply is the (oldest) root commit.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>

diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index b5b13de..f1124e2 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -298,9 +298,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 	if (!access(".mailmap", R_OK))
 		read_mailmap(".mailmap");
 
-	if (rev.pending.nr == 1)
-		die ("Need a range!");
-	else if (rev.pending.nr == 0)
+	if (rev.pending.nr == 0)
 		read_from_stdin(&list);
 	else

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [BUG] git shortlog: need a range!
  2006-11-28 20:20 [BUG] git shortlog: need a range! Junio C Hamano
  2006-11-28 21:49 ` [PATCH] shortlog: remove range check René Scharfe
@ 2006-11-29  9:38 ` Johannes Schindelin
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2006-11-29  9:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 667 bytes --]

Hi,

On Tue, 28 Nov 2006, Junio C Hamano wrote:

> I just got this:
> 
>         $ git shortlog --since=Oct.20 --until=Nov.20 master
>         fatal: Need a range!
> 
> Why isn't this a range?

It really is not. Think about this scenario:

A - B - C
  \   /
    D

where both B and D were done after Oct.20, but not A. Then you do not have 
a range, i.e. you cannot represent the same in the form X..Y.

However, this only shows that my reasoning in shortlog was wrong. It was 
meant to prevent accidentally traversing the _whole_ history (which does 
take some time), but maybe even this is something people want to do?

Therefore: Ack on René's patch.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-29  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28 20:20 [BUG] git shortlog: need a range! Junio C Hamano
2006-11-28 21:49 ` [PATCH] shortlog: remove range check René Scharfe
2006-11-29  9:38 ` [BUG] git shortlog: need a range! Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).