git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org, spearce@spearce.org
Subject: [JGIT PATCH 0/5] jgit diff
Date: Thu, 3 Sep 2009 12:45:43 +0200 (CEST)	[thread overview]
Message-ID: <cover.1251974493u.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <alpine.DEB.1.00.0909030846230.8306@pacific.mpi-cbg.de>

This patch series provides a rudimentary, working implementation of "jgit 
diff".  It does not provide all modes of "git diff" -- by far! -- but it 
is robust, and should provide a good starting point for further work.

Unfortunately, I lack the time to do proper profiling/benchmarking, but I 
verified at least that it succeeds in recreating valid patches for all 
commits in jgit.git with this script:

	git rev-list HEAD |
	sed '$d' |
	while read commit
	do
	        printf "\\r$commit "
	        (export GIT_INDEX_FILE=test-index &&
	         ./jgit diff $commit^ $commit > test-patch &&
	         git read-tree $commit^ &&
	         git apply --cached test-patch &&
	         git diff --exit-code --cached $commit) || break
	done

Johannes Schindelin (5):
  Add set to IntList
  Add Myers' algorithm to generate diff scripts
  Add a test class for Myers' diff algorithm
  Prepare RawText for diff-index and diff-files
  Add the "jgit diff" command

 .../services/org.spearce.jgit.pgm.TextBuiltin      |    1 +
 .../src/org/spearce/jgit/pgm/Diff.java             |  133 +++++
 .../tst/org/spearce/jgit/diff/MyersDiffTest.java   |  103 ++++
 .../tst/org/spearce/jgit/util/IntListTest.java     |   21 +
 .../src/org/spearce/jgit/diff/DiffFormatter.java   |    2 +-
 .../src/org/spearce/jgit/diff/MyersDiff.java       |  515 ++++++++++++++++++++
 .../src/org/spearce/jgit/diff/RawText.java         |   28 +-
 .../src/org/spearce/jgit/util/IntList.java         |   17 +
 8 files changed, 818 insertions(+), 2 deletions(-)
 create mode 100644 org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Diff.java
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/diff/MyersDiffTest.java
 create mode 100644 org.spearce.jgit/src/org/spearce/jgit/diff/MyersDiff.java

  reply	other threads:[~2009-09-03 10:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02 23:28 [JGIT] Request for help Nasser Grainawi
2009-09-03  0:04 ` Johannes Schindelin
2009-09-03  1:22   ` Shawn O. Pearce
2009-09-03  6:55     ` jgit diff, was " Johannes Schindelin
2009-09-03 10:45       ` Johannes Schindelin [this message]
2009-09-03 10:46         ` [JGIT PATCH 1/5] Add set to IntList Johannes Schindelin
2009-09-03 10:46         ` [JGIT PATCH 2/5] Add Myers' algorithm to generate diff scripts Johannes Schindelin
2009-09-03 10:46         ` [JGIT PATCH 3/5] Add a test class for Myers' diff algorithm Johannes Schindelin
2009-09-03 10:47         ` [JGIT PATCH 4/5] Prepare RawText for diff-index and diff-files Johannes Schindelin
2009-09-03 10:47         ` [JGIT PATCH 5/5] Add the "jgit diff" command Johannes Schindelin
2009-09-03 10:48         ` [JGIT PATCH 0/5] jgit diff Johannes Schindelin
2009-10-01 18:47         ` Shawn O. Pearce
2009-10-01 21:47           ` Johannes Schindelin
2009-09-03 15:54       ` jgit diff, was Re: [JGIT] Request for help Christian Halstrick
2009-09-03 12:45     ` Jonas Fonseca
2009-09-03 14:42       ` Shawn O. Pearce
2009-09-03 15:38         ` Jonas Fonseca
2009-09-03 15:52           ` Shawn O. Pearce
2009-09-04  5:00             ` Gabe McArthur
2009-09-04  7:33               ` Mark Struberg
2009-09-04 12:22                 ` Jonas Fonseca
2009-09-04 12:27                   ` Mark Struberg
2009-09-04 12:41                 ` Jonas Fonseca
2009-09-04 12:47                   ` Mark Struberg
2009-09-03  1:23 ` Shawn O. Pearce
2009-09-03 19:46   ` Nasser Grainawi
2009-09-03 19:49     ` Shawn O. Pearce
2009-09-03 21:09       ` Nasser Grainawi

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=cover.1251974493u.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.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).