git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: "Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@gmail.com>
Cc: Robin Rosenberg <robin.rosenberg@dewire.com>,
	git@vger.kernel.org, "Daniel Cheng (aka SDiZ)" <git@sdiz.net>
Subject: Re: [PATCH EGIT 1/2] Implement "jgit rev-parse"
Date: Fri, 1 May 2009 08:14:54 -0700	[thread overview]
Message-ID: <20090501151454.GC23604@spearce.org> (raw)
In-Reply-To: <1241174172-19581-1-git-send-email-git@sdiz.net>

"Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@gmail.com> wrote:
>  .../src/org/spearce/jgit/pgm/RevParse.java         |   70 ++++++++++++++++++++

Thanks.  I have two remarks, I'm amending them in as they are
trivial for me to fix.

> +class RevParse extends TextBuiltin {
> +	RevWalk walk;

Unused field.  Deleted.

> +	@Option(name = "--all")
> +	boolean all = false;
> +
> +	@Argument(index = 0, metaVar = "commit-ish")
> +	private final List<ObjectId> commits = new ArrayList<ObjectId>();
> +
> +	@Override
> +	protected void run() throws Exception {
> +		if (all) {
> +			Map<String, Ref> allRefs = db.getAllRefs();
> +			for (final Ref r : allRefs.values())
> +				System.out.println(r.getObjectId().name());
> +		} else {
> +			for (final ObjectId o : commits)
> +				System.out.println(o.name());

These should use the PrintWriter called "out" inherited from
the TextBuiltin class, not System.out.  Fixed.

-- 
Shawn.

      parent reply	other threads:[~2009-05-01 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-01 10:36 [PATCH EGIT 1/2] Implement "jgit rev-parse" Daniel Cheng (aka SDiZ)
2009-05-01 10:36 ` [PATCH EGIT 2/2] Enable "jgit show-ref" Daniel Cheng (aka SDiZ)
2009-05-01 15:14 ` Shawn O. Pearce [this message]

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=20090501151454.GC23604@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@sdiz.net \
    --cc=git@vger.kernel.org \
    --cc=j16sdiz+freenet@gmail.com \
    --cc=robin.rosenberg@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).