]> source.dussan.org Git - jgit.git/log
jgit.git
7 years agoUse w1 for hashCode of AbbreviatedObjectId 73/101773/2
Shawn Pearce [Sat, 22 Jul 2017 17:06:25 +0000 (10:06 -0700)]
Use w1 for hashCode of AbbreviatedObjectId

Very short abbreviations that are under 8 hex digits do not
have values in w2. Use w1 as the Java hashCode() instead, so
that the prefix of the abbreviation is always included in the
hashing function used by any java.util.Collection type.

Change-Id: Idaf69f86b62630ba4a022d31b4c293c6d138f557

7 years agoIntList: support contains(int) 72/101772/2
Shawn Pearce [Thu, 20 Jul 2017 08:51:44 +0000 (01:51 -0700)]
IntList: support contains(int)

LongList supports contains(long).
IntList should also support contains(int).

Change-Id: Ic7a81c3c25b0f10d92087b56e9f200b676060f63

7 years agoMerge "Make 'inCoreLimit' of LocalFile used in ResolveMerger configurable"
Shawn Pearce [Sat, 22 Jul 2017 22:45:56 +0000 (18:45 -0400)]
Merge "Make 'inCoreLimit' of LocalFile used in ResolveMerger configurable"

7 years agoMake 'inCoreLimit' of LocalFile used in ResolveMerger configurable 14/101714/3
Changcheng Xiao [Fri, 21 Jul 2017 07:58:37 +0000 (09:58 +0200)]
Make 'inCoreLimit' of LocalFile used in ResolveMerger configurable

This change makes it possible to configure the 'inCoreLimit' of LocalFile
used in ResolveMerger#insertMergeResult. Since LocalFile itself has some
risks, e.g. it may be left behind as garbage in case of failure. It should
be good to be able to control the size limit for using LocalFile.

Change-Id: I3dc545ade370b2bbdb7c610ed45d5dd4d39b9e8e
Signed-off-by: Changcheng Xiao <xchangcheng@google.com>
7 years agodfs: optionally store blockSize in DfsPackDescription 42/101742/2
Shawn Pearce [Fri, 21 Jul 2017 14:54:00 +0000 (07:54 -0700)]
dfs: optionally store blockSize in DfsPackDescription

Allow a DFS implementation to report blockSize to DfsPackFile,
bypassing alignment errors and corrections in the DfsBlockCache when
the blockSize of a specific file differs from the cache's configured
blockSize.

Change-Id: Ic376314d4a86a0bd528c033e169d93eef035b233

7 years agodfs: silence resource warnings in DfsBlockCacheTest 03/101603/1
Shawn Pearce [Wed, 19 Jul 2017 21:59:50 +0000 (14:59 -0700)]
dfs: silence resource warnings in DfsBlockCacheTest

Change-Id: Ia934d8578592dc20837944d50acfb8920e260893

7 years agodfs: Fix DataFormatException: 0 bytes to inflate 00/101600/2
Shawn Pearce [Wed, 19 Jul 2017 21:20:23 +0000 (14:20 -0700)]
dfs: Fix DataFormatException: 0 bytes to inflate

When a file uses a different block size (e.g.  500) than the cache
(e.g.  512), and the DfsPackFile's blockSize field has not been
initialized, the cache misaligns block loads.  The cache uses its
default of 512 to compute the block alignment instead of the file's
500.

This causes DfsReader try to set an empty range into an Inflater,
resulting in an object being unable to load.

Change-Id: I7d6352708225f62ef2f216d1ddcbaa64be113df6

7 years agodfs: actually allow current DfsBlock to GC 99/101599/1
Shawn Pearce [Wed, 19 Jul 2017 20:56:06 +0000 (13:56 -0700)]
dfs: actually allow current DfsBlock to GC

Holding the current DfsBlock in a local variable 'b' may prevent the
Java GC from reclaiming it while loading the next block.  Remove the
local variable and rely only on the field.

Change-Id: Ibfc8394cac717b485fdc94d5c8479c3f8ca78ee4

7 years agodfs: test for repositories sharing blocks in DfsBlockCache 98/101598/1
Shawn Pearce [Wed, 19 Jul 2017 20:47:18 +0000 (13:47 -0700)]
dfs: test for repositories sharing blocks in DfsBlockCache

Simple test to verify two DfsRepository instances will reuse the same
DfsBlocks in the DfsBlockCache, even though the DfsStreamKey instance
is now different between their DfsPackFile instances.

Change-Id: I409c109142dea488d189b9ac0d3c319755dce7b4

7 years agoMerge "dfs: only create DfsPackFile if description has PACK"
Shawn Pearce [Wed, 19 Jul 2017 18:49:37 +0000 (14:49 -0400)]
Merge "dfs: only create DfsPackFile if description has PACK"

7 years agodfs: Fix incorrect use of reference == for DfsStreamKey 63/101563/1
Shawn Pearce [Wed, 19 Jul 2017 17:04:09 +0000 (10:04 -0700)]
dfs: Fix incorrect use of reference == for DfsStreamKey

Must use .equals() now with DfsStreamKey.

Change-Id: I35fecbe3895c2078d69213e9c708a9b0613a1c7c

7 years agodfs: Fix build break caused by DfsStreamKey.of signature change 60/101560/1
Shawn Pearce [Wed, 19 Jul 2017 16:32:00 +0000 (09:32 -0700)]
dfs: Fix build break caused by DfsStreamKey.of signature change

Change-Id: I6c49cf42a04dd0d96cfe0751f500a51f56f0bdb8

7 years agodfs: only create DfsPackFile if description has PACK 75/101475/2
Shawn Pearce [Wed, 19 Jul 2017 02:30:07 +0000 (19:30 -0700)]
dfs: only create DfsPackFile if description has PACK

In the future with reftable a DFS implementation may choose to create
a PackDescription that contains only a REFTABLE extension.  Filter
these out by only creating a DfsPackFile if the PackDescription as the
expected PackExt.PACK.

Change-Id: I4c831622378156ae6b68f82c1ee1db5e150893be

