]> source.dussan.org Git - jgit.git/log
jgit.git
11 years agoAdd javaewah bundle to features using it 21/10921/1
Matthias Sohn [Thu, 7 Mar 2013 07:51:06 +0000 (08:51 +0100)]
Add javaewah bundle to features using it

This ensures that OSGi consumers can retrieve this dependency from the
JGit or EGit p2 repository.

Change-Id: I6f88a4914a19e4e18aa60d59b0cc8a33b61f7fc2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDo not attempt to read bitmap from invalid pack 13/10913/1
Shawn Pearce [Wed, 6 Mar 2013 20:48:25 +0000 (12:48 -0800)]
Do not attempt to read bitmap from invalid pack

If a pack file has been marked invalid due to a prior IOException
accessing its contents, do not offer its bitmap index to callers.
The pack cannot be used so its bitmap should be off limits from
any reader trying to work from a bitmap.

Change-Id: Ia44e46558abdddee560bb184158b1e0af9437eee

11 years agoRename DfsPackFile getBitmap method to match PackFile 12/10912/1
Shawn Pearce [Wed, 6 Mar 2013 20:47:37 +0000 (12:47 -0800)]
Rename DfsPackFile getBitmap method to match PackFile

There is no reason for these to differ in name. Match the
shorter name used by PackFile.

Change-Id: I2d3a299069acc5ce276b1b5439ff2258903c6ff3

11 years agoWrite the bitmap index correctly in DFS GC. 10/10910/1
Colby Ranger [Wed, 6 Mar 2013 20:33:05 +0000 (12:33 -0800)]
Write the bitmap index correctly in DFS GC.

A bug caused the .bitmap to actually have the .idx contents.

Change-Id: I428bb27d419e8b1b69b6f3e2fd07cd29703669ad

11 years agoEnable writing bitmaps during GC by default. 18/10018/10
Colby Ranger [Wed, 30 Jan 2013 19:48:19 +0000 (11:48 -0800)]
Enable writing bitmaps during GC by default.

Bitmaps provide a huge performance boost for counting objects and they
play nice with the cgit implementation.

Change-Id: I33b05a6c8f1ee2df7770f0b9fdc50d0b4bbf1029

11 years agoEnable writing pack indexes with bitmaps in the GC. 42/7942/21
Colby Ranger [Wed, 26 Sep 2012 18:50:05 +0000 (11:50 -0700)]
Enable writing pack indexes with bitmaps in the GC.

Update the dfs and file GC implementations to prepare and write
bitmaps on the packs that contain the full closure of the object
graph. Update the DfsPackDescription to include the index version.

Change-Id: I3f1421e9cd90fe93e7e2ef2b8179ae2f1ba819ed

11 years agoEnable serving upload requests using bitmaps. 41/7941/18
Colby Ranger [Wed, 26 Sep 2012 18:57:15 +0000 (11:57 -0700)]
Enable serving upload requests using bitmaps.

If the pack index has bitmaps, allow the PackWriter to use the bitmaps
for upload requests.

Change-Id: Iefa995fe927a11e4fd78afb34530995614221fc0

11 years agoSupport creating pack bitmap indexes in PackWriter. 40/7940/18
Colby Ranger [Mon, 6 Aug 2012 18:09:53 +0000 (11:09 -0700)]
Support creating pack bitmap indexes in PackWriter.

Update the PackWriter to support writing out pack bitmap indexes,
a parallel ".bitmap" file to the ".pack" file.
Bitmaps are selected at commits every 1 to 5,000 commits for
each unique path from the start. The most recent 100 commits are
all bitmapped. The next 19,000 commits have a bitmaps every 100
commits. The remaining commits have a bitmap every 5,000 commits.
Commits with more than 1 parent are prefered over ones
with 1 or less. Furthermore, previously computed bitmaps are reused,
if the previous entry had the reuse flag set, which is set when the
bitmap was placed at the max allowed distance.

Bitmaps are used to speed up the counting phase when packing, for
requests that are not shallow. The PackWriterBitmapWalker uses
a RevFilter to proactively mark commits with RevFlag.SEEN, when
they appear in a bitmap. The walker produces the full closure
of reachable ObjectIds, given the collection of starting ObjectIds.

For fetch request, two ObjectWalks are executed to compute the
ObjectIds reachable from the haves and from the wants. The
ObjectIds needed to be written are determined by taking all the
resulting wants AND NOT the haves.

For clone requests, we get cached pack support for "free" since
it is possible to determine if all of the ObjectIds in a pack file
are included in the resulting list of ObjectIds to write.

On my machine, the best times for clones and fetches of the linux
kernel repository (with about 2.6M objects and 300K commits) are
tabulated below:

Operation                   Index V2               Index VE003
Clone                       37530ms (524.06 MiB)     82ms (524.06 MiB)
Fetch (1 commit back)          75ms                 107ms
Fetch (10 commits back)       456ms (269.51 KiB)    341ms (265.19 KiB)
Fetch (100 commits back)      449ms (269.91 KiB)    337ms (267.28 KiB)
Fetch (1000 commits back)    2229ms ( 14.75 MiB)    189ms ( 14.42 MiB)
Fetch (10000 commits back)   2177ms ( 16.30 MiB)    254ms ( 15.88 MiB)
Fetch (100000 commits back) 14340ms (185.83 MiB)   1655ms (189.39 MiB)

Change-Id: Icdb0cdd66ff168917fb9ef17b96093990cc6a98d

11 years agoAdded read/write support for pack bitmap index. 39/7939/17
Colby Ranger [Tue, 28 Aug 2012 16:08:20 +0000 (09:08 -0700)]
Added read/write support for pack bitmap index.

A pack bitmap index is an additional index of compressed
bitmaps of the object graph. Furthermore, a logical API of the index
functionality is included, as it is expected to be used by the
PackWriter.

Compressed bitmaps are created using the javaewah library, which is a
word-aligned compressed variant of the Java bitset class based on
run-length encoding. The library only works with positive integer
values. Thus, the maximum number of ObjectIds in a pack file that
this index can currently support is limited to Integer.MAX_VALUE.

