Commit Graph

1620 Commits

Author SHA1 Message Date
estib
2a3b3582e6 Ability to hard-reset commits to what's on the remote
Set a integration strategy, by choosing:
- Rebase
- Merge
- Hard Reset

Add tests
2024-11-15 17:44:10 +01:00
Caleb Owens
8c4001c9ca Find the branch head correctly when integrating upstream 2024-11-15 11:51:22 +01:00
Kiril Videlov
889cb4c401
Merge pull request #5553 from gitbutlerapp/add-remote-head-functionality
Fixes a bug where remote branches may incorrectly show more commits
2024-11-14 20:12:40 +01:00
Caleb Owens
28ac07c35f
Merge pull request #5548 from gitbutlerapp/Fix-dropping-empty-commits
Fix dropping empty commits
2024-11-14 19:38:16 +01:00
Kiril Videlov
152540d145 Fixes a bug where remote branches may incorrectly show more commits
While `default_target.sha` may be appropriate for computing what is new in workspace branches, this would be wrong for computing of what is remote branches.
To get what is the remote branch it needs to be compared to the head of the target branch.
2024-11-14 19:23:37 +01:00
estib
ea53bcf5fb Dependencies: Follow ups
- Update the comment that explain the ordering the commits need to be in.
- Remove the 'TryFrom' implementation in favor of the string parser function
2024-11-14 17:57:11 +01:00
Caleb Owens
4c8b8ae9d7 Fix dropping empty commits 2024-11-14 17:41:01 +01:00
estib
c336910689 Move stack commits
Ability to move commits in between stacks.
Moving commits fails if it's dependent on or dependent upon other commits or uncommited changes
2024-11-14 14:10:29 +01:00
Esteban Vega
3fe315d982
Merge pull request #5393 from gitbutlerapp/commit-dependencies
Use hunk dependency code for computing inter-commit dependencies
2024-11-14 13:58:00 +01:00
Kiril Videlov
93ca7dd31a refactor: remove legacy stack reference handling
Migration method no longer needed
2024-11-13 20:59:29 +01:00
estib
26ed78fae9 Address feedback 2024-11-13 18:46:21 +01:00
estib
b79d3912f3 Dependencies: Add documentation
Add some high-level docs on the way the dependency graph is calculated
2024-11-13 18:46:21 +01:00
estib
eb615f16bd Dependencies: Algo tracks indices and shifts correctly
Track what's the index of:
- The next hunk range to visit
- The index of the the first hunk range to shift after adding an incoming hunk.

Also, calculate correctly the lines of the hunk ranges that are trimmed at the top in the following cases:
- Incomming hunk is only deleting lines
- Incomming hunk is only adding lines

Add special handling for intersections with hunks that only add lines
2024-11-13 18:46:21 +01:00
estib
f6def88b5a Dependencies: Update the algo terminology 2024-11-13 18:46:21 +01:00
estib
24874014f3 Dependencies: Rework of the algo
Re-implement the algorithm so that it takes account of different scenarios when comparing input diffs.
Those changes include:
- Awareness of change type 
- Detection of "special" diffs, like file deletion and file recreation
- Correctly calculate the commit dependency graph between commits

