From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: Shawn Pearce <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: EGIT unpackedreadr problem
Date: Sun, 3 Dec 2006 02:00:13 +0100 [thread overview]
Message-ID: <200612030200.13857.robin.rosenberg@dewire.com> (raw)
Subject: [PATCH] Utility to show a log.
This program shows commit information for a commit.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
The main reason for this patch is not the program itself. The new code to
read really fast but doesn't always work.
Try the supplied program. I get no parents and the treeid
is wrong. An interesting thing is that if you look in the debugger the author
and commit messag is actually correct. Only the tree id and parent are wrong.
Not sure what's going on. The UnpackedReader "looks" like it does
the equivalent of what it did before,but apparently it isn't.
Reading commits from packs works fine. It's the unpacked reader that's bad.
-- robin
# java -Xmx100m -cp /home/me/SW/EGIT/org.spearce.jgit/bin org.spearce.jgit.pgm.Log c1ad80df56ff5f9d945eac8ac905b8009de30081
commit c1ad80df56ff5f9d945eac8ac905b8009de30081
tree 7ba4b782c23bb35b0cb7dbc46cfc09a6e887e19d
author PersonIdent[Shawn O. Pearce, spearce@spearce.org, Wed Nov 29 21:02:45 CET 2006]
Misc. code formatting cleanups.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
# git cat-file -p c1ad80df56ff5f9d945eac8ac905b8009de30081
tree a7ba4b7f1824763f182b6d45288e52fceece3c65b
parent 82c23bb35b0cb7dbc46cfc09a6e887e19dfb20f9
author Shawn O. Pearce <spearce@spearce.org> 1164830576 -0500
committer Shawn O. Pearce <spearce@spearce.org> 1164830576 -0500
Misc. code formatting cleanups.
[...]
org.spearce.jgit/src/org/spearce/jgit/pgm/Log.java | 23 ++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/pgm/Log.java b/org.spearce.jgit/src/org/spearce/jgit/pgm/Log.java
new file mode 100644
index 0000000..9598792
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/pgm/Log.java
@@ -0,0 +1,23 @@
+ package org.spearce.jgit.pgm;
+
+ import java.io.File;
+ import java.io.IOException;
+import java.util.Iterator;
+
+import org.spearce.jgit.lib.Commit;
+import org.spearce.jgit.lib.Repository;
+
+ public class Log {
+ public static void main(String[] args) throws IOException {
+ Repository db = new Repository(new File(".git"));
+ Commit commit = db.mapCommit(args[0]);
+ System.out.println("commit "+commit.getCommitId());
+ System.out.println("tree "+commit.getTreeId());
+ for (Iterator ci=commit.getParentIds().iterator(); ci.hasNext(); ) {
+ System.out.println("parent "+ci.next());
+ }
+ System.out.println("author "+commit.getAuthor());
+ System.out.println();
+ System.out.println(commit.getMessage());
+ }
+ }
--
1.4.4.gf05d
next reply other threads:[~2006-12-03 0:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 1:00 Robin Rosenberg [this message]
2006-12-03 2:25 ` EGIT unpackedreadr problem Shawn 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=200612030200.13857.robin.rosenberg@dewire.com \
--to=robin.rosenberg@dewire.com \
--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