summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/resources
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-6.5' into stable-6.6Matthias Sohn2023-10-131-0/+1
|\ | | | | | | | | | | | | | | | | | | * stable-6.5: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I7272a22451c0de6b4770767e7bb4e24c81518c20
| * Merge branch 'stable-6.4' into stable-6.5Matthias Sohn2023-10-131-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.4: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I2951d01f5f4581bee20079508cd8ee6ca8554f1f
| | * Merge branch 'stable-6.3' into stable-6.4Matthias Sohn2023-10-131-0/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.3: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I4b94a2b79941c085fa2f62246e8e879aaa85cd3f
| | | * Merge branch 'stable-6.1' into stable-6.2Matthias Sohn2023-10-131-0/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.1: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: Ib4e4fe407dce334c7537bf278baa39db93aa2f09
| | | | * Merge branch 'stable-6.0' into stable-6.1Matthias Sohn2023-10-131-0/+1
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-6.0: PackConfig: fix @since tags Remove unused API problem filters Add support for git config repack.packKeptObjects Do not exclude objects in locked packs from bitmap processing Change-Id: I0c9c0b3c206cac03a93b30eda348177a4de35c36
| | | | | * Do not exclude objects in locked packs from bitmap processingLuca Milanesio2023-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packfiles having an equivalent .keep file are associated with in-flight pushes that haven't been completed, with potentially a set of git objects not yet referenced by a ref. If the Git client is not up-to-date, it may result in pushing a packfile, generating a <packfile>.keep on the server, which may also contain existing commits due to the lack of Git protocol negotiation in the git-receive-pack. The Git protocol negotiation is the phase where the client and the server exchange the list of refs they have for trying to find a common base and minimise the amount of objects to be transferred. The repack phase in GC was previously skipping all objects that were contained in all packfiles having a <packfile>.keep file associated (aka "locked packfiles"), which did not take into consideration the fact that excluding the existing commits would have resulted in the generation of an invalid bitmap file. The code for excluding the objects in the locked packfiles was written well before the bitmap was introduced, hence could not consider a use case that did not exist at that time. However, when the bitmap was introduced, the exclusion of locked packfiles was not changed, hence creating a potential problem. The issue went unnoticed for many years because the bitmap generation was disabled when JGit noticed any locked packfiles; however, the bitmaps are enabled again since Id722e68d9f , and the the issue is now visible and is impacting the GC repack phase. Introduce the '--pack-kept-objects' option in GC for including the objects contained in the locked packfiles during the repack phase, which is not an issue because of the following: - If there are any existing commits duplicated in the packfiles they will be just considered once anyway because the repack doesn't generate duplicates in the output packfile. - If there are any new commits that do not have any ref pointing to them, they will be automatically excluded from the output repacked packfile. The same identical solution is adopted in the C implementation of git in repack.c. Because the locked packfile is not pruned, any new commits not pointed by any refs will remain in the repository and there will not be any accidental pruning or object loss as it is today before this change. As a side-effect of this change, it is now potentially possible to still have duplicate BLOBs after GC when the keep packfile contained existing objects. However, it is way better to keep the duplication until the next GC phase rather than omitting existing objects from repacking and, therefore generating an invalid bitmap and incorrect packfile. Bug: 582292 Bug: 582455 Change-Id: Ide3445e652fcf256a7912f881cb898897c99b8f8
* | | | | | AddCommand: ability to switch off renormalizationThomas Wolf2023-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit's AddCommand always renormalizes tracked files. C git does so only on git add --renormalize. Especially for git add . and the JGit equivalent git.add().addFilepattern(".").call() this can make a big difference if there are many files, or large files. Add a "renormalize" option to AddCommand. To maintain compatibility with existing uses, this option is "true" by default, and the behavior of AddCommand is as it has always been in JGit. If set to "false", use an IndexDiffFilter (in addition to a path filter, if any). This skips any unchanged files (that are not racily clean) from content checks. Note that changes in CRLF settings or in filters will be ignored for such files if renormalize == false. Add the "--renormalize" option to the Add command in the JGit command line program. For the command-line program, the default is as in C git: renormalize is off by default and enabled only if the option is given. Note that --renormalize implies --update in the command line program, as in C git. In AddCommand, the two settings are independent. Additionally, avoid opening input streams unnecessarily in WorkingTreeIterator.getEntryContentLength() and fix some bogus indentation. Add a simple test that adds 1000 files of 10kB in 10 directories twice and that fails if the second invocation (without any changes) with renormalize=false is not significantly faster. Locally, I observe for that second invocation * git.add().addFilepattern(".").call() ~660ms * git.add().addFilepattern(".").setRenormalize(false).call() ~16ms Bug: 494323 Change-Id: I30f9d518563fa55d7058a48c27c425f3b60aeb4c Signed-off-by: Thomas Wolf <twolf@apache.org>
* | | | | | [pgm] Implement git tag --contains optionMatthias Sohn2023-04-121-0/+1
|/ / / / / | | | | | | | | | | | | | | | Change-Id: I390bcd2c2c563d4b27e1369f09548be59ba7c111
* / / / / [pgm] Fetch-CLI: add support for shallowHarald Weiner2023-01-241-0/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for shallow cloning. The CloneCommand and the FetchCommand now have the new options --depth, --shallow-since and --shallow-exclude to tell the server that the client doesn't want to download the complete history. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=475615 Change-Id: I8f113bed25dd6df64f2f95de6a59d4675ab8a903
* / / / [pgm] Add options --name-only, --name-status to diff, log, showalerthak2022-11-231-0/+2
|/ / / | | | | | | | | | Change-Id: Ib218bd2ccbd7990feca4c35d8c8dc34d4a8291e6
* | | Add availability check of pre-defined toolsAndre Bossert2022-06-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: https://git-scm.com/docs/git-difftool see: https://git-scm.com/docs/git-mergetool * now all available tools are printed with "--tool-help" * if no diff.tool or merge.tool is defined the first available pre-defined tool is used TODO: - add mergetools to difftools --> extra change or merge to this - return the exit-code of the tool to jgit / java runtime Bug: 356832 Change-Id: I20fb04e71ced981f5625020f461bbac24e6cec70 Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | Add mergetool merge feature (execute external tool)Andre Bossert2022-05-251-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: https://git-scm.com/docs/git-mergetool * implement mergetool merge function (execute external tool) * add ExecutionResult and commandExecutionError to ToolException * handle "base not present" case (empty or null base file path) * handle deleted (rm) and modified (add) conflicts * handle settings * keepBackup * keepTemporaries * writeToTemp Bug: 356832 Change-Id: Id323c2fcb1c24d12ceb299801df8bac51a6d463f Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | Add command line support for "git mergetool"Andre Bossert2022-05-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: https://git-scm.com/docs/git-mergetool see: https://git-scm.com/docs/git-config * add command line support for "git mergetool" * add option handling for "--tool-help", "--tool=<mytool>", "--[no-]prompt", "--[no-]gui" * handle prompt * add MergeTools * add pre-defined mergetools * print merge actions --> no execute, will be done later Bug: 356832 Change-Id: I6e505ffc3d03f75ecf4bba452a25d25dfcf5793f Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | Add difftool compare feature (execute external tool)Andre Bossert2022-05-251-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see: http://git-scm.com/docs/git-difftool * add CommandExecutor that handles tool execution with help of "jgit.FS" * it handles tool execution with temporary created "command file" --> for for all "command interpreters" and parameters with spaces etc. * using of external bash.exe at Windows (MinGW) if shell-script is used as difftool command. It can be enabled with parameter "jgit.usemsys2bash=auto" that checks if command contains ".sh" or enabled / disabled with "jgit.usemsys2bash=true|false" * added special handling for empty files (e.g. deleted, added etc.) that are named "/dev/null" * added creation and deletion of temporary files needed for compare * added own Exception class for reporting to pgm / command line / EGit * added prompt option handling before executing difftool * reworked trustExitCode option for specific difftool and override for all difftools from config and command line * tested with command line options "--[no]-trust-exit-code", "--tool=<toolname>", "--[no]-gui", --[no]-prompt * ContentSource * added close() methods to close / cleanup used resources (like ObjectReader TreeWalk etc.) * added isWorkingTreeSource() methods to check if file can be used from working tree instead of copy from "ObjectLoader / ObjectReader" to temporary file (fixes "difftool <commit> <commit>") Bug: 356832 Change-Id: I5462fb6dbe4ecfd9da7c74117fce4070bbfd4d7a Signed-off-by: Andre Bossert <andre.bossert@siemens.com> Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
* | [pgm] Add describe --abbrev optionMatthias Sohn2022-03-021-0/+1
| | | | | | | | Change-Id: I8adf2fad21db71b43266d3f274143eee6bc9dce2
* | Merge branch 'stable-6.0'Thomas Wolf2022-01-052-6/+6
|\| | | | | | | | | | | | | | | * stable-6.0: Use slf4j-simple instead of log4j for logging Update orbit to R20211213173813 Change-Id: I746b7fb71571020ce49f7b50fd675c9864327719 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * Use slf4j-simple instead of log4j for loggingMatthias Sohn2021-12-312-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit uses slf4j-api as logging API. The libraries - org.eclipse.jgit.http.test - org.eclipse.jgit.pgm - org.eclipse.jgit.ssh.apache.test - org.eclipse.jgit.test used the outdated log4j 1.2.15 which is EOL since years. Since both jgit command line and also the tests don't need sophisticated logging features replace log4j with the much simpler slf4j-simple log implementation. The org.slf4j.binding.simple 1.7.30 archive has only 25kB instead of 429kB for log4j 1.2.15 Applications using jgit are free to choose any other log implementation supporting slf4j API. Change-Id: I89e85cd3c76e954c3434622510975ce65dc227d4
* | Add command line support for "git difftool"Andre Bossert2021-11-251-0/+13
|/ | | | | | | | | | | | | | see: http://git-scm.com/docs/git-difftool * add command line support for "jgit difftool" * show supported commands with "jgit difftool --help" * added "git difftool --tool-help" to show the tools (empty now) * prepare for all other commands Bug: 356832 Change-Id: Ice0c13ef7953a20feaf25e7746d62b94ff4e89e5 Signed-off-by: Andre Bossert <andre.bossert@siemens.com> Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
* [pgm] Fix default meta variable defined in StopOptionHandlerMatthias Sohn2021-06-281-1/+1
| | | | Change-Id: I703718e2476d40d34b11083414ac0ed5e34bf90a
* Implement ours/theirs content conflict resolutionThomas Wolf2021-04-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Git has different conflict resolution strategies: * There is a tree merge strategy "ours" which just ignores any changes from theirs ("-s ours"). JGit also has the mirror strategy "theirs" ignoring any changes from "ours". (This doesn't exist in C git.) Adapt StashApplyCommand and CherrypickCommand to be able to use those tree merge strategies. * For the resolve/recursive tree merge strategies, there are content conflict resolution strategies "ours" and "theirs", which resolve any conflict hunks by taking the "ours" or "theirs" hunk. In C git those correspond to "-Xours" or -Xtheirs". Implement that in MergeAlgorithm, and add API to set and pass through such a strategy for resolving content conflicts. * The "ours/theirs" content conflict resolution strategies also apply for binary files. Handle these cases in ResolveMerger. Note that the content conflict resolution strategies ("-X ours/theirs") do _not_ apply to modify/delete or delete/modify conflicts. Such conflicts are always reported as conflicts by C git. They do apply, however, if one side completely clears a file's content. Bug: 501111 Change-Id: I2c9c170c61c440a2ab9c387991e7a0c3ab960e07 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* init: add config option to set default for the initial branch nameMatthias Sohn2021-02-221-1/+1
| | | | | | | | | | | | | | | | We introduced the option --initial-branch=<branch-name> to allow initializing a new repository with a different initial branch. To allow users to override the initial branch name more permanently (i.e. without having to specify the name manually for each 'git init'), introduce the 'init.defaultBranch' option. This option was added to git in 2.28.0. See https://git-scm.com/docs/git-config#Documentation/git-config.txt-initdefaultBranch Bug: 564794 Change-Id: I679b14057a54cd3d19e44460c4a5bd3a368ec848 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* init: allow specifying the initial branch name for the new repositoryMatthias Sohn2021-02-221-0/+1
| | | | | | | | | | | Add option --initial-branch/-b to InitCommand and the CLI init command. This is the first step to implement support for the new option init.defaultBranch. Both were added to git in release 2.28. See https://git-scm.com/docs/git-init#Documentation/git-init.txt--bltbranch-namegt Bug: 564794 Change-Id: Ia383b3f90b5549db80f99b2310450a7faf6bce4c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* GPG signature verification via BouncyCastleThomas Wolf2021-02-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a GpgSignatureVerifier interface, plus a factory to create instances thereof that is provided via the ServiceLoader mechanism. Implement the new interface for BouncyCastle. A verifier maintains an internal LRU cache of previously found public keys to speed up verifying multiple objects (tag or commits). Mergetags are not handled. Provide a new VerifySignatureCommand in org.eclipse.jgit.api together with a factory method Git.verifySignature(). The command can verify signatures on tags or commits, and can be limited to accept only tags or commits. Provide a new public WrongObjectTypeException thrown when the command is limited to either tags or commits and a name resolves to some other object kind. In jgit.pgm, implement "git tag -v", "git log --show-signature", and "git show --show-signature". The output is similar to command-line gpg invoked via git, but not identical. In particular, lines are not prefixed by "gpg:" but by "bc:". Trust levels for public keys are read from the keys' trust packets, not from GPG's internal trust database. A trust packet may or may not be set. Command-line GPG produces more warning lines depending on the trust level, warning about keys with a trust level below "full". There are no unit tests because JGit still doesn't have any setup to do signing unit tests; this would require at least a faked .gpg directory with pre-created key rings and keys, and a way to make the BouncyCastle classes use that directory instead of the default. See bug 547538 and also bug 544847. Tested manually with a small test repository containing signed and unsigned commits and tags, with signatures made with different keys and made by command-line git using GPG 2.2.25 and by JGit using BouncyCastle 1.65. Bug: 547751 Change-Id: If7e34aeed6ca6636a92bf774d893d98f6d459181 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Remove reftree and ketchHan-Wen Nienhuys2020-12-151-4/+0
| | | | | | | This was experimental code and never used in production. Change-Id: Ia3da7f2b82d9e365cec2ccf9397cbc47439cd150 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* TagCommand: support signing annotated tagsThomas Wolf2020-12-071-1/+6
| | | | | | | | | | | | | | | | | | | | | Add the two config constants from C git that can switch on signing of annotated tags. Add them to the GpgConfig, and implement actually signing a tag in TagCommand. The interactions between command line options for "git tag" and config options is a bit murky in C git. There are two config settings for it: * tag.gpgSign is the main option, if set to true, it kicks in if neither -s nor -u are given on the command line. * tag.forceSignAnnotated signs only tags created via "git tag -m", but only if command-line option "-a" is not present. It applies even if tag.gpgSign is set explicitly to false. Giving -s or -u on the command line also forces an annotated tag since lightweight tags cannot be signed. Bug: 386908 Change-Id: Ic8a1a44b5f12f47d5cdf3aae2456c1f6ca9ef057 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Add support for reading symrefs from pack capabilitiesLee Worrall2020-11-261-0/+1
| | | | | | | | | | | | | | | A SymbolicRef is added to the advertised refs for any symref in capabilities whose target is an advertised ref; this may replace an existing entry, such as HEAD. When cloning, if any advertised HEAD is symbolic then use the target rather than looking for an advertised ref with a matching objectId. Add --symref option to LsRemote command. Bug: 514052 Change-Id: Idfb48e6f6e8dcfe57a6896883fe6d84d533aa9d0 Signed-off-by: Lee Worrall <worrall.la@gmail.com>
* Implement git describe --allJason Yeo2020-10-131-0/+1
| | | | | | | | This enables jgit to use any refs in the refs/ namespace when describing commits. Signed-off-by: Jason Yeo <jasonyeo88@gmail.com> Change-Id: I1fa22d1c39c0e2f5e4c2938c9751d8556494ac26
* pgm: add option if reflogs should be written when converting to reftableMatthias Sohn2019-12-151-0/+1
| | | | Change-Id: Ie1c38121005965e63015d9a2af26a1caa88d73fa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* pgm: add option to configure if convert-ref-storage should create backupMatthias Sohn2019-12-151-0/+3
| | | | Change-Id: I926f116797508a5982961dfd30c2f765d9536eee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* pgm: add command to convert repo to reftableHan-Wen Nienhuys2019-11-161-0/+2
| | | | | | Change-Id: I2f870699995da164a3e7adec430301ac7a53c425 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [pgm] Add --mirror option to clone commandMatthias Sohn2019-10-211-0/+3
| | | | | Bug: 552173 Change-Id: Ic8a98b2e0f8f29afd599723f93e51b06b9f13314 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-5.4' into stable-5.5Matthias Sohn2019-09-081-3/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Format BUILD files with buildifier Format BUILD files with buildifier [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache Bazel: Format BUILD files with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: Idf3abd80ad3b00188f655e638d9908228770911f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-09-081-3/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Format BUILD files with buildifier [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache Bazel: Format BUILD files with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: Iaea77a89fcd821df5dbb24f5e3e39e6d1dfc0bd4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-09-081-4/+0
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache Bazel: Format BUILD files with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: I0d8b7f79177a20dc00c89e2cf0005eb3d3039532 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-09-071-4/+0
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Bazel: Fix warning about deprecated lib.bzl Format lib/BUILD with buildifier Bazel: Add fixes for --incompatible_load_java_rules_from_bzl Bazel: Bump minimum supported version to 0.29.0 Bazel: Bump skylib library version to 0.8.0 Use bazelisk to switch between used bazel version Bazel: Require minimum bazel version 0.17.1 Fix wrong placeholder index in error message packInaccessible JGitText: Remove unused externalized strings RepoText: Remove unused externalized string CLI: Remove unused externalized strings Change-Id: Iea37a8e39e9d4872dc607c9222dcf191ce4e4757 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * CLI: Remove unused externalized stringsDavid Pursehouse2019-09-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id44117dd72b0e71e9bf0046a3c965eeae64cf3ea Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | JGit pgm: make Blame more robust against bogus inputThomas Wolf2019-08-261-0/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the command die with proper messages when the revision cannot be resolved or the file doesn't exist in the repository. Previously the command would throw NPEs in these cases. Bug: 490798 Change-Id: Ia457347aa22cf6bd2c2b6e7b9d705a66b3826307 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | cli: Add the --always option to describeSebastian Schuberth2019-05-311-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I0342d589e4deabe9d80ea3c9c6b48d7b265d8fe6 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* | | | cli: Add the --tags option to describeSebastian Schuberth2019-05-311-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I78924e61e2050eeaff991ee56715f36514100492 Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
* | | | Replace "Checkout" by "Check out" when used as a verbThomas Wolf2019-03-151-4/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | One occurrence in core JGit, several in jgit.pgm. One unused occurrence in jgit.pgm; remove it. Change-Id: I04c3dd9d9f542f1e1ac6df4cbf03bcefb6bfdf78 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | diff: add option metaVar for --src-prefix and --dst-prefixAndre Bossert2019-03-041-0/+1
| | | | | | | | | | | | | | | | | | | | | Fixes exception if using "jgit diff --help". Bug: 544735 Change-Id: I694ff3103da4bc199dd03c40962c5be191eddcd1 Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
* | | pgm: Externalize error messageMatthias Sohn2019-01-211-0/+1
| | | | | | | | | | | | Change-Id: Id9e33104c9681dc9a57674c1648c994a503fa6b8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Handle exceptions in Config commandMatthias Sohn2019-01-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Also externalize error message. Change-Id: I909dc77385a672d8298053b12683c0cbbf9f2aa2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | pgm: Fix too wide lines in Commit.run()Matthias Sohn2019-01-201-1/+1
| | | | | | | | | | | | Change-Id: I695d1771b808217b0fbde29805e53a819d8c3303 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix "jgit checkout -f" to overwrite dirty worktree filesChristian Halstrick2019-01-081-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CheckoutCommand had a setForce() method. But this didn't correspond to native git's 'git checkout -f' option. Deprecate the old setForce() method and move its implementation to a new method setForceRefUpdate() and use it to implement the -B option in the CLI class Checkout. Add a setForced() method and use it to fix the associated '-f' option of the CLI Checkout class to behave like native git's 'git checkout -f' which overwrites dirty worktree files during checkout. This is still not fully matching native git's behavior: updating additionally dirty index entries is not done yet. Bug: 530771 Change-Id: I776b78eb623b6ea0aca42f681788f2e4b1667f15 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add --ssh option to command-line commandsThomas Wolf2018-11-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables using the new ssh client based on Apache MINA sshd instead of the old JSch client. The default is still JSch, so unless the command is invoked with --ssh apache, there's no change. I prefer this over some fiddling with the GIT_SSH environment variable since that variable is handled in the JGit core bundle, which should remain free of any dependency to org.eclipse.jgit.ssh.apache to avoid problems in Gerrit or other JGit users that may use a different Apache MINA sshd version. Bug: 520927 Change-Id: I8460759c7113ef7887520fb0d297aa312200c69f Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | CLIText: Fix typo: remotes's -> remote'sDavid Pursehouse2018-10-291-1/+1
| | | | | | | | | | Change-Id: I28494ffff6cd8042ef5f3de7da976d4a1569fe10 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | CLIText: Fix typo: 'amd' -> 'and'David Pursehouse2018-10-291-1/+1
|/ | | | | Change-Id: Ifa48c35f413bd1a92946ea54c1c7adc0d53ebc78 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Add ls-files CLI commandMatthias Sohn2018-08-281-0/+1
| | | | | | Implement the basic functionality and support the option --help (-h). Change-Id: Ibcdf0c958d0f93b7415d4e591b1455ccba5d95f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Implement --force option in FetchCommand and CLI fetch commandMatthias Sohn2018-03-131-0/+1
| | | | Change-Id: I42cdb57b8fb54ce466d1958391f12f911045327f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>