New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not blame folders #9392
Do not blame folders #9392
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 much clearer to me
if (tabControl1.SelectedTab?.Parent is null) | ||
{ | ||
tabControl1.SelectedTab = DiffTab; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the DiffTab
in FormFileHistory?
- It just duplicates what can be seen on the
CommitTab
- with a little more space, of course. - It does not really apply when showing the history of a folder.
So, it should be hidden as the BlameTab
and the ViewTab
- or be removed completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff tab should show all changes to the folder. GE parsing fails to present this, probably the only place that is used.
To fix the parsing would require that the path is specially handled, which could be done, but as the info is available I will remove that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
4156f77
to
339c41f
Compare
To be squash merged in one day or so. |
It seemed to work well in a short test with the GE repo. OT: How to enable/disable the Artificial Commits for FormFileHistory? Why is the |
git-log --follow is not behavi9ng as most expect, it is a hack.
See also #9393 There is no commit info ever for artificial commits, compare to Browse. For FileHistory I would not bother. It is not that many steps left to get to #7598 (comment) or so. |
But if files of the folder have changes, would they be displayed? At work, artificial commits were displayed although no changes.
👍 Good to hear / read. |
The current behavior creates internal exceptions, so that is definitely worse. A third git-log would get the commits lost with --follow, adding the filenames for the commits from the full git-log parsing. Is it better to always drop the Diff/View/Blame tabs for object type tree (folders)?
In FileHistory, the Diff tab is "fixed" to one file so the Diff tab only contain info if there are changes to that specific file. (There is a theoretical possibility that a file is renamed in HEAD, then the wrong file would be blamed, so this makes sense also for non folders).
Then you only viewed the history for files that are changed in HEAD.
Blame in FileTree is likely some work, not got into details, especially if some "view-only" mode is needed. It is also open how to enable/disable the Advanced filter for paths. That is more a design issue than work though. |
IMO, yes.
According to Murphy's Law, the blamed file will be the wrong one.
... only the abstract view from user's perspective yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 no specific comments
Changed this. Plan to squash and merge tomorrow. |
It is possible to blame Git Tree objects (folders) from File tree, then the Diff/View/Blame could possibly only be shown for one "random" file in each commit (or none as git-log --follow do not report all commits). To decrease confusion only one of the files are shown. For artificial commits, this means that no tabs are displayed. * If a file object was blamed, diff the same file for Artificial commits as for HEAD.
9e9a239
to
1a92b61
Compare
Needed with #9056
Follow up to #9335
See long term goals in #7598 (comment)
(FileHistory is a sidetrack)
Proposed changes
It is possible to blame Git Tree objects (folders) from File tree.
GE shows the history for all commits affecting the folder, but just display the file and blame for one of them (the first reported file).
The name for the displayed/blamed file is added to the title bar.
If no files are seen for a certain commit, GE uses the "FileHistory" path for blame, which is not possible for a folder.
Also the first file in the folder is viewed, not matching the folder name in the title bar.
Diff tab could have been displayed but parsing of multiple diffs fail why this is hidden too.
(So no tabs shown for folder and aritificial commits.)
With #9056, this will raise an exception (that PR will show many issues in GE, a number has already been handled...)
(no popup though)
Note: That the filenames for a commit is not reported is a problem itself that likely occurs due to "--follow" option.
See https://stackoverflow.com/questions/46487476/git-log-follow-graph-skips-commits
That is ignored in this PR, the core case should be handled regardless.
Note 2: It is still possible to get the old behavior from the command line, that is ignored in this PR.
Screenshots
"Bin/" is used in these examples
Before #9335
(for all commits, no file viewed)
Before in master
#9056
After
Slightly different commits, changes in HEAD so artificial commits are shown - no tabs available
Test methodology
Manual
✒️ I contribute this code under The Developer Certificate of Origin.