+1

Highlight commits which change a file

Juho Routakorpi 1 year ago updated 1 year ago 2

Before submitting a code change to review, I usually try to clean it up and make sure the commits that make up the change make sense individually. During clean-up, I sometimes need to split commits, so the change could have ten or more commits waiting to be polished. At this time, it's sometimes difficult to keep track of which commit does what.

This work would be easier if commit graph would highlight the commits that affect a specific file.

What I have in mind is workflow like this:

1. Select a file in Commit / Files dialog.

2. Each commit that touches this file gets highlighted in Commit Graph.

The feature should be optional via Commit Graph hamburger menu.


Another variant of the same feature would add vertical lanes for the modified files in Commit Graph. Lanes would form a table with commits as rows, files as columns, and in each cell whether the commit modifies / deletes / adds the file. This would be more complex solution and might become cluttered if there are lots of files affected, so there should be a limit.

GUI Graph

> This work would be easier if commit graph would highlight the commits that affect a specific file.

> What I have in mind is workflow like this:

>

>  1. Select a file in Commit / Files dialog.


I'm not exactly sure what that means: I could imagine that the currently selected file from the Files view will always be used to highlight the commits (if the option has been selected in the hamburger menu).

To avoid performance problems, we'd limit this detection only to the commits of your feature branch. I.e. you will have to work insider a Git-Flow or Standard window "feature", to have this highlighting enabled. In addition, we might take into account all diverged commits between "main" and "origin/main". Otherwise, It's not reasonable to let SmartGit permanently scan over 100K "main" commits on every selection change.

That's how I envision this would work. It's fine to limit highlighting to current branch, or N commits, or what's currently visible. 100k commits is certainly overkill. Maybe the simpler views would work even better, I haven't really tried them yet.