7 years agodfs: Fix default DfsStreamKey to include DfsRepositoryDescription 35/101535/1
Shawn Pearce [Wed, 19 Jul 2017 12:53:30 +0000 (05:53 -0700)]
dfs: Fix default DfsStreamKey to include DfsRepositoryDescription

Not all DFS implementations use globally unique pack names in the
DfsPackDescription.  Most require the DfsRepositoryDescription to
qualify the pack.  Include DfsRepositoryDescription in the default
DfsStreamKey implementation, to prevent cache collisions.

Change-Id: I9ebf0c76bf2b414a702ae050b32e42588067bc44

7 years agodfs: Shrink DfsPackDescription.sizeMap storage 34/101534/1
Shawn Pearce [Wed, 19 Jul 2017 12:41:31 +0000 (05:41 -0700)]
dfs: Shrink DfsPackDescription.sizeMap storage

Using a HashMap is overkill for this storage.  PackExt is a
constrained type that permits no more than 32 unique values in the JVM.
Each is assigned a unique index (getPosition), which can be used as
indexes in a simple long[].

Change-Id: Ib8e3b2db15d3fde28989b6f4b9897f8a7bb36f3b

7 years agodfs: Fix caching of index, bitmap index, reverse index 78/101478/1
Shawn Pearce [Wed, 19 Jul 2017 04:58:30 +0000 (21:58 -0700)]
dfs: Fix caching of index, bitmap index, reverse index

When 07f98a8b71 ("Derive DfsStreamKey from DfsPackDescription")
stopped caching DfsPackFile in the DfsBlockCache, the DfsPackFile began
to always load the idx, bitmap, or compute reverse index, as the cache
handles were no longer populated by prior requests.

Rework caching to lookup the objects from the DfsBlockCache if the
local DfsPackFile handle is invalid.  This allows the DfsPackFile to
be more of a flyweight instance across requests.

Change-Id: Ic7b42ce2d90692cccea36deb30c2c76ccc81638b

7 years agodfs: Use special ForReverseIndex DfsStreamKey wrapper instead of derive 77/101477/1
Shawn Pearce [Wed, 19 Jul 2017 04:37:51 +0000 (21:37 -0700)]
dfs: Use special ForReverseIndex DfsStreamKey wrapper instead of derive

While implementing a custom subclass of DfsStreamKey it became obvious
the required derive(String) was making it impossible to construct an
efficient key in all cases.

Instead, use a special wrapper type ForReverseIndex around the INDEX's
own DfsStreamKey to denote the reverse index stream in the
DfsBlockCache.  This adds a smaller layer of boxing, but eliminates
weird issues for DFS implementors using specialized DfsStreamKey
implementations for space efficiency reasons.

Now that DfsStreamKey is reasonably light-weight, avoid allocating the
index and reverse index keys until necessary.  DfsPackFile mostly
holds the DfsBlockCache.Ref handle to the object, and only needs the
DfsStreamKey when its looking up the handle.

Change-Id: Icea78e8f7f1514087b94ef5f525d9573ea2913f2

7 years agoDerive DfsStreamKey from DfsPackDescription 73/101373/5
Shawn Pearce [Mon, 17 Jul 2017 17:24:09 +0000 (10:24 -0700)]
Derive DfsStreamKey from DfsPackDescription

By making this a deterministic function, DfsBlockCache can stop
retaining a map of every DfsPackDescription it has ever seen.  This
fixes a long standing memory leak in DfsBlockCache.

This refactoring also simplifies the idea of setting up more
lightweight objects around streams.

Change-Id: I051e7b96f5454c6b0a0e652d8f4a69c0bed7f6f4

7 years agoExtract BlockBasedFile base class for DfsPackFile 77/100577/2
Shawn Pearce [Tue, 4 Jul 2017 00:48:34 +0000 (17:48 -0700)]
Extract BlockBasedFile base class for DfsPackFile

This new base class has the minimum set of properties and methods
necessary for DfsBlockCache to manage blocks of a file in the cache.
Subclasses can use DfsBlockCache for any content.

This refactoring opens the door for additional PackExt types other
than PACK to be stored on a block-by-block basis by the DfsBlockCache.

Change-Id: I307228fc805c3ff0c596783beb24fd52bec35ba8

7 years agoUse separate DfsStreamKey for PackIndex 76/100576/2
Shawn Pearce [Tue, 4 Jul 2017 00:30:59 +0000 (17:30 -0700)]
Use separate DfsStreamKey for PackIndex

Instead of overloading the pack's DfsStreamKey with negative positions
for the idx, reverse idx and bitmap, assign a unique DfsStreamKey for
each of these related streams.

Change-Id: Ie048036c74a1d1bbf5ea7e888452dc0c1adf992f

7 years agoRename DfsPackKey to DfsStreamKey 75/100575/2
Shawn Pearce [Tue, 4 Jul 2017 00:22:52 +0000 (17:22 -0700)]
Rename DfsPackKey to DfsStreamKey

This renaming supports reusing DfsStreamKey in a future commit
to index other PackExt type streams inside of the DfsBlockCache.

Change-Id: Ib52d374e47724ccb837f4fbab1fc85c486c5b408

7 years agoAdd missing @since 4.9 for new API PackParser.setExpectedObjectCount() 51/100951/1
Matthias Sohn [Fri, 7 Jul 2017 22:06:31 +0000 (00:06 +0200)]
Add missing @since 4.9 for new API PackParser.setExpectedObjectCount()

Change-Id: I58fa956aea37c696dbc35ecd229d8971d532923f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge changes from topic 'packed-batch-ref-update'
Dave Borowitz [Fri, 7 Jul 2017 17:51:25 +0000 (13:51 -0400)]
Merge changes from topic 'packed-batch-ref-update'

* changes:
  RefList: Support capacity <= 0 on new builders
  Short-circuit writing packed-refs if no refs were packed
  BatchRefUpdate: Clarify some ref prefix calls

7 years agoMake possible to overwrite the object count 06/99706/3
Zhen Chen [Tue, 20 Jun 2017 21:28:25 +0000 (14:28 -0700)]
Make possible to overwrite the object count

Right now, PackParser relies on the object count from the pack header.
However, when creating Dfs INSERT packs, the object count is not known
at the beginning of the operation. And when we append the base to a
RECEIVE pack, we can't modify the pack header for object count in most
Dfs implementations.

