Commit Graph

455 Commits

Author SHA1 Message Date
Jonathan Nieder c2efb5c964 Merge "RepoCommand: Add setRecordRemoteBranch option to record upstream branch" 2015-10-05 19:24:48 -04:00
Stefan Beller cdd7c23446 RepoCommand: Add setRecordRemoteBranch option to record upstream branch
On a server also running Gerrit that is using RepoCommand to
convert from an XML manifest to a git submodule superproject
periodically, it would be handy to be able to use Gerrit's
submodule subscription feature[1] to update the superproject
automatically between RepoCommand runs as changes are merged
in each subprojects.

This requires setting the 'branch' field for each submodule
so that Gerrit knows what branch to watch.  Add an option to
do that.

Setting the branch field also is useful for plain Git users,
since it allows them to use "git submodule update --remote" to
manually update all submodules between RepoCommand runs.

[1] https://gerrit-review.googlesource.com/Documentation/user-submodules.html

Change-Id: I1a10861bcd0df3b3673fc2d481c8129b2bdac5f9
Signed-off-by: Stefan Beller <sbeller@google.com>
2015-10-05 16:01:11 -07:00
Matthias Sohn d652a6bfd7 Merge branch 'stable-4.1'
* stable-4.1:
  pgm: Open RevWalk and TreeWalk in try-with-resource
  ant: Open Repository and Git in try-with-resource
  pgm: Create instances of Git in try-with-resource
  FanoutBucket: Create ObjectInserter.Formatter in try-with-resource
  Fix compiler warnings in DiffFormatter.writeGitLinkText

Change-Id: I448ecc9a1334977d9f304dd61ea20c7a8e692b10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-10-02 01:34:59 +02:00
David Pursehouse ee66914e41 pgm: Open RevWalk and TreeWalk in try-with-resource
To prevent potential resource leaks.

Change-Id: I2039af04d9fb75405f8e13abf508623b7d4ef324
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2015-10-01 17:44:15 +09:00
David Pursehouse 3096ab6502 pgm: Create instances of Git in try-with-resource
To prevent potential resource leak.

Change-Id: I8ac4ae61193324849bafb46501a55f93c5029a4e
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2015-10-01 16:55:26 +09:00
Matthias Sohn 6664bc6f1c Prepare 4.2.0-SNAPSHOT builds
Change-Id: If559d3565b1f84c93a533e1ce18d5293605d1950
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28 14:48:41 +02:00
Matthias Sohn 729f085ac2 Prepare 4.1.1-SNAPSHOT builds
Change-Id: I035f3a8d0f0de86e8b8f00e668be5ce008402e82
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28 13:37:39 +02:00
Matthias Sohn fdfd6e2872 JGit v4.1.0.201509280440-r
Change-Id: I9a536870b9f5c1247c52d6c976a954115982fa1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28 10:36:08 +02:00
Matthias Sohn 4a11534c25 Restore lazy Bundle-ActivationPolicy removed in 3a4a5a4e
This header was removed unintentionally from some bundles in
3a4a5a4e57. Restore it to ensure lazy
activation of bundles.

Change-Id: I1f841f978fb93278e3ec0533a01f1363510dd976
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-08-31 22:18:54 +02:00
Matthias Sohn 3a4a5a4e57 Update uses-clauses in OSGi manifests
In Bug 476164 it was reported that EGit doesn't start when the platform
comes with jsch 0.1.51 while this version of EGit/JGit brings jsch
0.1.53. This could be caused by outdated uses-clauses. Hence recompute
them using PDE tooling.

Bug: 476164
Change-Id: I185ba097884ead9cd034eba842bd3bf34181a99b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-08-31 11:34:06 +02:00
Andrey Loskutov 847b3d1258 Enable annotation based NPE analysis in jgit
Bug: 470647
Change-Id: I14d1983bb7c208faeffee0504e0567e38d8a89f3
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-08-20 21:10:04 +02:00
Andrey Loskutov 6bc6e9520e Changed default log4j log level from "WARNING" to "WARN"
Bug: 474674
Change-Id: I8be8934cf6cb3ee60567b59f8e836475efb780ac
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-08-11 04:05:02 -04:00
Matthias Sohn ffa3d4bdb4 Fix non-externalized string warning in Main.execute()
Change-Id: Ib0404daaf485aa6c8dc6ba0b169b46fb800325e4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-07-24 22:56:52 +02:00
Christian Halstrick c3a073527e Honor also https_proxy environment variable
In addition to honor the http_proxy variable for setting a proxy for
http JGit should also honor the https_proxy variable to set a similar
proxy for https traffic

