Re: [PATCH] Make git log --follow support --find-copies-harder.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 22, 2010 at 12:56 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> What does the command do when given a single -C instead of --f-c-h, with
> or without your patch?  What should it do?

I have found that two days ago, all '-M/-C/-C -C' with some <path>
specified will fail.
byang@byang-laptop:~/git/git$ git diff --name-status -M  maint master
builtin/add.c
A       builtin/add.c

byang@byang-laptop:~/git/git$ git log -M -C -C --name-status
--pretty=oneline t/t4013/diff.show_--first-parent_master
2bf6587349e31b582dae47954b1a334052230e28 show --first-parent/-m: do
not default to --cc
A       t/t4013/diff.show_--first-parent_master

without <path>
byang@byang-laptop:~/git/git$ git diff --name-status -M  maint master
| grep  'builtin/add.c'
R100	builtin-add.c	builtin/add.c

byang@byang-laptop:~/git/git$ git log -M -C -C --name-status
--pretty=oneline | grep -- 't/t4013/diff.show_--first-parent_master'
C050	t/t4013/diff.show_master	t/t4013/diff.show_--first-parent_master

Both of above files are copied/renamed.

This because in diff_tree,

              if (opt->nr_paths) {
                        skip_uninteresting(t1, base, baselen, opt);
                        skip_uninteresting(t2, base, baselen, opt);
                }

And this give no chance for later rename/copy detection. I have been
trying to figure out a patch for this, but the logic is complex and it
will take more time...

> Because try_to_follow_renames() is supposed to be a rare-event (it only
> happens when a path we have been following disappears), I am having this
> feeling that it would make more sense to do this change unconditionally.
>
> Two possible outcomes that this patch allows the users to have by giving
> them a choice to give (or not to give) --f-c-h are:
>
>  (1) the path is judged to be new in a commit and traversal finishes
>     there; or
>
>  (2) the path is found to be a copy from another path from one of the
>     parents and traversal continues.
>
> But I think using --follow is a sure sign of the user wanting the latter
> and never the former, no?

Hmm, that makes sense. So, --follow always means --f-c-h.

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]