Commit Graph

1973 Commits

Author SHA1 Message Date
Matthias Sohn 0f15d656f2 Narrow exceptions declared by LsRemoteCommand
API commands either throw GitAPIException or JGitInternalException.

Also add missing javadoc and reduce nesting of catch blocks.

Change-Id: I9a3b302e1b3f373ee11a977a0e3d6213bfbd3cdf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Kevin Sawicki <kevin@github.com>
2012-01-08 17:15:05 -08:00
Robin Rosenberg 0806c803a9 Merge "Retain executable mode of existing files on Windows" 2012-01-08 16:34:28 -05:00
Matthias Sohn f9726423ab Merge "Use constants from ConfigConstants in CoreConfig" 2012-01-05 10:15:55 -05:00
Kevin Sawicki 3d15298011 Add helper for determining if status is clean
This checks if all collections that Status exposes are
empty or not

Change-Id: I0c342ab70dc36c1fd70acb4f8a924bb207d62f47
2012-01-03 16:48:01 -08:00
Kevin Sawicki 69451b8302 Provide file mode of paths in index from IndexDiff
Change-Id: I1d543e2f721987114cc1e1cb0848c234470df794
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-01-04 00:27:56 +01:00
Kevin Sawicki 6c959f7702 Use constants from ConfigConstants in CoreConfig
Change-Id: Ic1253498ecdd7545c6b1f114f4c83a3b77273874
2012-01-03 15:24:55 -08:00
Kevin Sawicki c15c46e41e Retain executable mode of existing files on Windows
Currently files in a repository marked as executable will have
that mode unset when modified and committed on systems that
do not support detection of this mode since the working tree
iterator will never report this mode for any entries.

This change updates WorkingTreeIterator to be able
to determine the target file mode to be used for the index
through consideration of the configured WorkingTreeOptions.

Bug: 364956
Change-Id: Iae496baa011b8a59d9329ec73615482b03d34a5a
2012-01-03 15:07:02 -08:00
Kevin Sawicki d57c00e036 Add support for cloning submodules to CloneCommand
Change-Id: Ib1f82206fa14be75e2080f95db9f2d178e876453
2012-01-02 17:32:41 -08:00
Kevin Sawicki dea4511572 Extend TransportCommand in submodule add/update commands
This allows all the settings of a TransportCommand to be
configured on the clone commands that are run by submodule
add/update

Change-Id: I93bfe5a91d430200de8c7f1e32a60cb990aa58ea
2012-01-02 09:40:53 -08:00
Kevin Sawicki 287d17f601 Add submodule command helpers to Git class
Change-Id: I649d96617072db68ab15aa2569836fa783577424
2012-01-02 09:34:25 -08:00
Tomasz Zarna 1a2ca5b811 Skip a number commits before starting to show the commit output
Change-Id: Id2666d897d29b6371f7a6cf241cfda02964b4971
Signed-off-by: Kevin Sawicki <kevin@github.com>
2012-01-02 08:40:02 -08:00
Tomasz Zarna 5d95cd9418 Add constant for default name for the Git repo configuration
Change-Id: I5a6ef686c444fb1e46c9f784bad01165471ef372
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-01-02 13:24:36 +01:00
Tomasz Zarna 617c5d91da Sort translation bundle keys in alphabetical order.
Change-Id: I83e26531ea924178ba43fa82b3c1fe02afd23eca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-01-02 12:59:05 +01:00
Matthias Sohn 174536fa16 Update base version for clirr API check to latest release
Change-Id: Icb56610241c80d6ca8a980f6d419f4934579d441
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-30 02:09:17 +01:00
Kevin Sawicki 92c6f2f97b Add comand support for git-submodule
Adds the following commands:
    - Add
    - Init
    - Status
    - Sync
    - Update

This also updates AddCommand so that file patterns added that
are submodules can be staged in the index.

Change-Id: Ie5112aa26430e5a2a3acd65a7b0e1d76067dc545
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2011-12-28 10:33:14 -06:00
Kevin Sawicki 3c7dceec1a Add commit id and parent count to exception message
Bug: 357312
Change-Id: I2f85cf88650594eca7df6aa0e26bea329674f08e
2011-12-27 13:37:42 -08:00
Shawn Pearce 80c5210409 Merge "Only print stack trace to Sytem.err when debug flag is set" 2011-12-27 16:24:36 -05:00
Tomasz Zarna 8f8e43b741 Fix typo in RebaseResult#mySatus
Change-Id: I88d34eec8307231f89343ead06858d1df4ac0886
2011-12-27 21:47:44 +01:00
Kevin Sawicki 2de1d9fb64 Only print stack trace to Sytem.err when debug flag is set
Bug: 362100
Change-Id: Id18de9660f0dc2fb6c30db9770f31f26c874022d
2011-12-27 09:20:03 -08:00
Matthias Sohn 067ccbfda7 Merge branch 'stable-1.2'
* stable-1.2:
  JGit v1.2.0.201112221803-r
  Expose unmerged paths when revert fails
  Enforce the use of Java5 API:s only (with a few exceptions)

