]> source.dussan.org Git - jgit.git/log
jgit.git
14 years agoAdd one more test to ReadTreeTest 50/1450/1
Christian Halstrick [Mon, 30 Aug 2010 07:07:59 +0000 (09:07 +0200)]
Add one more test to ReadTreeTest

Add an explicit test case to check that we don't
overwrite dirty files in case Head & Index are
equal.

Change-Id: I6266d0a449e55369d2d0a048694dca5565c5fcf3
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
14 years agoMerge "Buffer very large delta streams to reduce explosion of CPU work"
Shawn O. Pearce [Sun, 29 Aug 2010 00:31:24 +0000 (20:31 -0400)]
Merge "Buffer very large delta streams to reduce explosion of CPU work"

14 years agoRevert "Hide Maven target directories from Eclipse" 44/1444/2
Robin Rosenberg [Sat, 28 Aug 2010 07:45:23 +0000 (09:45 +0200)]
Revert "Hide Maven target directories from Eclipse"

This reverts commit db4c516f673e4c274e55adc27a95891c52a5aba8 since
it breaks compatibility with Eclipse 3.5 which can no longer import
the projects

Bug: 323390
Change-Id: I3cc91364a6747cfcb4c611a9be5258f81562f726

14 years agoBuffer very large delta streams to reduce explosion of CPU work 41/1441/1
Shawn O. Pearce [Fri, 27 Aug 2010 20:28:14 +0000 (13:28 -0700)]
Buffer very large delta streams to reduce explosion of CPU work

Large delta streams are unpacked incrementally, but because a delta
can seek to a random position in the base to perform a copy we may
need to inflate the base repeatedly just to complete one delta.
So work around it by copying the base to a temporary file, and then
we can read from that temporary file using random seeks instead.
Its far more efficient because we now only need to inflate the
base once.

This is still really ugly because we have to dump to a temporary
file, but at least the code can successfully process a large
file without throwing OutOfMemoryError.  If speed is an
issue, the user will need to increase the JVM heap and ensure
core.streamFileThreshold is set to a higher value, so we don't use
this code path as often.

Unfortunately we lose the "optimization" of skipping over portions
of a delta base that we don't actually need in the final result.
This is going to cause us to inflate and write to disk useless
regions that were deleted and do not appear in the final result.
We could later improve on our code by trying to flatten delta
instruction streams before we touch the bottom base object, and
then only store the portions of the base we really need for the
final result and that appear out-of-order.  Since that is some
pretty complex code I'm punting on it for now and just doing this
simple whole-object buffering.

Because the process umask might be permitting other users to read
files we create, we put the temporary buffers into $GIT_DIR/objects.
We can reasonably assume that if a reader can read our temporary
buffer file in that directory, they can also read the base pack
file we are pulling it from and therefore its not a security breach
to expose the inflated content in a file.  This requires a reader
to have write access to the repository, but only if the file is
really big.  I'd rather err on the side of caution here and refuse
to read a very big file into /tmp than to possibly expose a secured
content because the Java 5 JVM won't let us create a protected
temporary file that only the current user can access.

Change-Id: I66fb80b08cbcaf0f65f2db0462c546a495a160dd
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd TagCommand 93/1293/11
Chris Aniszczyk [Thu, 12 Aug 2010 16:25:31 +0000 (11:25 -0500)]
Add TagCommand

A tag command is added to the Git porcelain API. Tests were
also added to stress test the tag command.

Change-Id: Iab282a918eb51b0e9c55f628a3396ff01c9eb9eb
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoImplement a Dircache checkout (needed for merge) 25/825/18
Christian Halstrick [Fri, 11 Jun 2010 05:33:16 +0000 (07:33 +0200)]
Implement a Dircache checkout (needed for merge)

Implementation of a checkout (or 'git read-tree') operation which
works together with DirCache. This implementation does similar things
as WorkDirCheckout which main problem is that it works with deprecated
GitIndex. Since GitIndex doesn't support multiple stages of a file
which is required in merge situations this new implementation is
required to enable merge support.

Change-Id: I13f0f23ad60d98e5168118a7e7e7308e066ecf9c
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoAdd getBaseCommit() to Merger 56/1356/3
Christian Halstrick [Fri, 20 Aug 2010 15:17:01 +0000 (17:17 +0200)]
Add getBaseCommit() to Merger

The Merger was was only exposing the merge base as an
AbstractTreeIterator. Since we need the merge base as
RevCommit to generate the merge result I expose it here.

Change-Id: Ibe846370a35ac9bdb0c97ce2e36b2287577fbcad
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoIncrease heap size for jgit tests 35/1435/2
Matthias Sohn [Thu, 26 Aug 2010 22:26:25 +0000 (00:26 +0200)]
Increase heap size for jgit tests

Otherwise PackFileTest.testDelta_LargeObjectChain() reproducibly
fails with OutOfMemoryError on Mac OS X 10.6.4.

Change-Id: I6a55ff9ba181102606a0d99ffd52392a1615a422
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoRemove unused import 33/1433/1
Matthias Sohn [Thu, 26 Aug 2010 21:53:41 +0000 (23:53 +0200)]
Remove unused import

Change-Id: I22f5751720576475e5e1e04110268f6f7fb376b1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoMerge "Fix parsing of multiple authors in PersonIdent."
Shawn Pearce [Thu, 26 Aug 2010 19:00:58 +0000 (15:00 -0400)]
Merge "Fix parsing of multiple authors in PersonIdent."

14 years agoMerge "Use JUnit4 for tests"
Shawn Pearce [Thu, 26 Aug 2010 18:50:05 +0000 (14:50 -0400)]
Merge "Use JUnit4 for tests"

14 years agoRun formatter on edited lines via save action 31/1431/1
Chris Aniszczyk [Thu, 26 Aug 2010 17:31:34 +0000 (12:31 -0500)]
Run formatter on edited lines via save action

Updates the project level settings to run the formatter
on save on only on the edited lines.

Change-Id: I26dd69d0c95e6d73f9fdf7031f3c1dbf3becbb79
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoUse JUnit4 for tests 30/1430/1
Chris Aniszczyk [Thu, 26 Aug 2010 17:26:38 +0000 (12:26 -0500)]
Use JUnit4 for tests

