summaryrefslogtreecommitdiffstats
path: root/pkg/commands
AgeCommit message (Collapse)Author
2023-08-02Appease linterJesse Duffield
2023-07-31Adds EditRebaseFromBaseCommit log message to i18nKarl Heitmann
2023-07-31Moves log related translations into its own Tr.Log. namespaceKarl Heitmann
2023-07-31Moves hard coded strings for LogCommand to i18n.Karl Heitmann
2023-07-31Allow force-tagging if tag existsStefan Haller
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-31Don't show branch marker for head commit unless updateRefs config is onStefan Haller
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-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 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 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-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-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-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-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-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-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-30Support older versions of git when fetching worktreesJesse Duffield
Older versions of git don't support the -z flag in `git worktree list`. So we're using newlines. Also, we're not raising an error upon error because that triggers another refresh, which gets us into an infinite loop
2023-07-30Fix testsJesse Duffield
Going and fixing up some submodule tests which were broken by bad assumptions with worktree code
2023-07-30Safer fetching of linked worktree pathsJesse Duffield
2023-07-30Support opening worktree in editorJesse Duffield
2023-07-30Properly render worktrees in files panelJesse Duffield
2023-07-30Better logic for knowing which repo we're inJesse Duffield
2023-07-30Hide worktree functionality on old git versionsJesse Duffield
2023-07-30Associate branches with worktrees even when mid-rebaseJesse Duffield
2023-07-30Support creating worktrees from refsJesse Duffield
2023-07-30Log when directory is changedJesse Duffield
2023-07-30Handle deleting branch attached to worktreeJesse Duffield
2023-07-30Move current worktree to top of listJesse Duffield
2023-07-30Improve name handlingJesse Duffield
2023-07-30Update worktree modelJesse Duffield
2023-07-30Address PR commentsJoel Baranick
2023-07-30Basic support for adding a worktreeJoel Baranick
2023-07-30Improve worktree panelJoel Baranick
2023-07-30Style missing worktree as red and display better error when trying to switch ↵Joel Baranick
to them Use a broken link icon for missing worktrees
2023-07-30Hide worktrees in the worktree panel if they point at a non-existing ↵Joel Baranick
filesystem location. Remove unneeded check when filtering out branches from non-current worktrees from the branch panel. Add link icon for linked worktrees
2023-07-30Support for deleting a worktreeJoel Baranick
2023-07-30Initial addition of support for worktreesJoel Baranick
2023-07-29Add bisect menu entry that lets you choose bisect termsStefan Haller
This can be useful if you want to find the commit that fixed a bug (you'd use "broken/fixed" instead of "good/bad" in this case), or if you want to find the commit that brought a big performance improvement (use "slow/fast"). It's pretty mind-bending to have to use "good/bad" in these cases, and swap their meanings in your head. Thankfully, lazygit already had support for using custom terms during the bisect (for the case that a bisect was started on the command-line, I suppose), so all that's needed is adding a way to specify them in lazygit.