From: "Shawn O. Pearce" <spearce@spearce.org>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Cc: Galder Zamarreno <galder.zamarreno@redhat.com>,
git@vger.kernel.org, Florian Koeberle <florianskarten@web.de>,
Marek Zawirski <marek.zawirski@gmail.com>
Subject: Re: [egit-jgit] excluded patterns are decorated as being untracked
Date: Wed, 18 Jun 2008 00:39:31 -0400 [thread overview]
Message-ID: <20080618043931.GC11793@spearce.org> (raw)
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.
> 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.
next prev parent reply other threads:[~2008-06-18 4:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-17 16:43 [egit-jgit] excluded patterns are decorated as being untracked Galder Zamarreno
2008-06-17 21:16 ` Robin Rosenberg
2008-06-18 4:39 ` Shawn O. Pearce [this message]
2008-06-18 15:40 ` Galder Zamarreno
2008-06-18 22:03 ` Robin Rosenberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080618043931.GC11793@spearce.org \
--to=spearce@spearce.org \
--cc=florianskarten@web.de \
--cc=galder.zamarreno@redhat.com \
--cc=git@vger.kernel.org \
--cc=marek.zawirski@gmail.com \
--cc=robin.rosenberg.lists@dewire.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).