Every ObjectId is given an integer mapping. The integer is the
position of the ObjectId in the complete ObjectId list, sorted
by offset, for the pack file. That integer is what the bitmaps
use to reference the ObjectId. Currently, the new index format can
only be used with pack files that contain a complete closure of the
object graph e.g. the result of a garbage collection.

The index file includes four bitmaps for the Git object types i.e.
commits, trees, blobs, and tags. In addition, a collection of
bitmaps keyed by an ObjectId is also included. The bitmap for each entry
in the collection represents the full closure of ObjectIds reachable
from the keyed ObjectId (including the keyed ObjectId itself). The
bitmaps are further compressed by XORing the current bitmaps against
prior bitmaps in the index, and selecting the smallest representation.
The XOR'd bitmap and offset from the current entry to the position
of the bitmap to XOR against is the actual representation of the entry
in the index file. Each entry contains one byte, which is currently
used to note whether the bitmap should be blindly reused.

Change-Id: Id328724bf6b4c8366a088233098c18643edcf40f

11 years agoMerge "Break the dependency on RevObject when creating a newObjectToPack()."
Shawn Pearce [Tue, 5 Mar 2013 01:12:35 +0000 (20:12 -0500)]
Merge "Break the dependency on RevObject when creating a newObjectToPack()."

11 years agoMerge "Fix RefUpdate performance for existing Refs"
Shawn Pearce [Tue, 5 Mar 2013 00:11:08 +0000 (19:11 -0500)]
Merge "Fix RefUpdate performance for existing Refs"

11 years agoMerge "Fix corrupted CloneCommand bare-repo fetch-refspec (#402031)"
Shawn Pearce [Mon, 4 Mar 2013 22:53:02 +0000 (17:53 -0500)]
Merge "Fix corrupted CloneCommand bare-repo fetch-refspec (#402031)"

11 years agoBreak the dependency on RevObject when creating a newObjectToPack(). 38/7938/10
Colby Ranger [Mon, 27 Aug 2012 23:08:42 +0000 (16:08 -0700)]
Break the dependency on RevObject when creating a newObjectToPack().

Update the ObjectReuseAsIs API to support creating new
ObjectToPack with only the AnyObjectId and Git object type. This is
needed to support the future pack index bitmaps, which only contain
this information and do not want the overhead of creating a temporary
object for every ObjectId.

Change-Id: I906360b471412688bf429ecef74fd988f47875dc

11 years agoMerge "Remove the unused method PackFile.hasExt()."
Colby Ranger [Mon, 4 Mar 2013 22:30:27 +0000 (17:30 -0500)]
Merge "Remove the unused method PackFile.hasExt()."

11 years agoRemove the unused method PackFile.hasExt(). 32/10832/1
Colby Ranger [Mon, 4 Mar 2013 22:16:36 +0000 (14:16 -0800)]
Remove the unused method PackFile.hasExt().

It will be used in a future change, so just include it with that change.

Change-Id: I7db28d86f8e8b282a403acd9a4c4defaae828f94

