git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Florian Köberle" <FloriansKarten@web.de>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [egit / jgit] Implementation of a file tree iteration using ignore rules.
Date: Sat, 10 May 2008 17:11:59 +0200	[thread overview]
Message-ID: <4825BB3F.4060006@web.de> (raw)
In-Reply-To: <20080510001132.GF29038@spearce.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

| This is an interesting start.  Did you see the existing "Main" class
| in org.spearce.jgit/src/org/spearce/jgit/pgm?  It sets up and invokes
| a TextBuiltin, which is sort of like the "Command" class you added in
| your first patch.  Though TextBuiltins are created on-the-fly and thus
| are harder/impossible to use to format a "jgit help".
I noticed that the class appeared after a rebase, but didn't have a
closer look to it yet.

|
| I think your approach of building up a table of commands is likely
| the better one long term, so I am interested in seeing the two unify,
| taking the best from each (from Main and MainProgram that is).
|
| Please note that jgit is restricted to Java 5 APIs only right now.
| The "MainProgram" class you introduced uses Arrays.copyOfRange()
| which does not compile under Java 5.  I guess it is new in Java 6?
Yes it is new in Java 6. A patch fixing this is contained in the patch
set I send to the mailing list.
| What is missing here is really two things:
|
|  #1)  Take .gitignore and .git/info/exclude (and other patterns) into
|       account as WorkingTreeIterator (base class of FileTreeIterator)
|       loops over the entries in a directory.

I had a look at the WorkingTreeIterator and it seems to me that it is
possible to reuse my Rules class there.

We could simply give the iterator a member variable of type Rule.

The method loadEntries of WorkingTreeIterator could then use the rules
class to filter out unwanted files and directories.

The constructor  WorkingTreeIterator(final WorkingTreeIterator p) could
use the Rules#getRulesForSubDirectory to create a Rules instance from
the parent Rules instance.

Also note that my Rules implementation would ignore the directory a in
the case of "/a\n!/a/b.txt". This means that a directory may not appear
in the list entries, but must be used to create another iterator.

I suggest to put all the classes from the package
org.spearce.jgit.treewalk and the package
org.spearce.jgit.lib.fileiteration into one package. Please tell me
which package and I will send a patch, or do it yourself. I don't have
any outstanding changes.

I don't see a easy way of porting my Rules implementation to the
TreeFilter framework, but as you may noticed it is may not necessary to
do so.

| I think the command you are looking for is `git send-email`.
Thanks, after switching to a newer version of git I was able to use that
command.

Best regards,
Florian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIJbr659ca4mzhfxMRAn/ZAKCYERVJfHgZmvGFXEP+uCT0rD2RawCgqBIW
Xa4NTcAWjt8j0oMPdKMjbbY=
=koEN
-----END PGP SIGNATURE-----

  reply	other threads:[~2008-05-10 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09 13:20 [egit / jgit] Implementation of a file tree iteration using ignore rules Florian Köberle
2008-05-10  0:11 ` Shawn O. Pearce
2008-05-10 15:11   ` Florian Köberle [this message]
2008-05-11  0:12     ` Shawn O. Pearce

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=4825BB3F.4060006@web.de \
    --to=florianskarten@web.de \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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).