[EGIT] [PATCH v1 0/1] Add an ignored icon

9 messages, 3 authors, 2016-06-15 · open the first message on its own page

[EGIT] [PATCH v1 0/1] Add an ignored icon

From: Ferry Huberts <hidden>
Date: 2016-06-15 22:46:16

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

[EGIT] [PATCH v1 1/1] Add an ignored icon

From: Ferry Huberts <hidden>
Date: 2016-06-15 22:46:16

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.

Signed-off-by: Ferry Huberts <redacted>
---
 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
diff --git a/org.spearce.egit.ui/icons/ovr/ignored.gif b/org.spearce.egit.ui/icons/ovr/ignored.gif
new file mode 100644
index 0000000000000000000000000000000000000000..509e706b3c847697c8fab379bc8bacdc66d21f3c
GIT binary patch
literal 102
zcmZ?wbhEHb<Y3@nc+AJ}>(@D15q3p!E=^fpC2=k-SzZ$rK|38WV-+D!6DfNgu|P{%
zPh+VN3xoe)p!k!8k%57qL5BedKxQzo2!Gh?Hha$0M=_26udo+g4fC2Q!pL9^04%B;
A)&Kwi

literal 0
HcmV?d00001
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java
index 8d617e9..f76b6e1 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/PluginPreferenceInitializer.java
@@ -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);
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java
index 952816c..5bc1eaf 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java
@@ -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");
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIPreferences.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIPreferences.java
index bbc36be..cdf9ab4 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIPreferences.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIPreferences.java
@@ -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";
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
index 0740f09..85bb50b 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java
@@ -1013,6 +1013,9 @@
 	public static String DecoratorPreferencesPage_iconsShowUntracked;
 
 	/** */
+	public static String DecoratorPreferencesPage_iconsShowIgnored;
+
+	/** */
 	public static String DecoratorPreferencesPage_iconsShowStaged;
 
 	/** */
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitLightweightDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitLightweightDecorator.java
index 6f69c80..06c10e1 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitLightweightDecorator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitLightweightDecorator.java
@@ -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;
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitDecoratorPreferencePage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
index eca2277..8c950cf 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
@@ -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
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
index 847cb2c..932c75c 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties
@@ -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
-- 
1.6.0.6

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Tor Arne Vestbø <hidden>
Date: 2016-06-15 22:46:16

Ferry Huberts wrote:
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?).
 		prefs.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.
+	/** 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

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Ferry Huberts (Pelagic) <hidden>
Date: 2016-06-15 22:46:16

Tor Arne Vestbø wrote:
Ferry Huberts wrote:
quoted
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.
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
 		prefs.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
+	/** 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

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Ferry Huberts (Pelagic) <hidden>
Date: 2016-06-15 22:46:16

On Tue, February 24, 2009 06:15, Ferry Huberts (Pelagic) wrote:
Tor Arne Vestbø wrote:
quoted
Ferry Huberts wrote:
quoted
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.
I just checked, TortoiseSVN has the overlay for ignored items on by default

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:46:16

tisdag 24 februari 2009 00:59:30 skrev Tor Arne Vestbø [off-list ref]:
Ferry Huberts wrote:
quoted
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

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Tor Arne Vestbø <hidden>
Date: 2016-06-15 22:46:16

Ferry Huberts (Pelagic) wrote:
On Tue, February 24, 2009 06:15, Ferry Huberts (Pelagic) wrote:
quoted
Tor Arne Vestbø wrote:
quoted
Ferry Huberts wrote:
quoted
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 :-)
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.

Acked-by: Tor Arne Vestbø <redacted>
quoted
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

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Tor Arne Vestbø <hidden>
Date: 2016-06-15 22:46:16

Robin Rosenberg wrote:
tisdag 24 februari 2009 00:59:30 skrev Tor Arne Vestbø [off-list ref]:
quoted
Ferry Huberts wrote:
quoted
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.
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

Re: [EGIT] [PATCH v1 1/1] Add an ignored icon

From: Ferry Huberts (Pelagic) <hidden>
Date: 2016-06-15 22:46:16

quoted
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.
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help