git/list[1] front-page[2] threads[3] people[4] search[5] about
 

"git log --follow filename" (with diff.renameLimit=0) not working after subtree add

From
Diogo de Campos <campos@esss.com.br>
Date
Aug 7, 2013, 15:51 UTC
Message-ID
<CAMebvcSGzGatdaT-iowCUMqnw0ZYM20qxDBbE7SRn7-jFXs3VA@mail.gmail.com>
Problem:
"git log --follow filename" is not working for files after a big move.
Scenario:

Just performed a "git subtree add" where big projects were moved into another repository, and I'm not able to view history for a single file.

Sample output: Output after subtree add (no output)

> git log --follow --oneline file.py

Output from same command in old repository (the one that was merged with subtree, this is the output i expect to continue having atfer a merge)

> git log --follow --oneline file.py

cefa32b Convert doc strings to Sphinx 748b2dd Added target for C++ tests 1f2b52e Using default git_source_server for everything after moving to Stash ... [more commits]

A couple of notes:
- Made sure I used --follow
- Using options diff.renameLimit=0 and diff.renames=true
- Tried options -C and -M (even though there were no changes, should
be a 100% rename match)
- "git subtree add" was made without --squash to keep history
- "git blame file.py" works fine, detects all changes and rename history
- Commits added after the merge are tracked, but log stops at merge
- Tested with git 1.8.3.4
- This guy in StackOverflow seems to have the same problem:
http://stackoverflow.com/questions/4393527/why-might-git-log-not-show-history-for-a-moved-file-and-what-can-i-do-about-it

Relevant output for "git config -l" in repository: core.symlinks=false core.autocrlf=false color.diff=auto color.status=auto color.branch=auto color.interactive=true pack.packsizelimit=2g help.format=html http.sslcainfo=/bin/curl-ca-bundle.crt sendemail.smtpserver=/bin/msmtp.exe diff.astextplain.textconv=astextplain rebase.autosquash=true core.packedgitlimit=128m diff.renamelimit=0 diff.renames=true core.repositoryformatversion=0 core.filemode=false core.bare=false core.logallrefupdates=true core.symlinks=false core.ignorecase=true core.hidedotfiles=dotGitOnly

--
Diogo Campos
Message 1 of 1 in “"git log --follow filename" (with diff.renameLimit=0) not working after subtree add”
  1. Diogo de CamposAug 7, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.