Steps to Reproduce:

This might be related to #238
However, compare these:
git log -7 --oneline --decorate -- content/core.js
aca790215 Merge pull request #1495 from minj/web-ext-1339
4249db6bd rewrite the clipboard copying to use the stackoverflow hack
6b885f7c4 Merge pull request #1469 from minj/epic-new-live-1434
1cb90b6a7 adjust shortTeamName mechanism to HT changes
785705895 (clear-cache-1378) automatically clear cache when season changes
873a80e5d move HT_TIME detection before jsLink
ce0636bfd (origin/pulls/1389) put a final touch on things
git log -7 --oneline --decorate --simplify-merges -- content/core.js
aca790215 Merge pull request #1495 from minj/web-ext-1339
4249db6bd rewrite the clipboard copying to use the stackoverflow hack
6b885f7c4 Merge pull request #1469 from minj/epic-new-live-1434
1cb90b6a7 adjust shortTeamName mechanism to HT changes
785705895 (clear-cache-1378) automatically clear cache when season changes
873a80e5d move HT_TIME detection before jsLink
ce0636bfd (origin/pulls/1389) put a final touch on things
md5-11f39b1c795ee5ba7798925a9e44eb36
git log -7 --oneline --full-history -- content/core.js
4855c9cc0 (HEAD -> master, origin/master, origin/HEAD) Merge remote-tracking branch 'origin/cdn'
656c70157 (origin/pulls/1538) Merge branch 'minor-fixes'
58b73809e Merge branch 'promotion-diff-fix'
ea9f6613e Merge branch 'cws-login-fix'
5ca175474 Merge remote-tracking branch 'origin/cdn'
14ed47efe Merge remote-tracking branch 'origin/cdn'
b5fa6bc1b Merge remote-tracking branch 'origin/cdn'
Evidently, --simplify-merges should not change anything here. GitLens works in --full-history mode for some reason though
That was fast, thanks
I'm still seeing this behavior with GitLens 7.5.9 (or 8.0.0 beta); the list for "Show File History" appears to match the output of git log -7 --oneline --full-history.
@eamodio @minj can either of you confirm that you're no longer seeing it? I'm wondering if I'm missing a setting or something...
I haven't tried beta, the commit looked "reasonable" so I figured I would wait for a stable release.
I definitely removed --full-history from the file log calls. If you run git log -7 --oneline --full-history vs git log -7 --oneline do you see a difference?
I agree that the commit looks correct, but this is what I'm getting:
$ git log -7 --oneline -- src/lib/app/Application.cpp
f01bb7162a Modify cpp files based on clang-tidy
b7730b83b4 I95-14446 : Formatted C++ codebase
a2feb303e6 Create auditdReceiver
85ba17e106 Use the appropriate log category per PollerThread and ConnectionManager
828775605e Use the appropriate log category per application
1f11506e25 Handle Application state changes more carefully
54add446e8 Prevent shutdown before Application is fully constructed and run()
$ git log -7 --oneline --full-history -- src/lib/app/Application.cpp
15502a9f15 (origin/I95-17770-merge-dp-3.1.11-13) Merge PR#5495 (athompson/I95-18130-remove-128t-salt-minion-dep=>release/devilspurse) to develop
922208ea6a Merge PR#5512 (acormier/TOOL-1608-migrate-validatedb=>release/devilspurse) to develop
86e7b7bf83 Merge PR#5533 (I95-18013-initializer-daemon-reload=>release/devilspurse) to develop
591f142491 Merge PR#5534 (dmon/I95-18113-pcapinjectiontest-devilspurse=>release/devilspurse) to develop
68b153b24d (origin/I95-19770-merge-dp-pr5485) Merge PR#5485 (I95-16608-router-register-with-node-name=>release/devilspurse) to develop
b6323a07fa Merge PR#5516 (I95-18160-copy-cert-every-time=>release/devilspurse) to develop
be9b542d47 Merge PR#5473 (dmon/I95-18007-fib-only-supports-7000-entries=>release/devilspurse) to develop

