summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/utils/JGitUtils.java
Commit message (Collapse)AuthorAgeFilesLines
* Escape folder names in JGitUtils to allow special characters. Fixes #999Martin Spielmann2019-06-101-3/+3
|
* Add integration strategy to merge tickes fast-forward or with commit.Florian Zschocke2016-10-281-65/+278
| | | | | | | | | | | | | Add the option to merge a ticket branch to the integration branch only when it can be fast-forwarded, or always with a merge commit, or by fast-foward if possible, otherwise with a merge commit. Adds a new property ticket.mergeType with the valid values FAST_FOWARD_ONLY, MERGE_ALWAYS and MERGE_IF_NECESSARY. Merging and canMerge were refactored to make use of a new IntegrationStrategy class for each type of strategy.
* Ticket Reference handling #1048Paul Martin2016-04-271-3/+168
| | | | | | | | | | | | | | | + Supports referencing: + Tickets from other tickets via comments + Tickets from commits on any branch + Common TicketLink class used for both commits and tickets + TicketLink is temporary and persisted to ticket as a Reference + Support deletion of ticket references + Rebasing patchsets/branches will generate new references + Deleting old patchsets/branches will remove the relevant references + Substantial testing of use cases + With and without patchsets, deleting, amending + BranchTicketService used during testing to allow end-to-end ref testing + Relocated common git helper functions to JGitUtils
* Fix for #962 - Delete patchset abilityPaul Martin2016-04-061-7/+3
|
* Friendly URL for EditFile Page #974Paul Martin2016-03-271-0/+17
| | | | + Prevent Edit of old doc version
* Document edit capability via ProseMirror submodule #974Paul Martin2016-03-271-0/+131
| | | | | | | | | | | | + New docEdit page with links from docPage and docList + Bespoke menu system with full screen edit mode + npm required for building client side scripts + Ant script added for BuildUI which performs npm commands + Update font-awesome to 4.5.0 + Factor out to JGitUtils common code in BranchTicketService for EditFilePage + getTreeEntries + commitIndex + Merge capability for document editing
* Fix for #976 - Filestore links via browserPaul Martin2015-12-251-23/+107
| | | | | | | | | | | | | + GitLFS client support + FilestoreModel now parses meta file + Read meta heading from cache if available + Authentication based on accept headers for browser view filestore login + PathModel & PathChangeModel now understands filestore items + Zip & Rar downloads contain include filestore items + Filestore servlet returns LFS JSON error only if accepted by client + DiffStat now knows repository to allow identification of filestore items + Filestore items identified and returned via view, raw & blob links on blame, commitDiff, commit and Tree pages
* Use author date to be consistent with other tools (fixes #919)James Moger2015-09-181-2/+5
|
* Bump to JGit 4.0.0Luca Milanesio2015-06-121-12/+12
| | | | | JGit 4.0.0 fixes a memory leak but introduces a non-compatible change for closing the RevWalk: before it was release() but now is close()
* #230 - Improve empty folder navigation.Milos Cubrilo2015-01-111-202/+300
| | | | Empty folders are automatically skipped when browsing repository tree (similar to github "folder jumping" feature).
* Gracefully handle missing integration branch in ticket pageJames Moger2014-10-311-4/+14
|
* Updated the SyndicationServlet to provide an additional option to return ↵Gerard Smyth2014-05-081-1/+47
| | | | | | | | details of the tags in the repository instead of the commits. This uses a new 'ot' request parameter to indicate the object type of the content to return, which can be ither TAG or COMMIT. If this is not provided, then COMMIT is assumed to maintain backwards compatability. If tags are returned, then the paging parameters, 'l' and 'pg' are still supported, but searching options are currently ignored.
* [findbugs] Add null check when closing a RevWalk in JGitUtilsJames Moger2014-04-171-4/+8
|
* Fix 'head' vs 'HEAD' commit resolutionJames Moger2014-03-071-1/+1
|
* Fixed bug in merge: improper use of force and failing on FORCED resultJames Moger2014-03-061-5/+5
|
* Ticket tracker with patchset contributionsJames Moger2014-03-031-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A basic issue tracker styled as a hybrid of GitHub and BitBucket issues. You may attach commits to an existing ticket or you can push a single commit to create a *proposal* ticket. Tickets keep track of patchsets (one or more commits) and allow patchset rewriting (rebase, amend, squash) by detecing the non-fast-forward update and assigning a new patchset number to the new commits. Ticket tracker -------------- The ticket tracker stores tickets as an append-only journal of changes. The journals are deserialized and a ticket is built by applying the journal entries. Tickets are indexed using Apache Lucene and all queries and searches are executed against this Lucene index. There is one trade-off to this persistence design: user attributions are non-relational. What does that mean? Each journal entry stores the username of the author. If the username changes in the user service, the journal entry will not reflect that change because the values are hard-coded. Here are a few reasons/justifications for this design choice: 1. commit identifications (author, committer, tagger) are non-relational 2. maintains the KISS principle 3. your favorite text editor can still be your administration tool Persistence Choices ------------------- **FileTicketService**: stores journals on the filesystem **BranchTicketService**: stores journals on an orphan branch **RedisTicketService**: stores journals in a Redis key-value datastore It should be relatively straight-forward to develop other backends (MongoDB, etc) as long as the journal design is preserved. Pushing Commits --------------- Each push to a ticket is identified as a patchset revision. A patchset revision may add commits to the patchset (fast-forward) OR a patchset revision may rewrite history (rebase, squash, rebase+squash, or amend). Patchset authors should not be afraid to polish, revise, and rewrite their code before merging into the proposed branch. Gitblit will create one ref for each patchset. These refs are updated for fast-forward pushes or created for rewrites. They are formatted as `refs/tickets/{shard}/{id}/{patchset}`. The *shard* is the last two digits of the id. If the id < 10, prefix a 0. The *shard* is always two digits long. The shard's purpose is to ensure Gitblit doesn't exceed any filesystem directory limits for file creation. **Creating a Proposal Ticket** You may create a new change proposal ticket just by pushing a **single commit** to `refs/for/{branch}` where branch is the proposed integration branch OR `refs/for/new` or `refs/for/default` which both will use the default repository branch. git push origin HEAD:refs/for/new **Updating a Patchset** The safe way to update an existing patchset is to push to the patchset ref. git push origin HEAD:refs/heads/ticket/{id} This ensures you do not accidentally create a new patchset in the event that the patchset was updated after you last pulled. The not-so-safe way to update an existing patchset is to push using the magic ref. git push origin HEAD:refs/for/{id} This push ref will update an exisitng patchset OR create a new patchset if the update is non-fast-forward. **Rebasing, Squashing, Amending** Gitblit makes rebasing, squashing, and amending patchsets easy. Normally, pushing a non-fast-forward update would require rewind (RW+) repository permissions. Gitblit provides a magic ref which will allow ticket participants to rewrite a ticket patchset as long as the ticket is open. git push origin HEAD:refs/for/{id} Pushing changes to this ref allows the patchset authors to rebase, squash, or amend the patchset commits without requiring client-side use of the *--force* flag on push AND without requiring RW+ permission to the repository. Since each patchset is tracked with a ref it is easy to recover from accidental non-fast-forward updates. Features -------- - Ticket tracker with status changes and responsible assignments - Patchset revision scoring mechanism - Update/Rewrite patchset handling - Close-on-push detection - Server-side Merge button for simple merges - Comments with Markdown syntax support - Rich mail notifications - Voting - Mentions - Watch lists - Querying - Searches - Partial miletones support - Multiple backend options
* Improve getting changed paths in a commit rangeJames Moger2014-03-011-1/+31
|
* Properly dispose RevWalk in getCommitJames Moger2014-03-011-2/+9
|
* Simplify blob loading codeJames Moger2013-12-031-24/+3
| | | | Change-Id: I7f8ad8936e620dd06e88d85f6837248eea75a1ec
* Remove elaborate HEAD determinationJames Moger2013-11-261-17/+0
| | | | Change-Id: I0da34a1da0dc3dcb07a98629c2284184402cb23a
* Implement mirror executor (issue-5)James Moger2013-11-131-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | The mirror executor will fetch ref updates for repository mirrors. This feature is disabled by default and can be enabled by setting git.enableMirroring=true. The period between update checks is configurable, but it is global. An individual rpeository may not set it's own update schedule. Requirements: 1. you must manually clone the repository using native git git clone --mirror git://somewhere.com/myrepo.git 2. the "origin" remote must be the mirror source 3. the "origin" repository must be accessible without authentication OR the credentials must be embedded in the origin url (not recommended) Notes: 1. "origin" SSH urls are untested and not likely to work 2. mirrors cloned while Gitblit is running are likely to require clearing the gitblit cache (link on the repositories page of an administrator account) 3. Gitblit will automatically repair any invalid fetch refspecs with a "//" sequence. Change-Id: I4bbe3fb2df106366ae4c2313596d0fab0dfcac46
* Fix Markdown document enumeratonJames Moger2013-10-161-2/+2
|
* Check for refs/ not refs/heads/ when updating a refJames Moger2013-10-011-1/+1
| | | | Change-Id: I19f9507fdb859902a6df96f1960433a91378e400
* Trim trailing whitespace and organize importsJames Moger2013-09-301-86/+86
| | | | Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc
* Add normalized diffstats to the commit, commitdiff, and compare pagesJames Moger2013-09-271-30/+31
| | | | Change-Id: I8f26746a611e9ab955efe8b2597cc81db48fb085
* Fix potential NPE in git commit searchJames Moger2013-09-231-1/+4
|
* Merge branch 'init-shared' of https://github.com/fzs/gitblit into prefixesJames Moger2013-09-171-3/+179
|\
| * Fix set-gid bit clearing under Linux when effective gid is different from ↵Florian Zschocke2013-08-261-1/+15
| | | | | | | | file gid.
| * Fix setting wrrong custom mode on file and in config.Florian Zschocke2013-08-261-2/+5
| |
| * Add JavaDoc.Florian Zschocke2013-08-261-1/+20
| |
| * Implement adjusting file permissions for shared repositories.Florian Zschocke2013-08-261-19/+63
| | | | | | | | | | Implement adjusting file and directory permissions for shared repositories in JGitUtils.
| * Add proper implementation of methods in JnaUtils.Florian Zschocke2013-08-261-99/+93
| | | | | | | | | | | | | | Implement the methods getFilemode and setFilemode in JnaUtils. Not using the libc names as we don't necessarily use JNA and because it is not necessarily a one to one mapping.
| * Add method JGitUtils.createRepository(folder, name, shared) to create a newFlorian Zschocke2013-08-261-0/+102
| | | | | | | | repository as if it was created with the --shared command line switch of git.
* | Avoid NPE when the default branch cannot be identifiedRobin Rosenberg2013-09-011-0/+2
|/ | | | | This is a normal condition that complicates debugging, i.e. when catching all NPE's.
* Set author as tooltip of "last change" on repositories page (issue-238)James Moger2013-07-031-11/+28
|
* Ignore orphaned .git folder in repositories folder (issue-256)James Moger2013-06-181-0/+1
|
* New JGit util method to retrieve changed paths in a commit range (issue 226)James Moger2013-05-231-5/+62
|
* Completed migration to JGit 3.0.0-SNAPSHOTJames Moger2013-04-151-2/+1
|
* Bump JGit version to 3.0.0-SNAPSHOTDavid Ostrovsky2013-04-141-2/+3
|
* Revised incremental push tags featureJames Moger2013-04-011-31/+28
|
* Merge branch 'autotagpush' of https://github.com/akquinet/gitblit into pushtagsJames Moger2013-04-011-0/+70
|
* Reorganized to Apache Standard Directory Layout & integrated MoxieJames Moger2013-03-271-0/+1775
This is a massive commit which reorganizes the entire project structure (although it is still monolithic), removes the Build classes, and switches to Moxie, a smarter Ant build tookit based on the original Gitblit Build classes. The Ant build script will likely require additional fine-tuning, but this is big step forward.