We should use JUnit4 for tests. This patch updates
the MANIFEST.MF and respective launch configurations.

Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoFix parsing of multiple authors in PersonIdent. 24/1324/5
Marc Strapetz [Thu, 19 Aug 2010 13:34:44 +0000 (15:34 +0200)]
Fix parsing of multiple authors in PersonIdent.

PersonIdent should be parsable for an invalid commit which
contains multiple authors, like "A <a@a.org>, B <b@b.org>".
PersonIdent(String) constructor now delegates to
RawParseUtils.parsePersonIdent().

Change-Id: Ie9798d36d9ecfcc0094ca795f5a44b003136eaf7

14 years agoIncrease temporary buffer for unit test 28/1428/1
Shawn O. Pearce [Thu, 26 Aug 2010 00:53:00 +0000 (17:53 -0700)]
Increase temporary buffer for unit test

Because we are using the large stream size, we have to be
above the STREAM_THRESHOLD constant, which I just increased.

Change-Id: I6f10ec8558d9f751d4b547fcae05af94f1c8866b
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoIncrease the default streaming threshold to 15 MiB 27/1427/1
Shawn O. Pearce [Thu, 26 Aug 2010 00:05:31 +0000 (17:05 -0700)]
Increase the default streaming threshold to 15 MiB

Applying deltas in the large streaming mode is horrifically slow.
Trying to pack icu4c is impossible because a single 11 MiB file
sits on top of a 15 MiB file though a 10 deep delta chain, which
results in this very slow inflate process.

Upping the default limit to 15 MiB lets us process this large in a
reasonable time, but its still sufficiently low enough to prevent
exploding the heap of a very large process like Eclipse or Gerrit
Code Review.

We have to revisit the streaming delta application process and do
something much smarter, like flatten the delta chain before we apply
it to the base.  But even that is ugly, I've seen a 155 MiB delta
sitting on top of a 450 MiB file to produce a 300 MiB result object.
If the chain is deep, we may have trouble flatting it down.

Change-Id: If5a0dcbf9d14ea683d75546f104b09bb8cd8fdbb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoFix reuse from pack file for REF_DELTA types 26/1426/1
Shawn O. Pearce [Wed, 25 Aug 2010 23:46:43 +0000 (16:46 -0700)]
Fix reuse from pack file for REF_DELTA types

We miscomputed the CRC32 checksum for a REF_DELTA type of object, by
not including the full 20 byte ObjectId of the delta base in the CRC
code we use when the delta is too large to go through our two faster
small reuse code paths.  This resulted in a corruption error during
packing, where the PackFile erroneously suspected the data was wrong
on the local filesystem and aborted writing, because the CRC didn't
match what we had read from the index.

Change-Id: I7d12cdaeaf2c83ddc11223ce0108d9bd6886e025
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoCleanup and correct resolve Javadoc 10/1410/2
Shawn O. Pearce [Wed, 25 Aug 2010 01:18:24 +0000 (18:18 -0700)]
Cleanup and correct resolve Javadoc

We didn't fully cover what we support and what we don't.  It was
also a bit hard to follow the syntaxes supported.  Clean that up
by documenting it.

Change-Id: I7b96fa6cbefcc2364a51f336712ad361ae42df2d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoSupport parsing commit:path style blob references 09/1409/2
Shawn O. Pearce [Wed, 25 Aug 2010 00:52:26 +0000 (17:52 -0700)]
Support parsing commit:path style blob references

We can now resolve expressions that reference a path within a
commit, designating a specific revision of a specific tree or
file in the project.

Change-Id: Ie6a8be629d264d72209db894bd680c5900035cc0
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoSupport parsing git describe style output 08/1408/2
Shawn O. Pearce [Wed, 25 Aug 2010 00:35:52 +0000 (17:35 -0700)]
Support parsing git describe style output

We now match on the -gABBREV style output created by git describe
when its describing a non-tagged commit, and resolve that back to
the full ObjectId using the abbreviation resolution feature that
we already support.

Change-Id: Ib3033f9483d9e1c66c8bb721ff48d4485bcdaef1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoRename T0008_testparserev to RepositoryResolveTest 07/1407/2
Shawn O. Pearce [Tue, 24 Aug 2010 23:45:53 +0000 (16:45 -0700)]
Rename T0008_testparserev to RepositoryResolveTest

Calling it by the old numerical numbering system makes it really
hard to find the test that tests Repository.resolve(String).

Change-Id: I92d0ecbc8d66ce21bfed08888eeedf1300ffa594
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoThrow AmbiguousObjectException during resolve if its ambiguous 03/1403/3
Shawn O. Pearce [Tue, 24 Aug 2010 23:26:40 +0000 (16:26 -0700)]
Throw AmbiguousObjectException during resolve if its ambiguous

Its wrong to return null if we are resolving an abbreviation and we
have proven it matches more than one object.  We know how to resolve
it if we had more nybbles, as there are two or more objects with the
same prefix.  Declare that to the caller quite clearly by giving them
an AmbiguousObjectException.

Change-Id: I01bb48e587e6d001b93da8575c2c81af3eda5a32
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoComplete an abbreviation when formatting a patch 02/1402/3
Shawn O. Pearce [Tue, 24 Aug 2010 22:50:36 +0000 (15:50 -0700)]
Complete an abbreviation when formatting a patch

If we are given a DiffEntry header that already has abbreviated
ObjectIds on it, we may still be able to resolve those locally and
output the difference.  Try to do that through the new resolve API
on ObjectReader.

Change-Id: I0766aa5444b7b8fff73620290f8c9f54adc0be96
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoUse limited getCachedBytes in RevWalk 01/1401/3
Shawn O. Pearce [Tue, 24 Aug 2010 19:50:59 +0000 (12:50 -0700)]
Use limited getCachedBytes in RevWalk

Parsing is rewritten to use the size limited form of getCachedBytes,
thus freeing the revwalk infrastructure from needing to care about
a large object vs. a small object when it gets an ObjectLoader.

Right now we hardcode our upper bound for a commit or annotated
tag to be 15 MiB.  I don't know of any that is more than 1 MiB in
the wild, so going 15x that should give us some reasonable headroom.

