summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb13227)
raw | patch | inline | side by side (parent: fb13227)
author | Marco Costalba <mcostalba@gmail.com> | |
Fri, 20 Jul 2007 18:15:13 +0000 (20:15 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 14 Aug 2007 08:59:33 +0000 (01:59 -0700) |
With this option git-log prints log message size
just before the corresponding message.
Porcelain tools could use this to speedup parsing
of git-log output.
Note that size refers to log message only. If also
patch content is shown its size is not included.
In case it is not possible to know the size upfront
size value is set to zero.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
just before the corresponding message.
Porcelain tools could use this to speedup parsing
of git-log output.
Note that size refers to log message only. If also
patch content is shown its size is not included.
In case it is not possible to know the size upfront
size value is set to zero.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-log.txt | patch | blob | history | |
log-tree.c | patch | blob | history | |
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
index 63c1dbe812e6078870569c0b8d03ff021e4b56a3..5a90f65b5e9d9ce21bcd0c936a01ded5065d5868 100644 (file)
--follow::
Continue listing the history of a file beyond renames.
+--log-size::
+ Before the log message print out its size in bytes. Intended
+ mainly for porcelain tools consumption. If git is unable to
+ produce a valid value size is set to zero.
+ Note that only message is considered, if also a diff is shown
+ its size is not included.
+
<paths>...::
Show only commits that affect the specified paths.
diff --git a/log-tree.c b/log-tree.c
index 8624d5a39ca3119fe7c4204a2c3b1f272a4b609d..a6423718e76be34e62bc76dcf3c93b32e38aa152 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
if (opt->add_signoff)
len = append_signoff(&msgbuf, &msgbuf_len, len,
opt->add_signoff);
+ if (opt->show_log_size)
+ printf("log size %i\n", len);
+
printf("%s%s%s", msgbuf, extra, sep);
free(msgbuf);
}
diff --git a/revision.c b/revision.c
index 038693caba69a9274b632510c9ee8a14a87b6eee..7d32a89b0eca858113829e9219e80ff15e66e953 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -1150,6 +1150,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
die("unknown date format %s", arg);
continue;
}
+ if (!strcmp(arg, "--log-size")) {
+ revs->show_log_size = 1;
+ continue;
+ }
/*
* Grepping the commit log
diff --git a/revision.h b/revision.h
index f46b4d55a2c75e201b37dda8edd6d353722a96cb..98a0a8f3fa9db4b2302dd31a4867ae824831b25c 100644 (file)
--- a/revision.h
+++ b/revision.h
const char *log_reencode;
const char *subject_prefix;
int no_inline;
+ int show_log_size;
/* Filter by commit log message */
struct grep_opt *grep_filter;