git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [egit-jgit] excluded patterns are decorated as being untracked

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 18, 2008, 04:39 UTC
Message-ID
<20080618043931.GC11793@spearce.org>
In-Reply-To
<200806172316.46416.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
> Btw, Here is an attempt to match folders by Team ignore patterns too.
> 
> (OT: I did not format the code. (please try, and you'll see why). We'll have
> to come up with something better than an 80-column format, it's so seventies)

Ignoring the patch for a second, I'm a die-hard 80 column format person. You can pry my 80 column wide terminals from me long after I'm dead.

In Java it may seem like an 80 column limit is a problem, because the code often gets nested deep and far to the right, such as in this example here. I find that just like in C, when code is this far indented to the right in Java its too damn complex as-is and should be refactored into smaller methods, and anonymous types should perhaps be converted to named inner classes or top-level classes of their own right.

My laptop display panel is only 1440 pixels wide. By the time I get my Eclipse workbench open I have about 90 characters wide for the editor page, given how I place the other views and non-Eclipse applications around the edges. Pushing much beyond 80 characters wide makes it very hard to read code quickly.

And no, I do not want to tote a laptop with a display that is 9000 pixels wide, thanks.

So IMHO, code in jgit+egit should try to target 80 characters wide as much as possible. If you can't hit that you need to rethink how you have the code structured. I've never refactored something into smaller more modular methods (to hit the 80 target) and said "gee, that refactoring made my code harder to understand, what with those highly descriptive method names and javadoc I gave everything".

OK, now you can call me crazy.
 
Show 26 quoted lines
> diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
> index 6521f1c..af16cdb 100644
> --- a/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
> +++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/TrackOperation.java
> @@ -90,13 +90,20 @@ public class TrackOperation implements IWorkspaceRunnable {
>  							public boolean visit(IResource resource) throws CoreException {
>  								try {
>  									String repoPath = rm.getRepoRelativePath(resource);
> +									// We use add to reset the assume valid bit, so we check the bit
> +									// first. If a resource within a ignored folder is marked
> +									// we ignore it here, i.e. there is no way to unmark it expect
> +									// by explicitly selecting and invoking track on it.
>  									if (resource.getType() == IResource.FILE) {
>  										Entry entry = index.getEntry(repoPath);
> -										if (!Team.isIgnored((IFile)resource) || entry != null && entry.isAssumedValid()) {
> +										if (!Team.isIgnoredHint(resource) || entry != null && entry.isAssumedValid()) {
>  											entry = index.add(rm.getWorkDir(), new File(rm.getWorkDir(), repoPath));
>  											entry.setAssumeValid(false);
>  										}
>  									}
> +									if (Team.isIgnoredHint(resource))
> +										return false;
> +
>  								} catch (IOException e) {
>  									e.printStackTrace();
>  									throw Activator.error(CoreText.AddOperation_failed, e);
-- 
Shawn.
Previous: Robin RosenbergNext: Galder Zamarreno
Message 3 of 5 in “[egit-jgit] excluded patterns are decorated as being untracked”
  1. Galder ZamarrenoJun 17, 2008
  2. Robin RosenbergJun 17, 2008
  3. Shawn O. PearceJun 18, 2008
  4. Galder ZamarrenoJun 18, 2008
  5. Robin RosenbergJun 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.