Make it possible to tell PackParser the expected object count by adding
a setter for expectedObjectCount, implementation can overwrite the
object count in onPackHeader function.

Change-Id: I646ca33ab2b843de84edc287abfb65803a56a927
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoRefList: Support capacity <= 0 on new builders 67/100767/1
Dave Borowitz [Wed, 5 Jul 2017 17:32:35 +0000 (13:32 -0400)]
RefList: Support capacity <= 0 on new builders

Callers may estimate the size, and their estimate may be zero. Silently
allow this, rather than throwing IndexOutOfBoundsException later during
add.

Change-Id: Ife236f9f4ce469c57b18e76cf4fad6feb52cb2b0

7 years agoShort-circuit writing packed-refs if no refs were packed 66/100766/1
Dave Borowitz [Wed, 5 Jul 2017 16:16:56 +0000 (12:16 -0400)]
Short-circuit writing packed-refs if no refs were packed

Change-Id: Id691905599b242e48f590138a96e0c86132308fd

7 years agoBatchRefUpdate: Clarify some ref prefix calls 65/100765/1
Dave Borowitz [Wed, 5 Jul 2017 13:57:01 +0000 (09:57 -0400)]
BatchRefUpdate: Clarify some ref prefix calls

Inline the old addRefToPrefixes, since it was just a glorified addAll.
Split getPrefixes into a variant, addPrefixesTo, that doesn't allocate a
small Collection on every invocation. Use this in the tight loop of
getTakenPrefixes.

Change-Id: I25cc7feef0c8e312820d85b7ed48559da49b83d2

7 years agoMerge "Support -merge attribute in binary macro"
Christian Halstrick [Mon, 3 Jul 2017 11:48:19 +0000 (07:48 -0400)]
Merge "Support -merge attribute in binary macro"

7 years agoUse read ahead during copyPackThroughCache 69/100169/1
Shawn Pearce [Tue, 27 Jun 2017 16:51:39 +0000 (09:51 -0700)]
Use read ahead during copyPackThroughCache

If a block is missing from the block cache, open the pack stream,
retain the ReadableChannel, and turn on read-ahead.  This should help
to load a medium sized pack into a cold cache more quickly from a
slower IO stream, as the pack is scanned sequentially and missing
blocks are more likely to be available through the read-ahead.

Change-Id: I3300d936b9299be6d9eb642992df7c04bb439cde

7 years agoSupport -merge attribute in binary macro 74/99874/3
Mathieu Cartaud [Mon, 22 May 2017 08:33:52 +0000 (10:33 +0200)]
Support -merge attribute in binary macro

The merger is now able to react to the use of the merge attribute.
The value unset and the custom value 'binary' are handled (-merge
and merge=binary)

Since the specification of the merge attribute states that when the
attribute is unset, ours version must be kept in case of a conflict, we
don't overwrite the file but keep the local version.

Bug: 517128
Change-Id: Ib5fbf17bdaf727bc5d0e106ce88f2620d9f87a6f
Signed-off-by: Mathieu Cartaud <mathieu.cartaud@obeo.fr>
7 years agoAdd a test for parsing fsck config options and expose FsckMode enum 80/99780/5
David Turner [Wed, 21 Jun 2017 19:23:03 +0000 (15:23 -0400)]
Add a test for parsing fsck config options and expose FsckMode enum

These config options allow overriding the message type (error, warn or
ignore) of a specific message ID such as missingEmail.
The supported fsck message IDs are defined in ObjectChecker.ErrorType.

Since TransferConfig.FsckMode wasn't public parsing fsck configuration
options like e.g. fsck.missingEmail=ignore failed with an
IllegalAccessException. Fix this by declaring this enum public.

Change-Id: I3f41ff7a76a846250a63ce92a9fd111eb347269f
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd --match option for `jgit describe` to CLI 72/99772/2
Oliver Lockwood [Wed, 21 Jun 2017 16:34:05 +0000 (17:34 +0100)]
Add --match option for `jgit describe` to CLI

This adds --match option for glob(7) matchers on git tags to jgit
describe in CLI.

Bug: 518377
Change-Id: I745988d565dd4391e8b3e5a91bbfbae575333819
Signed-off-by: Oliver Lockwood <oliver.lockwood@cantab.net>
7 years agoFix bug in multiple tag handling on DescribeCommand 86/99686/5
Oliver Lockwood [Wed, 21 Jun 2017 16:25:19 +0000 (17:25 +0100)]
Fix bug in multiple tag handling on DescribeCommand

In the case of multiple tags on the same commit, jgit previously
only ever looked at the last of those tags; git behaviour is to
return the first tag (or first matching one if --match is
specified).

Bug: 518377
Change-Id: I3b6b58ad9f8aa3879ae35b84542b7bddc74a27d6
Signed-off-by: Oliver Lockwood <oliver.lockwood@cantab.net>
7 years agoSupport --match functionality in DescribeCommand 09/99509/3
Oliver Lockwood [Fri, 16 Jun 2017 14:28:26 +0000 (15:28 +0100)]
Support --match functionality in DescribeCommand

A `match()` method has been added to the DescribeCommand, allowing
users to specify one or more `glob(7)` matchers as per Git convention.

Bug: 518377
Change-Id: Ib4cf34ce58128eed0334adf6c4a052dbea62c601
Signed-off-by: Oliver Lockwood <oliver.lockwood@cantab.net>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAllow to programmatically set FastForwardMode for PullCommand 62/99262/7
Matthias Sohn [Mon, 12 Jun 2017 17:29:55 +0000 (19:29 +0200)]
Allow to programmatically set FastForwardMode for PullCommand

Bug: 517847
Change-Id: I70d12dbe347a3d7a3528687ee04e52a2052bfb93
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd support for config "pull.ff 23/76323/6
Mattias Neuling [Thu, 30 Jun 2016 12:25:53 +0000 (14:25 +0200)]
Add support for config "pull.ff

When the configuration entry 'pull.ff' exists the merge of the pull will
use the value as fast forward option.

