summaryrefslogtreecommitdiffstats
path: root/pkg
AgeCommit message (Collapse)Author
2024-06-12Show "exec" todos in the list of rebase todosStefan Haller
Unfortunately it isn't possible to delete them. This would often be useful, but our todo rewriting mechanisms rely on being able to find todos by some identifier (hash for pick, ref for update-ref), and exec todos don't have a unique identifier.
2024-06-10Disregard master commits when finding base commit for fixupStefan Haller
If exactly one candidate from inside the current branch is found, we return that one even if there are also hunks belonging to master commits; we disregard those in this case.
2024-06-10Don't reference Model().Commits multiple timesStefan Haller
Copy the slice into a variable and use that throughout the whole operation; this makes us a little more robust against the model refreshing concurrently.
2024-06-10Add test demonstrating the desired behaviorStefan Haller
It has two modified hunks, one for a master commit and one for a branch commit. Currently we get an error mentioning those two commits, but we would like to silently select the branch commit.
2024-06-07feat: support range selection for commit attributes amendAzraelSec
2024-06-07feat: let the staging secondary panel change view modeAzraelSec
2024-06-07fix: typo in `IsVisible` assertion stringAzraelSec
2024-06-05Include demos when running integration tests with go testStefan Haller
2024-06-05Don't wait in integration tests when running in headless modeStefan Haller
There's no point in spending time waiting in this case, as nobody can see it.
2024-06-05fix: update rebase_onto demo test to match new rebase menu titleAzraelSec
2024-06-03Add -profile command line flagStefan Haller
When on, start a built-in web server that takes requests on port 6060 to gather profiling data.
2024-06-03Add command "Rebase onto base branch" to rebase menuStefan Haller
2024-06-03Remove target branch from title of rebase menuStefan Haller
Put it into the individual menu items instead. Again, this is necessary because we are going to add another entry to the menu that is independent of the selected branch.
2024-06-03Always show rebase menu, even when rebasing is not possibleStefan Haller
Instead, disable the individual entries in the menu. This is necessary because we are going to add another entry to the menu that is independent of the selected branch.
2024-06-03Make "Rebase" show up with "..." in the keybindings menuStefan Haller
2024-06-03Fix typoStefan Haller
2024-06-03Add command "View divergence from base branch"Stefan Haller
2024-06-03Show divergence from base branch in branches listStefan Haller
2024-06-03Remove ColoredBranchStatus and branchStatusColorStefan Haller
Previously the entire status was colored in a single color, so the API made sense. This is going to change in the next commit, so now we must include the color in the string returned from BranchStatus(), which means that callers who need to do hit detection or measure the length need to decolorize it. While we're at it, switch the order of ↑3↓7 to ↓7↑3. For some reason that I can't really explain I find it more logical this way. The software out there is pretty undecided about it, it seems: VS Code puts ↓7 first, and so does the shell prompt that comes with git; git status and git branch -v put "ahead" first though. Shrug.
2024-06-03Add GetBaseBranch functionStefan Haller
2024-06-03Make GetMergeBase a method of ExistingMainBranchesStefan Haller
2024-06-03Factor out CommitLoader.mainBranches into its own class, and store it in ModelStefan Haller
2024-06-03Remove the cache invalidation logic from getMergeBaseStefan Haller
It is a valid case for a branch to share no history with any of the main branches, in which case git merge-base returns an error (and an empty string). Since we can't distinguish this from one of the main branches having been deleted, we shouldn't invalidate the cache in that case.
2024-06-03More explicit test of status panel contentStefan Haller
Use Equals instead of Contains for asserting the status view content. This solves the problem that we might assert Contains("↓2 repo"), but what it really shows is "↑1↓2 repo", and the test still succeeds. At best this is confusing. Also, this way we don't have to use the awkward DoesNotContain to check that it really doesn't show a checkmark. To do this, we need to fix two whitespace problems: - there was always a space at the end for no reason. Simply remove it. It was added in efb51eee96, but from looking at that diff it seems it was added accidentally. - there was a space at the beginning if the branch status was empty. This is actually a cosmetic problem, for branches without a status the text was indented by once space. Change this so that the space is added conditionally. It's a bit awkward that we have to use Decolorise here, but this will go away again later in this branch.
2024-06-02Add HEAD: when referencing upstream branchJordan
Update unit tests
2024-06-01Make "Find base commit for fixup" work with hunks with only added linesStefan Haller
To understand what this does and why, read the design document that I'm about to add in the next commit.
2024-06-01Extract a function findCommitStefan Haller
It's not much code, but it turns three lines of code into one, and since we need to do this a few more times in the next commit, it's worth it.
2024-06-01Return errors from blameDeletedLines instead of just logging themStefan Haller
I guess when I originally wrote this code I just didn't know how to do that...
2024-06-01Also return hunks with only added lines from parseDiffStefan Haller
We aren't using them, yet, except for deciding whether to show the warning about hunks with only added lines. Add a bit of test coverage for parseDiff while we're at it.
2024-06-01Make parseDiff a non-member function so that we can test it more easilyStefan Haller
2024-06-01Rename deletedLineInfo to hunkStefan Haller
We'll use it with a more general meaning later in this branch.
2024-06-01Add user config `expandedSidePanelWeight`Stefan Haller
2024-06-01Add test for ExpandFocusedSidePanel configStefan Haller
2024-06-01Add integration test for pushing when the remote is not stored locallyStefan Haller
The test needs all three fixes from this branch to succeed.
2024-06-01Use --force instead of --force-with-lease when remote is not stored locallyStefan Haller
--force-with-lease simply doesn't work in this case, it will always return a "stale info" error.
2024-06-01Rename Force to ForceWithLeaseStefan Haller
This describes better what it is, and we're going to add the regular --force in the next commit. No change in behavior in this commit.
2024-06-01Ask to force push if server rejected the update, if remote not stored locallyStefan Haller
This broke with 81b497d186 (#3387). In that PR I claimed that we never want to ask for force-pushing if the server rejected the update, on the assumption that this can only happen because the remote tracking branch is not up to date, and users should just fetch in this case. However, I didn't realize it's even possible to have a branch whose upstream branch is not stored locally; in this case we can't tell ahead of time whether a force push is going to be necessary, so we _have_ to rely on the server response to find out. But we only want to do that in this specific case, so this is not quite an exact revert of 81b497d186.
2024-06-01Don't force-push if the remote branch is not stored locallyStefan Haller
This broke with #3528. If the remote branch is not stored locally, we only see question marks in the branch status. In this case we can't tell whether we need to force-push, so it's best to assume that we don't, and see if the server rejects the push, and react to that by asking to force push. This second part is also broken right now, we'll fix this in the next commit.
2024-05-31Fix boolean config keys not appearing in the generated Config.mdStefan Haller
The reason why they didn't appear is that they didn't get a default value in the generated schema; this commit fixes that.
2024-05-31Remove an outdated commentStefan Haller
Lazygit doesn't touch this, the comment is just not true. I wonder if we need the config at all, actually; I'd be in favor of removing it.
2024-05-29Refresh branches and reflog independently when sorting branches by dateStefan Haller
When branches are sorted by recency we have this logic that first loads the branches so that they can be rendered quickly; in parallel, it starts loading the reflog in the background, and when that's done, it loads the branches again so that they get their recency values. This means that branches are loaded twice at startup. We don't need this logic when branches are not sorted by recency, so we can simply load branches and reflog in parallel like everything else. This shouldn't change any user observable behavior, it just avoids doing unnecessary work at startup.
2024-05-29Fix out-of-date commentStefan Haller
The behavior described in the comment is no longer what we do, it was changed in ae66f720f5; we now always reuse the state.
2024-05-26Fix tooltip of fixup commandfix-tooltip-for-fixupStefan Haller
2024-05-26Fix calculation of tooltip heightStefan Haller
For tooltips that are just one or two characters longer than the available width, the last word would be cut off. On my screen this happened for the tooltip for the fixup command.
2024-05-20Add property outputTitle to CustomCommandStefan Haller
It can optionally be used to set the title of the panel that shows the output of a command (when showOutput is true). If left unset, the command string is used as the title.
2024-05-20feat: focus on local commits view after moving code into new commitAzraelSec
2024-05-19Make Keybindings definition in UserConfig struct lastKarim Khaleel
This makes the generated default config in Config.md match the original order.
2024-05-19Add default lazygit config generator for Config.md from JSON schemaKarim Khaleel
2024-05-19Set default value for WindowSize config to pass validationKarim Khaleel
2024-05-19Remove unnecesary schema validations in user configKarim Khaleel