GitLens runs something along the lines of the following:
git log -7 --name-status -M --oneline --follow -m -- src/lib/app/Application.cpp
Can you send the output of that and also:
git log -7 --name-status -M --oneline --follow -- src/lib/app/Application.cpp
FYI, if you set "gitlens.debug": true" in your settings, there will be a new GitLens (Git) output channel in the output pane and you can see every git command GitLens runs
Thanks for the tip about gitlens.debug.
I realized that the history of that particular file was actually not the best example for this, but the same problem seems to apply with another file, which has some merge commits in its recent history.
The actual command that gets run when I "Show file history":
git log --name-status -M --format=%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3ca%x3e %an%n%x3ce%x3e %ae%n%x3cd%x3e %at%n%x3cp%x3e %P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e --follow -n200 -m -- src/lib/protobuf/state.proto
And here's the output of those two commands, it looks like the -m flag is the one pulling in these extra merges:
$ git log -7 --name-status -M --oneline --follow -m -- src/lib/protobuf/state.proto
6315a70d11 (from 6071a2e4ec) Merge branch 'develop' into ichamberlain/I95-17783-disable-auto-entitlement
M src/lib/protobuf/state.proto
e28beb5f76 (from 346e980a78) (origin/rkoss/I95-18237-build-error-pserviceagent, origin/develop, origin/chase/I95-18219-ipv4-to-v6-df-bit-lost, origin/bob/I95-16139-warn-tenant-prefix, origin/ST-353-performance-collection-1210-basic, origin/HEAD, develop) Merge pull request #5518 in T128/i95 from jbogdanov/I95-18149-show-config-version-timeout to develop
M src/lib/protobuf/state.proto
2602eaffb7 (from 9324915589) Merge pull request #5399 in T128/i95 from I95-17982/amenon/end-ha-test-2 to develop
M src/lib/protobuf/state.proto
2cfeefc1e5 (from 2e77111a27) Merge pull request #5527 in T128/i95 from aware/I95-16866-source-tenant-ui to develop
M src/lib/protobuf/state.proto
660fbe52cc (from 0827cfc292) (origin/rpatterson/I95-18210-cleanup-dnsManager, origin/chao/I95-18218-auto-generated-pppoe-hostname-robot) Merge pull request #5543 in T128/i95 from dbuchanan/stop-inactivity-query to develop
M src/lib/protobuf/state.proto
e64041267d (from aa753e0488) (origin/gjordan/I95-18017-resolve-merge-conflict) Merge branch 'develop' into gjordan/I95-18017-resolve-merge-conflict
M src/lib/protobuf/state.proto
bb9be224ca (from 07f20d16ae) (origin/athompson/I95-18223-installer-dep-downgrade-issues) Merge pull request #5523 in T128/i95 from athompson/I95-17796-installer-log-yum-output to develop
M src/lib/protobuf/state.proto
vs
$ git log -7 --name-status -M --oneline --follow -- src/lib/protobuf/state.proto
5bff46cd1a *) Changing prefix-length type *) Adding C++ tests *) Making prefix-length non-mandatory *) Adding revision information
M src/lib/protobuf/state.proto
97591e20b0 *) show_network_interface changes *) dhcp info prefix propagation to state
M src/lib/protobuf/state.proto
0cc554d238 Add host-name backend support for show peers command
M src/lib/protobuf/state.proto
606a883fbd Add filter for interface physical address in state monitor
M src/lib/protobuf/state.proto
4cecf9a80b Reserve public_ip_address in state.proto
M src/lib/protobuf/state.proto
d6f378f8cc Revert "Merge pull request #4372 in T128/i95 from ichamberlain/I95-16536-show-asset-ip-datamodel to release/devilspurse"
M src/lib/protobuf/state.proto
ce575242ea Add duplicate ids to asset state service response
M src/lib/protobuf/state.proto
I'm not sure what the desired output is, based on looking at the actual history of the file. The best result seems for me to be this, although the merge commits show as empty because of other commits (the ones that were merged in) that makes those changes.
$ git log -7 --name-status -M --oneline --stat -- src/lib/protobuf/state.proto
65a35b02d5 Merge PR#5451 (rherrero/I95-17489-show-network-interface-prefix=>release/devilspurse) to develop
5bff46cd1a *) Changing prefix-length type *) Adding C++ tests *) Making prefix-length non-mandatory *) Adding revision information
M src/lib/protobuf/state.proto
97591e20b0 *) show_network_interface changes *) dhcp info prefix propagation to state
M src/lib/protobuf/state.proto
0cc554d238 Add host-name backend support for show peers command
M src/lib/protobuf/state.proto
60be503e2d Merge PR#5185 (tjb/I95-16468-pcli-mac-address-unavailable=>release/devilspurse) to develop
606a883fbd Add filter for interface physical address in state monitor
M src/lib/protobuf/state.proto
40c7abdc3c Merge PR#4826 (ichamberlain/I95-17077-detect-duplicate-minion-ids=>release/devilspurse) to develop
I guess it comes down to how you want to implement the "File History" list. Certainly, I don't think it makes sense to show merge commits that didn't affect the file, but it may be difficult to show all merge commits that did since some of them will be "empty" according to git.
Hope this helps!
Thank you so much for the details! Seems like the -m flag is doing more than it is supposed to. Because I do want the file information for the merge commit IF it affected the file. I'll dig into this a bit more.
For the file you posted could you also check that file history on GitHub and let me know which one it matches? Thanks!
Can you also try that same command with the -m but also add --first-parent?
Unfortunately, this repo is hosted on Bitbucket, which doesn't show any merge commits in file history.
--first-parent seems to show only merge commits, but at least they all affected the file:
$ git log -7 --name-status -M --oneline --follow -m --first-parent -- src/lib/protobuf/state.proto
6315a70d11 Merge branch 'develop' into ichamberlain/I95-17783-disable-auto-entitlement
M src/lib/protobuf/state.proto
b336eb5300 Merge branch 'develop' into ichamberlain/I95-17783-disable-auto-entitlement
M src/lib/protobuf/state.proto
287541ac5c Merge PR5185 (merge-dp-pr5185) to develop
M src/lib/protobuf/state.proto
1886096511 Merge pull request #4968 in T128/i95 from merge-dp-31 to develop
M src/lib/protobuf/state.proto
f225a7fe4a Merge pull request #4962 in T128/i95 from merge-dp-30 to develop
M src/lib/protobuf/state.proto
bed01e8469 Merge pull request #4787 in T128/i95 from merge-dp-24 to develop
M src/lib/protobuf/state.proto
6e8808df55 Merge branch 'develop' into aware/I95-16751-title-bar
M src/lib/protobuf/state.proto
OK, so the question becomes to show or not show merge commits when they affect the file. Basically -m --first-parent or neither. I'm going to do some more testing with these options -- Thanks!
Git can be so frustrating at times. So if I don't use --follow to follow file renames (which I definitely want), then everything will show up properly without using -m or --first-parent. BUT when I use --follow it filters at ALL merge commits (even if they affected the file) -- so trying to use -m --first-parent gets closer to the original without the --follow but adds extra merge commits that really shouldn't be there :(
I opted for the -m --first-parent it isn't the same as without the --follow, but its relatively close, and as far as I can tell the merge commits that it includes did affect the file in question.
debug mode lists this command:
$ git log --name-status -M --format=%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3ca%x3e %an%n%x3ce%x3e %ae%n%x3cd%x3e %at%n%x3cp%x3e %P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e -n200 --follow -m --first-parent -- content/core.js
It can be simplified to:
$ git log --oneline -7 -M --follow -m --first-parent -- content/core.js
aca790215 Merge pull request #1495 from minj/web-ext-1339
6b885f7c4 Merge pull request #1469 from minj/epic-new-live-1434
02b90c4d3 Merge branch 'clear-cache-1378'
e4d7f7e9a Merge branch 'lint-content'
a44c8c0a7 Merge branch 'lint-content'
903f4ae4e Merge branch 'lint-content'
f39c2a10c Merge branch 'time-rewrite'
Evidently, now only merges are listed, losing the commits that were actually merged.
Both --follow and --first-parent transform the commit list in one way or another ðŸ˜
I guess it's better than the initial issue but I wonder if --follow is really worth it.
@minj I've added a new setting gitlens.advanced.fileHistoryFollowsRenames that will allow you to control this behavior. It will be in the GitLens 8-rc release coming soon.
There will also be a context menu to toggle it on the GitLens explorer when in the History view
@minj this has been released in GitLens 8
@eamodio, Hi, I have a similar issue with unnecessary log history list. I tried to turn off follow rename, then I can ONLY see recent commit after renaming. If I turn on follow rename, I saw a lot of merge commit. However, in another VSCode extension, https://github.com/DonJayamanne/gitHistoryVSCode, I can view log history nicely without any merge commit. I found that the git command they use to retrieve the history is:
git log --full-history --pretty=oneline --date-order --decorate=full --skip=0 --max-count=100 HEAD --follow -- filename.
Actually, the param of --full-history and --follow give me the best result. Do you think this command would serve better to solve this issue?
@ladevan can you provide a repo or something that shows the differences in the commit histories?
@eamodio, Thanks for the quick reply. I am sorry but the repo is from my company and it's confidential. Basically we are using Gerrit Code review system. The merge of several commits are generated from Gerrit.
Perhaps git log --oneline --decorate --graph --all would help to
reproduce this? You can obfuscate the commit messages etc
2018-06-05 19:06 GMT+02:00 dengyu notifications@github.com:
@eamodio https://github.com/eamodio, Thanks for the quick reply. I am
sorry but the repo is from my company and it's confidential. Basically we
are using Gerrit Code review system. The merge of several commits are
generated from Gerrit.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/eamodio/vscode-gitlens/issues/259#issuecomment-394787190,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_NA50WvZwGL_0w2fgpKwIGc645kKXkks5t5rqtgaJpZM4RsuYc
.
Below are some git log command and corresponding file history for your reference




The latest two commits are after file renaming. Actually, in my case, I found that just --follow is enough for me to get nice results.
I think what is in 8.5.2 is the best compromise
What does the compromise entail @eamodio ?
It seems like I'm still seeing tons of merge commit messages in the file history side bar:

Turning on Don't Follow Renames

does alleviate the problem, but I'd like to be able to still follow renames.
Is there a way to get both?
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.