Bug: 474174
Change-Id: Ic8db2f00095ed81528667b064ff523911e6c122e
Signed-off-by: Mattias Neuling <neuling@dakosy.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFetch/PullCommand: Improve Javadoc of setRecurseSubmodules 35/99435/1
David Pursehouse [Fri, 16 Jun 2017 03:52:31 +0000 (12:52 +0900)]
Fetch/PullCommand: Improve Javadoc of setRecurseSubmodules

Annotate the `recurse` parameter as @Nullable and expand the
Javadoc to clarify the precedence of options.

Change-Id: I7aee800cdbf8243133a0d353ef79b97b67ce011e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoImprove javadoc for MergeCommand.setFastForward() 31/99431/1
Matthias Sohn [Thu, 15 Jun 2017 20:58:29 +0000 (22:58 +0200)]
Improve javadoc for MergeCommand.setFastForward()

- mark parameter to be nullable
- explain that we fallback to value of merge.ff if set to null and to
--ff if also not configured there

Change-Id: Id077763b95195d21543ac637f9939a6d4179e982
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd tests for SubmoduleConfig 86/99186/5
David Pursehouse [Mon, 12 Jun 2017 04:41:20 +0000 (13:41 +0900)]
Add tests for SubmoduleConfig

Change-Id: Idcc93c2ca95938995d489cffda649c7d7b26c50e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'stable-4.8' 87/99187/3
Matthias Sohn [Thu, 15 Jun 2017 17:05:12 +0000 (19:05 +0200)]
Merge branch 'stable-4.8'

* stable-4.8:
  Prepare 4.8.1-SNAPSHOT builds
  JGit v4.8.0.201706111038-r

Change-Id: I32024b36093eb095539e02b1788d074bc5237d9f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd a new singlePack option to PackConfig 71/99371/4
Terry Parker [Wed, 14 Jun 2017 21:02:45 +0000 (14:02 -0700)]
Add a new singlePack option to PackConfig

