From: Michael Andreen <harv@ruin.nu>
To: gitster@pobox.com
Cc: git@vger.kernel.org
Subject: [PATCH] Make XDF_NEED_MINIMAL default in blame.
Date: Thu, 20 Mar 2014 21:18:58 +0100 [thread overview]
Message-ID: <6555655.XSJ9EnW4BY@mako> (raw)
Currently git blame has a big problem finding copies and moves when you
split up a big file into smaller ones. One example in the git repository
is 2cf565c, which split the documentation into smaller files.
In 582aa00 XDF_NEED_MINIMAL was removed as the default for performance
reasons, mainly for diff and rebase, but blame was also changed.
In 059a500 the problem with blame was noticed and the flag --minimal was
introduced. However this flag is not documented and it is not possible
to set when using "git gui blame".
Setting XDF_NEED_MINIMAL as default has a small performance impact when
you run on a file with few modifications. However, if you run it on a
file with a bigger number of modifications, the performance impact is
small enough to not be noticable.
The previous behavior can still be activated with --no-minimal.
((2cf565c...))$ time PAGER=cat git blame -C -M
Documentation/git-ls-files.txt > /dev/null
real 0m0.003s
user 0m0.002s
sys 0m0.000s
((2cf565c...))$ time PAGER=cat git blame --minimal -C -M
Documentation/git-ls-files.txt > /dev/null
real 0m0.010s
user 0m0.009s
sys 0m0.000s
((2cf565c...))$ time PAGER=cat git blame -C -C -C -M
Documentation/git-ls-files.txt > /dev/null
real 0m0.010s
user 0m0.010s
sys 0m0.000s
((2cf565c...))$ time PAGER=cat git blame --minimal -C -C -C -M
Documentation/git-ls-files.txt > /dev/null
real 0m0.028s
user 0m0.027s
sys 0m0.000s
(master)$ time PAGER=cat git blame -C -C -C -M
Documentation/git-ls-files.txt > /dev/null
real 0m2.338s
user 0m2.283s
sys 0m0.056s
(master)$ time PAGER=cat git blame --minimal -C -C -C -M
Documentation/git-ls-files.txt > /dev/null
real 0m2.355s
user 0m2.285s
sys 0m0.069s
(master)$ time PAGER=cat git blame -C -M cache.h > /dev/null
real 0m1.755s
user 0m1.730s
sys 0m0.024s
(master)$ time PAGER=cat git blame --minimal -C -M cache.h > /dev/null
real 0m1.785s
user 0m1.770s
sys 0m0.014s
(master)$ time PAGER=cat git blame -C -C -C -M cache.h > /dev/null
real 0m31.515s
user 0m30.810s
sys 0m0.684s
(master)$ time PAGER=cat git blame --minimal -C -C -C -M cache.h >
/dev/null
real 0m31.504s
user 0m30.885s
sys 0m0.598s
Signed-off-by: Michael Andreen <harv@ruin.nu>
---
There hasn't been any arguments against this patch. Just updated the message
with a note about --no-minimal.
Applies cleanly on both master and maint.
builtin/blame.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index e5b5d71..0e7ebd0 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -42,7 +42,7 @@ static int show_root;
static int reverse;
static int blank_boundary;
static int incremental;
-static int xdl_opts;
+static int xdl_opts = XDF_NEED_MINIMAL;
static int abbrev = -1;
static int no_whole_file_rename;
--
1.8.3.2
next reply other threads:[~2014-03-20 20:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 20:18 Michael Andreen [this message]
2014-03-20 20:45 ` [PATCH] Make XDF_NEED_MINIMAL default in blame Junio C Hamano
2014-03-20 21:21 ` Michael Andreen
-- strict thread matches above, loose matches on Subject: below --
2014-03-16 10:43 Michael Andreen
2014-03-16 12:12 ` Thomas Rast
2014-03-16 12:32 ` Michael Andreen
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=6555655.XSJ9EnW4BY@mako \
--to=harv@ruin.nu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).