Also add and update unit and integration tests
2024-11-13 18:46:21 +01:00
estib
1b31c41ab8 Propagate the dependency information to the commits
Propagate information about commit and uncommited change inter-dependencies to the commits for the FE to access
2024-11-13 18:46:21 +01:00
estib
84030ab03f Track dependencies in Stack
Stack keeps a map of commit and uncommitted chanegs inter-dependencies
2024-11-13 18:46:21 +01:00
estib
f1b0dccbe6 Hunk locking: Remove the experimental flag
Move fully to the new Hunk Locking algorithm, remove the references to that flag and the settings UI
2024-11-13 18:46:21 +01:00
estib
ce87969c06 Move out dependency calculation to a dedicated module 2024-11-13 18:46:21 +01:00
Mattias Granlund
58cafba3db Use hunk dependency code for computing inter-commit dependencies 2024-11-13 18:46:21 +01:00
Kiril Videlov
72598da978 remove unused code 2024-11-13 14:34:37 +01:00
Caleb Owens
765a967c60 Refactor initialized 2024-11-13 13:29:57 +01:00
Caleb Owens
30e6540a63 Removed unneeded instances of CommandContext passed about 2024-11-13 13:29:53 +01:00
estib
7bc2021bb6 Add method to unapply lines
Method to unapply ownership lines.
Adds the ability to determine a subset of hunk lines to be discarded.
2024-11-13 09:32:02 +01:00
Sebastian Thiel
9e080d299c
Use gix::Repository::virtual_merge_base() for better merge-bases.
Just like Git in merge-ORT, a virtual merge base helps to deal with multiple
merge bases which can happen more easily when more than two commits are involved.
2024-11-12 15:34:20 +01:00
Kiril Videlov
cabe9387aa Chore: remove GC restriction
Previous the app used to disable Git GC. This is no longer needed since all git trees used by gitbutler are now referenced via the reflog hack used by the oplog. This change removes the 'prune never' config if it was previously set by the app.
2024-11-11 16:13:13 +01:00
Kiril Videlov
3546c9e5a2 Make pr numbers available for branch listing 2024-11-10 22:36:46 +01:00
Kiril Videlov
5bdb565884 Fix serialization bug: alias StackBranch head to target 2024-11-10 12:40:34 +01:00
Kiril Videlov
f404bca84a Rename functions and vars referencing branch to stack if the type is Stack 2024-11-09 23:23:21 +01:00
Kiril Videlov
d45e7d874d Rename fields named branch to stack where the type is Stack 2024-11-09 22:57:59 +01:00
Kiril Videlov
62a74107dc Rename branch and branch_id function parameters to stack and stack_id
Internally only, skipping the API for now
2024-11-09 22:41:52 +01:00
Kiril Videlov
1c2871c907 rename Branch to StackBranch to remove ambiguity 2024-11-09 22:20:15 +01:00
Kiril Videlov
2559722db0 refactor: rename Branch target to head
Confusing name was a leftover from pre-refactor
2024-11-09 22:20:15 +01:00
Kiril Videlov
a4d4ec57a6 refactor: remove unused struct Series 2024-11-09 22:20:15 +01:00
Kiril Videlov
2b828cfa11 refactor: remove unused list_series method 2024-11-09 22:20:15 +01:00
Kiril Videlov
32c05ee726 refactor: remove list_series from unit tests 2024-11-09 22:20:15 +01:00
Kiril Videlov
629ff089df refactor: integrate upstream uses stack.branches() 2024-11-09 22:20:15 +01:00
Kiril Videlov
49f6c8cfae refactor: rename branch->stack in places 2024-11-09 22:20:15 +01:00
Kiril Videlov
e98dbd7ca9 refactor: listing commits now uses stack.branches() 2024-11-09 22:20:15 +01:00
Kiril Videlov
4e806156c9 refactor: reorder now uses stack.branches() istead of list_series() 2024-11-09 22:20:15 +01:00
Kiril Videlov
b04ee7e511 refactor: reorder integration tests now uses branch.commits() 2024-11-09 22:20:15 +01:00
Kiril Videlov
39a41a2194 refactor: stack push now uses stack.branches()
As opposed to stack.list_series() which does more unnecessary work
2024-11-09 22:20:15 +01:00
Kiril Videlov
1c49a9f5f6 add tree asertions for reorder conflict handling 2024-11-09 20:34:23 +01:00
Kiril Videlov
748f93ff2e add assertion that commit timestamps are updated upon reorder 2024-11-09 11:54:53 +01:00
Kiril Videlov
0f47113f3a test conflict handling when commir reordering 2024-11-08 23:37:17 +01:00
Kiril Videlov
c352a1abd3
Merge pull request #5502 from gitbutlerapp/refactor-extract-branch-trees-to-create
Move branch_trees modeule to workspace crate
2024-11-08 18:27:05 +01:00
Kiril Videlov
b61b73e820 Move branch_trees module to a new create 2024-11-08 16:26:44 +01:00
Caleb Owens
9da74da070 Update commiter when rebasing 2024-11-08 15:56:41 +01:00
Caleb Owens
de23e3c772 Push empty stacks, skip archived stacks. 2024-11-08 13:35:37 +01:00
Caleb Owens
3712410a85 Fix listing old branches 2024-11-07 19:24:15 +01:00