If set, "singlePack" will create a single GC pack file for all
objects reachable from refs/*. If not set, the GC pack will contain
object reachable from refs/heads/* and refs/tags/*, and the GC_REST
pack will contain all other reachable objects.

Change-Id: I56bcb6a9da2c10a0909c2f940c025db6f3acebcb
Signed-off-by: Terry Parker <tparker@google.com>
7 years agoPrepare 4.8.1-SNAPSHOT builds 89/99189/1
Matthias Sohn [Tue, 13 Jun 2017 02:19:30 +0000 (22:19 -0400)]
Prepare 4.8.1-SNAPSHOT builds

Change-Id: I7ca4186bbfe5ccc3fed4509a1fe4fc47bb2e8c50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoJGit v4.8.0.201706111038-r 76/99076/1 v4.8.0.201706111038-r
Matthias Sohn [Sun, 11 Jun 2017 14:39:41 +0000 (16:39 +0200)]
JGit v4.8.0.201706111038-r

Change-Id: Ie33623a2191ffffc2ca5756fd078a7003c0c660f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'stable-4.8' 74/99074/1
David Pursehouse [Sun, 11 Jun 2017 11:24:12 +0000 (20:24 +0900)]
Merge branch 'stable-4.8'

* stable-4.8:
  Use a dedicated executor to run auto-gc in command line interface
  Allow to use an external ExecutorService for background auto-gc
  Fetch: Add --recurse-submodules and --no-recurse-submodules options
  Fix capitalization of command help summaries

Change-Id: I7c85f11daa34c11c7f6389de885a2183a686197e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoUse a dedicated executor to run auto-gc in command line interface 73/99073/2
Matthias Sohn [Sun, 11 Jun 2017 09:51:59 +0000 (11:51 +0200)]
Use a dedicated executor to run auto-gc in command line interface

WorkQueue uses daemon threads so auto-gc would not be executed after
short-lived commands run in command line. Hence use a dedicated executor
which we shutdown when the command finishes.

Change-Id: I0c2429ecfa04387389d159168ba78a020a696228
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAllow to use an external ExecutorService for background auto-gc 70/99070/3
Matthias Sohn [Sat, 10 Jun 2017 23:20:34 +0000 (01:20 +0200)]
Allow to use an external ExecutorService for background auto-gc

If set use the external executor, otherwise use JGit's own simple
WorkQueue. Move WorkQueue to an internal package so we can reuse it
without exposing it in the public API.

Change-Id: I060d62ffd6692362a88b4bf13ee07b0dc857abe9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFetch: Add --recurse-submodules and --no-recurse-submodules options 96/98396/7
David Pursehouse [Fri, 24 Mar 2017 01:26:44 +0000 (10:26 +0900)]
Fetch: Add --recurse-submodules and --no-recurse-submodules options

Add options to control recursion into submodules on fetch.

Add a callback interface on FetchCommand, to allow Fetch to display
an update "Fetching submodule XYZ" for each submodule.

Change-Id: Id805044b57289ee0f384b434aba1dbd2fd317e5b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix capitalization of command help summaries 71/99071/1
David Pursehouse [Sun, 11 Jun 2017 07:18:13 +0000 (16:18 +0900)]
Fix capitalization of command help summaries

Change-Id: Ibb245fdca5470efa6340af019b452dd17b01e9c2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoMerge branch 'stable-4.8' 63/99063/1
David Pursehouse [Sat, 10 Jun 2017 05:14:12 +0000 (14:14 +0900)]
Merge branch 'stable-4.8'

* stable-4.8:
  SubmoduleUpdateCommand#setCallback should return 'this'
  CloneCommand#setCallback should return 'this'
  Prepare 4.7.2-SNAPSHOT builds
  JGit v4.7.1.201706071930-r
  ArchiveCommand: Create prefix entry with commit time
  Run auto GC in the background
  Update Orbit to the Oxygen version R20170516192513

Change-Id: Ibf90b4899d097474e7836e6baab8829e66fca524
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoSubmoduleUpdateCommand#setCallback should return 'this' 61/99061/1
Matthias Sohn [Fri, 9 Jun 2017 22:58:23 +0000 (00:58 +0200)]
SubmoduleUpdateCommand#setCallback should return 'this'

The other methods in this class follow the builder pattern, and
return 'this', allowing multiple method calls to be chained in a
single statement.

Update the setCallback method to do the same.
Change-Id: I4ddaacd6d50601f47f61eb6be8b62c8d59cce062
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoDefer object collision check until pack stream is done 40/98740/4
Zhen Chen [Thu, 8 Jun 2017 23:55:26 +0000 (16:55 -0700)]
Defer object collision check until pack stream is done

Object collision check requires read from local storage which may be
slow. We already delay this check for blobs, this change will also delay
other objects until the pack stream is closed. In this way, there is no
readCurs call until the pack stream is closed.

Change-Id: I3c8c4720dd19a5f64f8c7ddf07d815ed6877b6aa
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoCloneCommand#setCallback should return 'this' 93/98393/4
David Pursehouse [Thu, 1 Jun 2017 04:49:58 +0000 (13:49 +0900)]
CloneCommand#setCallback should return 'this'

The other methods in this class follow the builder pattern, and
return 'this', allowing multiple method calls to be chained in a
single statement.

Update the setCallback method to do the same.

Change-Id: I0366d28bf66ba47f08ee7eee636d613c9fe079f5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoMerge branch 'stable-4.7' into stable-4.8 59/98959/1
Matthias Sohn [Thu, 8 Jun 2017 12:21:01 +0000 (14:21 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.2-SNAPSHOT builds

Change-Id: Icbbc642d37cc8261ed11d7e34548198ce2a003f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoPrepare 4.7.2-SNAPSHOT builds 92/98892/1
Matthias Sohn [Thu, 8 Jun 2017 11:33:25 +0000 (13:33 +0200)]
Prepare 4.7.2-SNAPSHOT builds

Change-Id: I7c127bd402cd84c68d8f33a32c6aad093a2264c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'stable-4.7' into stable-4.8 52/98852/2
David Pursehouse [Thu, 8 Jun 2017 00:03:25 +0000 (09:03 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  JGit v4.7.1.201706071930-r
  ArchiveCommand: Create prefix entry with commit time

Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Change-Id: Id4df76da84fde253ce04484f3437816dc145b4f2

7 years agoJGit v4.7.1.201706071930-r 53/98853/1 v4.7.1.201706071930-r
Matthias Sohn [Wed, 7 Jun 2017 23:19:38 +0000 (01:19 +0200)]
JGit v4.7.1.201706071930-r

Change-Id: I28cd8fbe995d76c8a00e7db6ddf826e983d89043
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'stable-4.7' into stable-4.8 18/98818/1
Matthias Sohn [Wed, 7 Jun 2017 14:58:18 +0000 (16:58 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Run auto GC in the background

Change-Id: I5e25765f65d833f13cbe99696ef33055d7f5c4cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoArchiveCommand: Create prefix entry with commit time 78/98478/3
Yasuhiro Takagi [Sat, 29 Apr 2017 11:35:10 +0000 (20:35 +0900)]
ArchiveCommand: Create prefix entry with commit time

The cgit archive command creates a prefix (root) directory entry
in the archive file. That entry's time is set to the commit time.

This patch makes jgit's behavior consistent with with cgit:

prefix: hoge/     -> creates prefix directory "hoge/" entry.
prefix: hoge////  -> creates prefix directory "hoge/" entry.
prefix: hoge/foo  -> does not create prefix directory entry, but for
                     each file/directory entry, prefix is added.

Change-Id: I2610e40ce37972c5f7456fdca6337e7fb07176e5
Signed-off-by: Yasuhiro Takagi <ytakagi@bea.hi-ho.ne.jp>
7 years agoRun auto GC in the background 74/98474/2
David Turner [Wed, 8 Feb 2017 20:07:18 +0000 (15:07 -0500)]
Run auto GC in the background

When running an automatic GC on a FileRepository, when the caller
passes a NullProgressMonitor, run the GC in a background thread. Use a
thread pool of size 1 to limit the number of background threads spawned
for background gc in the same application. In the next minor release we
can make the thread pool configurable.

In some cases, the auto GC limit is lower than the true number of
unreachable loose objects, so auto GC will run after every (e.g) fetch
operation.  This leads to the appearance of poor fetch performance.
Since these GCs will never make progress (until either the objects
become referenced, or the two week timeout expires), blocking on them
simply reduces throughput.

In the event that an auto GC would make progress, it's still OK if it
runs in the background. The progress will still happen.

This matches the behavior of regular git.

Git (and now jgit) uses the lock file for gc.log to prevent simultaneous
runs of background gc. Further, it writes errors to gc.log, and won't
run background gc if that file is present and recent. If gc.log is too
old (according to the config gc.logexpiry), it will be ignored.

Change-Id: I3870cadb4a0a6763feff252e6eaef99f4aa8d0df
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agofetch: Accept any SHA-1 on lhs of refspec 03/98603/1
Shawn Pearce [Sun, 4 Jun 2017 20:58:16 +0000 (13:58 -0700)]
fetch: Accept any SHA-1 on lhs of refspec

Allow fetch to accept a SHA-1 on the left hand side of a RefSpec,
enabling callers to pass a specific SHA-1 they want that may not have
been advertised by the remote repository. This can be passed along to
the network protocol to be sent in a "want" line.

Rest of the plumbing only cares about the ObjectId of the Ref in
the askFor map, so make up a fake name using ObjectId.name() to
pass the desired ObjectId into the network code.

Change-Id: I620a189f3de005c403aa68b7d0442d6aa94e6056

7 years agoUpdate Orbit to the Oxygen version R20170516192513 70/98270/1
Matthias Sohn [Sun, 28 May 2017 22:05:45 +0000 (00:05 +0200)]
Update Orbit to the Oxygen version R20170516192513

Change-Id: I13575c77540149d383747a34754ac338ed60fb52
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoPrepare 4.9.0-SNAPSHOT builds 07/98207/1
Matthias Sohn [Tue, 30 May 2017 11:42:07 +0000 (13:42 +0200)]
Prepare 4.9.0-SNAPSHOT builds

Change-Id: I52a4153d573799e861ab104939f51fac1aceb9ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'master' into stable-4.8 97/98197/1
Matthias Sohn [Tue, 30 May 2017 11:01:53 +0000 (13:01 +0200)]
Merge branch 'master' into stable-4.8

* master:
  Fix out-of-bounds exception in RepoCommand#relative
  Fix null return from FS.readPipe when command fails to launch
  RenameDetector: Clarify rename limits <= 0
  Remove unnecessary cast for DfsReader
  Allow DfsReader to be subclassed
  Track read IO for DfsReader
  Fix javadoc of TooLargeObjectInPackException
  Exclude refs/tags from bitmap commit selection

Change-Id: I9cd20ded108d2e5d81fa1f0c2cb9aa0eabe1f256

7 years agoFix out-of-bounds exception in RepoCommand#relative 80/97680/3
Han-Wen Nienhuys [Mon, 22 May 2017 12:48:39 +0000 (14:48 +0200)]
Fix out-of-bounds exception in RepoCommand#relative

Change-Id: I9c91aa2ff037bff27a8131fba54be22f5f27d80d
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix null return from FS.readPipe when command fails to launch 09/97709/3
Bryan Donlan [Mon, 22 May 2017 18:37:14 +0000 (11:37 -0700)]
Fix null return from FS.readPipe when command fails to launch

When a command invoked from readPipe fails to launch (i.e. the exec call
fails due to a missing command executable), Process.start() throws,
which gets caught by the generic IOException handler, resulting in a
null return. This change detects this case and rethrows a
CommandFailedException instead.

Additionally, this change uses /bin/sh instead of bash for its posix
command failure test, to accomodate building in environments where bash
is unavailable.

Change-Id: Ifae51e457e5718be610c0a0914b18fe35ea7b008
Signed-off-by: Bryan Donlan <bdonlan@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoRenameDetector: Clarify rename limits <= 0 78/97878/1
Dave Borowitz [Wed, 24 May 2017 13:26:40 +0000 (09:26 -0400)]
RenameDetector: Clarify rename limits <= 0

Change-Id: I8da386e02272316b8e5e5c2f31ce10ad98bcdb28

7 years agoRemove unnecessary cast for DfsReader 04/97704/1
Zhen Chen [Mon, 22 May 2017 17:26:27 +0000 (10:26 -0700)]
Remove unnecessary cast for DfsReader

Change-Id: I22aaccfc9d589750f9d1d711b655dd0fd543fa57
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoMerge "Fix javadoc of TooLargeObjectInPackException"
David Pursehouse [Mon, 22 May 2017 05:12:10 +0000 (01:12 -0400)]
Merge "Fix javadoc of TooLargeObjectInPackException"

7 years agoAllow DfsReader to be subclassed 08/97608/1
Shawn Pearce [Fri, 19 May 2017 20:47:10 +0000 (13:47 -0700)]
Allow DfsReader to be subclassed

Necessary if a DFS implementation wants to override close()
to record DfsReaderIoStats.

Change-Id: I144575f9bf1abf2c1fd72030550c4f0795fcf44d

7 years agoTrack read IO for DfsReader 03/97603/1
Shawn Pearce [Fri, 19 May 2017 19:23:02 +0000 (12:23 -0700)]
Track read IO for DfsReader

Compute how much disk IO a DfsReader is performing, and how long the
sum of those operations took on this reader instance. Implementations
of DFS and interested applications can get the stats by calling the
new DfsReader.getIoStats() method at or after close().

Change-Id: If585741301f29182617933d6406d4a70497f2ca7

7 years agoFix javadoc of TooLargeObjectInPackException 43/97543/1
Matthias Sohn [Fri, 19 May 2017 09:22:05 +0000 (11:22 +0200)]
Fix javadoc of TooLargeObjectInPackException

The API exception should have the same javadoc like the internal
exception org.eclipse.jgit.errors.TooLargeObjectInPackException

Change-Id: Ia7508c77609e53c8e808412ac523a93194648e49
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge "Exclude refs/tags from bitmap commit selection"
Terry Parker [Thu, 18 May 2017 22:35:40 +0000 (18:35 -0400)]
Merge "Exclude refs/tags from bitmap commit selection"

7 years agoExclude refs/tags from bitmap commit selection 04/97404/7
Terry Parker [Thu, 18 May 2017 08:30:14 +0000 (01:30 -0700)]
Exclude refs/tags from bitmap commit selection

Commit db77610 ensured that all refs/tags commits are added to the
primary GC pack. It did that by adding all of the refs/tags commits
to the primary GC pack PackWriter's "interesting" object set.

Unfortunately, all commit objects in the "interesting" set are
selected as commits for which bitmap indices will be built. In a
repository like chromium with lots of tags, this changed the number of
bitmaps created from <700 to >10000. That puts huge memory pressure on
the GC task.

This change restores the original behavior of ignoring tags when
selecting commits for bitmaps.

In the "uninteresting" set, commits for refs/heads and refs/tags for
unannotated tags can not be differentiated. We instead identify
refs/tags commits by passing their ObjectIds as a new "noBitmaps"
parameter to the PackWriter.preparePack() methods.
PackWriterBitmapPreparer.setupTipCommitBitmaps() can then use that
"noBitmaps" parameter to exclude those commits.

Change-Id: Icd287c6b04fc1e48de773033fe432a9b0e904ac5
Signed-off-by: Terry Parker <tparker@google.com>
7 years agoMerge branch 'stable-4.8' 85/97485/1
Matthias Sohn [Thu, 18 May 2017 17:06:34 +0000 (19:06 +0200)]
Merge branch 'stable-4.8'

* stable-4.8:
  Prepare 4.8.0-SNAPSHOT builds
  JGit v4.8.0.201705170830-rc1

Change-Id: I001bac19abae58f8d634ba1bf2df1e0067154955
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoPrepare 4.8.0-SNAPSHOT builds 45/97345/1
Matthias Sohn [Wed, 17 May 2017 14:45:21 +0000 (16:45 +0200)]
Prepare 4.8.0-SNAPSHOT builds

Change-Id: I27fc4e4969fafde0fcba26aeebe30d732770b68f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoJGit v4.8.0.201705170830-rc1 21/97321/1 v4.8.0.201705170830-rc1
Matthias Sohn [Wed, 17 May 2017 12:26:54 +0000 (14:26 +0200)]
JGit v4.8.0.201705170830-rc1

Change-Id: I60c0a40f2e38748641b25a25bcf10346e2950886
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Use UTF-8 to write to the error stream in TextProgressMonitor 24/97024/3
Matthias Sohn [Sat, 13 May 2017 16:58:21 +0000 (18:58 +0200)]
[findBugs] Use UTF-8 to write to the error stream in TextProgressMonitor

Change-Id: Ic85db2043d6f673f268bf781917daad45d28f8cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Use UTF-8 to read git-rebase-todo file 23/97023/3
Matthias Sohn [Sat, 13 May 2017 16:56:03 +0000 (18:56 +0200)]
[findBugs] Use UTF-8 to read git-rebase-todo file

Change-Id: I7c6f71e13ef106678157eae1aa3f9d39712e577b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Use UTF-8 when writing to the error stream in GitHook 22/97022/3
Matthias Sohn [Sat, 13 May 2017 16:43:37 +0000 (18:43 +0200)]
[findBugs] Use UTF-8 when writing to the error stream in GitHook

Change-Id: Ica8a40b909ed45cf8e538714e4f26b64ff9a3d21
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Use UTF-8 when writing to the error stream in jgit pgm 21/97021/2
Matthias Sohn [Sat, 13 May 2017 16:01:18 +0000 (18:01 +0200)]
[findBugs] Use UTF-8 when writing to the error stream in jgit pgm

Change-Id: Ic2555ea932dbbd1a3a6868e731f247b9754d7f09
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd shutdown hook to cleanup unfinished clone when JVM is killed 83/96783/5
Matthias Sohn [Wed, 10 May 2017 22:18:40 +0000 (00:18 +0200)]
Add shutdown hook to cleanup unfinished clone when JVM is killed

Bug: 516303
Change-Id: I5181b0e8096af3537296848ac7dd74dff0b6d279
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoClean up the disk when cloning fails 65/96565/3
Thomas Wolf [Mon, 8 May 2017 06:48:40 +0000 (08:48 +0200)]
Clean up the disk when cloning fails

CloneCommand.call() has three stages: preparation, then the actual
clone (init/fetch), and finally maybe checking out the working
directory.

Restructure such that if we fail or are cancelled during the actual
clone (middle phase), we do clean up the disk again. This prevents
leaving behind a partial clone in an inconsistent state: either we
have a fully successfully built clone, or nothing at all.

Bug: 516303
Change-Id: I9b18c60f8f99816d42a3deb7d4a33a9f22eeb709
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
7 years agoUpgrade japicmp-maven-plugin to latest version 95/96695/4
David Pursehouse [Wed, 10 May 2017 01:25:51 +0000 (10:25 +0900)]
Upgrade japicmp-maven-plugin to latest version

Change-Id: Iace4350e51592e42f0dacf05558e53a6f87e1a6a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoUpgrade maven-pmd-plugin to latest version 94/96694/4
David Pursehouse [Wed, 10 May 2017 01:23:54 +0000 (10:23 +0900)]
Upgrade maven-pmd-plugin to latest version

Change-Id: Ief52488d97bb2771b4c5a40c4a9578c68a24964b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoRemove unused clirr-maven-plugin from LFS pom.xml files 93/96693/4
David Pursehouse [Wed, 10 May 2017 01:08:10 +0000 (10:08 +0900)]
Remove unused clirr-maven-plugin from LFS pom.xml files

Change-Id: I7252b6c89d91ac675c0e02e4d17ba0212b617098
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoUpdate jetty to 9.4.5 59/96859/6
Mat Booth [Thu, 11 May 2017 14:46:50 +0000 (15:46 +0100)]
Update jetty to 9.4.5

* Adapt to API removals in jetty 9.4+
* Manifests changed to restrict jetty to [9.4.5,10.0.0)

Bug: 514336
Bug: 516514
Change-Id: Ifcfd968084dfa6db0ae07cf541d33a6cdedc1ee2
Signed-off-by: Mat Booth <mat.booth@redhat.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoSpecify minimum Maven version in pom.xml 92/96692/2
David Pursehouse [Wed, 10 May 2017 01:05:41 +0000 (10:05 +0900)]
Specify minimum Maven version in pom.xml

Maven version 3.3.1 is the minimum required version as reported
by running:

  mvn versions:display-plugin-updates

Change-Id: I9514013dcffa6cb945496515c3eb4894c9043d7b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoCheckout should not use too long filenames 88/95588/2
Christian Halstrick [Mon, 24 Apr 2017 12:33:47 +0000 (14:33 +0200)]
Checkout should not use too long filenames

DirCacheCheckout is generating names for temporary files. It was not checking
the length of this filenames. It may happen that a generated filename is
longer than 255 chars which causes problems on certain platforms. Make sure
that filenames for temporary files do not exceed 255 chars.

Bug: 508823
Change-Id: I9475c04351ce3faebdc6ad40ea4faa3c326815f4

7 years agoSupport pull on detached HEAD 47/93047/5
Mickael Istria [Tue, 14 Mar 2017 16:41:55 +0000 (17:41 +0100)]
Support pull on detached HEAD

Bug: 485396
Change-Id: I82be09385c9b0bcc0054fea5a9cb9d178a41e278
Signed-off-by: Mickael Istria <mistria@redhat.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoReset ObjectWalker when it starts a new walk 52/96352/2
Zhen Chen [Wed, 3 May 2017 21:56:40 +0000 (14:56 -0700)]
Reset ObjectWalker when it starts a new walk

The ObjectWalker in PackWriterBitmapWalker needs to be reset whenever it
starts a new walk. Move this responsibility from the caller to the
method when the new walk starts.

Change-Id: Ib66003be1b5bdc80f46b9bbbb17d45e616714912
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoFix stack overflow in MergeBaseGenerator 97/96097/3
Shawn Pearce [Sat, 29 Apr 2017 15:27:41 +0000 (08:27 -0700)]
Fix stack overflow in MergeBaseGenerator

Some repository topologies can cause carryOntoHistory to overflow the
thread stack, due to its strategy of recursing into the 2nd+ parents
of a merge commit.  This can easily happen if a project maintains a
local fork, and frequently pulls from the upstream repository, which
itself may have a branchy history.

Rewrite the carryOntoHistory algorithm to use a fixed amount of thread
stack, pushing the save points onto the heap.  By using heap space the
thread stack depth is no longer a concern.  Repositories are instead
limited by available memory.

The algorithm is now structured as two loops:

  carryOntoHistory: This outer loop pops saved commits off the top of
  the stack, allowing the inner loop algorithm to dive down that path
  and carry bits onto commits along that part of the graph.  The loop
  ends when there are no more stack elements.

  carryOntoHistoryInner: The inner loop walks along a single path of
  the graph. For a string of pearls (commits with one parent each)

    r <- s <- t <- u

  the algorithm walks backwards from u to r by iteratively updating
  its local variable 'c'.  This avoids heap allocation along a simple
  path that does not require remembering state.

  The inner loop breaks in the HAVE_ALL case, when all bits have been
  found to be previously set on the commit.  This occurs when a prior
  iteration of the outer loop (carryOntoHistory) explored a different
  path to this same commit, and copied the bits onto it.

  When the inner loop encounters a merge commit, it pushes all parents
  onto the heap based stack by allocating individual CarryStack
  elements for each parent.  Parents are pushed in order, allowing
  side branches to be explored first.

  A small optimization is taken for the last parent, avoiding pushing
  it and instead updating 'c', allowing the side branch to be entered
  without allocating a CarryStack.

Change-Id: Ib7b67d90f141c497fbdc61a31b0caa832e4b3c04

7 years agoClone: add --recurse-submodules option 91/91591/8
David Pursehouse [Wed, 22 Feb 2017 04:21:49 +0000 (13:21 +0900)]
Clone: add --recurse-submodules option

Add the --recurse-submodules option on the command, which causes
submodules to also be initialized and updated.

Add a callback interface on CloneCommand and SubmoduleUpdateCommand to
them to provide progress feedback for clone operations.

Change-Id: I41b1668bc0d0bdfa46a9a89882c9657ea3063fc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix unnecessary type paramaters 23/95523/1
Shawn Pearce [Sat, 22 Apr 2017 21:32:41 +0000 (14:32 -0700)]
Fix unnecessary type paramaters

Can be inferred by the compiler.

Change-Id: If880ddfb7d7af2be70729d0c9f73c7c821b9c652

7 years agoDelete expired garbage even when there is no GC pack present. 99/95499/5
Thirumala Reddy Mutchukota [Fri, 21 Apr 2017 19:26:33 +0000 (12:26 -0700)]
Delete expired garbage even when there is no GC pack present.

Delete the condition to check whether the garbage pack creation time
is older than the last GC operation, because it's not possible to
find the last GC operation time when there is no GC pack.

Add additional tests to make sure the contents of the expired garbage
packs are considered during the GC operation and any actively
referenced objects from the garbage packs are copied successfully
into the GC pack before deleting the garbage pack.

Change-Id: I09e8b2656de8ba7f9b996724ad1961d908e937b6
Signed-off-by: Thirumala Reddy Mutchukota <thirumala@google.com>
7 years agoUpdate eclipse-jarsigner-plugin to 1.1.4 27/95427/1
Matthias Sohn [Thu, 20 Apr 2017 21:21:15 +0000 (23:21 +0200)]
Update eclipse-jarsigner-plugin to 1.1.4

Change-Id: Id3be21fe5146dedd46a1399e885c6d5f4778dda2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd parseCommit(AnyObjectId) method to Repository. 45/94245/4
Martin Fick [Fri, 31 Mar 2017 17:31:47 +0000 (11:31 -0600)]
Add parseCommit(AnyObjectId) method to Repository.

It is quite common to want to parse a commit without already having a
RevWalk.  Provide a shortcut to do so to make it more convenient, and to
ensure that the RevWalk is released afterwards.

Signed-off-by: Martin Fick<mfick@codeaurora.org>
Change-Id: I9528e80063122ac318f115900422a24ae49a920e

7 years agoRepoCommand: Add linkfile support. 97/85097/15
Dan Willemsen [Tue, 15 Nov 2016 23:33:53 +0000 (15:33 -0800)]
RepoCommand: Add linkfile support.

Android wants them to work, and we're only interested in them for bare
repos, so add them just for that.

Make sure to use symlinks instead of just using the copyfile
implementation. Some scripts look up where they're actually located in
order to find related files, so they need the link back to their
project.

Change-Id: I929b69b2505f03036f69e25a55daf93842871f30
Signed-off-by: Dan Willemsen <dwillemsen@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jeff Gaston <jeffrygaston@google.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoAdd some tests for alternates 83/95083/3
Matthias Sohn [Fri, 14 Apr 2017 20:57:23 +0000 (22:57 +0200)]
Add some tests for alternates

Change-Id: I00d256d0e132c0b5ff02ff27a26fbf21ecc1bccd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge "Process all "have"s even when MissingObjectException is encountered"
Jonathan Nieder [Mon, 17 Apr 2017 18:53:19 +0000 (14:53 -0400)]
Merge "Process all "have"s even when MissingObjectException is encountered"

7 years agoProcess all "have"s even when MissingObjectException is encountered 36/95136/4
Jonathan Nieder [Mon, 17 Apr 2017 18:16:50 +0000 (11:16 -0700)]
Process all "have"s even when MissingObjectException is encountered

Because objects described by the client using "have" lines do not need
to be reachable by any ref on the server, it is possible for them to
point to missing objects in the reachability graph.  When such an
object is encountered, I1097a2defa4a9dcf502ca8baca5d32880378818f (Only
throw MissingObjectException when necessary, 2017-03-29) aborts the
"have" walk early to salvage the fetch.  The downside of that change
is that remaining "have"s are ignored unless they pointed directly to
an object with a bitmap.  In the worst case this can increase the
bandwidth cost of a fetch to the cost of a clone because most "have"s
are ignored.

Avoid this cost by bypassing the failed "have" completely and moving
on to the remaining "have"s.

Change-Id: Iac236b6d05f735078c9935abfa6e58d1eb47f388