Change-Id: If296c211d8b257d76e44908504e71dd9ba70ffa8
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoUse limited getCachedBytes code to reduce duplication 00/1400/3
Shawn O. Pearce [Tue, 24 Aug 2010 21:01:55 +0000 (14:01 -0700)]
Use limited getCachedBytes code to reduce duplication

Rather than duplicating this block everywhere, reuse the limited size
form of getCachedBytes to acquire the content of an object.

Change-Id: I2e26a823e6fd0964d8f8dbfaa0fc2e8834c179c1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoAdd brute force byte array loading to ObjectLoader 99/1399/3
Shawn O. Pearce [Tue, 24 Aug 2010 19:46:56 +0000 (12:46 -0700)]
Add brute force byte array loading to ObjectLoader

Some algorithms are coded in a way that requires us to provide them
the entire object contents as a contiguous byte array.  The parsers
in RevCommit and RevTag, or our RawText objects are really good
examples of these.

Instead of duplicating this logic everywhere, lets put it into the
base ObjectLoader type.  That way the caller only needs to give us
their upper size bound, and we'll do the rest of the heavy work to
figure out if the object still fits within that bound, and get them
an array that has the complete contents.

Change-Id: Id95a7f79d2b97e39f6949370ccca2f2c9cfb1a0f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoMerge "Add ObjectId to the LargeObjectException"
Chris Aniszczyk [Wed, 25 Aug 2010 23:54:32 +0000 (19:54 -0400)]
Merge "Add ObjectId to the LargeObjectException"

14 years agoAdd ObjectId to the LargeObjectException 98/1398/3
Shawn O. Pearce [Tue, 24 Aug 2010 23:11:41 +0000 (16:11 -0700)]
Add ObjectId to the LargeObjectException

A chunk of code that throws LargeObjectException may or may not have
the specific ObjectId on hand when its thrown.  If it does, we want
to cache it in the exception, and put that in the message.  If it is
missing we want to be able to set it later from a higher level stack
frame that does have the object handy.

Change-Id: Ife25546158868bdfa886037e4493ef8235ebe4b9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoMerge "Don't copy more than the object size"
Chris Aniszczyk [Wed, 25 Aug 2010 23:52:36 +0000 (19:52 -0400)]
Merge "Don't copy more than the object size"

14 years agoMerge "Use the ObjectStream size during copyTo"
Chris Aniszczyk [Wed, 25 Aug 2010 23:50:43 +0000 (19:50 -0400)]
Merge "Use the ObjectStream size during copyTo"

14 years agoFixed typo in DirCache documentation 18/1418/1
Benjamin Muskalla [Wed, 25 Aug 2010 13:52:18 +0000 (15:52 +0200)]
Fixed typo in DirCache documentation

Change-Id: Ifc2e9047a45d57829fce59c66618e5de9120a5bb
Signed-off-by: Benjamin Muskalla <bmuskalla@eclipsesource.com>
14 years agoDon't copy more than the object size 97/1397/2
Shawn O. Pearce [Tue, 24 Aug 2010 19:59:10 +0000 (12:59 -0700)]
Don't copy more than the object size

If the loader's stream is broken and returns to us more content
than it originally declared as the size of the object, don't
copy that onto the output stream.  Instead throw EOFException
and abort fast.  This way we don't follow an infinite stream,
but instead will at least stop when the size was reached.

Change-Id: I7ec0c470c875f03b1f12a74a9b4d2f6e73b659bb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoUse the ObjectStream size during copyTo 96/1396/2
Shawn O. Pearce [Tue, 24 Aug 2010 19:56:47 +0000 (12:56 -0700)]
Use the ObjectStream size during copyTo

If the stream is a delta decompression stream, getting the size
can be expensive.  Its cheaper to get it from the stream itself
rather than from the object loader.

Change-Id: Ia7f0af98681f6d56ea419a48c6fa8eea09274b28
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoFix ObjectDirectory abbreviation resolution to notice new packs 06/1406/1
Shawn O. Pearce [Wed, 25 Aug 2010 00:20:50 +0000 (17:20 -0700)]
Fix ObjectDirectory abbreviation resolution to notice new packs

If we can't resolve an abbreviation, it might be because there is
a new pack file we haven't picked up yet.  Try scanning the packs
again and recheck each pack if there were differences from the last
scan we did.

Because of this, we don't have to open a pack during the test where
we generate a pack on the fly.  We'll miss on the first loop during
which the PackList is the NO_PACKS magic initialization constant,
and pick up the newly created index during this retry logic.

Change-Id: I7b97efb29a695ee60c90818be380f7ea23ad13a3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoFully implement SHA-1 abbreviations 89/1389/1
Shawn O. Pearce [Mon, 23 Aug 2010 22:53:11 +0000 (15:53 -0700)]
Fully implement SHA-1 abbreviations

ObjectReader implementations are now responsible for creating the
unique abbreviation of an ObjectId, or for resolving an abbreviation
back to its full form.  In this latter case the reader can offer up
multiple candidates to the caller, who may be able to disambiguate
them based on context.

Repository.resolve() doesn't take multiple candidates into account
right now, but it could in the future by looking for a remaining
^0 or ^{commit} suffix and take an expansion if there is only one
commit that matches the input abbreviation.  It could also use
the distance from an annotated tag to resolve "tag-NNN-gcommit"
style strings that are often output by `git describe`.

Change-Id: Icd3250adc8177ae05278b858933afdca0cbbdb56
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoDelete deprecated ObjectWriter 87/1387/1
Shawn O. Pearce [Mon, 23 Aug 2010 17:59:30 +0000 (10:59 -0700)]
Delete deprecated ObjectWriter

ObjectWriter is a deprecated API that people shouldn't be using.
So get rid of it in favor of the ObjectInserter API.

Change-Id: I6218bcb26b6b9ffb64e3e470dba5dca2e0a62fd4
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd openEntryStream to WorkingTreeIterator 86/1386/1
Shawn O. Pearce [Mon, 23 Aug 2010 17:30:58 +0000 (10:30 -0700)]
Add openEntryStream to WorkingTreeIterator

