Re: Git log of all (modifying) commands run on a repo?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: <git@...>
Date: Wednesday, February 7, 2007 - 8:26 pm

Linus Torvalds writes:

> With "--pretty=oneline --abbrev-commit" I'll agree that it's actually

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");

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Git log of all (modifying) commands run on a repo?, Linus Torvalds, (Wed Feb 7, 6:49 pm)
Re: Git log of all (modifying) commands run on a repo?, Linus Torvalds, (Wed Feb 7, 7:02 pm)
Re: Git log of all (modifying) commands run on a repo?, Linus Torvalds, (Wed Feb 7, 7:29 pm)
Re: Git log of all (modifying) commands run on a repo?, Shawn O. Pearce, (Wed Feb 7, 6:57 pm)
Re: Git log of all (modifying) commands run on a repo?, Junio C Hamano, (Wed Feb 7, 6:56 pm)
Re: Git log of all (modifying) commands run on a repo?, Linus Torvalds, (Wed Feb 7, 7:26 pm)
Re: Git log of all (modifying) commands run on a repo?, Junio C Hamano, (Wed Feb 7, 7:36 pm)
Re: Git log of all (modifying) commands run on a repo?, Linus Torvalds, (Wed Feb 7, 7:46 pm)
Re: Git log of all (modifying) commands run on a repo?, Junio C Hamano, (Wed Feb 7, 8:26 pm)
Re: Git log of all (modifying) commands run on a repo?, Johannes Schindelin, (Wed Feb 7, 8:41 pm)
Re: Git log of all (modifying) commands run on a repo?, Junio C Hamano, (Wed Feb 7, 8:50 pm)
Re: Git log of all (modifying) commands run on a repo?, Linus Torvalds, (Thu Feb 8, 1:51 pm)
Re: Git log of all (modifying) commands run on a repo?, Johannes Schindelin, (Thu Feb 8, 2:36 pm)
Re: Git log of all (modifying) commands run on a repo?, Johannes Schindelin, (Wed Feb 7, 8:56 pm)
Re: Git log of all (modifying) commands run on a repo?, Johannes Schindelin, (Wed Feb 7, 7:59 pm)
Re: Git log of all (modifying) commands run on a repo?, Shawn O. Pearce, (Wed Feb 7, 8:05 pm)
Re: Git log of all (modifying) commands run on a repo?, Shawn O. Pearce, (Wed Feb 7, 7:03 pm)