Change-Id: Ib18d41a65e68cc47fb63114fcce27a16820d0692
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-26 23:52:32 +01:00
Robin Rosenberg 64a3bf1dcb Merge "Limit the number of commits in LogCommand output" 2011-12-23 13:28:21 -05:00
Tomasz Zarna 248959146a Limit the number of commits in LogCommand output
Bug: 316680
Change-Id: I88cf7aac6b5763cc94421433dd4bbd42f81e0e69
2011-12-23 13:38:07 +01:00
Tomasz Zarna acd8aee98a DiffFormatter#format(List) fails unless #scan(ATI, ATI) is called first
Bug: 354919
Change-Id: I710394fe6675e0e5aa66d9118c5b10d433aa30ea
2011-12-23 13:05:31 +01:00
Robin Rosenberg 160ffc9df1 Merge "Support getting specific entry number in reflog" 2011-12-22 18:49:04 -05:00
Matthias Sohn a069e90fa9 JGit v1.2.0.201112221803-r
Change-Id: Icc0b09324f205d93929af8cf522a99ad00cf7591
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-23 00:19:02 +01:00
Christian Halstrick 200d3f5aaf Refactor ResolveMerger
The places where ResolveMerger was doing content merges have been
refactored. The goal was to have one single method where content merge
was done and to factor out other topics (updating the index, updating
the working tree) into own methods. This was done to allow adding
pluggable content mergers in change
I7817e2123d254f3eeb315b47a61d2c55bd202c12

Change-Id: I8529697b197372a284bcd5ab2c9ba1adb925a520
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2011-12-20 10:17:42 +01:00
Kevin Sawicki 52507ee2e7 Expose unmerged paths when revert fails
Change-Id: I02678aeb31a62668ae2b0342a6dae721e043dc5e
2011-12-19 22:46:20 +01:00
Kevin Sawicki 1dcb76739c Support getting specific entry number in reflog
The number specified is interpreted as relative to the
last entry in the reflog.

Change-Id: Ie4dd03370bb0d475a0e89d3015113ca98920100f
2011-12-19 09:14:47 -08:00
Kevin Sawicki 656461a991 Add exception class for when locking a file fails
This will allows calling classes to handle lock failures
without checking against the message and will also provide
access to the file that could not be locked.

Change-Id: I95bc59e1330a7af71ae3b0485c4516299193f504
2011-12-18 14:40:42 -08:00
Tomasz Zarna 8c60468ff4 Allow to amend commits with JGit CLI
Change-Id: I0e8d365b56e079ac4ccece7fcf80ea140c319c78
2011-12-18 16:28:44 +01:00
Kevin Sawicki dc4c06e7ac Support resolving integer-based reflog revisions
Revision strings such as 'master@{0}' can now be resolved
by Repository.resolve by reading the reflog for the ref and
returning the commit for the entry number specified.

This still throws an exception for cases not supported
such as 'master@{yesterday}'.

Change-Id: I6162777d6510e083565a77cac4545cda5a9aefb3
2011-12-16 17:05:47 -08:00
Robin Rosenberg 29fc8fffc1 Merge "Report diff entries for files that only change mode" 2011-12-16 10:30:24 -05:00
Matthias Sohn f1019b9738 Merge branch 'stable-1.2'
* stable-1.2:
  Add API checking using clirr
  Fix MergeCommandTest to pass if File.executable is not supported
  Fix ResolveMerger not to add paths with FileMode 0

Change-Id: I86e7194a40acd6dfa3d433f1d17c01bdf5bb0d9c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-16 08:50:49 +01:00
Robin Rosenberg 0ca105a502 Enforce the use of Java5 API:s only (with a few exceptions)
This only works with Eclipse 3.6 and newer and requires installation
of new package. Documentation is not very good, but there is a blog
about it here:
http://eclipseandjazz.blogspot.com/2011/10/of-invalid-references-to-system.html

API checking is especially useful on OS X where Java5 is not readily
available.

Change-Id: I3c0ad460874a21c073f5ac047146cbf5d31992b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-16 01:01:36 +01:00
Matthias Sohn 78ebffd5f4 Merge "Fix MergeCommandTest to pass if File.executable is not supported" into stable-1.2 2011-12-15 18:58:48 -05:00
Matthias Sohn e178ba20d0 Add API checking using clirr
In order to generate API reports run: mvn clirr:clirr

The reports are generated to the folder
target/site/clirr-report.html under the respective
project.