This makes it easier for abstract tools like AddCommand to open the
file from the working tree, without knowing internal details about
how the tree is managed.

Change-Id: Ie64a552f07895d67506fbffb3ecf1c1be8a7b407
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd setLength(long) to DirCacheEntry 85/1385/1
Shawn O. Pearce [Mon, 23 Aug 2010 17:29:50 +0000 (10:29 -0700)]
Add setLength(long) to DirCacheEntry

Applications should favor the long style interface, especially when
their source input is a long type, e.g. coming from java.io.File.
This way when the index format is later changed to support a
larger file size than 2 GiB we can handle it by just changing the
entry code, and not need to fix a lot of applications.

Change-Id: I332563caeb110014e2d544dc33050ce67ae9e897
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMove commit and tag formatting to CommitBuilder, TagBuilder 84/1384/1
Shawn O. Pearce [Mon, 23 Aug 2010 17:13:25 +0000 (10:13 -0700)]
Move commit and tag formatting to CommitBuilder, TagBuilder

These objects should be responsible for their own formatting,
rather than delegating it to some obtuse type called ObjectInserter.

While we are at it, simplify the way we insert these into a database.
Passing in the type and calling format in application code turned
out to be a huge mistake in terms of ease-of-use of the insert API.

Change-Id: Id5bb95ee56aa2a002243e9b7853b84ec8df1d7bf
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoRename Commit, Tag to CommitBuilder, TagBuilder 83/1383/1
Shawn O. Pearce [Mon, 23 Aug 2010 16:46:14 +0000 (09:46 -0700)]
Rename Commit, Tag to CommitBuilder, TagBuilder

Since these types no longer support reading, calling them a Builder
is a better description of what they do.  They help the caller to
build a commit or a tag object.

Change-Id: I53cae5a800a66ea1721b0fe5e702599df31da05d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd documentation explaining how to read Commit and Tag 82/1382/1
Shawn O. Pearce [Mon, 23 Aug 2010 16:40:41 +0000 (09:40 -0700)]
Add documentation explaining how to read Commit and Tag

Since we stopped supporting these types for reading, but their
name is a natural candidate for someone to try and use in code,
explain where they should be looking instead.

Change-Id: I091a1b0ef71b842016020f938ba3161431aab9c9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoImproved creation of JGitInternalException 70/1370/1
Christian Halstrick [Mon, 23 Aug 2010 07:48:17 +0000 (09:48 +0200)]
Improved creation of JGitInternalException

There where 3 cases where a JGitInternalExcption was created
without specifying the root cause. This has been fixed.

Change-Id: I2ee08d04732371cd9e30874b1437b61217770b6a
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
14 years agoPerform automatic CRLF to LF conversion during WorkingTreeIterator 79/1179/7
Marc Strapetz [Thu, 29 Jul 2010 14:21:37 +0000 (16:21 +0200)]
Perform automatic CRLF to LF conversion during WorkingTreeIterator

WorkingTreeIterator now optionally performs CRLF to LF conversion for
text files.  A basic framework is left in place to support enabling
(or disabling) this feature based on gitattributes, and also to
support the more generic smudge/clean filter system.  As there is
no gitattribute support yet in JGit this is left unimplemented,
but the mightNeedCleaning(), isBinary() and filterClean() methods
will provide reasonable places to plug that into in the future.

