Add an ignored icon
cover Add an ignored icon
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
Ferry Huberts (1):
Add an ignored icon
org.spearce.egit.ui/icons/ovr/ignored.gif | Bin 0 -> 102 bytes .../egit/ui/PluginPreferenceInitializer.java | 1 + .../src/org/spearce/egit/ui/UIIcons.java | 4 ++++ .../src/org/spearce/egit/ui/UIPreferences.java | 2 ++ .../src/org/spearce/egit/ui/UIText.java | 3 +++ .../decorators/GitLightweightDecorator.java | 11 ++++++++--- .../preferences/GitDecoratorPreferencePage.java | 12 ++++++++++++ .../src/org/spearce/egit/ui/uitext.properties | 1 + 8 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 org.spearce.egit.ui/icons/ovr/ignored.gif
PATCH 1/1 Add an ignored icon
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
--- org.spearce.egit.ui/icons/ovr/ignored.gif | Bin 0 -> 102 bytes .../egit/ui/PluginPreferenceInitializer.java | 1 + .../src/org/spearce/egit/ui/UIIcons.java | 4 ++++ .../src/org/spearce/egit/ui/UIPreferences.java | 2 ++ .../src/org/spearce/egit/ui/UIText.java | 3 +++ .../decorators/GitLightweightDecorator.java | 11 ++++++++--- .../preferences/GitDecoratorPreferencePage.java | 12 ++++++++++++ .../src/org/spearce/egit/ui/uitext.properties | 1 + 8 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 org.spearce.egit.ui/icons/ovr/ignored.gif
org.spearce.egit.ui/icons/ovr/ignored.gif new file binary +0 -0
org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java +1 -0
@@ -46,6 +46,7 @@ public void initializeDefaultPreferences() { UIText.DecoratorPreferencesPage_projectFormatDefault); prefs.setDefault(UIPreferences.DECORATOR_SHOW_TRACKED_ICON, true); prefs.setDefault(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON, true); + prefs.setDefault(UIPreferences.DECORATOR_SHOW_IGNORED_ICON, true); prefs.setDefault(UIPreferences.DECORATOR_SHOW_STAGED_ICON, true); prefs.setDefault(UIPreferences.DECORATOR_SHOW_CONFLICTS_ICON, true); prefs.setDefault(UIPreferences.DECORATOR_SHOW_ASSUME_VALID_ICON, true);
org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java +4 -0
@@ -31,6 +31,9 @@ /** Decoration for resource not being tracked by Git */ public static final ImageDescriptor OVR_UNTRACKED; + /** Decoration for resource ignored by Git */ + public static final ImageDescriptor OVR_IGNORED; + /** Decoration for tracked resource with a merge conflict. */ public static final ImageDescriptor OVR_CONFLICT;
@@ -92,6 +95,7 @@ OVR_STAGED_ADD = map("ovr/staged_added.gif"); OVR_STAGED_REMOVE = map("ovr/staged_removed.gif"); OVR_UNTRACKED = map("ovr/untracked.gif"); + OVR_IGNORED = map("ovr/ignored.gif"); OVR_CONFLICT = map("ovr/conflict.gif"); OVR_ASSUMEVALID = map("ovr/assume_valid.gif"); ELCL16_FIND = map("elcl16/find.gif");
org.spearce.egit.ui/src/org/spearce/egit/ui/UIPreferences.java +2 -0
@@ -67,6 +67,8 @@ /** */ public final static String DECORATOR_SHOW_UNTRACKED_ICON = "decorator_show_untracked_icon"; /** */ + public final static String DECORATOR_SHOW_IGNORED_ICON = "decorator_show_ignored_icon"; + /** */ public final static String DECORATOR_SHOW_STAGED_ICON = "decorator_show_staged_icon"; /** */ public final static String DECORATOR_SHOW_CONFLICTS_ICON = "decorator_show_conflicts_icon";
org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java +3 -0
@@ -1013,6 +1013,9 @@ public static String DecoratorPreferencesPage_iconsShowUntracked; /** */ + public static String DecoratorPreferencesPage_iconsShowIgnored; + + /** */ public static String DecoratorPreferencesPage_iconsShowStaged; /** */
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitLightweightDecorator.java +8 -3
@@ -224,6 +224,8 @@ public ImageData getImageData() { private static ImageDescriptor untrackedImage; + private static ImageDescriptor ignoredImage; + private static ImageDescriptor stagedImage; private static ImageDescriptor stagedAddedImage;
@@ -238,6 +240,7 @@ public ImageData getImageData() { trackedImage = new CachedImageDescriptor(TeamImages .getImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR)); untrackedImage = new CachedImageDescriptor(UIIcons.OVR_UNTRACKED); + ignoredImage = new CachedImageDescriptor(UIIcons.OVR_IGNORED); stagedImage = new CachedImageDescriptor(UIIcons.OVR_STAGED); stagedAddedImage = new CachedImageDescriptor(UIIcons.OVR_STAGED_ADD); stagedRemovedImage = new CachedImageDescriptor(
@@ -269,9 +272,6 @@ public DecorationHelper(IPreferenceStore preferencesStore) { */ public void decorate(IDecoration decoration, IDecoratableResource resource) { - if (resource.isIgnored()) - return; - decorateText(decoration, resource); decorateIcons(decoration, resource); }
@@ -335,6 +335,11 @@ else if (staged == Staged.REMOVED) && resource.hasConflicts()) overlay = conflictImage; + } else if (resource.isIgnored()) { + if (store + .getBoolean(UIPreferences.DECORATOR_SHOW_IGNORED_ICON)) { + overlay = ignoredImage; + } } else if (store .getBoolean(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON)) { overlay = untrackedImage;
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitDecoratorPreferencePage.java +12 -0
@@ -99,6 +99,8 @@ private Button showUntracked; + private Button showIgnored; + private Preview preview; private Button showStaged;
@@ -308,6 +310,8 @@ private Control createIconDecoratorPage(Composite parent) { UIText.DecoratorPreferencesPage_iconsShowTracked); showUntracked = SWTUtils.createCheckBox(imageGroup, UIText.DecoratorPreferencesPage_iconsShowUntracked); + showIgnored = SWTUtils.createCheckBox(imageGroup, + UIText.DecoratorPreferencesPage_iconsShowIgnored); showStaged = SWTUtils.createCheckBox(imageGroup, UIText.DecoratorPreferencesPage_iconsShowStaged); showConflicts = SWTUtils.createCheckBox(imageGroup,
@@ -376,6 +380,8 @@ private void initializeValues() { .getBoolean(UIPreferences.DECORATOR_SHOW_TRACKED_ICON)); showUntracked.setSelection(store .getBoolean(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON)); + showIgnored.setSelection(store + .getBoolean(UIPreferences.DECORATOR_SHOW_IGNORED_ICON)); showStaged.setSelection(store .getBoolean(UIPreferences.DECORATOR_SHOW_STAGED_ICON)); showConflicts.setSelection(store
@@ -391,6 +397,7 @@ public void widgetSelected(SelectionEvent e) { showTracked.addSelectionListener(selectionListener); showUntracked.addSelectionListener(selectionListener); + showIgnored.addSelectionListener(selectionListener); showStaged.addSelectionListener(selectionListener); showConflicts.addSelectionListener(selectionListener); showAssumeValid.addSelectionListener(selectionListener);
@@ -447,6 +454,8 @@ private boolean performOk(IPreferenceStore store) { .getSelection()); store.setValue(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON, showUntracked.getSelection()); + store.setValue(UIPreferences.DECORATOR_SHOW_IGNORED_ICON, + showIgnored.getSelection()); store.setValue(UIPreferences.DECORATOR_SHOW_STAGED_ICON, showStaged .getSelection()); store.setValue(UIPreferences.DECORATOR_SHOW_CONFLICTS_ICON,
@@ -485,6 +494,9 @@ protected void performDefaults() { showUntracked .setSelection(store .getDefaultBoolean(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON)); + showIgnored + .setSelection(store + .getDefaultBoolean(UIPreferences.DECORATOR_SHOW_IGNORED_ICON)); showStaged.setSelection(store .getDefaultBoolean(UIPreferences.DECORATOR_SHOW_STAGED_ICON)); showConflicts
org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties +1 -0
@@ -376,6 +376,7 @@ DecoratorPreferencesPage_textLabel=T&ext Decorations DecoratorPreferencesPage_iconLabel=&Icon Decorations DecoratorPreferencesPage_iconsShowTracked=Tracked resources DecoratorPreferencesPage_iconsShowUntracked=Untracked resources +DecoratorPreferencesPage_iconsShowIgnored=Ignored resources DecoratorPreferencesPage_iconsShowStaged=Staged resources DecoratorPreferencesPage_iconsShowConflicts=Conflicting resources DecoratorPreferencesPage_iconsShowAssumeValid=Assumed unchanged resources
Signature · 1 line
1.6.0.6
Quoted 3 lines · Ferry Huberts
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
The reason this was not added in the original series was because that's kind of the point of ignoring a resource -- you don't want any information about it. Also, none of the other team plugins provide decorations for ignored resources-
On the other hand, since the decorators are now user configurable, adding the option to allow users to enable decoration of ignored resources if they really feel it's useful to them is admittedly in line with the whole customization idea.
Though I'm not sure if this particular case of customization would cause more confusion than good, for example in terms of which doors we open by allowing ignored resources to actually not be ignored (i.e what other features would you expect to work for ignored resources?).
org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java public void initializeDefaultPreferences() { · line 50
Quoted 3 lines
org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java +1
-0prefs.setDefault(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON, true); + prefs.setDefault(UIPreferences.DECORATOR_SHOW_IGNORED_ICON, true); prefs.setDefault(UIPreferences.DECORATOR_SHOW_STAGED_ICON, true);
If applied, I would argue that the option should be _off_ by default, to match the behavior of the other team plugins and the normal logical action of ignoring a resource.
org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java line 36
Quoted 3 lines
org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java +3
-0+ /** Decoration for resource ignored by Git */ + public static final ImageDescriptor OVR_IGNORED; +
Side-note: the current decoration implementation only uses Eclipse's concept of an ignored resource -- not .gitignore et al. since we don't have a standard way of reading those yet.
Tor Arne
tisdag 24 februari 2009 00:59:30 skrev Tor Arne Vestbø <[email protected]>:
Quoted 9 lines
Quoted 3 lines · Ferry Huberts
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
The reason this was not added in the original series was because that's kind of the point of ignoring a resource -- you don't want any information about it. Also, none of the other team plugins provide decorations for ignored resources-
"Ignored" in this context does not mean unimportant. It means we will not track it in git, which is quite important.
-- robin
Quoted 5 lines · Robin Rosenberg
tisdag 24 februari 2009 00:59:30 skrev Tor Arne Vestbø <[email protected]>:
Quoted 4 lines
Quoted 3 lines · Ferry Huberts
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
Quoted 7 lines
Quoted 4 lines
The reason this was not added in the original series was because that's kind of the point of ignoring a resource -- you don't want any information about it. Also, none of the other team plugins provide decorations for ignored resources-
"Ignored" in this context does not mean unimportant. It means we will not track it in git, which is quite important.
True, it's important. Untracked already has a decoration (the '?'), and tracked files have the yellow database icon. I'm just saying the convention so far in Eclipse has been to use non-decoration (no ? or yellow db icon) to signal ignored resources.
Tor Arne
Quoted 10 lines · Tor Arne Vestbø
Quoted 3 lines · Ferry Huberts
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
The reason this was not added in the original series was because that's kind of the point of ignoring a resource -- you don't want any information about it. Also, none of the other team plugins provide decorations for ignored resources-
I could also argue that I want everything to be explicit, even the status of ignored files :-)
If you look at (for example) TortoiseSVN then you'll see that it does provide an ignore icon. My icon was sort of 'inspired' by that one. Don't know if it's on by default though, will have to check that.
Quoted 10 lines
On the other hand, since the decorators are now user configurable, adding the option to allow users to enable decoration of ignored resources if they really feel it's useful to them is admittedly in line with the whole customization idea.
Though I'm not sure if this particular case of customization would cause more confusion than good, for example in terms of which doors we open by allowing ignored resources to actually not be ignored (i.e what other features would you expect to work for ignored resources?).
Quoted 7 lines
org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java public void initializeDefaultPreferences() { · line 50
Quoted 3 lines
org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java +1
-0prefs.setDefault(UIPreferences.DECORATOR_SHOW_UNTRACKED_ICON, true); + prefs.setDefault(UIPreferences.DECORATOR_SHOW_IGNORED_ICON, true); prefs.setDefault(UIPreferences.DECORATOR_SHOW_STAGED_ICON, true);If applied, I would argue that the option should be _off_ by default, to match the behavior of the other team plugins and the normal logical action of ignoring a resource.
not my preference (hey I wrote the patch) but reasonable.
Quoted 11 lines
org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java line 36
Quoted 4 lines
org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java +3
-0+ /** Decoration for resource ignored by Git */ + public static final ImageDescriptor OVR_IGNORED; +Side-note: the current decoration implementation only uses Eclipse's concept of an ignored resource -- not .gitignore et al. since we don't have a standard way of reading those yet.
Tor Arne
I've started work on that, see the issue on the issue tracker. The plan is to hook in on change events and then parse all gitignore files, and tell eclipse about the contents of the ignores.
Ferry
Quoted 12 lines · Ferry Huberts (Pelagic)
Quoted 10 lines · Tor Arne Vestbø
Quoted 3 lines · Ferry Huberts
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
The reason this was not added in the original series was because that's kind of the point of ignoring a resource -- you don't want any information about it. Also, none of the other team plugins provide decorations for ignored resources-
Quoted 6 lines
I could also argue that I want everything to be explicit, even the status of ignored files :-)
If you look at (for example) TortoiseSVN then you'll see that it does provide an ignore icon. My icon was sort of 'inspired' by that one. Don't know if it's on by default though, will have to check that.
I just checked, TortoiseSVN has the overlay for ignored items on by default
Tor Arne Vestbø
Acked-byQuoted 6 lines · Ferry Huberts (Pelagic)
Quoted 5 lines · Ferry Huberts (Pelagic)
Quoted 4 lines · Tor Arne Vestbø
Quoted 3 lines · Ferry Huberts
Add an ignored icon to the label decorations page and make sure that it is actually decorated: from now on do not ignore ignored resources during decoration.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
The reason this was not added in the original series was because that's kind of the point of ignoring a resource -- you don't want any information about it. Also, none of the other team plugins provide decorations for ignored resources-
I could also argue that I want everything to be explicit, even the status of ignored files :-)
That's a reasonable argument :) I'm not really opposed to the feature -- I was just trying to think of reasons why it might not be such as good idea, just to be safe and have that discussion. But you are right.
Quoted 5 lines
Quoted 3 lines
If you look at (for example) TortoiseSVN then you'll see that it does provide an ignore icon. My icon was sort of 'inspired' by that one. Don't know if it's on by default though, will have to check that.
I just checked, TortoiseSVN has the overlay for ignored items on by default
The difference is TortoiseSVN does not come with a set of global default ignored files (as far as I know). Eclipse does, see Team->Ignored...
So, a globally ignored file such as foobar.BAK would show up as non-decorated if shared using the CVS or SVN plugins, but with an icon if shared with Git. That might be confusing to users, especially since the minus-sign icon does not have any history in Eclipse as something being "ignored" (it actually breaks the convention of using non-decoration -- meaning no "untracked"-icon -- to signal ignored).
So, I would still argue that we should leave it off by default.
Tor Arne
Quoted 5 lines
Quoted 1 line
I just checked, TortoiseSVN has the overlay for ignored items on by default
The difference is TortoiseSVN does not come with a set of global default ignored files (as far as I know). Eclipse does, see
Team->Ignored...
Quoted 9 lines
So, a globally ignored file such as foobar.BAK would show up as non-decorated if shared using the CVS or SVN plugins, but with an icon if shared with Git. That might be confusing to users, especially since the minus-sign icon does not have any history in Eclipse as something being "ignored" (it actually breaks the convention of using non-decoration -- meaning no "untracked"-icon -- to signal ignored).
So, I would still argue that we should leave it off by default.
For now I think that's acceptable. However, when I complete the work on the ignores then we should switch it on:
I plan to let EGit NOT look at the Eclipse global ignore list because the ignores are defined by .gitignore files for git repositories. At that point it totally makes sense to decorate ignored resources because these are configured in .gitignore files