11 years agoFix corrupted CloneCommand bare-repo fetch-refspec (#402031) 10/10810/3
Roberto Tyley [Mon, 4 Mar 2013 00:03:20 +0000 (00:03 +0000)]
Fix corrupted CloneCommand bare-repo fetch-refspec (#402031)

CloneCommand has been creating fetch refspecs like this on bare clones:

[remote "origin"]
        url = ssh://example.com/my-repo.git
        fetch = +refs/heads/*:refs/heads//*

As you can see, the destination ref pattern has a superfluous slash.

It looks like this behaviour has always been the case for CloneCommand,
at least since cc2197ed when code catering to bare-clone fetch refspecs
was added. That was released with JGit v1.0 almost 2 years ago, so
there will probably be some bare repos in the wild which will have been
cloned with JGit and have these corrupted refspecs.

The effect of the corrupted fetch refspec is quite interesting. Up to
and including JGit 2.0, the corrupt refspec was tolerated and fetches
would work as intended with no indication to the user that anything was
amiss. With JGit 2.1, a change was introduced which made JGit less
tolerant, and fetches now attempt to update the non-existing ref
"refs/heads//master". No exception is raised, but the real ref -
"refs/heads/master" - is not updated.

This behaviour was noticed by a user of Agit (which does bare clones by
default and recently updated from JGit v2.0 to v2.2), reported here:

https://github.com/rtyley/agit/issues/92

If you run C-Git fetch on a bare-repo cloned by JGit, it flat-out
rejects the refspec (checked against v1.7.10.4):

fatal: Invalid refspec '+refs/heads/*:refs/heads//*'

Incidentally, C-Git does not create an explicit fetch refspec at all
when performing a bare clone - the full remote config generated by C-Git
looks like this:

[remote "origin"]
        url = ssh://example.com/my-repo.git

Using JGit on such a repository works fine, so omitting the fetch
refspec entirely is also an option.

Change-Id: I14b0d359dc69b8908f68e02cea7a756ac34bf881

11 years agoFix RefUpdate performance for existing Refs 92/10792/1
Roberto Tyley [Fri, 1 Mar 2013 21:49:58 +0000 (21:49 +0000)]
Fix RefUpdate performance for existing Refs

No longer invoke the expensive RefDatabase.isNameConflicting() check on
updating existing refs, reducing batch ref update time by ~97%.

The RefDirectory implementation of isNameConflicting() is quite
slow (it has to do an expensive loose-ref scan) but it's only necessary
to perform this check on ref update if the ref is being *created* - if
the ref already exists, we can already guarantee that it does not
conflict with any other refs.

C-Git seems to use a similar condition before making the
is_refname_available() check:

https://github.com/git/git/blob/v1.8.1.4/refs.c#L1660-L1670

As an example of the effects on performance, here's a simple timing
experiment using The BFG to remove one file from the JGit repo:

---
$ wget http://repo1.maven.org/maven2/com/madgag/bfg-repo-cleaner/1.0.1/bfg-1.0.1.jar
$ git clone --mirror https://git.eclipse.org/r/p/jgit/jgit.git
$ java -jar bfg-1.0.1.jar -D make_jgit.sh jgit.git
....
Updating references:    100% (5760/5760)
...Ref update completed in 148,949 ms.

BFG run is complete!
---

The execution time for the run is completely dominated by the batch ref
update at the end. Repeating the experiment with BFG v1.0.2 (using JGit
patched with this change), the refs update is dramatically reduced:

---
Updating references:    100% (5760/5760)
...Ref update completed in 4,327 ms.
---

Change-Id: I9057bc4ee22f9cc269b1cc00c493841c71527cd6

11 years agoMerge "Improve the documentation of the ByteArraySet used by PathFilterGroup"
Shawn Pearce [Fri, 1 Mar 2013 00:21:59 +0000 (19:21 -0500)]
Merge "Improve the documentation of the ByteArraySet used by PathFilterGroup"

11 years agoInclude supported extensions in PackFile constructor. 80/9980/7
Colby Ranger [Mon, 28 Jan 2013 19:49:01 +0000 (11:49 -0800)]
Include supported extensions in PackFile constructor.

Previously a PackFile class was assumed to only support a .pack and .idx
file. Update the constructor to enumerate the supported extensions for
the pack file. This will allow the bitmap code to only be executed if
the bitmap extension file is known to exist.

Change-Id: Ie59041dffec5f60d7ea2771026ffd945106bd4bf

11 years agoFix while boundries in DateRevQueue.add() 26/10626/1
Gustaf Lundh [Mon, 25 Feb 2013 17:24:16 +0000 (18:24 +0100)]
Fix while boundries in DateRevQueue.add()

In add(), "low" will never equals "first". This fact
should be reflected in the code.

Change-Id: I5cab51374e67bd2d3301e5d9dac47c4259b5e562

11 years agoMerge "Performance fixes in DateRevQueue"
Shawn Pearce [Mon, 25 Feb 2013 16:50:21 +0000 (11:50 -0500)]
Merge "Performance fixes in DateRevQueue"

11 years agoPerformance fixes in DateRevQueue 07/10307/8
Gustaf Lundh [Fri, 1 Feb 2013 12:20:31 +0000 (13:20 +0100)]
Performance fixes in DateRevQueue

When a lot of commits are added to DateRevQueue, the
sort-on-insertion approach is very heavy on CPU cycles.

One approach to fix this was made by Dave Borowitz:
https://git.eclipse.org/r/#/c/5491/

But using Java's PriorityQueue seems to have brought some
extra overhead, and the desired performance could not be
reached.

This fix takes another approach to the insertion problem,
without changing the expected behaviour or bringing extra
memory overhead:

If we detect over 1000 commits in the DateRevQueue, a
"seek-index" is rebuilt every 1000th added commit.

The index keeps track of every 100th commit in the
DateRevQueue. During insertions, it will be used for a
preliminary scanning (binary search) of the queue, with
the intention of helping add() find a good starting point
to start walking from. After finding this starting point,
add() will step commit-by-commit until the correct
insertion place in the queue is found (today, the queue
is expected to be sorted at all times).

When applied to repositories with many refs, this approach
has proven to bring huge performance gains and scales quite
well.

For instance, in a repository with close to 80000 refs,
we could cut down the time a typical Gerrit replication
of 1 commit would take (just a push from JGit's point of
view) from 32sec down to 3.5sec.

Below you see some typical times to add a specific amount
of commits (with random commit times) to the DateRevQueue
and the difference the preliminary seek-index makes:

Commits | Index | No Index
   1024     8ms        8ms
   2048    13ms        9ms
   4096     5ms       59ms
   8192    11ms      595ms
  16384    22ms     3058ms
  32768    64ms    13811ms
  65536   201ms    62677ms
 131072   783ms   331585ms

Only one extra reference is needed for every 100 inserted
commits (and only when we see more than 1000 commits in
the queue), so the memory overhead should be negligible.

Various index-stepping values were tested, and 100 seemed to
scale very well and be effective from start.

In the future, it should probably be dynamic and based on
the number of refs in the queue, but this should serve well
as a starting point.

Note: While other fundamentally different data structures may
be more suitable, the DateRevQueue is extremely central to
many of the Git core operations. This approach was chosen,
since the effect of the patch is easy to predict in conjuction
with the current implementation. A totally new data structure
will make it harder to predict behaviour in many common and
uncommon cases (in terms of breaking ties, memory usage, cost
when using few elements, object creation/disposing overhead,
etc).

Change-Id: Ie7b99f40eacf6324bfb4716d82073adeda64d10f

11 years agoUpdate last release version to 2.3.1.201302201838-r 08/10608/1
Matthias Sohn [Sat, 23 Feb 2013 23:11:21 +0000 (00:11 +0100)]
Update last release version to 2.3.1.201302201838-r

Change-Id: I9c6d774526028e56707e15e80370460d964de76e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDeploy Maven artifacts to Eclipse Nexus repository 05/10605/3
Matthias Sohn [Sat, 23 Feb 2013 09:11:26 +0000 (10:11 +0100)]
Deploy Maven artifacts to Eclipse Nexus repository

Bug: 401469
Bug: 401470
Change-Id: I4901dc208fe8f9e4055d27ab7e0ced979fd234f5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoImplement recursive merge strategy 13/8113/26
George C. Young [Thu, 21 Feb 2013 18:44:40 +0000 (13:44 -0500)]
Implement recursive merge strategy

Extend ResolveMerger with RecursiveMerger to merge two tips
that have up to 200 bases.

Bug: 380314
CQ: 6854
Change-Id: I6292bb7bda55c0242a448a94956f2d6a94fddbaa
Also-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoImprove the documentation of the ByteArraySet used by PathFilterGroup 03/10603/1
Robin Rosenberg [Fri, 22 Feb 2013 22:21:57 +0000 (23:21 +0100)]
Improve the documentation of the ByteArraySet used by PathFilterGroup

Change-Id: I2ba7a67e8e1596aa6c33a9caddee03a6be48f008

11 years agoFix off by one error in PackReverseIndex. 58/10558/1
Colby Ranger [Thu, 21 Feb 2013 06:59:35 +0000 (22:59 -0800)]
Fix off by one error in PackReverseIndex.

The last 32bit offset is at Integer.MAX_VALUE.

Change-Id: Idee8be3c7887e1d0c8339ff94aceff36dbf000db

11 years agoMerge branch 'stable-2.3' 54/10554/1
Matthias Sohn [Thu, 21 Feb 2013 01:34:17 +0000 (02:34 +0100)]
Merge branch 'stable-2.3'

* stable-2.3:
  Prepare 2.3.2-SNAPSHOT builds
  JGit v2.3.1.201302201838-r
  Accept Change-Id even if footer contains not well-formed entries
  Fix false positives in hashing used by PathFilterGroup

Change-Id: I5882aa3b482d6bcd40a45bed51e5ab03f018a5bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare 2.3.2-SNAPSHOT builds 53/10553/1 stable-2.3
Matthias Sohn [Thu, 21 Feb 2013 01:13:15 +0000 (02:13 +0100)]
Prepare 2.3.2-SNAPSHOT builds

Change-Id: I51a8a53194928416b1aef1f3fce0ce66aadceca4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v2.3.1.201302201838-r 51/10551/1 v2.3.1.201302201838-r
Matthias Sohn [Wed, 20 Feb 2013 23:46:22 +0000 (00:46 +0100)]
JGit v2.3.1.201302201838-r

Change-Id: I0d79873137ad4042ecc2a0210fe1f6305608b851
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Accept Change-Id even if footer contains not well-formed entries" into stable-2.3
Matthias Sohn [Wed, 20 Feb 2013 23:35:44 +0000 (18:35 -0500)]
Merge "Accept Change-Id even if footer contains not well-formed entries" into stable-2.3

11 years agoAccept Change-Id even if footer contains not well-formed entries 81/10381/6
Stefan Lay [Fri, 15 Feb 2013 11:34:44 +0000 (12:34 +0100)]
Accept Change-Id even if footer contains not well-formed entries

Instead of only looking for a Change-Id in the last section if it
consists only of well-formed "key: value" lines replace the last
occurrence of a valid Change-Id line in the last section. Some tools
require footer lines e.g. without a colon.

Gerrit doesn't accept Change-Id lines in the footer if the Change-Id
line doesn't start at the beginning of the line.

Bug: 400818
Change-Id: Icce54872adc8c566994beea848448a2f7ca87085
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix false positives in hashing used by PathFilterGroup 95/10495/4
Robin Stocker [Tue, 19 Feb 2013 22:41:15 +0000 (23:41 +0100)]
Fix false positives in hashing used by PathFilterGroup

The ByteArraySet failed to check the length of the entry correctly leading
to matches where no match should be.

Bug: 401249
Change-Id: I925bc48d9cafcdf13e1a797bb09fc2555eb270c5
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
11 years agoMust use double single quotes around parameters 76/10376/2
Robin Rosenberg [Thu, 14 Feb 2013 22:17:55 +0000 (23:17 +0100)]
Must use double single quotes around parameters

Change-Id: I34da782e6b9a492e3e291b36ef82f06ce8347660

11 years agoAdd the --branch flag to the jgit clone command 28/10328/3
Robin Rosenberg [Tue, 12 Feb 2013 23:27:52 +0000 (00:27 +0100)]
Add the --branch flag to the jgit clone command

--branch or -b allows the user to specify which branch to checkout after
clone.

Change-Id: Ie27533e5ecb43097862a8337a27a742b501e17a5

11 years agoMerge "Prepare 2.4.0-SNAPSHOT builds"
Matthias Sohn [Thu, 14 Feb 2013 00:00:11 +0000 (19:00 -0500)]
Merge "Prepare 2.4.0-SNAPSHOT builds"

11 years agoPrepare 2.4.0-SNAPSHOT builds 61/10361/2
Matthias Sohn [Wed, 13 Feb 2013 23:11:20 +0000 (00:11 +0100)]
Prepare 2.4.0-SNAPSHOT builds

Change-Id: I4ab2baeb5d598d40d5dadfccdfe75152a1b9b7bf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Cleanup unused imports"
Robin Rosenberg [Wed, 13 Feb 2013 23:39:27 +0000 (18:39 -0500)]
Merge "Cleanup unused imports"

11 years agoCleanup unused imports 59/10359/1
Robin Rosenberg [Wed, 13 Feb 2013 23:32:29 +0000 (00:32 +0100)]
Cleanup unused imports

Change-Id: I7fe51f4a6187c32c917b2f503d6b50d0d6b28a61

11 years agoRemove unused imports 58/10358/1
Matthias Sohn [Wed, 13 Feb 2013 23:06:17 +0000 (00:06 +0100)]
Remove unused imports

These imports are unused since commit
cb349da0174e77cc751e6cb8a16b327c4976b993

Change-Id: I74ea2a17bf4976d9c74255500e5deeff18208e87
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-2.3' 48/10348/1
Matthias Sohn [Wed, 13 Feb 2013 22:12:03 +0000 (23:12 +0100)]
Merge branch 'stable-2.3'

* stable-2.3:
  Prepare post 2.3.0.201302130906 builds
  JGit v2.3.0.201302130906
  Replace explicit version by property where possible
  Add better documentation to DirCacheCheckout
  Prepare post 2.3rc1 builds
  JGit v2.3.0.201302060400-rc1

Change-Id: I5a7626014dc38e7623937a4241dbf8a6db05c1f9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 2.3.0.201302130906 builds 47/10347/1
Matthias Sohn [Wed, 13 Feb 2013 22:07:25 +0000 (23:07 +0100)]
Prepare post 2.3.0.201302130906 builds

Change-Id: Ia11b4000557d0cf235c4e33cda4539cab25fef47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Remove unused availableRefs local from Clone.guessHEAD"
Robin Rosenberg [Wed, 13 Feb 2013 21:46:29 +0000 (16:46 -0500)]
Merge "Remove unused availableRefs local from Clone.guessHEAD"

11 years agoJGit v2.3.0.201302130906 41/10341/1 v2.3.0.201302130906
Matthias Sohn [Wed, 13 Feb 2013 14:17:59 +0000 (15:17 +0100)]
JGit v2.3.0.201302130906

Change-Id: If2e5fcbc01c2a7f058ef13d60b0bba5f77300d52
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoReplace explicit version by property where possible 40/10340/1
Matthias Sohn [Wed, 13 Feb 2013 14:18:41 +0000 (15:18 +0100)]
Replace explicit version by property where possible

Change-Id: Ibb3b983d01133fd98477d9284118d8220846f0e9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove unused availableRefs local from Clone.guessHEAD 30/10330/1
Jonathan Nieder [Wed, 13 Feb 2013 00:29:24 +0000 (16:29 -0800)]
Remove unused availableRefs local from Clone.guessHEAD

This variable has been populated and never used ever since it was
introduced in v0.4.9~336 (Add "jgit clone", 2008-12-23).  Remove it
to make the function easier to understand.

Change-Id: Idb7eb80bc236a20f7385ad2d6141b4d1c5c3f1cc

11 years agoImplement core.checkstat = minimal 48/10048/6
Robin Rosenberg [Wed, 30 Jan 2013 20:50:22 +0000 (21:50 +0100)]
Implement core.checkstat = minimal

There is a huge performance issue when using both JGit (EGit) and Git
because JGit does not fill all dircache stat fields with the values Git
would expect. As a result thereof Git would typically revalidate a large
number of tracked files. This can take several minutes for large
repositories with many large files.

Since 1.8.2 Git will restrict stat checking to the size and whole second
part of the modification time stamp, if core.statinfo is set to
"minimal".

As JGit checks only size and modification time this is close to what
JGit already does. To make the match perfect ignore the sub-second part
of the modification time stamp if core.statinfo = minimal.

Change-Id: I8eaff1858a891571075a86db043f9d80da3d7503

11 years agoFix Config.fromText to not skip a last line with no newline 63/10263/1
Dave Borowitz [Fri, 8 Feb 2013 19:35:20 +0000 (11:35 -0800)]
Fix Config.fromText to not skip a last line with no newline

Change-Id: Id6da6ff19296410806282bb7419fd8455e8c5475

11 years agoReally handle annotated tags in MergeCommand 50/10250/2
Robin Rosenberg [Fri, 8 Feb 2013 05:47:50 +0000 (06:47 +0100)]
Really handle annotated tags in MergeCommand

Repository.peel() must be called to ensure a tag is really peeled.

Change-Id: I83e25f09fad3ad55a3ffe41ab4758f249b7ac9f9

11 years agoAdd better documentation to DirCacheCheckout 28/10228/1
Christian Halstrick [Sun, 15 Jan 2012 23:59:49 +0000 (00:59 +0100)]
Add better documentation to DirCacheCheckout

Change-Id: I282b702d9e4cb19063d8e9503604538f80e955b7
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
11 years agoPrepare post 2.3rc1 builds 09/10209/1
Matthias Sohn [Wed, 6 Feb 2013 15:08:09 +0000 (16:08 +0100)]
Prepare post 2.3rc1 builds

Change-Id: I5c7daa5a735bfc2ecb9adc11c392b94d235102b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v2.3.0.201302060400-rc1 05/10205/1 v2.3.0.201302060400-rc1
Matthias Sohn [Wed, 6 Feb 2013 12:15:01 +0000 (13:15 +0100)]
JGit v2.3.0.201302060400-rc1

Change-Id: Id1f1d174375f7399cee4c2eb23368d4dbb4c384a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd getConflictingNames to RefDatabase 36/9636/3
Robin Stocker [Sat, 12 Jan 2013 14:20:32 +0000 (15:20 +0100)]
Add getConflictingNames to RefDatabase

This has the same logic as isNameConflicting, but instead of only
returning a boolean, it returns a collection of names that conflict.

It will be used in EGit to provide a better message to the user when
validating a ref name, see Ibea9984121ae88c488858b8a8e73b593195b15e0.

Existing implementations of isNameConflicting could be rewritten like
this:

  return !getConflictingNames(name).isEmpty();

But I'm not sure about that, as isNameConflicting can be implemented in
a faster way than getConflictingNames.

Change-Id: I11e0ba2f300adb8b3612943c304ba68bbe73db8a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMove base test classes to the junit bundle for reuse for Java 7 tests 02/9402/8
Robin Rosenberg [Sun, 30 Dec 2012 12:31:07 +0000 (13:31 +0100)]
Move base test classes to the junit bundle for reuse for Java 7 tests

Change-Id: Iedb54eb9d8396bc3ae66d8754c1527fd9ca655f9

11 years agoMerge "Extract method to output the first header line of a git diff"
Robin Rosenberg [Sat, 2 Feb 2013 20:06:22 +0000 (15:06 -0500)]
Merge "Extract method to output the first header line of a git diff"

11 years agoFixed problems occuring when changing user in gerrit configuration 04/10104/1
Tobias Pfeifer [Fri, 1 Feb 2013 15:05:31 +0000 (16:05 +0100)]
Fixed problems occuring when changing user in gerrit configuration

Bug: 399238
Change-Id: I255634bc9b3681f292190051daed22a4771d6e57
Signed-off-by: Tobias Pfeifer <to.pfeifer@sap.com>
11 years agoUpdate to latest orbit release 86/9986/4
Matthias Sohn [Mon, 28 Jan 2013 08:28:15 +0000 (09:28 +0100)]
Update to latest orbit release

Update 3rd party dependencies to respective latest approved version.

args4j 2.0.21 is not yet available on Maven central, hence compile
against 2.0.12 and package 2.0.21 until 2.0.21 has been published on
Maven central.

Change-Id: I41a34485970af41b4b5b2404e3d29c98979ddb48
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove PathFilterGroupTest2 45/10045/1
Robin Rosenberg [Wed, 30 Jan 2013 20:03:01 +0000 (21:03 +0100)]
Remove PathFilterGroupTest2

The test is not very useful for regression testing in its current form

Change-Id: I19d1a29ff693397ac795d414b83411f32fae56d8

11 years agoRemove debug printouts from PathFilterGroupTest 41/10041/1
Robin Rosenberg [Wed, 30 Jan 2013 18:46:19 +0000 (19:46 +0100)]
Remove debug printouts from PathFilterGroupTest

Change-Id: I4767e53efafe48d447ebe399fb2f8617072950ea

11 years agoFix stash apply using merge logic 77/9877/4
Robin Rosenberg [Thu, 24 Jan 2013 03:23:26 +0000 (04:23 +0100)]
Fix stash apply using merge logic

Instead of the complicated strange stuff, implement staah
apply as cherry-pick.

Provided there are no conflicts and it is requested that
the index should be applied, perform yet another cherry-pick,
but discard tha results thereof it that would result in conflicts.

Bug: 376035
Change-Id: I553f3a753e0124b102a51f8edbb53ddeff2912e2

11 years agoExtract method to output the first header line of a git diff 03/10003/4
Tobias Pfeifer [Thu, 17 Jan 2013 13:45:00 +0000 (14:45 +0100)]
Extract method to output the first header line of a git diff

In order to be able to determine the range of the first header line
(e.g. "diff --git a/file1 b/file2") in subclasses, the code that formats
the first header line is extracted.

Required by egit's change: Ia61398146c0336ab332234f24d341561292554db

Change-Id: I9dd5eb964ed8b6869745c3162159b7425ac2c44a
Signed-off-by: Tobias Pfeifer <to.pfeifer@sap.com>
11 years agoMerge "Align execution environment with JRE on the classpath in jgit.ant.test"
Matthias Sohn [Tue, 29 Jan 2013 17:05:29 +0000 (12:05 -0500)]
Merge "Align execution environment with JRE on the classpath in jgit.ant.test"

11 years agoFix Check for FF_ONLY merges again 88/9988/1
Robin Rosenberg [Tue, 29 Jan 2013 07:05:00 +0000 (08:05 +0100)]
Fix Check for FF_ONLY merges again

Added more FF-mode tests

Change-Id: I33eed5737d9411cc1cf214da62ce719916a1b736

11 years agoMerge "Check for FF_ONLY merges correctly"
Robin Rosenberg [Tue, 29 Jan 2013 00:02:18 +0000 (19:02 -0500)]
Merge "Check for FF_ONLY merges correctly"

11 years agoMerge changes Ife0cc2da,If38507ef
Robin Rosenberg [Tue, 29 Jan 2013 00:00:00 +0000 (19:00 -0500)]
Merge changes Ife0cc2da,If38507ef

* changes:
  Speed up PathFilterGroup for large sets of paths
  Add test case for PathFilterGroup

11 years agoCheck for FF_ONLY merges correctly 52/9852/2
Robin Rosenberg [Tue, 22 Jan 2013 23:04:08 +0000 (00:04 +0100)]
Check for FF_ONLY merges correctly

Bug: 398192
Change-Id: I1253c0ea0632185bbf9f77e32f13ba5842a6e18e

11 years agoAlign execution environment with JRE on the classpath in jgit.ant.test 26/9826/3
Tomasz Zarna [Tue, 22 Jan 2013 11:41:31 +0000 (12:41 +0100)]
Align execution environment with JRE on the classpath in jgit.ant.test

Change-Id: Ic11ddce81dbcc7d703742c7e86941d2f43668617

11 years agoMerge changes I25204d9e,Ia10d76e9
Matthias Sohn [Thu, 24 Jan 2013 20:57:11 +0000 (15:57 -0500)]
Merge changes I25204d9e,Ia10d76e9

* changes:
  Attempt to stabilize GCTest
  Attempt to stabilize FileTreeIterator test on Windows

11 years agoAttempt to stabilize GCTest 55/9855/1
Robin Rosenberg [Wed, 23 Jan 2013 07:27:12 +0000 (08:27 +0100)]
Attempt to stabilize GCTest

File system time stamps and System.currentTimeMillis() may not
necessarily be running on the same clock so add some slack.

Bug: 396662
Change-Id: I25204d9e3181e15368da2902447518c6ce205017

11 years agoAttempt to stabilize FileTreeIterator test on Windows 53/9853/1
Robin Rosenberg [Wed, 23 Jan 2013 06:55:13 +0000 (07:55 +0100)]
Attempt to stabilize FileTreeIterator test on Windows

My guess is that the higher resolution of timestamps provided by Java on
Windows causes this test to occasionally fail.

Bug: 396662
Change-Id: Ia10d76e95fe6156c7ad05972619160e461606805

11 years agoMerge "Reduce memory held and speed up DfsGarbageCollector."
Colby Ranger [Tue, 22 Jan 2013 23:55:36 +0000 (18:55 -0500)]
Merge "Reduce memory held and speed up DfsGarbageCollector."

11 years agoReduce memory held and speed up DfsGarbageCollector. 51/9851/2
Colby Ranger [Tue, 22 Jan 2013 22:54:05 +0000 (14:54 -0800)]
Reduce memory held and speed up DfsGarbageCollector.

getObjectList() returns a list of ObjectToPack. These can hold on to a
lot of memory. Furthermore, binary searching for objects in a sorted
array can be slow. Improve the speed and reduce the memory by creating a
copy of the ObjectId and inserting it into an ObjectIdOwnerMap.

Change-Id: Ib5aa5b7447e05938b47fa55812a87b9872c20ea7

11 years agoEnable marking entries using TreeFilters in DiffEntry 16/6716/8
Robin Stocker [Mon, 25 Jun 2012 22:55:39 +0000 (00:55 +0200)]
Enable marking entries using TreeFilters in DiffEntry

This adds a new optional TreeFilter[] argument to DiffEntry.scan. All
filters will be checked during the scan to determine if an entry should
be "marked" with regard to that filter.

After having called scan, the user can then call isMarked(int) on the
entries to find out whether they matched the TreeFilter with the passed
index.

An example use case for this is in the file diff viewer of EGit's
History view, where we'd like to highlight entries that are matching the
current filter.

See EGit change I03da4b38d1591495cb290909f0e4c6e52270e97f.

Bug: 393610
Change-Id: Icf911fe6fca131b2567514f54d66636a44561af1
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd new committers 92/9692/2
Matthias Sohn [Tue, 15 Jan 2013 23:20:12 +0000 (00:20 +0100)]
Add new committers

Change-Id: I5ef1edb8efc4668ef4731094ea6dbbcaf200195d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate to jsch 0.1.46 91/9691/2
Matthias Sohn [Tue, 15 Jan 2013 23:16:54 +0000 (00:16 +0100)]
Update to jsch 0.1.46

Change-Id: Ib7eb1ff175e3f9763653b0b0432b8ddc6b1c8938
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Fix NPE FS_Win32 when looking up git executable and home directory avoiding...
Matthias Sohn [Tue, 22 Jan 2013 13:28:49 +0000 (08:28 -0500)]
Merge "Fix NPE FS_Win32 when looking up git executable and home directory avoiding redundant code"

11 years agoSpeed up PathFilterGroup for large sets of paths 07/9607/8
Robin Rosenberg [Sun, 20 Jan 2013 11:56:25 +0000 (12:56 +0100)]
Speed up PathFilterGroup for large sets of paths

The ByteArraySet is a distorted copy of ObjectIdSubclassMap.

Bug: 397185
Change-Id: Ife0cc2da6cc46431be94a6b14f64f6adbe983afb

11 years agoAdd test case for PathFilterGroup 05/9605/7
Robin Rosenberg [Thu, 10 Jan 2013 23:19:27 +0000 (00:19 +0100)]
Add test case for PathFilterGroup

This is needed to prepare for optimization.

Bug: 397185
Change-Id: If38507ef8cc5a161353cc07bf7cd1922f54d1f8a

11 years agoMerge "Improve handling of checkout conflicts"
Robin Rosenberg [Sun, 20 Jan 2013 19:01:38 +0000 (14:01 -0500)]
Merge "Improve handling of checkout conflicts"

11 years agoMerge changes I7e7fae12,I87ecca00
Robin Rosenberg [Sat, 19 Jan 2013 16:54:21 +0000 (11:54 -0500)]
Merge changes I7e7fae12,I87ecca00

* changes:
  Add conflicts message before footer
  Only replace the ChangeId in the footer, not in the body

11 years agoAdd conflicts message before footer 30/9530/9
Stefan Lay [Wed, 9 Jan 2013 13:02:51 +0000 (14:02 +0100)]
Add conflicts message before footer

In case of a conflict during cherry-pick or revert the commit message
was amended after the footer. This made the footer invalid. Many users
do not understand that they have to edit the commit message in order to
make it valid again.

Change-Id: I7e7fae125129e2a0d8950510550acda766531835
Bug: 367416

11 years agoOnly replace the ChangeId in the footer, not in the body 54/9554/6
Stefan Lay [Wed, 9 Jan 2013 13:02:13 +0000 (14:02 +0100)]
Only replace the ChangeId in the footer, not in the body

Additionally expose methods to find the first footer line and to find
the position of the ChangeId footer in the commit message in order to
enable reuse of these methods introduced for the fix.

Change-Id: I87ecca009ca3bff1ca0de3c436ebd95736bf5a10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
11 years agoMerge "Use correct method link in Javadoc"
Robin Rosenberg [Sat, 19 Jan 2013 16:23:39 +0000 (11:23 -0500)]
Merge "Use correct method link in Javadoc"

11 years agoMerge "Fix patch application WRT windows line endings."
Robin Rosenberg [Sat, 19 Jan 2013 16:20:27 +0000 (11:20 -0500)]
Merge "Fix patch application WRT windows line endings."

11 years agoFix patch application WRT windows line endings. 14/6314/5
Markus Duft [Tue, 12 Jun 2012 05:02:58 +0000 (07:02 +0200)]
Fix patch application WRT windows line endings.

Previously the result of an application would have been \r\r\n in the
case of windows line endings, as RawText does not touch the \r, and
ApplyCommand adds "\r\n" if this is the ending of the first line in the
target file. Only always adding \n should be ok, since \r\n would be the
result if the file and the patch include windows line endings.

Also add according test.

Change-Id: Ibd4c4948d81bd1c511ecf5fd6c906444930d236e

11 years agoMerge "Update DfsGarbageCollector to not read back a pack index."
Colby Ranger [Sat, 19 Jan 2013 00:38:08 +0000 (19:38 -0500)]
Merge "Update DfsGarbageCollector to not read back a pack index."

11 years agoUpdate DfsGarbageCollector to not read back a pack index. 76/9776/1
Colby Ranger [Sat, 19 Jan 2013 00:22:10 +0000 (16:22 -0800)]
Update DfsGarbageCollector to not read back a pack index.

Previously, the Dfs GC excluded objects from packs by passing a
previously written index to the PackWriter. Reading back a file on
Dfs is slow. Instead, allow the PackWriter to expose the objects
included in a pack and forward that to invocations of excludeObjects() .

Change-Id: I377cb4ab07f62cf790505e1eeb0b2efe81897c79

11 years agoMerge "Define a tree filter for user-visible changes between two indexes"
Robin Rosenberg [Sat, 19 Jan 2013 00:07:30 +0000 (19:07 -0500)]
Merge "Define a tree filter for user-visible changes between two indexes"

11 years agoMerge "Add additional FastForwardMode enums for different config contexts"
Shawn Pearce [Fri, 18 Jan 2013 16:28:07 +0000 (11:28 -0500)]
Merge "Add additional FastForwardMode enums for different config contexts"

11 years agoAdd additional FastForwardMode enums for different config contexts 43/9743/2
Tomasz Zarna [Thu, 17 Jan 2013 20:38:43 +0000 (21:38 +0100)]
Add additional FastForwardMode enums for different config contexts

FastForwardMode is represented by different strings depending on context
it is set or get from. E.g. FastForwardMode.FF_ONLY for
branch.<name>.mergeoptions is "--ff-only" but for merge.ff it is "only".

Change-Id: I39ae93578e4783de80ebf4af29ae23b3936eec47

11 years agoUse correct method link in Javadoc 52/9752/1
Dani Megert [Fri, 18 Jan 2013 08:17:53 +0000 (09:17 +0100)]
Use correct method link in Javadoc

Change-Id: I7fb5a44910a4738bbb14ad025cee7cbedbba2d07
Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
11 years agoRename PackConstants to PackExt, a typed pack file extension. 46/9746/2
Colby Ranger [Thu, 17 Jan 2013 23:00:38 +0000 (15:00 -0800)]
Rename PackConstants to PackExt, a typed pack file extension.

PackConstants previously contained string values for the pack and pack
index extension. Change PackConstant to be PackExt, a typed wrapper
around the string pack file extension.

Change-Id: I86ac4db6da8f33aa42d6f37cfcc119e819444318

11 years agoDefine a tree filter for user-visible changes between two indexes 37/9437/5
Robin Rosenberg [Thu, 3 Jan 2013 23:24:48 +0000 (00:24 +0100)]
Define a tree filter for user-visible changes between two indexes

The primary purpose of the filter is to detect an index change that
could possibly lead to a change in what files are visible in the staging
view and decorations. Besides what TreeFilter.ANY_DIFF does for trees in
general, this filter also looks at the assume-valid (CE_VALID) flag to
see whether changes should be ignored or not.

Change-Id: I13e9ed4ae62dc3851204fba598239edce07ca977

11 years agoRemove getReverseIndexSize() from DfsPackDescription. 90/9690/2
Colby Ranger [Tue, 15 Jan 2013 22:56:48 +0000 (14:56 -0800)]
Remove getReverseIndexSize() from DfsPackDescription.

The method is used in only one location (DfsPackFile). Furthermore,
PackIndex already does an explicit computation of the size in
DfsPackFile. Simplify the DfsPackDescription by removing the method
and do the calculation similar to PackIndex.

Change-Id: I1391fdaaf7c2c3226d96ada1ae8647bcdff4794e

11 years agoUse file extension with DfsPackDescription get/set file size. 89/9689/2
Colby Ranger [Tue, 15 Jan 2013 22:24:30 +0000 (14:24 -0800)]
Use file extension with DfsPackDescription get/set file size.

Previously the size getters and setters had explicit methods for index
and pack. Update the api to be based on the file extension. This will
make it possible to support other extensions in the future, such as
the forthcoming bitmap extensions.

Change-Id: Iab9d4abe0af65b2fc71ad71ef1db0feb6b3b5c58

11 years agoFix concurrent creation of fan-out object directories 72/9372/2
Roberto Tyley [Tue, 25 Dec 2012 09:10:51 +0000 (09:10 +0000)]
Fix concurrent creation of fan-out object directories

If multiple threads attempted to insert loose objects into the same new
fan-out directory, the creation of that directory was subject to a race
condition that could lead to an unnecessary IOException being thrown -
because an inserter could not 'create' a directory that had just been
generated by a different thread. All we require is that the directory
does indeed *exist*, so not being able to _create_ it is not actually a
fatal problem. Setting 'skipExisting' to 'true' on the call to mkdir()
fixes the issue.

I found this issue as a real world occurrence while working on The BFG
Repo Cleaner (https://github.com/rtyley/bfg-repo-cleaner), a tool which
concurrently performs a lot of object creation.

In order to demonstrate the problem here I've added a small test case
which reliably reproduces the issue on the few different hardware
systems I've tried. The error thrown when the race-condition arises is
this:

java.io.IOException: Creating directory /home/roberto/repo.git/objects/e6 failed
at org.eclipse.jgit.util.FileUtils.mkdir(FileUtils.java:182)
at org.eclipse.jgit.storage.file.ObjectDirectory.insertUnpackedObject(ObjectDirectory.java:590)
at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insertOneObject(ObjectDirectoryInserter.java:113)
at org.eclipse.jgit.storage.file.ObjectDirectoryInserter.insert(ObjectDirectoryInserter.java:91)
at org.eclipse.jgit.lib.ObjectInserter.insert(ObjectInserter.java:329)

Change-Id: I88eac49bc600c56ba9ad290e6133d8a7113125ab

11 years agoImprove handling of checkout conflicts 73/5373/9
Markus Duft [Fri, 13 Jul 2012 06:25:25 +0000 (08:25 +0200)]
Improve handling of checkout conflicts

This converts a checkout conflict exception into a RebaseResult /
MergeResult containing the conflicting paths, which enables EGit (or
others) to handle the situation in a user-friendly way

Change-Id: I48d9bdcc1e98095576513a54a225a42409f301f3

11 years agoAccept '-' instead of space in enum config values 34/9634/2
Shawn Pearce [Fri, 11 Jan 2013 22:42:35 +0000 (14:42 -0800)]
Accept '-' instead of space in enum config values

This is necessary because some versions of JGit containing
the flawed c98abc9c0586c73ef7df4172644b7dd21c979e9d were
used in the wild and wrote bad configuration files. We now
must accept this value in addition to the preferred case.

Change-Id: I3ed5451735658df6381532499130e5186805024a

11 years agoRevert "Add additional FastForwardMode enums for different config contexts" 33/9633/1
Shawn Pearce [Fri, 11 Jan 2013 22:39:51 +0000 (14:39 -0800)]
Revert "Add additional FastForwardMode enums for different config contexts"

This reverts commit c98abc9c0586c73ef7df4172644b7dd21c979e9d.

Change-Id: I1d2a0de81eb17860ee36b6d3d3c00959b880fb85

11 years agoFix enum parsing from Config files 32/9632/1
Shawn Pearce [Fri, 11 Jan 2013 22:09:02 +0000 (14:09 -0800)]
Fix enum parsing from Config files

Change-Id: Ib0b86ceab070d46903de7b55f2fd441714855141