Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

captin411
Copy link

This makes it easier to identify which projects have uncommitted
changes when working with more than one project.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

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:

  • first is my concern with unexpected consequences for other plugin developers who use the repo.getDirectoryStatus (is the root folder coming back with a status of 0 a feature or a bug?)
  • second, an update here allows people to get this new feature by updating the plugin instead of all of Atom

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

David Bartle added 2 commits July 4, 2017 15:21
This makes it easier to identify which projects have uncommitted
changes when working with more than one project.
@captin411
Copy link
Author

Here is an example of the final result:

screen shot 2017-07-04 at 15 19 25

@daviwil
Copy link
Contributor

daviwil commented Feb 28, 2018

Looks great, thanks a lot @captin411!

@daviwil daviwil merged commit 154b1e0 into atom:master Feb 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants