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 - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| James Bottomley | Re: [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done" |
| Tomasz Kłoczko | Is it time for remove (crap) ALSA from kernel tree ? |
| Bryan Woods | Stardom SATA HSM violation |
| Paa Paa | Lower HD transfer rate with NCQ enabled? |
git: | |
| Linus Torvalds | Re: cleaner/better zlib sources? |
| Ittay Dror | Re: detecting rename->commit->modify->commit |
| Pascal Obry | Re: Git-windows and git-svn? |
| Chris Hoffman | git-daemon on Windows? |
| Havard Eidnes | Re: Fork bomb protection patch |
| Garrett D'Amore | Re: @booted_kernel magic symlink? |
| Juergen Hannken-Illjes | Re: Redoing file system suspension API (update) |
| Steven M. Bellovin | Re: /dev on tmpfs problem |
| Larry McVoy | Re: tcp bw in 2.6 |
| Volker Armin Hemmann | build error with 2.6.27.6+reiser4+ehci-hub patch. ERROR: "mii_ethtool_gset" [drive... |
| Tilman Schmidt | [2.6.25-rc5-mm1] regression: cannot run Postfix sendmail command as non-root |
| Indan Zupancic | Re: Realtek 8111C transmit timed out |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 1 hour ago | Linux kernel |
| USB statistics | 2 hours ago | Linux kernel |
| Block Sub System query | 6 hours ago | Linux kernel |
| kernel module to intercept socket creation | 7 hours ago | Linux kernel |
| Image size changing during each build | 8 hours ago | Linux kernel |
| Soft lock bug | 13 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 19 hours ago | Linux kernel |
| Question on swap as ramdisk partition | 21 hours ago | Linux kernel |
| serial driver xmit problem | 1 day ago | Linux kernel |
| Generic Netlink subsytem | 1 day ago | Linux kernel |