Bug: 473365
Change-Id: I1002cb575e26cd842bf81ad751ec7c267b585ce2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-07-24 22:54:56 +02:00
Jonathan Nieder 6227b340d3 Merge branch 'stable-4.0'
* stable-4.0:
  Revert "Fix unchecked conversion warning in MergeFormatter"
  Delete deprecated TemporaryBuffer.LocalFile constructors
  Delete deprecated FileUtils.setExecute(File, boolean)
  Delete deprecated WorkingTreeIterator.isModified(DirCacheEntry, boolean)
  Delete deprecated UploadPackMayNotContinueException
  Delete deprecated TransferConfig.isFsckObjects()
  Delete deprecated TextBuiltin.out
  Delete deprecated Merger.getBaseCommit()

Change-Id: Id23a39cc6a3cd122ff1738cb85b7451bbfd8af5f
Signed-off-by: Jonathan Nieder <jrn@google.com>
2015-06-03 12:27:17 -07:00
Matthias Sohn 07114d99a0 Delete deprecated TextBuiltin.out
Change-Id: I184c2f0e0203fa95e0a117391bae93da0d23a435
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-06-03 13:16:26 +02:00
Matthias Sohn a79168bcbb Prepare 4.1.0-SNAPSHOT builds
Change-Id: I03d08b8e2d3400d4b5cdb4ab541b312870776843
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-06-03 00:52:00 +02:00
Matthias Sohn 72ecb5c8c7 Prepare post 4.0-RC3 builds
Change-Id: I74469f1243503098fb05b5ddec3fa609132debab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-06-02 23:11:57 +02:00
Matthias Sohn d59fafc7ca JGit v4.0.0.201506020755-rc3
Change-Id: I31c6177d19cba228aa67b2b5c3e0d82c38395cda
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-06-02 13:55:16 +02:00
Matthias Sohn 74009ba3ef Prepare post 4.0.0-rc2 builds
Change-Id: I3ba1bb0d7f220f88eb768a3137493f737aadf466
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-05-26 15:05:25 +02:00
Matthias Sohn 3ed57820f2 JGit v4.0.0.201505260635-rc2
Change-Id: I496743145da865f9631b46a432c65c1e63ccb501
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-05-26 12:33:24 +02:00
Matthias Sohn 686124bec3 Replace deprecated release() methods by close()
See the discussion [1] in the Gerrit mailing list.

[1] https://groups.google.com/forum/#!topic/repo-discuss/RRQT_xCqz4o

Change-Id: I2c67384309c5c2e8511a7d0d4e088b4e95f819ff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-05-21 02:05:45 +02:00
Shawn Pearce e4e947049f Expose disposeBody() on RevCommit and RevTag
Applications that use a commit message once and do not
need it again can free the body to save memory. Expose
the disposeBody() methods to support this and use it in
pgm.Log which only visits each commit once.

Change-Id: I4142a0749c24f15386ee7fb119934a0432234de3
2015-05-10 10:56:34 -07:00
Matthias Sohn ff798f13da Restore AwtCredentialsProvider to enable debugging pgm in Eclipse
In 6c1f739388 the AWT based credentials
provider was dropped because we don't support Java 5 any longer so we
can always use the ConsoleCredentialsProvider which requires Java 6.
This broke debugging org.eclipse.jgit.pgm since Eclipse doesn't support
using a system console authenticator [1].

[1] see https://bugs.eclipse.org/bugs/show_bug.cgi?id=148831

Change-Id: Iba71001a7762e73d6579ba9dfa5a08ddaba777ea
2015-04-22 12:53:35 +02:00
Matthias Sohn dd453f4185 Include slf4j and log4j in jgit command line
This enables the command line to log. Include log4j configuration to log
warnings and errors to stderr.

