|
|
The library provides a Java implementation of git client allowing you to work with and get information about Git repositories and run Git commands.
Question (arch-overall): Describe the overall architecture. Answer:The library is a facade over a java implementation of Git client - JGit. Because JGit does not provide a full-featured high-level API (on the level of whole git commands), this library groups the JGit low-level API into bigger pieces and exports the API in the form of full Git commandline commands (e.g. status, commit, checkout, reset, etc.). GitlibraryAPI - Allows clients to work with local Git repositories and invoke a set of Git commands affecting a Git repository.
Question (arch-usecases): Describe the main use cases of the new API. Who will use it under what circumstances? What kind of code would typically need to be written to use the module? Answer:GitClient
are provided by GitRepository.
GitRepository
represents a concrete local Git repository and is always bound to a specific folder.
The correct way to achieve this is to call GitRepository.getInstance(repositoryRoot).createClient()
.
GitClient
mapped to a Git command accepts an instance of
ProgressMonitor
as a parameter. Through an instance of this class you can cancel a command, an implementation of such a command periodically calls
isCanceled and interrupts its work if the method returns true
.
Package org.netbeans.libs.git.progress offers
a set of listeners extending the NotificationListener interface which you can attach to an instance of
GitClient
via addNotificationListener()
and through which you can closely monitor building of the result.
Quality of the API is covered by JUnit tests for all exported git commands.
Question (arch-where): Where one can find sources for your module? Answer:
The sources for the module are in the Apache Git repositories or in the GitHub repositories.
These modules are required in project.xml:
None.
Question (dep-platform): On which platforms does your module run? Does it run in the same way on each? Answer:Runs on all platforms.
Question (dep-jre): Which version of JRE do you need (1.2, 1.3, 1.4, etc.)? Answer:1.6
Question (dep-jrejdk): Do you require the JDK or is the JRE enough? Answer:JRE suffices.
Just the JAR file.
Question (deploy-nbm): Can you deploy an NBM via the Update Center? Answer:Yes.
Question (deploy-shared): Do you need to be installed in the shared location only, or in the user directory only, or can your module be installed anywhere? Answer:The module may be installed anywhere.
Question (deploy-packages): Are packages of your module made inaccessible by not declaring them public? Answer:XXX no answer for deploy-packages
Question (deploy-dependencies): What do other modules need to do to declare a dependency on this one, in addition to or instead of the normal module dependency declaration (e.g. tokens to require)? Answer:No additional setting is needed, direct dependency is enough.
No plans to internationalize the library. It contains no UI and besides description of enum values and exception messages it returns no strings needed to internationalize. I think it is best to leave it up to an API client to process and deliver these messages to user in its own way.
Question (compat-standards): Does the module implement or define any standards? Is the implementation exact or does it deviate somehow? Answer:The module does not implement or define any standards.
Question (compat-version): Can your module coexist with earlier and future versions of itself? Can you correctly read all old settings? Will future versions be able to read your current settings? Can you read or politely ignore settings stored by a future version? Answer:The library stores no internal settings.
Question (compat-deprecation): How the introduction of your project influences functionality provided by previous version of the product? Answer:No influence on the product.
java.io.File
directly?
Answer:
Yes, it works directly with java.io.File.
Question (resources-layer): Does your module provide own layer? Does it create any files or folders in it? What it is trying to communicate by that and with which components? Answer:No
Question (resources-read): Does your module read any resources from layers? For what purpose? Answer:No
Question (resources-mask): Does your module mask/hide/override any resources provided by other modules in their layers? Answer:No
Question (resources-preferences): Does your module uses preferences via Preferences API? Does your module use NbPreferences or or regular JDK Preferences ? Does it read, write or both ? Does it share preferences with other modules ? If so, then why ? Answer:No
org.openide.util.Lookup
or any similar technology to find any components to communicate with? Which ones?
Answer:
No.
Question (lookup-register): Do you register anything into lookup for other code to find? Answer:No.
Question (lookup-remove): Do you remove entries of other modules from lookup? Answer:No.
System.getProperty
) property?
On a similar note, is there something interesting that you
pass to java.util.logging.Logger
? Or do you observe
what others log?
Answer:
Properties:
org.netbeans.libs.git.trackSymLinks
-
Java 6 has no direct support for symbolic links and the library then treats them as regular file and folders. This causes serious inconveniences when traversing
a folder tree. Symbolic links are followed and stepped into as if normal folders, thus taking a lot of time to finish a command. The status of such files and folders
is then incorrectly detected as a pair deleted/added.
By default this property is set to false
and leaves already committed symbolic link untouched and unattended. To start traversing and treating symlinks as normal files,
set the property to true
.
There is no GUI for this module.
Question (exec-ant-tasks): Do you define or register any ant tasks that other can use? Answer:No.
Question (exec-classloader): Does your code create its own class loader(s)? Answer:No.
Question (exec-reflection): Does your code use Java Reflection to execute other code? Answer:No.
Question (exec-privateaccess): Are you aware of any other parts of the system calling some of your methods by reflection? Answer:Not at all.
Question (exec-process): Do you execute an external process from your module? How do you ensure that the result is the same on different platforms? Do you parse output? Do you depend on result code? Answer:No external process is executed.
Question (exec-introspection): Does your module use any kind of runtime type information (instanceof
,
work with java.lang.Class
, etc.)?
Answer:
No, it does not.
Question (exec-threading): What threading models, if any, does your module adhere to? How the project behaves with respect to threading? Answer:The single-threaded model is used, everything runs in a single thread. Callbacks are called and events are fired synchronously during a command's execution.
Question (security-policy): Does your functionality require modifications to the standard policy file? Answer:No
Question (security-grant): Does your code grant additional rights to some other code? Answer:No
The library works with Git metadata, so anything written under the .git folder in a repository root directly affects library's behaviour. However no module-specific settings are stored inside the folder.
Question (format-dnd): Which protocols (if any) does your code understand during Drag & Drop? Answer:None
Question (format-clipboard): Which data flavors (if any) does your code read from or insert to the clipboard (by access to clipboard on means calling methods onjava.awt.datatransfer.Transferable
?
Answer:
None
No
Question (perf-exit): Does your module run any code on exit? Answer:No.
Question (perf-scale): Which external criteria influence the performance of your program (size of file in editor, number of files in menu, in source directory, etc.) and how well your code scales? Answer:The size of a git repository affects the performance and duration of run commands. However caller's responsibility to limit the file tree a git command will be invoked on.
Question (perf-limit): Are there any hard-coded or practical limits in the number or size of elements your code can handle? Answer:No limit.
Question (perf-mem): How much memory does your component consume? Estimate with a relation to the number of windows, etc. Answer:Repository metadata is cached as long as someone holds a reference to the repository root folder (java.io.File). The underlying JGit library caches:
No
Question (perf-progress): Does your module execute any long-running tasks? Answer:All API methods may take a long time because they directly access IO. No API method should be run inside the AWT thread.
Question (perf-huge_dialogs): Does your module contain any dialogs or wizards with a large number of GUI controls such as combo boxes, lists, trees, or text areas? Answer:The module uses no GUI.
Question (perf-menus): Does your module use dynamically updated context menus, or context-sensitive actions with complicated and slow enablement logic? Answer:No.
Question (perf-spi): How the performance of the plugged in code will be enforced? Answer:The module does not initiate any work by itself, implementors of the module's SPI are also the its API clients at the same time, so it is their responsibility to ensure the performance quality.