In order to check API compatibility and fail the build
on incompatible changes run: mvn clirr:check

For now we compare the API against the latest release
1.1.0.201109151100-r.

Bug: 336849
Change-Id: I21baaf3a6883c5b4db263f712705cc7b8ab6d888
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Kevin Sawicki <kevin@github.com>
2011-12-15 15:50:46 -08:00
Robin Rosenberg 720119744f Fix MergeCommandTest to pass if File.executable is not supported
Change-Id: If11080ed6e53d9df88a1ae42f48ee8914d54669b
2011-12-15 23:36:14 +01:00
Kevin Sawicki 78bc526d9b Report diff entries for files that only change mode
This also updates DiffFormatter to not write path lines
for entries that have the same object id

Bug: 361570
Change-Id: I830a78e2babf472503630a7aa020ebfd5c7e69c6
2011-12-14 17:51:42 -08:00
Dave Borowitz 84c80be1dc Fire DfsPacksChangedEvents when committing packs.
Once a pack has been committed with commitPack(), we know that the pack
list has changed but we don't re-scan the underlying storage.

Change-Id: Ia7b35df4442a5f5dfe7e817edcc77b44b5410d08
2011-12-13 11:04:30 -08:00
Tomasz Zarna 9f66137716 StatusCommand#setWorkingTreeIt should return 'this'
All setters for JGit API commands return the command instance, follow
the builder pattern.

Change-Id: Id2bbc3f1300bb179887c4d2d6dd72925bde55f24
Signed-off-by: Kevin Sawicki <kevin@github.com>
2011-12-12 09:21:15 -08:00
Christian Halstrick 3c544647b7 Fix ResolveMerger not to add paths with FileMode 0
When ResolveMerger finds a path where it has to do a content merge it
will try the content merge and if that succeeds it'll add the newly
produced content to the index. For the FileMode of this new index entry
it blindly copies the FileMode it finds for that path in the common base
tree. If by chance the common base tree does not contain this path it'll
try to add FileMode 0 (MISSING) to the index.

One could argue that this can't happen: how can the ResolveMerger
successfully (with no conflicts) merge two contents if there is no
common base? This was due to another bug in ResolveMerger. It failed to
find out that for two files which differ only in the FileMode (e.g. 644
vs. 755) it should not try a content merge.

Change-Id: I7a00fe1a6c610679be475cab8a3f8aa4c08811a1
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2011-12-11 01:05:13 +01:00
Matthias Sohn 7fded4d14f Prepare 1.3.0 builds
Change-Id: I7a1ae73783c95041b59f047a7330e62e7f642149
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-10 01:07:16 +01:00
Matthias Sohn e11af56828 Merge branch 'stable-1.2'
* stable-1.2:
  Fix version.sh
  Throw API exception when MergeCommand hits checkout conflicts
  Add methods for configuring platform emulation
  Fix history rendering not to occupy too many lanes
  Fix History rendering

Change-Id: If71cc760423ae2b76c7435ca4830edc1745556de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-10 01:06:47 +01:00
Matthias Sohn c1f352c100 Fix version.sh
Change-Id: Icdf5d9ea3ca62839cbf7de13dfee9682056b7cef
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-10 01:03:33 +01:00
Shawn Pearce d1dd3403ac Merge "Add simple chain implementations of transport hooks and loggers" 2011-12-09 12:23:23 -05:00
Dave Borowitz 629c61513c Add simple chain implementations of transport hooks and loggers
Allows callers to effectively run multiple hooks and loggers without
modifying the UploadPack/ReceivePack interface.

Change-Id: I5b388816b63036ffff08ef3a9b857ccb764cb8c4
2011-12-09 09:05:40 -08:00
Shawn Pearce a313ec006f Merge "Force jgit.sh to use UTF-8 encoding on Mac" 2011-12-09 10:11:30 -05:00
Shawn Pearce 32263d310c Merge changes I9f1842c2,Ie139133b
* changes:
  Throw invalid ref exception instead of invalid remote exception
  Use constant for logs directory
2011-12-09 10:04:03 -05:00
Shawn Pearce 1291e834df Merge "Add a no-op UploadPackLogger and use it by default" 2011-12-08 21:44:18 -05:00
Matthias Sohn 26b5738629 Throw API exception when MergeCommand hits checkout conflicts
When MergeCommand hit checkout conflicts it did throw an internal JGit
exception org.eclipse.jgit.errors.CheckoutConflictException instead of
org.eclipse.jgit.api.errors.CheckoutConflictException which it
declares to throw. Hence translate the internal exception to the
exception declared in the API.

Bug: 327573
Change-Id: I1efcd93a43ecbf4a40583e0fc9d8d53cffc98cae
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-08 23:33:53 +01:00