Exclude the dependencies which log4j 1.2.15 should have marked optional.
See
http://unitstep.net/blog/2009/05/18/resolving-log4j-1215-dependency-problems-in-maven-using-exclusions/
for details

Change-Id: Ie730db4007fb7614fd7d130cd0858b1ac550066a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-03-23 09:52:22 -04:00
Matthias Sohn 197e3393a5 Merge bundle org.eclipse.jgit.java7 into org.eclipse.jgit
As we moved minimum Java version to 7 we don't need a separate bundle
and feature for JGit features depending on Java 7 anymore.

Change-Id: Ib5da61b0886ddbdea65298f1e8c6d65c9879ced1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-03-23 14:23:07 +01:00
Kaloyan Raev 9041fbc958 CLI status should support --untracked-files
A special options handler is added to properly handle the short -u alias
of the option.

The "normal" mode is not supported by this patch, because this mode of
listing untracked files is not
supported by the org.eclipse.jgit.lib.IndexDiff class. This mode is not
necessary for my use case. It can be added later if anyone really needs
it.

The StatusTest is updated to cover all possible combinations of the
--porcelain and --untracked-files options.

Bug: 459319
Change-Id: I305ac95739cfed0c16735e0987844e57fa27e236
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-03-12 18:10:26 -07:00
Christian Halstrick 0e3ddea1b0 Add "--long" option to JGit describe
Native git supports "git describe --long". This will enforce returning a
long description of a commit even if a tag is directly pointing to the
commit (in contrast to just returning the tag name as it is now). This
commit teaches JGits DescribeCommand and the describe command in the pgm
package to support "--long".

Bug: 460991
Change-Id: I65e179b79e89049c6deced3c71cb3ebb08ed0a8f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-03-09 13:48:04 -07:00
Matthias Sohn 6c1f739388 Move console classes to pgm bundle
Since we updated minimum Java version to Java 7 the console bundle
doesn't need to be a separate bundle anymore. Move the contained classes
to the pgm bundle which is using these classes.

Change-Id: If8e6f2d7405fdfe6f4b178673b4ccf99c67d4b64
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-10 09:14:48 +01:00
Matthias Sohn c26bc63ef1 Set minimum required Java version to Java 7
Bug: 458475
Change-Id: Iea8f2236d4e6a94a8d14bb8cc685006ea3fd1bb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-09 14:11:50 +01:00
Matthias Sohn 21f667edba Merge branch 'stable-3.7'
* stable-3.7:
  Add option --orphan for checkout
  Prepare post 3.7.0.201502031740-rc1 builds
  JGit v3.7.0.201502031740-rc1
  Support for the pre-commit hook
  Fix FileUtils.testRelativize_mixedCase which failed on Mac OS X
  Add a hook test
  Introduce hook support into the FS implementations
  If a pack isn't found on disk remove it from pack list

Conflicts:
	org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF

Change-Id: I936acd24d47b911fa30ab29856094e1b2c6ac3db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-04 14:21:52 +01:00
Rüdiger Herrmann fc801dd79f Add option --orphan for checkout
Change-Id: I546a93f3e147d8d6fc70094b22679c0d11cd8921
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
2015-02-04 13:35:32 +01:00
Matthias Sohn 3c2b4086b6 Prepare post 3.7.0.201502031740-rc1 builds
Change-Id: Id3728e771a4441757de016cc9d68055f668126b0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-04 02:04:47 +01:00
Matthias Sohn 8fe6e51be2 JGit v3.7.0.201502031740-rc1
Change-Id: Ia2ea65945b7e1d4120da3d6e6c9f6d5fdb642ae6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-03 23:36:31 +01:00
Matthias Sohn 94ebdbfada Prepare 4.0.0-SNAPSHOT builds
Change-Id: I414ba8ccc82866d3107ba7083a567ea70c879bdf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-01-27 08:48:26 +01:00
Shawn Pearce e463fdef15 Merge "Make jgit.sh work on windows when JGIT_CLASSPATH is set" 2015-01-27 00:51:18 -05:00
Rüdiger Herrmann 3285d2f238 [pgm] Prevent commands from writing progress to System.err
Commands which report progress used to write to System.err. This is not
desirable in cases where jgit.pgm is embedded. This change redirects
progress output to the error stream that is configured by the command.

Change-Id: I01fa5e167437e619448ac201fcb1cbf63bad96d7
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-01-13 11:01:00 +01:00
Matthias Sohn fd022b9f7f [pgm] Add missing help text for clone --bare option
Bug: 456695
Change-Id: Ib6005e8453ecc871a9b72227e2593a3823f56010
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-01-07 15:49:35 +01:00
Matthias Sohn cdfd22da30 Prepare 3.7.0-SNAPSHOT builds
Change-Id: Ib3e7b5f46ee1e27b9cf25b3b2d01d681a5c4904c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-24 01:17:40 +01:00
Matthias Sohn 9882915810 Merge branch 'stable-3.6'
* stable-3.6:
  Prepare 3.6.1-SNAPSHOT builds
  JGit v3.6.0.201412230720-r
  [pgm] Add option --bare to clone command
  [pgm] Implement clone using CloneCommand
  Fix junit tests under windows when the platform is explicitly changed
  Fix unit tests for windows by explicitly closing test repos
  [pgm] Add option --tags for ls-remote
  [pgm] Add option --heads for ls-remote
  [pgm] Use LsRemoteCommand to implement ls-remote and add a test

Change-Id: I8f31e76cb7e9416919f37e02c7e51ab1d221df40
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-24 01:09:25 +01:00
Matthias Sohn 02b0660b8b Prepare 3.6.1-SNAPSHOT builds
Change-Id: Ie620c90ffafbffc6755b4e1ed55a61a15b118a2a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-23 23:38:20 +01:00
Matthias Sohn b2ca2ffd7d JGit v3.6.0.201412230720-r
Change-Id: Ic28e2bbbdb1099e948c64a005c39f6b8d8ac69a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-23 13:56:43 +01:00
Matthias Sohn 15e8b4fb2e [pgm] Add option --bare to clone command
Change-Id: I528491e3e20d3c9ebe37fe3cd2bf85b4644d8698
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-22 15:45:46 +01:00
Matthias Sohn 563c1ad514 [pgm] Implement clone using CloneCommand
Change-Id: I56699b7bf9a71f673cb308d3015f51de5b06c1d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-22 15:43:44 +01:00
Matthias Sohn 8812e6f3f6 [pgm] Add option --tags for ls-remote
Bug: 444072
Change-Id: I52b470924609fc201e078d9d232aad257506728d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-16 15:29:08 +01:00
Matthias Sohn 490660a7c6 [pgm] Add option --heads for ls-remote
TODO: find a way to use option -h which is already captured by
TextBuiltin's option --help which also uses the alias -h.

Bug: 444072
Change-Id: Ie66584c2fc7fc224014a43cf928547703dd9d213
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-16 15:28:16 +01:00
Matthias Sohn 816de9e9fa [pgm] Use LsRemoteCommand to implement ls-remote and add a test
Change-Id: Ic266f844c23e2519df5770ca56284b26e4cfe1f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-15 15:59:38 +01:00
Alexander Kurtakov 5c788e2ce5 Do not use deprecated tasks in maven-antrun-plugin.
Maven-antrun-plugin deprecated tasks in favor of target, this patch
fixes JGit poms to do the same.

Change-Id: I420fd2ce88c61cf8e786ed45fbb8235dc30c124e
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
2014-12-09 14:48:42 +02:00
Christian Halstrick 145b1bf0fb Make jgit.sh work on windows when JGIT_CLASSPATH is set
jgit.sh was concatenating classpath entries with ":". On Windows systems
using "Git for Windows" this caused problems when JGIT_CLASSPATH was set.

Find out whether we are running on a platform which name starts with
"MINGW" ("Git for Windows" sets this) and use ";" as classpath
separator in this case.

Change-Id: I7e8fc2bee6513f587612accfc456a83d6277ef4a
2014-12-01 14:54:17 +01:00
Matthias Sohn 5672535360 Prepare post 3.6.0-m1 builds
Change-Id: Ie9927de64fa6b7d517f96b8cd12e57541f284ff2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-11-12 18:51:54 +01:00