summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2023-07-31Add a "Mark commit as base commit for rebase" commandStefan Haller
This allows to do the equivalent of "git rebase --onto <target> <base>", by first marking the <base> commit with the new command, and then selecting the target branch and invoking the usual rebase command there.
2023-07-31Cleanup: remove extra OutsideFilterMode guardStefan Haller
We are in the outsideFilterModeBindings section here; all of these handlers are wrapped in a OutsideFilterMode guard in a loop below. No need to add one manually here.
2023-07-31Visualize local branch heads in commits panel, 2nd approach (#2775)Stefan Haller
2023-07-31Add documentation for working with stacked branchesStefan Haller
2023-07-31Don't show branch marker for head commit unless updateRefs config is onStefan Haller
2023-07-31Don't show branch heads in reflog subcommitsStefan Haller
It's tricky to get this right for reflog commits wrt what's the current branch for each one; so just disable it entirely here, it's probably not something anybody needs here.
2023-07-31Visualize local branch heads in commits panelStefan Haller
We want to mark all local branch heads with a "*" in the local commits panel, to make it easier to see how branches are stacked onto each other. In order to not confuse users with "*" markers that they don't understand, do this only for the case where users actually use stacked branches; those users are likely not going to be confused by the display. This means we want to filter out a few branch heads that shouldn't get the marker: the current branch, any main branch, and any old branch that has been merged to master already.
2023-07-31Store full sha in branch modelStefan Haller
The model will be used for logic, so the full hash is needed there; a shortened hash of 8 characters might be too short to be unique in very large repos. If some view wants to display a shortened hash, it should truncate it at presentation time.
2023-07-31Add CheckedOutBranch to Model structStefan Haller
2023-07-31Make bisect/basic.go test more concreteStefan Haller
- check out a non-main branch before we start - add authors to expected commits so that we can see whether the commits show an asterisk - explicitly check what the top line displays after bisecting has started This shows that the detached head shows an asterisk, which we don't want. We'll fix that in the next commit.
2023-07-31Add author short names to commits in testStefan Haller
This allow us to check not only whether a given commit has the branch head marker, but also that other commits _don't_ have it, which is important.
2023-07-31Improve updateRef testStefan Haller
This test not only tests the correct handling and display of the updateRef command, but also the visualization of branch heads in the commits panel. Since we are about to change the behavior here, extend the test so that a master commit is added (we don't want this to be visualized as a branch head), and then a stack of two non-main branches. At the end of this branch we only want to visualize the head commit of the first.
2023-07-31Remove the old experimentalShowBranchHeads mechanism and configStefan Haller
We are going to replace it with a better one later in this branch.
2023-07-31Fix merge status for update-ref command (#2845)Stefan Haller
2023-07-31Fix merge status of commits when update-ref command is presentStefan Haller
Update-ref commands have an empty sha, and strings.HasPrefix returns true when called with an empty second argument, so whenever an update-ref command is present in a rebase, all commits from there on down were drawn with a green sha.
2023-07-31Add tests for setCommitMergedStatusesStefan Haller
The test for update-ref shows demonstrates a problem. See next commit for the fix.
2023-07-31Make setCommitMergedStatuses a non-member functionStefan Haller
It doesn't depend on anything in CommitLoader, so it can be free-standing, and that makes it easier to test (see next commit).
2023-07-30Remove redundant secureexec package (#2847)Jesse Duffield
2023-07-30Remove secureexec packageJesse Duffield
From the go 1.19 release notes: Command and LookPath no longer allow results from a PATH search to be found relative to the current directory. This removes a common source of security problems but may also break existing programs that depend on using, say, exec.Command("prog") to run a binary named prog (or, on Windows, prog.exe) in the current directory. See the os/exec package documentation for information about how best to update such programs.
2023-07-30Standardise on using lo for slice functions (#2846)Jesse Duffield
2023-07-30Standardise on using lo for slice functionsJesse Duffield
We've been sometimes using lo and sometimes using my slices package, and we need to pick one for consistency. Lo is more extensive and better maintained so we're going with that. My slices package was a superset of go's own slices package so in some places I've just used the official one (the methods were just wrappers anyway). I've also moved the remaining methods into the utils package.
2023-07-30Updated README.mdREADME-bot
2023-07-30Add worktrees view (#2147)Jesse Duffield
2023-07-30fix go modJesse Duffield
2023-07-30Use double dash for disambuating path in editor templatesJesse Duffield
2023-07-30Fix flakey worktree testsJesse Duffield
In the presentation layer, when showing branches, we'll show worktrees against branches if they're associated. But there was a race condition: if the worktree model was refreshed after the branches model, it wouldn't be used in the presentation layer when it came time to render the branches. A better solution would be to have some way of signalling that a particular context needs to be refreshed and after all the models are done being refreshed, we then refresh the contexts. This will prevent double-renders
2023-07-30rename filesJesse Duffield
2023-07-30Write unit tests with the help of aferoJesse Duffield
Afero is a package that lets you mock out a filesystem with an in-memory filesystem. It allows us to easily create the files required for a given test without worrying about a cleanup step or different tests tripping on eachother when run in parallel. Later on I'll standardise on using afero over the vanilla os package
2023-07-30Fix bug where worktree view would take over window upon switching branchesJesse Duffield
When switching worktrees (which we can now do via the branch view) we re-layout the windows and their views. We had the worktree view ahead of the file view based on the Flatten() method in context.go, because it used to be associated with the branches panel.
2023-07-30Use forward-slashes on windowsJesse Duffield
We want to be using forward slashes everywhere internally, so if we get a path from windows we should immediately convert it to use forward slashes. I'm leaving out the recent repos list because that would require a migration
2023-07-30Add section in integration readme about testing against old git versionsJesse Duffield
2023-07-30Add more i18n for worktreesJesse Duffield
2023-07-30Use fields rather than methods on worktreesJesse Duffield
I would prefer to use methods to keep things immutable but I'd rather be consistent with the other models and update them all at once
2023-07-30Centralise logic for obtaining repo pathsJesse Duffield
There are quite a few paths you might want to get e.g. the repo's path, the worktree's path, the repo's git dir path, the worktree's git dir path. I want these all obtained once and then used when needed rather than having to have IO whenever we need them. This is not so much about reducing time spent on IO as it is about not having to care about errors every time we want a path.
2023-07-30Remove IO logic from presentation code for worktreesJesse Duffield
We're doing all the IO in our workers loader method so that we don't need to do any in our presentation code
2023-07-30Add test for opening lazygit in the worktree of a bare repoJesse Duffield
2023-07-30Remove dead functionJesse Duffield
2023-07-30Fix test by making branches appear deterministicallyJesse Duffield
This fixes pkg/integration/tests/worktree/rebase.go which was failing on old git versions due to a difference in order of branches that don't have recency values
2023-07-30Allow entering a submodule by pressing spaceJesse Duffield
2023-07-30Allow entering a worktree by pressing enterJesse Duffield
2023-07-30Update repo switch logicJesse Duffield
We now always re-use the state of the repo if we're returning to it, and we always reset the windows to their default tabs. We reset to default tabs because it's easy to implement. If people want to: * have tab states be retained when switching * have tab states specific to the current repo retained when switching back Then we'll need to revisit this
2023-07-30Add test for retained context focus when switching worktreesJesse Duffield
2023-07-30Support fastforwarding worktreeJesse Duffield
2023-07-30Add more worktree testsJesse Duffield
2023-07-30Add worktree tests for removing/detachingJesse Duffield
2023-07-30Add worktree integration testsJesse Duffield
2023-07-30Update cheatsheetsJesse Duffield
2023-07-30Remove worktree version guardsJesse Duffield
Our min required git version is 2.20 so there's no need to add guards for worktrees because they were added in 2.5
2023-07-30Fix unit testsJesse Duffield
2023-07-30Show loader when switching worktreesJesse Duffield