]> source.dussan.org Git - jgit.git/log
jgit.git
13 years agoStore Git on any DHT 95/2295/24
Shawn O. Pearce [Wed, 2 Mar 2011 23:23:30 +0000 (15:23 -0800)]
Store Git on any DHT

jgit.storage.dht is a storage provider implementation for JGit that
permits storing the Git repository in a distributed hashtable, NoSQL
system, or other database.  The actual underlying storage system is
undefined, and can be plugged in by implementing 7 small interfaces:

  *  Database
  *  RepositoryIndexTable
  *  RepositoryTable
  *  RefTable
  *  ChunkTable
  *  ObjectIndexTable
  *  WriteBuffer

The storage provider interface tries to assume very little about the
underlying storage system, and requires only three key features:

  *  key -> value lookup (a hashtable is suitable)
  *  atomic updates on single rows
  *  asynchronous operations (Java's ExecutorService is easy to use)

Most NoSQL database products offer all 3 of these features in their
clients, and so does any decent network based cache system like the
open source memcache product.  Relying only on key equality for data
retrevial makes it simple for the storage engine to distribute across
multiple machines.  Traditional SQL systems could also be used with a
JDBC based spi implementation.

Before submitting this change I have implemented six storage systems
for the spi layer:

  * Apache HBase[1]
  * Apache Cassandra[2]
  * Google Bigtable[3]
  * an in-memory implementation for unit testing
  * a JDBC implementation for SQL
  * a generic cache provider that can ride on top of memcache

All six systems came in with an spi layer around 1000 lines of code to
implement the above 7 interfaces.  This is a huge reduction in size
compared to prior attempts to implement a new JGit storage layer.  As
this package shows, a complete JGit storage implementation is more
than 17,000 lines of fairly complex code.

A simple cache is provided in storage.dht.spi.cache.  Implementers can
use CacheDatabase to wrap any other type of Database and perform fast
reads against a network based cache service, such as the open source
memcached[4].  An implementation of CacheService must be provided to
glue this spi onto the network cache.

[1] https://github.com/spearce/jgit_hbase
[2] https://github.com/spearce/jgit_cassandra
[3] http://labs.google.com/papers/bigtable.html
[4] http://memcached.org/

Change-Id: I0aa4072781f5ccc019ca421c036adff2c40c4295
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoAdd org.eclipse.jgit.ant to parent pom.xml 37/3337/3
Chris Aniszczyk [Thu, 5 May 2011 16:33:16 +0000 (18:33 +0200)]
Add org.eclipse.jgit.ant to parent pom.xml

Bug: 321237
Change-Id: Idd106f2700740db07f41f6d31f50d6b2a30fa732
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoMerge "Fix error handling in RepositoryFilter"
Chris Aniszczyk [Thu, 5 May 2011 14:35:55 +0000 (10:35 -0400)]
Merge "Fix error handling in RepositoryFilter"

13 years agoAdd pom.xml to org.eclipse.jgit.ant 73/3273/4
Chris Aniszczyk [Wed, 27 Apr 2011 20:59:14 +0000 (15:59 -0500)]
Add pom.xml to org.eclipse.jgit.ant

Also-by: Ketan Padegaonkar <KetanPadegaonkar@gmail.com>
Bug: 321237
CQ: 5111
Change-Id: Ie93b85df76fcb5c077b93f01ed1959eaeffb3c20
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoFix error handling in RepositoryFilter 35/3335/1
Shawn O. Pearce [Wed, 4 May 2011 21:55:53 +0000 (14:55 -0700)]
Fix error handling in RepositoryFilter

The filter did not correctly match smart HTTP client requests,
so it always fell back on HTTP status codes for errors. This
usually causes a smart client to retry a dumb request, which
is not what the server wants.

Change-Id: I42592378dc42fbe308ef30a2923786c690f668a9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPresent reset in the reflog like C Git does nowadays 28/3328/1
Robin Rosenberg [Mon, 2 May 2011 23:13:21 +0000 (01:13 +0200)]
Present reset in the reflog like C Git does nowadays

Confirmed for v1.7.4.1

Change-Id: I4f1c3cd6b2cf543be213f061afb94223062dde51
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoImplemented merge for parallel delete/modification 94/3294/2
Bernard Leach [Fri, 29 Apr 2011 09:37:00 +0000 (19:37 +1000)]
Implemented merge for parallel delete/modification

Duplicates cgit behaviour for merging the case where
OURS is deleted and THEIRS is modified as well as
OURS is modified and THEIRS id deleted.

Change-Id: Ia2ab4f8dc95020f2914ff01c2bf3b1bc62a9d45d
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAdd better exception handling for the git-init ant task 13/3313/2
Ketan Padegaonkar [Mon, 2 May 2011 16:48:27 +0000 (09:48 -0700)]
Add better exception handling for the git-init ant task

Change-Id: Ia935720fc9c09b427abb84be038c4dc74610850c
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "Attempt to make git prefix detection more reliable"
Chris Aniszczyk [Tue, 3 May 2011 16:53:49 +0000 (12:53 -0400)]
Merge "Attempt to make git prefix detection more reliable"

13 years agoMerge "Add path support to checkout command."
Stefan Lay [Tue, 3 May 2011 15:39:11 +0000 (11:39 -0400)]
Merge "Add path support to checkout command."

13 years agoAdd path support to checkout command. 80/3280/18
Kevin Sawicki [Tue, 3 May 2011 15:07:15 +0000 (08:07 -0700)]
Add path support to checkout command.

Change-Id: I89e8edfc6dd87d5bf8fd08704df2432720084330
Signed-off-by: Kevin Sawicki <kevin@github.com>
13 years agoQualify post-0.12 builds 17/3317/1
Matthias Sohn [Mon, 2 May 2011 22:19:54 +0000 (00:19 +0200)]
Qualify post-0.12 builds

Change-Id: I70fe2671321efb5c3d271121ce00299533d1b388
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoMerge branch 'stable-0.12' 16/3316/1
Matthias Sohn [Mon, 2 May 2011 22:11:47 +0000 (00:11 +0200)]
Merge branch 'stable-0.12'

* stable-0.12:
  JGit 0.12.1

13 years agoAttempt to make git prefix detection more reliable 61/3261/4
Robin Rosenberg [Mon, 2 May 2011 20:35:54 +0000 (22:35 +0200)]
Attempt to make git prefix detection more reliable

This fix makes sure the readPipe methods drains the stderr
pipe and close the subprocess' stdin stream before reading
the process outputs.

I never managed to repeat the reported problem myself, so this
may help in diagnosing the probelm on other peoples machines.

Bug: 337533
Change-Id: I299555f09768c34d5868327e574326946ee265e1

13 years agoAdd better javadoc to the git-init ant task 12/3312/2
Ketan Padegaonkar [Mon, 2 May 2011 16:44:34 +0000 (09:44 -0700)]
Add better javadoc to the git-init ant task

Change-Id: If41e5a9ab37533cce10ea1c1925d7bd3ece586ea
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoJGit 0.12.1 10/3310/1 stable-0.12 v0.12.1
Matthias Sohn [Mon, 2 May 2011 16:24:45 +0000 (18:24 +0200)]
JGit 0.12.1

Change-Id: Ia6e58b466fa3ef7ddd61b40f2ad44141fe8786c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoAdd GitCheckoutTask to org.eclipse.jgit.ant 78/3278/4
Ketan Padegaonkar [Tue, 26 Apr 2011 16:41:56 +0000 (09:41 -0700)]
Add GitCheckoutTask to org.eclipse.jgit.ant

Bug: 321237
Change-Id: I5c4753f7b99d0be002b32e403f5dfff9353c57b0
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAdd GitCloneTask to org.eclipse.jgit.ant 77/3277/3
Ketan Padegaonkar [Tue, 26 Apr 2011 16:33:52 +0000 (09:33 -0700)]
Add GitCloneTask to org.eclipse.jgit.ant

Bug: 321237
Change-Id: I605da8150048158d918c577ef8ca4f6edbed0133
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAdd org.eclipse.jgit.ant 06/3306/3
Ketan Padegaonkar [Mon, 25 Apr 2011 17:24:48 +0000 (10:24 -0700)]
Add org.eclipse.jgit.ant

Adds the initial project and a GitInitTask.

Bug: 321237
Change-Id: I06b94e0b42b20ecf51f86845e47d49913f3513c4
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge branch 'stable-0.12' 15/3215/1
Shawn O. Pearce [Thu, 21 Apr 2011 23:33:56 +0000 (16:33 -0700)]
Merge branch 'stable-0.12'

* stable-0.12:
  Implement the no-done capability

13 years agoImplement the no-done capability 16/2716/9
Shawn O. Pearce [Tue, 15 Mar 2011 01:18:49 +0000 (18:18 -0700)]
Implement the no-done capability

Smart HTTP clients may request both multi_ack_detailed and no-done in
the same request to prevent the client from needing to send a "done"
line to the server in response to a server's "ACK %s ready".

For smart HTTP, this can save 1 full HTTP RPC in the fetch exchange,
improving overall latency when incrementally updating a client that
has not diverged very far from the remote repository.

Unfortuantely this capability cannot be enabled for the traditional
bi-directional connections.  multi_ack_detailed has the client sending
more "have" lines at the same time that the server is creating the
"ACK %s ready" and writing out the PACK stream, resulting in some race
conditions and/or deadlock, depending on how the pipe buffers are
implemented.  For very small updates, a server might actually be able
to send "ACK %s ready", then the PACK, and disconnect before the
client even finishes sending its first batch of "have" lines.  This
may cause the client to fail with a broken pipe exception.  To avoid
all of these potential problems, "no-done" is restricted only to the
smart HTTP variant of the protocol.

Change-Id: Ie0d0a39320202bc096fec2e97cb58e9efd061b2d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMerge branch 'stable-0.12' 12/3212/1
Shawn O. Pearce [Thu, 21 Apr 2011 22:41:10 +0000 (15:41 -0700)]
Merge branch 'stable-0.12'

* stable-0.12:
  Fix sorting of names in RefDirectory
  Make running static checks configurable in maven build
  Add constants for gerrit change id configuration

13 years agoFix sorting of names in RefDirectory 08/3208/1
Shawn O. Pearce [Thu, 21 Apr 2011 19:40:26 +0000 (12:40 -0700)]
Fix sorting of names in RefDirectory

RefDirectory did not correctly follow the contract of RefList.  The
contract says if you use add() method of RefList builder, you MUST
sort() it afterwards, and later every other method assumes that list
is properly sorted (especially the binary search in the find() and
get() methods).  Instead RefDirectory class tried to scan the refs
recursively while sorting every folder in the process before
processing and did not call sort().

For example, when scanning the contents of refs/tags project1 string
is smaller than project1-*, so it will recursively go into the folder
and add these tags first and only then will add project-* ones. This
will result in a broken list (any project1-* string is less than
project1/* one, but they all appear after them in the list), that's
why binary search will fail making loose RefList and the whole local
RefMap completely unusable.

Change-Id: Ibad90017e3b2435b1396b69a22520db4b1b022bb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoEnabled unit tests in HttpClientTests 96/3196/1
Christian Halstrick [Tue, 12 Apr 2011 15:21:27 +0000 (17:21 +0200)]
Enabled unit tests in HttpClientTests

Change-Id: I92ae117f1dcfc569e27c66c191e090a60fbe2bb6
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoAdded support to IndexDiff to return information on conflicts 05/3105/4
Bernard Leach [Tue, 19 Apr 2011 21:51:40 +0000 (07:51 +1000)]
Added support to IndexDiff to return information on conflicts

Change-Id: I43c13eb72a44f80135c93525fce0c0280b0e64a2
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "Make running static checks configurable in maven build" into stable-0.12
Shawn Pearce [Mon, 18 Apr 2011 15:46:47 +0000 (11:46 -0400)]
Merge "Make running static checks configurable in maven build" into stable-0.12

13 years agoMake running static checks configurable in maven build 47/3147/2
Matthias Sohn [Sat, 16 Apr 2011 00:08:24 +0000 (02:08 +0200)]
Make running static checks configurable in maven build

In order to run the static checks run:

mvn -P static-checks clean install

Change-Id: I14077498a04be986ded123ddbfc97da8f9bc3130
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoAdd constants for gerrit change id configuration 19/3119/1
Stefan Lay [Thu, 14 Apr 2011 15:25:22 +0000 (17:25 +0200)]
Add constants for gerrit change id configuration

Change-Id: I22fc46dff6cc5dfd975f6e82161d265781778cde
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoUpdate eclipse IP log for 0.12 82/3082/2
Matthias Sohn [Tue, 12 Apr 2011 21:21:57 +0000 (23:21 +0200)]
Update eclipse IP log for 0.12

Change-Id: I8f2ce63e039d5baabc1533477128470696a36ced
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoHande latin-1 encoding 44/3044/7
Leonard Broman [Fri, 8 Apr 2011 19:09:04 +0000 (21:09 +0200)]
Hande latin-1 encoding

Bug: 342259
Change-Id: Ie285b8819b5ea6f9892ebafc4ebbd9c6d091d1fe
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAdd NotesCommand to the JGit API 70/2970/6
Chris Aniszczyk [Tue, 29 Mar 2011 21:56:58 +0000 (16:56 -0500)]
Add NotesCommand to the JGit API

Bug: 334765
Change-Id: Ie0fb79671e7a741eb85651f507b8ade930bfcc20
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "Create all test data in trash folder"
Chris Aniszczyk [Sat, 9 Apr 2011 23:12:23 +0000 (19:12 -0400)]
Merge "Create all test data in trash folder"

13 years agoCreate all test data in trash folder 34/3034/2
Matthias Sohn [Sat, 9 Apr 2011 23:02:29 +0000 (01:02 +0200)]
Create all test data in trash folder

This ensures that all test data is separated from project sources and
cleaned up after the test. Previously the cloned bare test repository
was created in org.eclipse.jgit.test/ and not deleted after the test
run.

Change-Id: I55110442e365fc8fe610f1c372f72a71ee6e1412
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoUpdate to use Tycho 0.11 32/3032/1
Matthias Sohn [Sat, 9 Apr 2011 21:23:47 +0000 (23:23 +0200)]
Update to use Tycho 0.11

Change-Id: I1f9053fe2af39898851b41e1e86c9320ab5594ca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoAdd "Conflicts" section to merge message on conflict 14/3014/1
Robin Stocker [Wed, 6 Apr 2011 20:55:10 +0000 (22:55 +0200)]
Add "Conflicts" section to merge message on conflict

The same as with cherry-pick, the commit message of a merge should
include a "Conflicts" section when the merge resulted in conflicts.

Change-Id: I6261dc898262322924af5ca1bef841a654b0df55
Signed-off-by: Robin Stocker <robin@nibor.org>
13 years agoRefactor reading and writing heads in Repository 13/3013/2
Robin Stocker [Wed, 6 Apr 2011 19:10:16 +0000 (21:10 +0200)]
Refactor reading and writing heads in Repository

Add private methods which are used for reading and writing MERGE_HEAD
and CHERRY_PICK_HEAD files, as suggested in the comments on change
I947967fdc2f1d55016c95106b104c2afcc9797a1.

Change-Id: If4617a05ee57054b8b1fcba36a06a641340ecc0e
Signed-off-by: Robin Stocker <robin@nibor.org>
13 years agoAdd CHERRY_PICK_HEAD for cherry-pick conflicts 96/2996/3
Robin Stocker [Sun, 3 Apr 2011 17:37:55 +0000 (19:37 +0200)]
Add CHERRY_PICK_HEAD for cherry-pick conflicts

Add handling of CHERRY_PICK_HEAD file in .git (similar to MERGE_HEAD),
which is written in case of a conflicting cherry-pick merge.

It is used so that Repository.getRepositoryState can return the new
states CHERRY_PICKING and CHERRY_PICKING_RESOLVED. These states, as well
as CHERRY_PICK_HEAD can be used in EGit to properly show the merge tool.

Also, in case of a conflict, MERGE_MSG is written with the original
commit message and a "Conflicts" section appended. This way, the
cherry-picked message is not lost and can later be re-used in the commit
dialog.

Bug: 339092
Change-Id: I947967fdc2f1d55016c95106b104c2afcc9797a1
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAdd parameters for timeout and branches to clone 09/3009/2
Stefan Lay [Wed, 6 Apr 2011 12:08:25 +0000 (14:08 +0200)]
Add parameters for timeout and branches to clone

The timeout is also used in the FetchCommand called by the
CloneCommand.

The possibility to provide a list of branches to fetch initially is a
feature offered by EGit. To implement it here is a prerequisite for
EGit to be able to use the CloneCommand.

Change-Id: I21453de22e9ca61919a7c3386fcc526024742f5f
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
13 years agoTry to checkout branch after cloning 08/3008/2
Stefan Lay [Wed, 6 Apr 2011 12:58:48 +0000 (14:58 +0200)]
Try to checkout branch after cloning

When no branch was specified in the clone command, HEAD pointed to a
commit after clone. Now the clone command tries to find a branch which
points to the same commit and checks out this branch.

Bug: 339354
Change-Id: Ie3844465329f213dee4a8868dbf434ac3ce23a08
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
13 years agoFix DirCache.isModified() 02/3002/1
Philipp Thun [Mon, 4 Apr 2011 16:04:21 +0000 (18:04 +0200)]
Fix DirCache.isModified()

Change I61a1b45db2d60fdcc0f87373ac6fd75ac4c4a202 fixed a possible NPE
occurring for newly created repositories - but in that case a wrong
value (false = not modified) was returned.

If a current version of the index file exists (liveFile), but there is
no snapshot, this means that there have been modifications (i.e. true
has to be returned).

Change-Id: I698f78112249f9924860fc58eb7eab7afdf87eb7
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years ago[findbugs] Use explicit initialization 98/2998/2
Matthias Sohn [Mon, 4 Apr 2011 00:19:16 +0000 (02:19 +0200)]
[findbugs] Use explicit initialization

Findbugs doesn't like using implicitly initialized field in
initializer.

Change-Id: Ic1ff9011813cc02950a71df587f31ed9f8415b49
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years ago[findbugs] Make mutable static field final 95/2995/1
Matthias Sohn [Sat, 2 Apr 2011 22:32:37 +0000 (00:32 +0200)]
[findbugs] Make mutable static field final

Change-Id: I310bc2093571bf22a58106f09706cc3eb43a2453
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoMerge "Make DeltaBaseCache per-ObjectReader"
Chris Aniszczyk [Sat, 2 Apr 2011 17:35:54 +0000 (13:35 -0400)]
Merge "Make DeltaBaseCache per-ObjectReader"

13 years agoMerge "Fix ReceivePack connectivity validation with alternates"
Chris Aniszczyk [Sat, 2 Apr 2011 13:44:26 +0000 (09:44 -0400)]
Merge "Fix ReceivePack connectivity validation with alternates"

13 years agoMerge "Add open(File) and wrap(Repository) to Git"
Christian Halstrick [Sat, 2 Apr 2011 07:38:07 +0000 (03:38 -0400)]
Merge "Add open(File) and wrap(Repository) to Git"

13 years agoAdd open(File) and wrap(Repository) to Git 69/2969/3
Christian Halstrick [Wed, 30 Mar 2011 00:47:19 +0000 (02:47 +0200)]
Add open(File) and wrap(Repository) to Git

When a new Git instance for an exisiting git repository should be
created there are two use-cases: either the application has already a
Repository instance in hand or the application knows where the
repository resides in the filesystem. Two methods are added to
explicitly support these use-cases: wrap(Repository db) and open(File
gitDir)

Change-Id: I2970e4aa8d4602cb1298f01e5b76bf0f96c492e5
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoSupport reading first SHA-1 from large FETCH_HEAD files 39/2739/3
Carsten Pfeiffer [Wed, 16 Mar 2011 15:57:35 +0000 (16:57 +0100)]
Support reading first SHA-1 from large FETCH_HEAD files

When reading refs, avoid reading huge files that were put there
accidentally, but still read the top of e.g. FETCH_HEAD, which
may be longer than our limit. We're only interested in the first line
anyway.

Bug: 340880
Change-Id: I11029b9b443f22019bf80bd3dd942b48b531bc11
Signed-off-by: Carsten Pfieffer <carsten.pfeiffer@gebit.de>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoMerge "Let LockFile.unlock use FileUtils.delete()"
Shawn Pearce [Sat, 2 Apr 2011 00:46:33 +0000 (20:46 -0400)]
Merge "Let LockFile.unlock use FileUtils.delete()"

13 years agoMake DeltaBaseCache per-ObjectReader 94/2994/1
Shawn O. Pearce [Sat, 2 Apr 2011 00:42:06 +0000 (20:42 -0400)]
Make DeltaBaseCache per-ObjectReader

The 'Counting objects' phase of PackWriter requires good hit rates
from the DeltaBaseCache while walking trees, the deltas need to find
their bases in the cache in order to inflate in a reasonable time.

If JGit is running in a multi-threaded server, such as Gerrit Code
Review, each thread needs its own DeltaBaseCache to prevent one thread
from evicting the other thread's relevant bases.  Move the cache to be
per-ObjectReader, lazily allocated when required by a PackFile.

Change-Id: If9d5ed06728e813632ae96dcfb811f4860b276e8
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoFix ReceivePack connectivity validation with alternates 93/2993/1
Shawn O. Pearce [Sat, 2 Apr 2011 00:21:38 +0000 (20:21 -0400)]
Fix ReceivePack connectivity validation with alternates

If a repository has an alternate object database, the alternate has
its references advertised as ".have" lines, which permits the client
to use these as delta base candidates when generating the pack.  If
setCheckReferencedObjectsAreReachable(true) is used, these additional
have lines need to be considered in addition to the advertised refs.

Change-Id: Ie39c6696f9d3ff147ef4405cd5624f6011700ce5
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoLet LockFile.unlock use FileUtils.delete() 82/2982/2
Christian Halstrick [Wed, 30 Mar 2011 15:29:10 +0000 (17:29 +0200)]
Let LockFile.unlock use FileUtils.delete()

We sometimes face the problem that the file .git/index.lock
can't deleted causing JGit operations to fail. Problem is
that LockFile.unlock() simply deletes the lockfile and ignores the
return value of File.delete(). Instead use
FileUtils.delete() with retry option. This method will retry the
deletion of the file at most 10 times with sleeps inbetween.

Bug: 335959
Change-Id: I9598edea9f2304fe12e6f470301211b503434848
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoEnhance RefDatabase with a refresh() method 80/2880/2
Christian Halstrick [Tue, 22 Mar 2011 10:19:18 +0000 (11:19 +0100)]
Enhance RefDatabase with a refresh() method

There should be a way to explictly refresh the refs cached in the
RefDirectory. Since commit c261b28 (use of FileSnapshot) this is
not needed anymore for storage in the filesystem. But for DHT based
storage an explicit refresh may be needed.

Change-Id: I7d30c3496c05e1fb6e9519f3af9f23c6adb93bf9
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoRefDirectory: Use FileSnapshot for packed-refs 18/2118/4
Shawn O. Pearce [Mon, 13 Dec 2010 21:41:19 +0000 (13:41 -0800)]
RefDirectory: Use FileSnapshot for packed-refs

Instead of tracking the length and modification time by hand, rely
on FileSnapshot to tell RefDirectory when the $GIT_DIR/packed-refs
file has been changed or should be re-read from disk.

Change-Id: I067d268dfdca1d39c72dfa536b34e6a239117cc3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agosmart HTTP: Return errors inside payload 48/2748/7
Shawn O. Pearce [Thu, 17 Mar 2011 02:19:15 +0000 (19:19 -0700)]
smart HTTP: Return errors inside payload

When the client is clearly making a smart HTTP request to our smart
HTTP server, return any errors like RepositoryNotFoundException or
ServiceNotEnabledException inside of the payload as a Git level ERR
message, rather than an HTTP error code.

This prevents the C Git command line client from retrying a failed
"$URL/info/refs?service=git-upload-pack" request without the smart
service URL, only to fail again with "403 Forbidden" when the dumb
as-is service has been disabled by the server configuration, or is
unavailable because the repository is not on the local filesystem.

Change-Id: I57e8756d5026e885e0ca615979bfcd729703be6c
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoUploadPack: Add a PreUploadHook to monitor and control behavior 46/2746/7
Shawn O. Pearce [Wed, 16 Mar 2011 20:46:53 +0000 (13:46 -0700)]
UploadPack: Add a PreUploadHook to monitor and control behavior

Embedding applications can use this hook to watch actions within
UploadPack and possibly reject them. This could be useful to prevent
clones of a large repository from this server, or to stop abusive
negotiation rounds that offer thousands of objects in a single batch.

Change-Id: Id96f1885ac4d61f22c80b6418fff54184b7348ba
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoAllow application filters on smart HTTP operations 31/2731/8
Shawn O. Pearce [Tue, 15 Mar 2011 21:00:43 +0000 (14:00 -0700)]
Allow application filters on smart HTTP operations

Permit applications embedding GitServlet to wrap the
info/refs?service=$name and /$name operations with a
servlet Filter.

To help applications inspect state of the operation,
expose the UploadPack or ReceivePack object into a
request attribute.  This can be useful for logging,
or to implement throttling of requests like Gerrit
Code Review uses to prevent server overload.

Change-Id: Ib8773c14e2b7a650769bd578aad745e6651210cb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPackWriter: Fix the way delta chain cycles are prevented 82/2782/4
Shawn O. Pearce [Fri, 18 Mar 2011 17:23:21 +0000 (10:23 -0700)]
PackWriter: Fix the way delta chain cycles are prevented

Take a very simple approach to avoiding delta chains during object
reuse: objects are now always selected from the oldest pack that
contains them.  This prevents cycles because a pack must not have
a cycle in the delta chain.  If both objects A and B are chosen
out of the same source pack then there cannot be an A->B->A cycle.

The oldest pack is also the most likely to have the smallest deltas.
Its the biggest pack in the system and probably came from the clone
(or last GC) of this repository, where all objects were previously
considered and packed tightly together.  If an object appears again
(for example due to a revert and a push into this repository) the
newer copy of won't be nearly as small as the older delta version
of it, even if the newer one is also itself a delta.

ObjectDirectory already enumerates objects during selection in this
newest->oldest order, so it already is supplying these assumptions
to PackWriter.  Taking advantage of this can speed up selection by
a tiny amount by avoiding some tests, but can also help to prevent
a cycle needing to be broken on the fly during writing.

The previous cycle breaking logic wasn't fully correct either.
If a different delta base was chosen, the new delta base might not
have been written into the output pack before the current object,
forcing the use of REF_DELTA when OFS_DELTA is always smaller.
This logic has now been reworked to always re-check the delta base
and ensure it gets written before the current object.

If a cycle occurs, it gets broken the same way as before, by
disabling delta reuse and finding an alternative form of the
object, which may require inflating/deflating in whole format.

Change-Id: I9953ab8be54ceb8b588e1280d6f7edd688887747
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPackWriter: Combine small reuse batches together 78/2778/4
Shawn O. Pearce [Fri, 18 Mar 2011 16:10:07 +0000 (09:10 -0700)]
PackWriter: Combine small reuse batches together

If the total number of objects to look for reuse on is under 4096
this is really close to a reasonable batch size for the DHT storage
system to lookup at once.  Combine all of the objects into a single
temporary list, perform reuse, and then prune the main lists if any
duplicate objects were detected from a selected CachedPack.

The intention here is to try and avoid 4 tiny sequential lookups
on the storage system when the time to wait for each of those to
finish is higher than the CPU time required to build (and later
GC) this temporary list.

Change-Id: I528daf9d2f7744dc4a6281750c2d61d8f9da9f3a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPackWriter: Remove dummy list 0 77/2777/4
Shawn O. Pearce [Fri, 18 Mar 2011 15:37:28 +0000 (08:37 -0700)]
PackWriter: Remove dummy list 0

Instead of looping over the objectsLists array, always set slot 0 to
null and explicitly work on the 4 indexes that matter.  This kills
some loops and increases the length of the code slightly, but I've
always really disliked that dummy 0 slot.

Change-Id: I5ad938501c1c61f637ffdaff0d0d88e3962d8942
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPackWriter: Speed up pruning of objects from cached packs 76/2776/4
Shawn O. Pearce [Fri, 18 Mar 2011 15:29:26 +0000 (08:29 -0700)]
PackWriter: Speed up pruning of objects from cached packs

During object enumeration for the thin pack, very few objects come
out that are duplicated with the cached pack. Typically these are
only cases where a blob or tree was cherry-picked forward, got a
copy or rename, or was reverted... all relatively infrequent events.

Speed up pruning of the thin pack object list by combining the phase
with the object representation selection. Implementers should already
be offering to reuse the object from the cached pack if it is stored
there, at which point the implementation can perform a very fast type
of containment test using the cached pack's identity rather than yet
another index lookup.  For the local disk case this is probably not a
big improvement, but it does help on the DHT implementation where the
two passes combined into one reduces latency.

Change-Id: I6a07fc75d9075bf6233e967360b6546f9e9a2b33
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMake PacketLineIn public 55/2955/2
Shawn O. Pearce [Mon, 28 Mar 2011 17:26:30 +0000 (10:26 -0700)]
Make PacketLineIn public

PacketLineOut is already public. Make PacketLineIn partially public
in case an application needs to use some of the pkt-line protocol.

Change-Id: I5b383eca980bd9e16a7dbdb5aed040c6586d4f46
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoMerge changes I2c8e917a,Ica9e50c0
Shawn Pearce [Fri, 1 Apr 2011 19:20:37 +0000 (15:20 -0400)]
Merge changes I2c8e917a,Ica9e50c0

* changes:
  Do not normalize URIishes
  Use Ignore to bypass unused test

13 years agoMerge "Fix broken git prefix detection"
Shawn Pearce [Fri, 1 Apr 2011 19:05:34 +0000 (15:05 -0400)]
Merge "Fix broken git prefix detection"

13 years agoBump jsch to 0.1.44 11/2211/4
Anatol Pomozov [Wed, 5 Jan 2011 20:02:22 +0000 (12:02 -0800)]
Bump jsch to 0.1.44

It fixes 'Corrupted MAC on input' ssh issue.

CQ: 4728
Change-Id: I7de63cb3482488ac938566706edebee8a1cdad3a
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoLet CloneCommand not checkout HEAD on bare repos 68/2968/1
Christian Halstrick [Wed, 30 Mar 2011 00:29:47 +0000 (02:29 +0200)]
Let CloneCommand not checkout HEAD on bare repos

If the clone command clones into a bare repository it should not try
to checkout HEAD in the end. For bare repos checkout is not possible.

Change-Id: I359719d421b93c9d2e962e3c0eccc2b59235c3d1
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoAdded Merge command to the CLI 20/320/7
Christian Halstrick [Fri, 5 Mar 2010 08:31:33 +0000 (09:31 +0100)]
Added Merge command to the CLI

This merge command accepts the merge strategy as option and uses the
resolve strategy as default. It expects exactly one other
revision which is merged with current head.

Change-Id: Ia8c188b93ade4afabe6a9ccf267faf045f359a3a
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoAllow InitCommand to run on existing git repos 59/2959/1
Christian Halstrick [Tue, 29 Mar 2011 13:03:25 +0000 (15:03 +0200)]
Allow InitCommand to run on existing git repos

To be more consistent with what native git does we should allow
to run the InitCommand also on existing git repos.

Change-Id: I833637842631b37dce96ed9729b3a6ed24054056
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoMerge "Do not categorize merge failures as 'abnormal'"
Christian Halstrick [Tue, 29 Mar 2011 08:23:56 +0000 (04:23 -0400)]
Merge "Do not categorize merge failures as 'abnormal'"

13 years agoFix possible NPE in DirCache.isModified() 51/2951/1
Philipp Thun [Mon, 28 Mar 2011 15:54:24 +0000 (17:54 +0200)]
Fix possible NPE in DirCache.isModified()

The snapshot field of a DirCache object for a newly created repository
can be null. This fix prevents a NPE when isModified() is called in
such a situation.

Change-Id: I61a1b45db2d60fdcc0f87373ac6fd75ac4c4a202
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoDo not categorize merge failures as 'abnormal' 48/2948/1
Philipp Thun [Mon, 28 Mar 2011 14:01:44 +0000 (16:01 +0200)]
Do not categorize merge failures as 'abnormal'

This change contains a simple renaming. Instead of using the
expression 'abnormal failure', we just treat this kind of situation
as 'failure'. This is specific enough as conflicts are already handled
separately.

Change-Id: I535acdc7d022543ed0f5ac6151b09a6985f4ef38
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoDo not normalize URIishes 42/2942/2
Robin Rosenberg [Sun, 27 Mar 2011 20:42:57 +0000 (22:42 +0200)]
Do not normalize URIishes

We used to normalize URI's since it seems simple. This however causes
inconsistencies to the user and to out tests. Just pass backslashes
through and make sure our parser can handle them.

Bug: 341062
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Change-Id: I2c8e917a086faabcd8749160c2acc9dd05a42838

13 years agoUse Ignore to bypass unused test 41/2941/2
Robin Rosenberg [Sun, 27 Mar 2011 20:53:26 +0000 (22:53 +0200)]
Use Ignore to bypass unused test

Change-Id: Ica9e50c0d512865d217f55bf0d100f27878031b9
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoFix broken git prefix detection 39/2939/3
Robin Rosenberg [Sun, 27 Mar 2011 18:44:38 +0000 (20:44 +0200)]
Fix broken git prefix detection

If JGit got a cygwin path it would fail to resolve directories
relative to it.

Also add system property to debug problems with the FS utilities.
Enable debug using -Djgit.fs.debug=1

Furthermore use -Djgit.gitprefix=<path> to set the git prefix
manually.

Change-Id: I5a58ee45c2d2ae5322f87fd6972526169b2918c8
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
13 years agoMerge "Detaching HEAD when checking out the same commit."
Shawn Pearce [Sun, 27 Mar 2011 20:55:54 +0000 (16:55 -0400)]
Merge "Detaching HEAD when checking out the same commit."

13 years agoMerge "Fix: possible IndexOutOfBoundsException in ReflogReader"
Shawn Pearce [Sun, 27 Mar 2011 20:48:45 +0000 (16:48 -0400)]
Merge "Fix: possible IndexOutOfBoundsException in ReflogReader"

13 years agoMerge "Registering the Checkout command and fixed a typo."
Shawn Pearce [Sun, 27 Mar 2011 20:46:39 +0000 (16:46 -0400)]
Merge "Registering the Checkout command and fixed a typo."

13 years agoDetaching HEAD when checking out the same commit. 25/2925/2
Sasa Zivkov [Fri, 25 Mar 2011 13:28:56 +0000 (14:28 +0100)]
Detaching HEAD when checking out the same commit.

Detaching HEAD didn't work in some corner checkout cases.  If, for example,
HEAD is symbolic ref to refs/heads/master, refs/heads/master is ref to commit
c0ffee... then:

    checkout c0ffee...

would leave the HEAD unchanged.

The same symptom occurs when checking out a remote tracking branch or a tag
that references the same commit as refs/heads/master.

In the above case, the RefUpdate class didn't have enough information to decide
if the update needed to detach symbolic ref because it dealt only with new/old
objectIDs. Therefore, this fix introduced the RefUpdate.detachingSymbolicRef
flag.

Bug: 315166
Change-Id: I085c98b77ea8f9104a213978ea0d4ac6fd58f49b
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
13 years agoPrevent NPE during fetch and push via SSH 22/2922/1
Matthias Sohn [Fri, 25 Mar 2011 02:01:50 +0000 (19:01 -0700)]
Prevent NPE during fetch and push via SSH

Bug: 340928
Change-Id: I870b77eeffa70a57891d7253a06ad7d44d808ee4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
13 years agoIntroduce FAILED result for RebaseCommand 47/2647/3
Philipp Thun [Thu, 24 Mar 2011 11:24:23 +0000 (12:24 +0100)]
Introduce FAILED result for RebaseCommand

In case an underlying cherry-pick fails due to uncommitted changes, a
RebaseCommand shall fail and roll-back changes.

Change-Id: Ic22eb047fb03ac2c8391f777036b7dbf22a1b061
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoRegistering the Checkout command and fixed a typo. 04/2904/2
Sasa Zivkov [Thu, 24 Mar 2011 10:13:16 +0000 (11:13 +0100)]
Registering the Checkout command and fixed a typo.

The Checkout command line command was added to JGit but it wasn't
registered in the list of available commands.
Additionally, the 'force' option was named '---force' (triple '-').

Change-Id: I259773932fa9aec3bb29e215740e67c834566f6f
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
13 years agoMerge "Introduce CherryPickResult"
Mathias Kinzler [Thu, 24 Mar 2011 07:18:32 +0000 (03:18 -0400)]
Merge "Introduce CherryPickResult"

13 years agoAdd status command to GIT api 90/2890/2
Christian Halstrick [Tue, 22 Mar 2011 23:06:07 +0000 (00:06 +0100)]
Add status command to GIT api

Allow users of the GIT api to get to know the state of their
workingtree and index by adding a status command. The implementation
is mainly a wrapper around IndexDiff class. Better support for multiple
stages in the index (conflict situations) is still missing. An
appropriate change to IndexDiff and StatusCommand will come in a
subsequent commit.

Bug: 337296
Change-Id: Idb390375a68611853c1c903299ec678c89b081dc
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoCreate RemoteSession interface 83/2583/5
Roland Schulz [Sat, 5 Mar 2011 00:50:14 +0000 (19:50 -0500)]
Create RemoteSession interface

The RemoteSession interface operates like a simplified version of
java.lang.Runtime with a single exec method (and a disconnect
method). It returns a java.lang.Process, which should begin execution
immediately. Note that this greatly simplifies the interface for
running commands. There is no longer a connect method, and most
implementations will contain the bulk of their code inside
Process.exec, or a constructor called by Process.exec. (See the
revised implementations of JschSession and ExtSession.)
Implementations can now configure their connections properly without
either ignoring the proper use of the interface or trying to adhere
to an overly strict interface with odd rules about what methods are
called first.  For example, Jsch needs to create the output stream
before executing, which it now does in the process constructor. These
changes should make it much easier to add alternate session
implementations in the future.

Also-by: John D Eblen <jdeblen@comcast.net>
Bug: 336749
CQ: 5004
Change-Id: Iece43632086afadf175af6638255041ccaf2bfbb
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
13 years agoIntroduce CherryPickResult 46/2646/4
Philipp Thun [Wed, 23 Mar 2011 09:24:14 +0000 (10:24 +0100)]
Introduce CherryPickResult

In order to distinguish cherry-pick failures caused by conflicts vs.
'abnormal failures' (e.g. due to unstaged changes or a dirty
worktree), a CherryPickResult class is introduced and returned by
CherryPickCommand.call() instead of a RevCommit. This new class is
similar to MergeResult and RebaseResult. The CherryPickResult contains
all necessary information, e.g. paths causing the cherry-pick (a merge
called within, respectively) to fail. This allows callers to better
react on failures.

Change-Id: I5db57b9259e82ed118e4bf4ec94463efe68b8c1f
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
13 years agoPullCommand: Use short ref name in merge message 86/2886/1
Robin Stocker [Tue, 22 Mar 2011 18:39:39 +0000 (19:39 +0100)]
PullCommand: Use short ref name in merge message

Add a test case for PullCommand for the successful merge case and test
that the short ref name is used.

Change-Id: I16cbbc88595f73e5512f984e67f93f87ee0fe242
Signed-off-by: Robin Stocker <robin@nibor.org>
13 years agoFix: possible IndexOutOfBoundsException in ReflogReader 83/2783/3
Marc Strapetz [Mon, 21 Mar 2011 07:33:40 +0000 (08:33 +0100)]
Fix: possible IndexOutOfBoundsException in ReflogReader

java.lang.IndexOutOfBoundsException
at java.nio.ByteBuffer.wrap(ByteBuffer.java:352)
at org.eclipse.jgit.util.RawParseUtils.decodeNoFallback(RawParseUtils.java:913)
at org.eclipse.jgit.util.RawParseUtils.decode(RawParseUtils.java:880)
at org.eclipse.jgit.util.RawParseUtils.decode(RawParseUtils.java:839)
at org.eclipse.jgit.storage.file.ReflogReader$Entry.<init>(ReflogReader.java:102)
at org.eclipse.jgit.storage.file.ReflogReader.getReverseEntries(ReflogReader.java:183)
at org.eclipse.jgit.storage.file.ReflogReader.getReverseEntries(ReflogReader.java:162)

Change-Id: I22a18bc7193962e5018c40a75337f9976b585c40

13 years agoImprove MergeResult 45/2645/3
Philipp Thun [Mon, 21 Mar 2011 11:33:58 +0000 (12:33 +0100)]
Improve MergeResult

Add paths causing abnormal merge failures (e.g. due to unstaged
changes) to the MergeResult returned by MergeCommand. This helps
callers to better handle (e.g. present) merge results.

Change-Id: Idb8cf04c5cecfb6a12cb880e16febfc3b9358564
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoRefactor test cases 34/2734/2
Philipp Thun [Mon, 21 Mar 2011 08:40:14 +0000 (09:40 +0100)]
Refactor test cases

This change moves commonly used methods into the RepositoryTestCase
base class.

Change-Id: I56a46c31ee1661c7ce22eb755ab23da8bc9f5da2
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoMerge "PackWriter: Collect stats by object type"
Chris Aniszczyk [Sat, 19 Mar 2011 16:33:19 +0000 (12:33 -0400)]
Merge "PackWriter: Collect stats by object type"

13 years agoMerge "BlockList: Micro-optimize appending from another BlockList"
Chris Aniszczyk [Sat, 19 Mar 2011 16:32:19 +0000 (12:32 -0400)]
Merge "BlockList: Micro-optimize appending from another BlockList"

13 years agoMerge "PackFile: Cache the packName string"
Chris Aniszczyk [Fri, 18 Mar 2011 21:28:05 +0000 (17:28 -0400)]
Merge "PackFile: Cache the packName string"

13 years agoPackWriter: Collect stats by object type 75/2775/2
Shawn O. Pearce [Fri, 18 Mar 2011 14:27:41 +0000 (07:27 -0700)]
PackWriter: Collect stats by object type

Frequently enough I'm wondering how much of a pack is commits vs.
trees, and the total line doesn't really tell us this because its
a gross total from the pack. Computing the counts per object type
is simple during packing, as PackWriter already has everything in
memory broken up by object type.  Its virtually free to get these
values and track them.

Change-Id: Id5e6b1902ea909c72f103a0fbca5d8bc316f9ab3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoBlockList: Micro-optimize appending from another BlockList 74/2774/1
Shawn O. Pearce [Fri, 18 Mar 2011 16:07:25 +0000 (09:07 -0700)]
BlockList: Micro-optimize appending from another BlockList

Simple variant of addAll() that knows how to copy large segments
quickly using System.arraycopy() rather than looping through with
an Iterator object.

Change-Id: Icb50a8f87fe9180ea28b6920f473bb9e70c300f1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoPackFile: Cache the packName string 73/2773/1
Shawn O. Pearce [Fri, 18 Mar 2011 15:21:39 +0000 (08:21 -0700)]
PackFile: Cache the packName string

Instead of computing this on every request, compute it once and
hold onto the result. This improves performance for LocalCachedPack
which does a lot of tests against the pack name string.

Change-Id: I3803745e3a5dda7b5f0faf39aae9423e2c777e7f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
13 years agoAbort merge when file to be checked out is dirty 33/2733/3
Philipp Thun [Thu, 17 Mar 2011 09:48:44 +0000 (10:48 +0100)]
Abort merge when file to be checked out is dirty

In case a file needs to be checked out (from THEIRS) during a merge
operation, it has to be checked if the worktree version of this file
is dirty. If this is true, merge shall fail.

Change-Id: I17c24845584700aad953c3d4f2bea77a0d665ec4
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoMerge "Refactor ResolveMerger"
Christian Halstrick [Fri, 18 Mar 2011 15:34:15 +0000 (11:34 -0400)]
Merge "Refactor ResolveMerger"

13 years agoRefactor ResolveMerger 54/2754/2
Philipp Thun [Fri, 18 Mar 2011 12:33:36 +0000 (13:33 +0100)]
Refactor ResolveMerger

1. Perform an explicit check for untracked files.
2. Extract 'dirty checks' into separate methods
3. Clean up comments.
4. Tests: also check contents of files not affected by merge.

Change-Id: Ieb089668834d0a395c9ab192c555538917dfdc47
Signed-off-by: Philipp Thun <philipp.thun@sap.com>
13 years agoMerge "Moved tests for commit -o option to own test class"
Mathias Kinzler [Fri, 18 Mar 2011 06:58:19 +0000 (02:58 -0400)]
Merge "Moved tests for commit -o option to own test class"

13 years agoMoved tests for commit -o option to own test class 32/2732/4
Christian Halstrick [Fri, 18 Mar 2011 06:54:35 +0000 (07:54 +0100)]
Moved tests for commit -o option to own test class

We test the -o option of the commit command very accurate by
writing tests for each line of a decision table. In order to
still be able to point new jgit users to the CommitAndLogCommandTest
to find out how to use log() and commit() I factored out these 1200
lines of very specific tests into their own class.

Change-Id: Icf7c517f790a8fa79c8afd9b7f4a2805cf79196e
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
13 years agoAdd path filtering to LogCommand 67/2767/2
Chris Aniszczyk [Thu, 17 Mar 2011 19:30:55 +0000 (14:30 -0500)]
Add path filtering to LogCommand

Bug: 340049
Change-Id: I825b93b3412a3041aca225962fc8463a8f180650
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>