{"thread":{"id":"32968","subject":"-B option of git log","startedAt":"2013-02-22T00:44:00Z","lastAt":"2013-02-22T10:14:36Z","messageCount":3,"participants":["Eckhard Maass","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"210011","messageId":"5126BF50.6020500@gmx.net","threadId":"32968","inReplyTo":null,"subject":"-B option of git log","fromName":"Eckhard Maass","fromEmail":"eckhard.maass@gmx.net","sentAt":"2013-02-22T00:44:00Z","receivedAt":"2013-02-22T00:44:00Z","isPatch":false,"sender":{"key":"eckhard.maass@gmx.net","avatar":null},"body":"Hello,\n\nAs far as I understand the documentation, -B of git-log should help\ncorrect rename detection. But it does not seem to work for me.\n\nLet me get a setup:\n\n$> git init .\nInitialized empty Git repository in /tmp/t2/.git/\n$> echo 'Lorem ipsum doler sed. Lorem ipsum doler sed. Lorem ipsum doler\nsed. Lorem ipsum doler sed.' > a\n$> git add a\n$> git commit -m 'Init.'\n[master (root-commit) b78205c] Init.\n 1 file changed, 1 insertion(+)\n create mode 100644 a\n$> mv a b\n$> echo 'new' > a\n$> git add -A .\n$> git commit -m '2nd.'\n[master a30ca49] 2nd.\n 2 files changed, 2 insertions(+), 1 deletion(-)\n create mode 100644 b\n\nNow, I get the following:\n\n$> git log --oneline -B20%/80% -M20% --name-status\na30ca49 2nd.\nM       a\nA       b\nb78205c Init.\nA       a\n\nBut I would expect that git-log shows me a rename from a to b and a new a.\n\nWhat is my misunderstanding? (And I tried it also with files with a\ncouple of lines.)\n\nSEcki\n"},{"id":"210012","messageId":"20130222005704.GA24287@sigill.intra.peff.net","threadId":"32968","inReplyTo":"5126BF50.6020500@gmx.net","subject":"Re: -B option of git log","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-02-22T00:57:04Z","receivedAt":"2013-02-22T00:57:04Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 22, 2013 at 01:44:00AM +0100, Eckhard Maass wrote:\n\n> Let me get a setup:\n> \n> $> git init .\n> Initialized empty Git repository in /tmp/t2/.git/\n> $> echo 'Lorem ipsum doler sed. Lorem ipsum doler sed. Lorem ipsum doler\n> sed. Lorem ipsum doler sed.' > a\n> $> git add a\n> $> git commit -m 'Init.'\n> [master (root-commit) b78205c] Init.\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 a\n> $> mv a b\n> $> echo 'new' > a\n> $> git add -A .\n> $> git commit -m '2nd.'\n> [master a30ca49] 2nd.\n>  2 files changed, 2 insertions(+), 1 deletion(-)\n>  create mode 100644 b\n> \n> Now, I get the following:\n> \n> $> git log --oneline -B20%/80% -M20% --name-status\n> a30ca49 2nd.\n> M       a\n> A       b\n> b78205c Init.\n> A       a\n> \n> But I would expect that git-log shows me a rename from a to b and a new a.\n\nI think the problem is that your test file is so tiny that it falls\nafoul of git's MINIMUM_BREAK_SIZE heuristic of 400 bytes (which prevents\nfalse positives on tiny files). Try replacing your \"Lorem ipsum\" echo\nwith something like \"seq 1 150\", and I think you will find the result\nyou are expecting.\n\n-Peff\n"},{"id":"210022","messageId":"5127450C.5040908@gmx.net","threadId":"32968","inReplyTo":"20130222005704.GA24287@sigill.intra.peff.net","subject":"Re: -B option of git log","fromName":"Eckhard Maass","fromEmail":"eckhard.maass@gmx.net","sentAt":"2013-02-22T10:14:36Z","receivedAt":"2013-02-22T10:14:36Z","isPatch":false,"sender":{"key":"eckhard.maass@gmx.net","avatar":null},"body":"On 02/22/2013 01:57 AM, Jeff King wrote:\n> I think the problem is that your test file is so tiny that it falls\n> afoul of git's MINIMUM_BREAK_SIZE heuristic of 400 bytes (which prevents\n> false positives on tiny files). Try replacing your \"Lorem ipsum\" echo\n> with something like \"seq 1 150\", and I think you will find the result\n> you are expecting.\nThanks. Two points, though:\n\nWith bigger files, I do get something like:\n| M100  d\n| R100  d       e\n\nThe rename is fine. But I am a bit puzzled mit the M - I, somehow,\nwould have expected an A for add and not a M.\n\nSecondly, would it be a good idea to enhance the documentation on\nthat point to clarify this minimum size?\n\nSEcki\n"}]}