git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: Git log of all (modifying) commands run on a repo?
Date: Wed, 07 Feb 2007 16:26:46 -0800	[thread overview]
Message-ID: <7v8xf94hq1.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0702071539390.8424@woody.linux-foundation.org> (Linus Torvalds's message of "Wed, 7 Feb 2007 15:46:32 -0800 (PST)")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> With "--pretty=oneline --abbrev-commit" I'll agree that it's actually 
> fairly pretty.
>
> Maybe we can make "-g" default to that? As it is, I'd otherwise still use 
> "less" just because there is less typing...
>
> 			Linus

Well, you would not know if the user gave you '-g' before you
ask setup_revisions() to parse the options, and once you let it
do its thing, you would not know if it also found an explicit
output format given by the end user, so your cannot sanely make
default depend on '-g'.

I suspect that it would have to be either somewhat involved or
outright hacky.  

---

 builtin-log.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 982d871..0221c76 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -22,8 +22,21 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 {
 	int i;
 
-	rev->abbrev = DEFAULT_ABBREV;
 	rev->commit_format = CMIT_FMT_DEFAULT;
+	if (!strcmp(argv[0], "log")) {
+		/* first see if there is "-g" */
+		for (i = 1; i < argc; i++) {
+			if (!strcmp("--", argv[i]))
+				break;
+			if (!strcmp("-g", argv[i]) ||
+			    !strcmp("--walk-reflogs", argv[i])) {
+				rev->abbrev_commit = 1;
+				rev->commit_format = CMIT_FMT_ONELINE;
+				break;
+			}
+		}
+	}
+	rev->abbrev = DEFAULT_ABBREV;
 	rev->verbose_header = 1;
 	rev->show_root_diff = default_show_root;
 	argc = setup_revisions(argc, argv, rev, "HEAD");

  parent reply	other threads:[~2007-02-08  0:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 22:15 Git log of all (modifying) commands run on a repo? Bill Lear
2007-02-07 22:29 ` Jakub Narebski
2007-02-07 22:39   ` Bill Lear
2007-02-07 22:59     ` Jakub Narebski
2007-02-07 22:49 ` Linus Torvalds
2007-02-07 22:56   ` Junio C Hamano
2007-02-07 23:03     ` Shawn O. Pearce
2007-02-07 23:26     ` Linus Torvalds
2007-02-07 23:36       ` Junio C Hamano
2007-02-07 23:46         ` Linus Torvalds
2007-02-07 23:53           ` Jakub Narebski
2007-02-07 23:59           ` Johannes Schindelin
2007-02-08  0:05             ` Shawn O. Pearce
2007-02-08  0:26           ` Junio C Hamano [this message]
2007-02-08  0:41             ` Johannes Schindelin
2007-02-08  0:50               ` Junio C Hamano
2007-02-08  0:56                 ` Johannes Schindelin
2007-02-08 17:51                 ` Linus Torvalds
2007-02-08 18:36                   ` Johannes Schindelin
2007-02-07 22:57   ` Shawn O. Pearce
2007-02-07 23:00   ` Bill Lear
2007-02-07 23:29     ` Linus Torvalds
2007-02-07 23:31       ` Bill Lear
2007-02-07 23:02   ` Linus Torvalds
2007-02-08  8:26   ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v8xf94hq1.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).