[sp: All bugs inside of WorkingTreeIterator are my fault, I wrote
     most of it while cherry-picking this patch and building it on
     top of Marc's original work.]

CQ: 4419
Bug: 301775
Change-Id: I0ca35cfbfe3f503729cbfc1d5034ad4abcd1097e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoExpose pack fetch/push connections for subclassing 46/1246/3
Shawn O. Pearce [Wed, 4 Aug 2010 00:40:01 +0000 (17:40 -0700)]
Expose pack fetch/push connections for subclassing

These classes need to be visible if an application wants to define
its own native pack based protocol embedded within another layer,
much like we already support for smart HTTP.

Change-Id: I7e2ac3ad01d15b94d340128a395fe0b2f560ff35
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAllow ObjectReuseAsIs to have more control over write ordering 24/1224/4
Shawn O. Pearce [Tue, 3 Aug 2010 00:00:35 +0000 (17:00 -0700)]
Allow ObjectReuseAsIs to have more control over write ordering

The reuse system used by an object database may be able to benefit
from knowing what objects are coming next, and even improve data
throughput by delaying (or moving up) objects that are stored near
each other in the source database.

Pushing the iteration down into the reuse code makes it possible
for a smarter implementation to aggregate reuse.  But for the
standard pack file format on disk we don't bother, its quite
efficient already.

Change-Id: I64f0048ca7071a8b44950d6c2a5dfbca3be6bba6
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAllow ObjectToPack subclasses to use up to 4 bits of flags 23/1223/4
Shawn O. Pearce [Mon, 2 Aug 2010 19:26:01 +0000 (12:26 -0700)]
Allow ObjectToPack subclasses to use up to 4 bits of flags

Some instances may benefit from having access to memory efficient
storage for some small values, like single flag bits.  Give up a
portion of our delta depth field to make 4 bits available to any
subclass that wants it.

This still gives us room for delta chains of 1,048,576 objects,
and that is just insane.  Unpacking 1 million objects to get to
something is longer than most users are willing to wait for data
from Git.

Change-Id: If17ea598dc0ddbde63d69a6fcec0668106569125
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoImplement async/batch lookup of object data 22/1222/4
Shawn O. Pearce [Sun, 1 Aug 2010 03:08:10 +0000 (20:08 -0700)]
Implement async/batch lookup of object data

An ObjectReader implementation may be very slow for a single object,
but yet support bulk queries efficiently by batching multiple small
requests into a single larger request.  This easily happens when the
reader is built on top of a database that is stored on another host,
as the network round-trip time starts to dominate the operation cost.

RevWalk, ObjectWalk, UploadPack and PackWriter are the first major
users of this new bulk interface, with the goal being to support an
efficient way to pack a repository for a fetch/clone client when the
source repository is stored in a high-latency storage system.

Processing the want/have lists is now done in bulk, to remove
the high costs associated with common ancestor negotiation.

PackWriter already performs object reuse selection in bulk, but it
now can also do the object size lookup and object counting phases
with higher efficiency.  Actual object reuse, deltification, and
final output are still doing sequential lookups, making them a bit
more expensive to perform.

Change-Id: I4c966f84917482598012074c370b9831451404ee
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoOffer ObjectReaders advice about a RevWalk 21/1221/3
Shawn O. Pearce [Fri, 30 Jul 2010 02:52:36 +0000 (19:52 -0700)]
Offer ObjectReaders advice about a RevWalk

By giving the reader information about the roots of a revision
traversal, some readers may be able to prefetch information from
their backing store using background threads in order to reduce
data access latency.  However this isn't typically necessary so
the default reader implementation doesn't react to the advice.

Change-Id: I72c6cbd05cff7d8506826015f50d9f57d5cda77e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAllow object reuse selection to occur in parallel 20/1220/3
Shawn O. Pearce [Sat, 31 Jul 2010 01:12:23 +0000 (18:12 -0700)]
Allow object reuse selection to occur in parallel

ObjectReader implementations may wish to use multiple threads in
order to evaluate object reuse faster.  Let the reader make that
decision by passing the iteration down into the reader.

Because the work is pushed into the reader, it may need to locate a
given ObjectToPack given its ObjectId.  This can easily occur if the
reader has sent a list of ObjectIds to the object database and gets
back information keyed only by ObjectId, without the ObjectToPack
handle.  Expose lookup using the PackWriter's own internal map,
so the reader doesn't need to build a redundant copy to track the
assocation of ObjectId back to ObjectToPack.

Change-Id: I0c536405a55034881fb5db92a2d2a99534faed34
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoFlush the pack header as soon as its ready 19/1219/3
Shawn O. Pearce [Mon, 2 Aug 2010 17:17:21 +0000 (10:17 -0700)]
Flush the pack header as soon as its ready

When the output stream is deeply buffered (e.g. 1 MiB or more in
an HTTP servlet on some containers) trying to kick out the header
earlier will prevent the client from stalling hard while the first
1 MiB is received and it can process the pack header.  Forcing a
flush here lets the client see the header and start its progress
monitor for "Receiving objects: (1/N)" so the user knows there
is still activity occurring, even though the buffering may cause
there to be some lag as the buffer fills up on the sending side.

Change-Id: I3edf39e8f703fe87a738dc236d426b194db85e3a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoExport the ObjectId on MissingObjectException 18/1218/3
Shawn O. Pearce [Sat, 31 Jul 2010 00:50:58 +0000 (17:50 -0700)]
Export the ObjectId on MissingObjectException

Callers catching a MissingObjectException may need programmatic
access to the ObjectId that wasn't available in the repository.

Change-Id: I2be0380251ebe7e4921fa74e246724e48ad88b0e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoExpose OBJ_ANY in ObjectReader 17/1217/3
Shawn O. Pearce [Fri, 30 Jul 2010 23:43:34 +0000 (16:43 -0700)]
Expose OBJ_ANY in ObjectReader

Storage implementations or application code using an ObjectReader
may want to access this constant without being inside of a subclass
of the reader.

Change-Id: I6c871a03d5846b9bb899de4d14a265e8b204d8e0
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoExpose getType in ObjectToPack 16/1216/3
Shawn O. Pearce [Thu, 29 Jul 2010 23:59:40 +0000 (16:59 -0700)]
Expose getType in ObjectToPack

Storage implementations may find this useful when implementing the
ObjectReuseAsIs interface on their ObjectReader.  Expose it so we
don't force them to create a redundant copy of the information.

Change-Id: I802ec8113c00884fccde5d0e92b9849716316f62
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd copyTo(ByteBuffer) to AnyObjectId 15/1215/3
Shawn O. Pearce [Fri, 30 Jul 2010 15:51:11 +0000 (08:51 -0700)]
Add copyTo(ByteBuffer) to AnyObjectId

Change-Id: I3572f6113db883002f9c3a5ecc1bcc8370105c98
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd copyTo(byte[], int) to AnyObjectId 14/1214/3
Shawn O. Pearce [Fri, 30 Jul 2010 02:41:59 +0000 (19:41 -0700)]
Add copyTo(byte[], int) to AnyObjectId

This permits formatting in hex into an existing byte array
supplied by the caller, and mirrors our copyRawTo method
with the same parameter signature.

Change-Id: Ia078d83e338b09b903bfd2d04284e5283f885a19
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd a public RevTag.parse() method 67/1367/1
Shawn O. Pearce [Fri, 20 Aug 2010 22:41:49 +0000 (15:41 -0700)]
Add a public RevTag.parse() method

Callers might have a canonical tag encoding on hand that they
wish to convert into a clean structure for presentation purposes,
and the object may not be available in a repository.  (E.g. maybe
its a "draft" tag being written in an editor.)

Change-Id: I387a462afb70754aa7ee20891e6c0262438fdf32
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoAdd a public RevCommit.parse() method 66/1366/1
Shawn O. Pearce [Fri, 20 Aug 2010 16:32:07 +0000 (09:32 -0700)]
Add a public RevCommit.parse() method

Callers might have a canonical commit encoding on hand that they
wish to convert into a clean structure for presentation purposes,
and the object may not be available in a repository.  (E.g. maybe
its a "draft" commit being written in an editor.)

Change-Id: I21759cff337cbbb34dbdde91aec5aa4448a1ef37
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMake Tag class only for writing 65/1365/1
Shawn O. Pearce [Fri, 20 Aug 2010 22:18:25 +0000 (15:18 -0700)]
Make Tag class only for writing

The Tag class now only supports the creation of an annotated tag
object.  To read an annotated tag, applictions should use RevTag.
This permits us to have exactly one implementation, and RevTag's
is faster and more bug-free.

Change-Id: Ib573f7e15f36855112815269385c21dea532e2cf
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMake Commit class only for writing 64/1364/1
Shawn O. Pearce [Fri, 20 Aug 2010 15:53:46 +0000 (08:53 -0700)]
Make Commit class only for writing

The Commit class now only supports the creation of a commit object.
To read a commit, applictions should use RevCommit.  This permits
us to have exactly one implementation, and RevCommit's is faster
and more bug-free.

Change-Id: Ib573f7e15f36855112815269385c21dea532e2cf
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoCorrect PersonIdent hashCode() and equals() to ignore milliseconds 63/1363/1
Shawn O. Pearce [Fri, 20 Aug 2010 22:42:52 +0000 (15:42 -0700)]
Correct PersonIdent hashCode() and equals() to ignore milliseconds

Git doesn't store millisecond accuracy in person identity lines,
so a line that we create in Java and round-trip through a Git object
wouldn't compare as being equal.  Truncate to seconds when comparing
values to ensure the same identity is equal.

Change-Id: Ie4ebde64061f52c612714e89ad34de8ac2694b07
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoTry really hard to load a commit or tag 62/1362/1
Shawn O. Pearce [Fri, 20 Aug 2010 16:25:47 +0000 (09:25 -0700)]
Try really hard to load a commit or tag

When we need the canonical form of a commit or a tag in order to
parse it into our RevCommit or RevTag fields, we really need it as a
single contiguous byte array.  However the ObjectDatabase may choose
to give us a large loader.  In general commits or tags are always
under the several MiB limit, so even if the loader calls it "large"
we should still be able to afford the JVM heap memory required to
get a single byte array.  Coerce even large loaders into a single
byte array anyway.

Change-Id: I04efbaa7b31c5f4b0a68fc074821930b1132cfcf
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoFix ReadTreeTests to not rely on cached index 52/1352/1
Christian Halstrick [Fri, 20 Aug 2010 08:15:53 +0000 (10:15 +0200)]
Fix ReadTreeTests to not rely on cached index

ReadTreeTests relied on Repository.getIndex() which on
platforms which coarse FileSystemTimers failed to detect
index modifications. By explicitly reloading and writing
the index this problem is solved.

Change-Id: I0a98babfc2068a3b6b7d2257834988e1154f5b26
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoFix formatting of serialization code in ObjectId 43/1343/1
Shawn O. Pearce [Thu, 19 Aug 2010 18:53:22 +0000 (11:53 -0700)]
Fix formatting of serialization code in ObjectId

Change-Id: I5b3e99e9e658fe272a9e171db04b0f20e48ed8d3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMake ObjectId.compareTo final 42/1342/1
Shawn O. Pearce [Thu, 19 Aug 2010 18:50:20 +0000 (11:50 -0700)]
Make ObjectId.compareTo final

Since equals() is now final and does not permit being overridden,
we should do the same thing with compareTo() to prevent different
subclasses from having different ordering behaviors.  This could
lead to the same mess that we had with different equals() behaviors.

Change-Id: I35a849b6efccee5fe74cc5788a3566a1516004b7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMake ObjectId.hashCode final too 41/1341/1
Shawn O. Pearce [Thu, 19 Aug 2010 18:46:22 +0000 (11:46 -0700)]
Make ObjectId.hashCode final too

Since equals() is now final and does not permit being overridden,
we should do the same thing with hashCode() to prevent different
subclasses from having different hashing behaviors.  This could
lead to the same mess that we had with different equals() behaviors.

Change-Id: I35a849b6efccee5fe74cc5788a3566a1516004b7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoRemove unnecessary ObjectId.copy() calls 40/1340/1
Shawn O. Pearce [Thu, 19 Aug 2010 18:43:39 +0000 (11:43 -0700)]
Remove unnecessary ObjectId.copy() calls

When RevObject overrode equals() to provide only reference equality
we used to need to convert a RevObject into an ObjectId by copy()
just to use standard Java tools like JUnit assertEquals(), or to
use contains() or get() on standard java.util collection types.

Now that we have removed this override and made ObjectId's equals()
final (preventing any of this mess in the future), some copy()
calls are unnecessary.  Anytime the value is being used as an input
to a lookup routine, or to an equals, we can avoid the copy().

However we still want to use copy() anytime we are given an ObjectId
that may exist long-term, where we don't want the high cost of the
additional storage from a RevCommit extension.  So we can't remove
all uses of copy(), just some of them.

Change-Id: Ief275dace435c0ddfa362ac8e5d93558bc7e9fc3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoFix missing Configuration Change eventing 81/1281/6
Mathias Kinzler [Thu, 19 Aug 2010 07:11:03 +0000 (09:11 +0200)]
Fix missing Configuration Change eventing

Configuration change events were not being triggered, now they are
forwarded from the FileConfig up to the Repository's listeners.

Change-Id: Ida94a59f5a2b7fa8ae0126e33c13343275483ee5
Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoEnhance MergeResult to report conflicts, etc 25/1225/5
Christian Halstrick [Thu, 19 Aug 2010 13:52:12 +0000 (15:52 +0200)]
Enhance MergeResult to report conflicts, etc

The MergeResult class is enhanced to report more data about a
three-way merge. Information about conflicts and the base, ours,
theirs commits can be retrived.

Change-Id: Iaaf41a1f4002b8fe3ddfa62dc73c787f363460c2
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoAllow for optional tagger and message in Tag 33/1333/4
Chris Aniszczyk [Thu, 19 Aug 2010 02:12:15 +0000 (21:12 -0500)]
Allow for optional tagger and message in Tag

We should be more lenient when tagging without an
tagger or message. Currently, we will throw an NPE
which is incorrect behavior.

Change-Id: I04e30ce25a9432e4ca56c3f29658ecb24fb18d24
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoRemove getter and setter for author in Tag 31/1331/2
Chris Aniszczyk [Thu, 19 Aug 2010 01:56:27 +0000 (20:56 -0500)]
Remove getter and setter for author in Tag

There was a duplicated getter and setter for tagger in Tag.
There's no needed to have two getters and setters that represent
the same things. The appropriate tests were updated also.

Change-Id: If46dc00c4c0f31ea4234c6d3bda3c03e6ebbafac
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoAdd blob-data to utility method indexState() 16/1316/2
Christian Halstrick [Mon, 16 Aug 2010 16:44:26 +0000 (18:44 +0200)]
Add blob-data to utility method indexState()

indexState() encodes the complete state of the index
into one readable String. This helps to write tests
against the index. indexState() is enhanced to optionally
also contain the content of the files in the index.

Change-Id: Ie988f93768d864f4cbd55809a786bd5759fc24a5
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
14 years agoadded resetIndex() to RepositoryTestCase 15/1315/2
Christian Halstrick [Mon, 16 Aug 2010 16:42:24 +0000 (18:42 +0200)]
added resetIndex() to RepositoryTestCase

Added a utility method to set the reset an index to match exactly
some content in the filesystem. This can be used by tests to prepare
commits in the working-tree and set the index in one shot.

[sp: Cleaned up formatting, added getEntryFile(), released inserter.]

Change-Id: If38b1f7cacaaf769f51b14541c5da0c1e24568a5
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoDo not trigger RefsChangedEvent on the first attempt to read a ref 09/1309/2
Robin Rosenberg [Sun, 15 Aug 2010 09:53:42 +0000 (11:53 +0200)]
Do not trigger RefsChangedEvent on the first attempt to read a ref

Such events make no sense, it has never been visible to this
process so no client can have a stale value of the ref.

Change-Id: Iea3a5035b0a1410b80b09cf53387b22b78b18018
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
14 years agoAdd FileRepository(String) convenience constructor 22/1322/2
Ketan Padegaonkar [Tue, 17 Aug 2010 02:41:54 +0000 (19:41 -0700)]
Add FileRepository(String) convenience constructor

Add a convenience API in FileRepository to pass in a String that
points to the GIT_DIR location.  This is converted to a File and
sent through the usual constructor.

Change-Id: I588388f37e89b8c690020f110a1bc59f46170c40

14 years agoMerge "Backout RevObject's object-identity based equals implementation"
Shawn Pearce [Wed, 18 Aug 2010 19:00:33 +0000 (15:00 -0400)]
Merge "Backout RevObject's  object-identity based equals implementation"

14 years agoSet default file encoding used for JGit tests to UTF-8 14/1314/1
Matthias Sohn [Mon, 16 Aug 2010 15:42:41 +0000 (17:42 +0200)]
Set default file encoding used for JGit tests to UTF-8

This patch fixes the problem that JGit tests run from Maven fail on
Mac OS X [1]. In Eclipse the tests succeed since we set Eclipse
workspace encoding to UTF-8 via "Preferences > General > Workspace
> Text file encoding", checked via JConsole that this setting changes
the JVM system property of the test run. This change copies this
setting to the Maven test environment so that we get consistent test
results on all platforms.

[1] http://kerneltrap.org/mailarchive/git/2009/2/6/4916414/thread

Change-Id: Ia657d4037c518411f7bc3c75626dbafb1f4706a2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoBackout RevObject's object-identity based equals implementation 13/1313/1
Matthias Sohn [Sun, 15 Aug 2010 21:12:58 +0000 (23:12 +0200)]
Backout RevObject's  object-identity based equals implementation

This restores the transitivity and symmetry properties of the equals
methods on the AnyObjectId type hierarchy as defined in [1].
Following [2] we declare these equals methods final to ensure that
semantics of equals are consistent across AnyObjectId's type hierarchy.

[1] http://download-llnw.oracle.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object)
[2] http://www.angelikalanger.com/Articles/JavaSolutions/SecretsOfEquals/Equals.html

Bug: 321502
Change-Id: Ibace21fa268c4aa15da6c65d42eb705ab1aa24b3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoMerge "Fix RevCommitList to work with subclasses of RevWalk"
Shawn Pearce [Thu, 12 Aug 2010 23:48:44 +0000 (19:48 -0400)]
Merge "Fix RevCommitList to work with subclasses of RevWalk"

14 years agoFix RevCommitList to work with subclasses of RevWalk 99/1299/1
Matthias Sohn [Thu, 12 Aug 2010 23:47:17 +0000 (01:47 +0200)]
Fix RevCommitList to work with subclasses of RevWalk

Bug: 321502
Change-Id: Ic4bc49a0da90234271aea7c0a4e344a1c3620cfc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
14 years agoImprove IndexDiff performance 90/1290/3
Jens Baumgart [Thu, 12 Aug 2010 16:28:07 +0000 (18:28 +0200)]
Improve IndexDiff performance

Exclude ignored files from IndexDiff tree walk.
This makes EGit commit much faster.

Change-Id: I398499510c22c37667b7612db32eac3b31d325f0
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoMerge "Hide Maven target directories from Eclipse"
Chris Aniszczyk [Wed, 11 Aug 2010 15:17:18 +0000 (11:17 -0400)]
Merge "Hide Maven target directories from Eclipse"

14 years agoTransportHttp does not honor timeout setting 76/1276/1
Mathias Kinzler [Tue, 10 Aug 2010 13:58:21 +0000 (15:58 +0200)]
TransportHttp does not honor timeout setting

This can result in an infinitely hanging IDE.

Change-Id: I669bc8d220a07011a42edf79de31825305ff3763
Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
14 years agoFix NPE on commit in empty Repository 67/1267/1
Jens Baumgart [Mon, 9 Aug 2010 09:14:38 +0000 (11:14 +0200)]
Fix NPE on commit in empty Repository

NPE occured when committing in an empty repository.

Bug: 321858
Change-Id: Ibddb056c32c14c1444785501c43b95fdf64884b1
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
14 years agoHide Maven target directories from Eclipse 62/1262/1
Robin Rosenberg [Sun, 8 Aug 2010 11:16:53 +0000 (13:16 +0200)]
Hide Maven target directories from Eclipse

Change-Id: I64f12a35423a90ced9c9bc83f6869d8ed766dd35
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
14 years agoMerge branch 'rename-bug' 61/1261/1
Shawn O. Pearce [Fri, 6 Aug 2010 16:48:50 +0000 (09:48 -0700)]
Merge branch 'rename-bug'

* rename-bug:
  Fix ArrayIndexOutOfBounds on non-square exact rename matrix

Conflicts:
org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java

Change-Id: Ie0b8dd3e1ec174f79ba39dc4706bb0694cc8be29

14 years agoFix ArrayIndexOutOfBounds on non-square exact rename matrix 60/1260/1
Shawn O. Pearce [Fri, 6 Aug 2010 16:33:55 +0000 (09:33 -0700)]
Fix ArrayIndexOutOfBounds on non-square exact rename matrix

If the exact rename matrix for a particular ObjectId isn't square we
crashed with an ArrayIndexOutOfBoundsException because the matrix
entries were encoded backwards.  The encode function accepts the
source (aka deleted) index first, not second.  Add a unit test to
cover this non-square case to ensure we don't have this regression
in the future.

Change-Id: I5b005e5093e1f00de2e3ec104e27ab6820203566
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMerge changes I39bfefee,I47795987,I70d120fb,I58cc5e01,I96bee7b9
Shawn O. Pearce [Fri, 6 Aug 2010 01:11:31 +0000 (21:11 -0400)]
Merge changes I39bfefee,I47795987,I70d120fb,I58cc5e01,I96bee7b9

* changes:
  Enable configuration of non-standard pack settings
  Pass PackConfig down to PackWriter when packing
  Simplify UploadPack use of options during writing
  Move PackWriter configuration to PackConfig
  Allow PackWriter callers to manage the thread pool

14 years agoMerge "Remove static progress task names from PackWriter"
Shawn O. Pearce [Fri, 6 Aug 2010 01:11:30 +0000 (21:11 -0400)]
Merge "Remove static progress task names from PackWriter"

14 years agoMerge "Add "all" parameter to the commit Command"
Chris Aniszczyk [Thu, 5 Aug 2010 19:02:59 +0000 (15:02 -0400)]
Merge "Add "all" parameter to the commit Command"

14 years agoMerge "Add the parameter "update" to the Add command"
Chris Aniszczyk [Thu, 5 Aug 2010 19:01:53 +0000 (15:01 -0400)]
Merge "Add the parameter "update" to the Add command"

14 years agoMerge "add fsTick() to RepositoryTestCase"
Chris Aniszczyk [Thu, 5 Aug 2010 18:57:14 +0000 (14:57 -0400)]
Merge "add fsTick() to RepositoryTestCase"

14 years agoMerge "add more control to indexState() return-value"
Chris Aniszczyk [Thu, 5 Aug 2010 18:56:43 +0000 (14:56 -0400)]
Merge "add more control to indexState() return-value"

14 years agoAllow to replace existing Change-Id 39/1239/3
Stefan Lay [Thu, 5 Aug 2010 12:11:38 +0000 (14:11 +0200)]
Allow to replace existing Change-Id

It is useful to be able to replace an existing Change-Id
in the message, for example if the user decides not to
amend the previous commit.

Bug: 321188
Change-Id: I594e7f9efd0c57d794d2bd26d55ec45f4e6a47fd
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoRename getOldName,getNewName to getOldPath,getNewPath 95/1195/2
Shawn O. Pearce [Wed, 28 Jul 2010 21:45:12 +0000 (14:45 -0700)]
Rename getOldName,getNewName to getOldPath,getNewPath

TreeWalk calls this value "path", while "name" is the stuff after the
last slash.  FileHeader should do the same thing to be consistent.
Rename getOldName to getOldPath and getNewName to getNewPath.

Bug: 318526
Change-Id: Ib2e372ad4426402d37939b48d8f233154cc637da
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agoMerge branch 'js/diff' 37/1237/1
Shawn O. Pearce [Wed, 4 Aug 2010 17:59:35 +0000 (10:59 -0700)]
Merge branch 'js/diff'

* js/diff:
  Fixed bug in scoring mechanism for rename detection

14 years agoFixed bug in scoring mechanism for rename detection 32/1232/2
Jeff Schumacher [Tue, 3 Aug 2010 23:59:30 +0000 (16:59 -0700)]
Fixed bug in scoring mechanism for rename detection

A bug in rename detection would cause file scores to be wrong. The
bug was due to the way rename detection would judge the similarity
between files. If file A has three lines containing 'foo', and file
B has 5 lines containing 'foo', the rename detection phase should
record that A and B have three lines in common (the minimum of the
number of times that line appears in both files). Instead, it would
choose the the number of times the line appeared in the destination
file, in this case file B. I fixed the bug by having the
SimilarityIndex instead choose the minimum number, as it should. I
also added a test case to verify that the bug had been fixed.

Change-Id: Ic75272a2d6e512a361f88eec91e1b8a7c2298d6b

14 years agoAdd gitignore support to IndexDiff and use TreeWalk 33/1233/4
Jens Baumgart [Wed, 4 Aug 2010 09:49:33 +0000 (11:49 +0200)]
Add gitignore support to IndexDiff and use TreeWalk

IndexDiff was re-implemented and now uses TreeWalk instead
of GitIndex. Additionally, gitignore support and retrieval of
untracked files was added.

Change-Id: Ie6a8e04833c61d44c668c906b161202b200bb509
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
14 years agoAdd "all" parameter to the commit Command 48/1148/4
Stefan Lay [Wed, 28 Jul 2010 09:00:22 +0000 (11:00 +0200)]
Add "all" parameter to the commit Command

When the add parameter is set all modified and deleted files
are staged prior to commit.

Change-Id: Id23bc25730fcdd151386cd495a7cdc0935cbc00b
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
14 years agoAdd the parameter "update" to the Add command 47/1147/7
Stefan Lay [Wed, 4 Aug 2010 11:21:57 +0000 (13:21 +0200)]
Add the parameter "update" to the Add command

This change is mainly done for a subsequent commit
which will introduce the "all" parameter to the Commit
command.

Bug: 318439
Change-Id: I85a8a76097d0197ef689a289288ba82addb92fc9
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
14 years agoadd fsTick() to RepositoryTestCase 31/1231/2
Christian Halstrick [Tue, 3 Aug 2010 20:27:41 +0000 (22:27 +0200)]
add fsTick() to RepositoryTestCase

An utility method which was in RacyGitTests has been moved to
RepositoryTestCase. Also the javadoc has been improved.
This method allows to wait long enough until the
filesystem-timer has advanced. This is useful when it has to
be guaranteed that two files modifications have different
modification timestamps.

Change-Id: I2ebd7cd7818feba6acffb3f835101d8fd281bd5a
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>