git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] shortlog: prompt when reading from terminal by mistake

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 8, 2007, 17:10 UTC
Message-ID
<Pine.LNX.4.63.0703081755500.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<Pine.LNX.4.64.0703080827170.10832@woody.linux-foundation.org>
Hi,
On Thu, 8 Mar 2007, Linus Torvalds wrote:
Show 12 quoted lines
> On Thu, 8 Mar 2007, Junio C Hamano wrote:
> > 
> > Not so.  "git shortlog" acts as a filter when no revs are given, 
> > unlike "git log" which defaults to HEAD.  It was reading from its 
> > standard input.
> 
> Could we just change that?
>
> [...]
> 
> Yeah, as a filter it *can* stil lbe useful, of course, but I suspect the 
> usefullness is limited.
How about something totally different: "git log --shortlog". I.e.
diff --git a/builtin-log.c b/builtin-log.c
index 865832c..ad1dafd 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -216,7 +216,11 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
 int cmd_log(int argc, const char **argv, const char *prefix)
 {
 	struct rev_info rev;
+	int i;
 
+	for (i = 1; i < argc; i++)
+		if (!strcmp(argv[i], "--shortlog"))
+			return cmd_shortlog(argc, argv, prefix);
 	git_config(git_log_config);
 	init_revisions(&rev, prefix);
 	rev.always_show_header = 1;
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 29b1636..952a475 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -289,7 +289,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 			summary = 1;
 		else if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))
 			usage(shortlog_usage);
-		else
+		else if (strcmp(argv[1], "--shortlog"))
 			break;
 		argv++;
 		argc--;

Ciao,
Dscho
Previous: Linus TorvaldsNext: Matthieu Moy
Message 11 of 17 in “shortlog: prompt when reading from terminal by mistake”
  1. shortlog: prompt when reading from terminal by mistakeJunio C Hamano, Mar 8, 2007
  2. Johannes SchindelinMar 8, 2007
  3. Shawn O. PearceMar 8, 2007
  4. Alex RiesenMar 8, 2007
  5. Shawn O. PearceMar 9, 2007
  6. Alex RiesenMar 9, 2007
  7. Shawn O. PearceMar 9, 2007
  8. Johannes SchindelinMar 8, 2007
  9. Shawn O. PearceMar 9, 2007
  10. Linus TorvaldsMar 8, 2007
  11. Johannes SchindelinMar 8, 2007
  12. Matthieu MoyMar 8, 2007
  13. Johannes SchindelinMar 8, 2007
  14. Linus TorvaldsMar 8, 2007
  15. Johannes SchindelinMar 8, 2007
  16. Jakub NarebskiMar 9, 2007
  17. Junio C HamanoMar 10, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.