This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repo status color on project root directory #1144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes it easier to identify which projects have uncommitted
changes when working with more than one project.
Requirements
Description of the Change
I occasionally work with software projects that have more than one project folder added to them.
In these cases, it is difficult to identify which repositories I have uncommitted changed on.
This change bubbles up the '.status-modified' and '.status-added' CSS classes to the '.project-root' elements so that the repo modification status can be clearly seen when all folders are collapsed.
Alternate Designs
The code changes in the
directory.coffee
file could alternatively be put into the atom core. It would require a change to the logic of 'repo.getDirectoryStatus()' method.The reason I avoided changin Atom core are twofold:
In short, there is a bug(?) in repo.getDirectoryStatus('/my/root') which will calculate the relative path as @relativize("/my/root") + "/" resulting in the string "/". Then all of the git statuses (formatted like "subdir/file.txt") are evaluated and if statusPath.indexOf(relative_git_root) == 0 then it will consider the status of the parent folder to be of a particular value.
The problem is that, in the case of the root folder, it will never match character 0 since none of the status paths ever have a leading "/".
Benefits
People who want to see the repo status at the root level will be able to do so - especially useful for those who use multi-project often.
Possible Drawbacks
It is aesthetic and people are opinionated -- so some people might not like it.
Applicable Issues
n/a