When the '--follow' option is used with '--find-copies-harder' ('-C -C')
logs on individual files will work across file copies as well as
renames.Intermediate copies will not be shown as a result of the workings of the
'--find-copies-harder' option.Signed-off-by: Arjen Laarhoven
---
Documentation/git-log.txt | 6 +++++-
t/t4202-log.sh | 12 ++++++++++++
tree-diff.c | 2 ++
3 files changed, 19 insertions(+), 1 deletions(-)diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 34cf4e5..2d42101 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -52,7 +52,11 @@ include::diff-options.txt[]
commits, and doesn't limit diff for those commits.--follow::
- Continue listing the history of a file beyond renames.
+ Continue listing the history of a file beyond renames. When
+ combined with `--find-copies-harder` (`-C -C`) git will also
+ list the file history beyond copies. Intermediate copies
+ will be skipped, e.g. a copy of file A to B to C will not
+ show B when showing the log on file C.--log-size::
Before the log message print out its size in bytes. Intended
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 7b976ee..a8dd690 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -109,6 +109,18 @@ test_expect_success 'git log --follow' ''
+test_expect_success 'git log --follow --find-copies-harder' '
+
+ actual=$(git log --follow -C -C --pretty="format:%s" ein) &&
+ expect=$(echo fourth; echo third ; echo second ; echo initial) &&
+ test "$actual" = "$expect" || {
+ echo Oops
+ echo "Actual: $actual"
+ false
+ }
+
+'
+
test_expect_success 'setup case sensitivity tests' '
echo case >one &&
test_tick &&
diff --git a/tree-diff.c b/tree-diff.c
index 9f67af6..73652b2 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -333,6 +333,8 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, codiff_setup(&diff_opts);
DIFF_OPT_SET(&diff_opts, RECURSIVE);
+ if (DIFF_OPT_TST(opt, FIND_COPIES_HARDER))
+ DIFF_OPT_SET(&diff_opts, FIND_COPIES_HARDER);
diff_opts.detect_rename = DIFF_DETECT_RENAME;
diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
diff_opts.single_follow = opt->paths[0];
--
1.6.1.354.gd9e51--
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
| Linus Torvalds | Linux 2.6.21-rc4 |
| Jens Axboe | [PATCH 0/8] IO queuing and complete affinity |
| Nicholas A. Bellinger | Re: Integration of SCST in the mainstream Linux kernel |
| Robin Lee Powell | NFS hang + umount -f: better behaviour requested. |
git: | |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Ingo Molnar | Re: [crash] BUG: unable to handle kernel NULL pointer dereference at 0000000000000... |
| Gerrit Renker | [PATCH 19/37] dccp: Header option insertion routine for feature-negotiation |
| Gary Thomas | Marvell 88E609x switch? |
| Jamie Lokier | Re: silent semantic changes with reiser4 |
| Jan Kara | [PATCH 10/16] ext4: Remove syncing logic from ext4_file_write |
| Jack Stone | Re: Versioning file system |
| Jens Axboe | [PATCH 8/8] vm: Add an tuning knob for vm.max_writeback_pages |
