Skip to content

[Feature] 'Dir History', i.e 'File History' but on a subfolder-tree #1470

Closed
@goran-w

Description

@goran-w

Quite often, File History is too narrow but full history is too wide - we might be interested in analying the history of a subfolder-tree (a whole subsystem, for example). The Git command-line equivalent would be some variant of git log -- <path/to/my/subfolder>.

This can be done in many Git clients, and also on the GitHub web - here is an example of subfolder-tree history, from the SourceGit repo : History for build/resources/deb/DEBIAN on master

To implement this in SourceGit, we'd need to add a context menu for the directories in the FILES view, so we can activate File History (or rather Dir History) for directories as well.

However, since the resulting history would no longer be for a single (file) Change per Commit, but instead for multiple Changes per each Commit, the File/Dir History view needs to be extended with an additional CHANGES panel in the lower half of the sidebar (below the list of Commits), where the specific Change-item can be selected for the currently selected Commit.

This means the view-layout for Dir History will be almost the same as in the STASHES view!

It could perhaps be implemented inside the existing classes for File History, using a property IsSingleFileHistory (or similar) to determine the different visibility and logic needed for the Commit-Change selection in File/Dir History. (Alternatively, a specific view for Dir History could be created, re-using sub-components from the File History view.)

(The CHANGE / CONTENT toggle-buttons from File History could be kept, but are less relevant for a Dir History view where the CHANGE part would be mostly sufficient - as in the STASHES view.)

IMPORTANT NOTE: Normally, the Changes from each of the listed Commits are filtered (one can use git log --raw --name-status -- <path/to/my/subfolder> to list compact status and filename for the relevant changes). Some clients, like TortoiseGit, allow for (optionally) showing (possibly in a grayed-out style) any OTHER (out-of-subfolder-tree) changes from the same commits. (The GitHub web example above also lists all changes from the involved commits.) But this is not necessary for a first implementation - it could be considered later on as a possible enhancement - it's more important to just support a basic subfolder history view...

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions