Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "JGit/New and Noteworthy/3.0"

m (Library)
(19 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
JGit now supports the "recursive" merge strategy and it's the default for merge/pull ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=380314 bug 380314]). It is based on the "resolve" strategy but can handle more than one merge base. See [http://git-scm.com/docs/git-merge#_merge_strategies merge strategies] in the Git documentation for a description.
 
JGit now supports the "recursive" merge strategy and it's the default for merge/pull ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=380314 bug 380314]). It is based on the "resolve" strategy but can handle more than one merge base. See [http://git-scm.com/docs/git-merge#_merge_strategies merge strategies] in the Git documentation for a description.
 
==Java 7==
 
 
'''TODO''':
 
 
Added <tt>org.eclipse.jgit.java7</tt> artifact (and p2 feature) for taking advantage of Java 7 for things like symlink support.
 
  
 
=Commands=
 
=Commands=
Line 22: Line 16:
 
* <tt>StashCreateCommand</tt> considers working tree changes when stashing newly added files ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=402396 bug 402396]).
 
* <tt>StashCreateCommand</tt> considers working tree changes when stashing newly added files ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=402396 bug 402396]).
 
* <tt>StashCreateCommand</tt> no longer stashes untracked files ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=403282 bug 403282]).
 
* <tt>StashCreateCommand</tt> no longer stashes untracked files ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=403282 bug 403282]).
 +
* <tt>CloneCommand</tt> now also works with a short branch/tag name passed to <tt>setBranch</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=390994 bug 390994]).
  
 
=Library=
 
=Library=
Line 30: Line 25:
 
* <tt>IndexDiff</tt> provides stage information for conflicting entries, e.g. <tt>BOTH_MODIFIED</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=403697 bug 403697]).
 
* <tt>IndexDiff</tt> provides stage information for conflicting entries, e.g. <tt>BOTH_MODIFIED</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=403697 bug 403697]).
 
* Behave more like C Git when fetching tags by not updating existing tags unless explicitly specified ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=388095 bug 388095]).
 
* Behave more like C Git when fetching tags by not updating existing tags unless explicitly specified ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=388095 bug 388095]).
* Internal "Delete" errors on <tt>Windows</tt> with checkout/reset etc [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=403685 bug 403685]]
+
* Support refspecs with wildcard in middle, e.g. <tt>+refs/pull/*/head:refs/remotes/origin/pr/*</tt> for fetching GitHub pull requests ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=405099 bug 405099]).
* <tt>Rebase/Cherry</tt> pick fails because/when new directory already exists [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=402834 bug 402834]]
+
* Basic Java 7 support ([https://git.eclipse.org/r/#/c/9378/ change I3d6580d]). Internal only (read: symlink support not visisble)
* <tt>Amend</tt> of merge commit reverses parent order [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=392670 bug 392670]]
+
* Fix GC which could corrupt repository on Windows if run twice on the exact same repository content ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=389305 bug 389305]).
* <tt>TreeFilter</tt> does not work if one folder name is a prefix of another folder [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=362430 bug 362430]]
+
* Fix internal "Delete" errors on Windows with checkout/reset, etc ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=403685 bug 403685]).
* If <tt>core.autocrlf</tt> = <tt>true</tt> then any 8000 byte file checks out as zero byte file [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=405672 bug 405672]]
+
* Fix <tt>Rebase/Cherry</tt> pick failing because/when new directory already exists ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=402834 bug 402834]).
* NPE in <tt>DiffFormatter</tt> when DiffEntry.oldId is null [[https://bugs.eclipse.org/bugs/show_bug.cgi?id=407743 bug 407743]]
+
* Fix <tt>Amend</tt> of merge commit to not reverse parent order ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=392670 bug 392670]).
* Do not cherry-pick merge commits during rebase [[https://git.eclipse.org/r/#/c/10548/ change Change-Id: I61239]]
+
* Fix <tt>TreeFilter</tt> if one folder name is a prefix of another folder ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=362430 bug 362430]).
* Basic Java 7 support API [[https://git.eclipse.org/r/#/c/9378/ change I3d6580d6]]. Internally only (read: symlink support not visisble)
+
* Fix 8000 byte file checking out as zero byte file if <tt>core.autocrlf</tt> = <tt>true</tt> ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=405672 bug 405672]).
 +
* Fix NPE in <tt>DiffFormatter</tt> when DiffEntry.oldId is null ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=407743 bug 407743]).
 +
* Do not cherry-pick merge commits during rebase ([https://git.eclipse.org/r/#/c/10548/ change I61239d2]).
  
 
=Command Line=
 
=Command Line=
Line 49: Line 46:
  
 
=Performance Improvements=
 
=Performance Improvements=
 
+
* New bitmap pack index created during JGit GC speeds up clone/fetch. With this new index type JGit can now serve Git repositories considerably faster than C Git.
 
* DateRevQueue (used by RevWalk) is faster for many commits ([https://git.eclipse.org/r/r/Ie7b99f40eacf6324bfb4716d82073adeda64d10f change Ie7b99f4]).
 
* DateRevQueue (used by RevWalk) is faster for many commits ([https://git.eclipse.org/r/r/Ie7b99f40eacf6324bfb4716d82073adeda64d10f change Ie7b99f4]).
* When using both Git and JGit and <tt>core.checkstat</tt> is set to <tt>minimal</tt>, Git no longer has to revalidate a large number of files ([https://git.eclipse.org/r/r/I8eaff1858a891571075a86db043f9d80da3d7503 change I8eaff18]).
+
* When using both C Git and JGit and <tt>core.checkstat</tt> is set to <tt>minimal</tt>, Git no longer has to revalidate a large number of files ([https://git.eclipse.org/r/r/I8eaff1858a891571075a86db043f9d80da3d7503 change I8eaff18]).
 
* Updating many existing refs is faster as the unnecessary check for ref name conflicts is no longer done ([https://git.eclipse.org/r/r/I9057bc4ee22f9cc269b1cc00c493841c71527cd6 change I9057bc4]).
 
* Updating many existing refs is faster as the unnecessary check for ref name conflicts is no longer done ([https://git.eclipse.org/r/r/I9057bc4ee22f9cc269b1cc00c493841c71527cd6 change I9057bc4]).
 
* Speed up clone/fetch with large number of refs ([https://git.eclipse.org/r/r/I17d0b3ccc27f868c8497607d8e57bf7082e65ba3 change I17d0b3c]).
 
* Speed up clone/fetch with large number of refs ([https://git.eclipse.org/r/r/I17d0b3ccc27f868c8497607d8e57bf7082e65ba3 change I17d0b3c]).
 
* Various improvements to packing/delta compression
 
* Various improvements to packing/delta compression
 
'''TODO''': bitmap index stuff, more?
 
  
 
=API Changes and Migration Hints=
 
=API Changes and Migration Hints=
Details of API changes in 3.0 compared to the previous release 2.3.1 are available in the [https://hudson.eclipse.org/hudson/job/jgit-stable/ws/org.eclipse.jgit/target/site/clirr-report.html Clirr API change report]
+
Details of API changes in 3.0 compared to the previous release 2.3.1 are available in the Clirr API change report linked from the [http://www.eclipse.org/jgit/download/ JGit download page].
 
+
('''TODO:''' adapt link when release is available)
+
  
 
===Internal storage API moved to internal packages===
 
===Internal storage API moved to internal packages===
Line 83: Line 76:
 
WindowCacheConfig c = new WindowCacheConfig();
 
WindowCacheConfig c = new WindowCacheConfig();
 
... set new configuration params ...
 
... set new configuration params ...
WIndowCacheConfig.install()
+
c.install();
 
</pre>
 
</pre>
  
Line 92: Line 85:
 
</pre>
 
</pre>
  
'''TODO''': Reflog?
+
=== Reflog interfaces moved ===
 +
The interfaces ReflogReader and ReflogEntry exposed by ReflogCommand and Repository were moved to package org.eclipse.jgit.lib.
  
 
= Bug Fixes =
 
= Bug Fixes =
[https://bugs.eclipse.org/bugs/buglist.cgi?resolution=FIXED&resolution=DUPLICATE&classification=Technology&chfieldto=2013-05-31&query_format=advanced&chfield=bug_status&chfieldfrom=2013-02-20&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&product=JGit&target_milestone=3.0 XX Bugs and XX enhancement requests] were closed
+
* Repository corruption after running gc twice (Windows only) ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=389305 bug 389305])
 +
[https://bugs.eclipse.org/bugs/buglist.cgi?resolution=FIXED&resolution=DUPLICATE&classification=Technology&chfieldto=2013-06-10&query_format=advanced&chfield=bug_status&chfieldfrom=2013-02-20&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&product=JGit&target_milestone=3.0 18 Bugs and 3 enhancement requests] were closed
  
 
= Contributors =
 
= Contributors =
The following X developers worked on this release of JGit:
+
The following 19 developers worked on this release of JGit:
  
TODO
+
Alex Blewitt,
 +
Andreas König,
 +
André Dietisheim,
 +
Arthur Baars,
 +
Christian Halstrick,
 +
Colby Ranger,
 +
Dave Borowitz,
 +
Edwin Kempin,
 +
François Rey,
 +
George C. Young,
 +
Gustaf Lundh,
 +
Jonathan Nieder,
 +
Matthias Sohn,
 +
Roberto Tyley,
 +
Robin Rosenberg,
 +
Robin Stocker,
 +
Shawn Pearce,
 +
Stefan Lay,
 +
Tomasz Zarna

Revision as of 11:47, 30 October 2013

Features

Recursive Merge

JGit now supports the "recursive" merge strategy and it's the default for merge/pull (bug 380314). It is based on the "resolve" strategy but can handle more than one merge base. See merge strategies in the Git documentation for a description.

Commands

(not to be confused with Command Line below)

  • Add NameRevCommand for describing IDs in terms of refnames (change I92bfb47).
  • Add ArchiveCommand for creating an archive file for a tree
  • TagCommand now also supports creating simple unannotated (lightweight) tags (bug 349223).
  • RebaseCommand supports aborting a non-interactive rebase started from C Git (bug 336820).
  • MergeCommand now has a setCommit(boolean) method which can be used to merge but not yet commit the result (bug 335091).
  • StashCreateCommand considers working tree changes when stashing newly added files (bug 402396).
  • StashCreateCommand no longer stashes untracked files (bug 403282).
  • CloneCommand now also works with a short branch/tag name passed to setBranch (bug 390994).

Library

  • Add isRebasing to RepositoryState for checking whether the repository is in a rebasing state.
  • Don't verify host name when http.sslVerify is set to false (change I42f509f).
  • Allow to provide OutputStream for push so that server messages can be written to it while they're coming in (bug 398404).
  • IndexDiff provides stage information for conflicting entries, e.g. BOTH_MODIFIED (bug 403697).
  • Behave more like C Git when fetching tags by not updating existing tags unless explicitly specified (bug 388095).
  • Support refspecs with wildcard in middle, e.g. +refs/pull/*/head:refs/remotes/origin/pr/* for fetching GitHub pull requests (bug 405099).
  • Basic Java 7 support (change I3d6580d). Internal only (read: symlink support not visisble)
  • Fix GC which could corrupt repository on Windows if run twice on the exact same repository content (bug 389305).
  • Fix internal "Delete" errors on Windows with checkout/reset, etc (bug 403685).
  • Fix Rebase/Cherry pick failing because/when new directory already exists (bug 402834).
  • Fix Amend of merge commit to not reverse parent order (bug 392670).
  • Fix TreeFilter if one folder name is a prefix of another folder (bug 362430).
  • Fix 8000 byte file checking out as zero byte file if core.autocrlf = true (bug 405672).
  • Fix NPE in DiffFormatter when DiffEntry.oldId is null (bug 407743).
  • Do not cherry-pick merge commits during rebase (change I61239d2).

Command Line

  • Clone command
    • Added --branch (-b) option for checking out a specific branch instead of HEAD in non-bare repository
  • Merge command
    • Add --no-commit option for merging but not committing the result
  • Status command
    • Show conflict description for unmerged paths (e.g. "both modified")

Performance Improvements

  • New bitmap pack index created during JGit GC speeds up clone/fetch. With this new index type JGit can now serve Git repositories considerably faster than C Git.
  • DateRevQueue (used by RevWalk) is faster for many commits (change Ie7b99f4).
  • When using both C Git and JGit and core.checkstat is set to minimal, Git no longer has to revalidate a large number of files (change I8eaff18).
  • Updating many existing refs is faster as the unnecessary check for ref name conflicts is no longer done (change I9057bc4).
  • Speed up clone/fetch with large number of refs (change I17d0b3c).
  • Various improvements to packing/delta compression

API Changes and Migration Hints

Details of API changes in 3.0 compared to the previous release 2.3.1 are available in the Clirr API change report linked from the JGit download page.

Internal storage API moved to internal packages

Applications are not supposed to build against the internal storage API unless they can accept API churn and make necessary updates as versions change.

  • package org.eclipse.jgit.storage.dfs was moved to org.eclipse.jgit.internal.storage.dfs
  • package org.eclipse.jgit.storage.file was moved to org.eclipse.jgit.internal.storage.file

In order to construct specific Repository instances use the respective builder classes:

  • org.eclipse.jgit.storage.file.FileRepositoryBuilder
  • org.eclipse.jgit.internal.storage.dfs.DfsRepositoryBuilder

WindowCache reconfiguration

Instead of

WindowCacheConfig c = new WindowCacheConfig();
... set new configuration params ...
WindowCache.reconfigure(c);

use

WindowCacheConfig c = new WindowCacheConfig();
... set new configuration params ...
c.install();

FollowFilter requires DiffConfig

Creation of a FollowFilter now needs an explicit DiffConfig, this was necessary to fix an NPE (see https://git.eclipse.org/r/#/c/12499)

public static FollowFilter create(String path, DiffConfig cfg)

Reflog interfaces moved

The interfaces ReflogReader and ReflogEntry exposed by ReflogCommand and Repository were moved to package org.eclipse.jgit.lib.

Bug Fixes

  • Repository corruption after running gc twice (Windows only) (bug 389305)

18 Bugs and 3 enhancement requests were closed

Contributors

The following 19 developers worked on this release of JGit:

Alex Blewitt, Andreas König, André Dietisheim, Arthur Baars, Christian Halstrick, Colby Ranger, Dave Borowitz, Edwin Kempin, François Rey, George C. Young, Gustaf Lundh, Jonathan Nieder, Matthias Sohn, Roberto Tyley, Robin Rosenberg, Robin Stocker, Shawn Pearce, Stefan Lay, Tomasz Zarna

Copyright © Eclipse Foundation, Inc. All Rights Reserved.