summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands
AgeCommit message (Collapse)Author
2023-10-08Remove sync mutexStefan Haller
I'm pretty convinced we don't need it. Git itself does a good job of making sure that concurrent operations don't corrupt anything.
2023-09-18Allow cherry-picking commits during a rebaseStefan Haller
This can be useful when you know that a cherry-picked commit would conflict at the tip of your branch, but doesn't at the beginning of the branch (or somewhere in the middle). In that case you want to be able to edit the commit before where you want to insert the cherry-picked commits, and then paste to insert them into the todo list at that point.
2023-09-18Add StatusCommands.IsInNormalRebase and IsInInteractiveRebaseStefan Haller
... and implement RebaseMode in terms of these.
2023-09-09Add coauthor (#2)Orlando Maussa
Add co-author to commits Add addCoAuthor command for commits - Implement the `addCoAuthor` command to add co-authors to commits. - Utilize suggestions helpers to populate author names from the suggestions list. - Added command to gui at `LocalCommitsController`. This commit introduces the `addCoAuthor` command, which allows users to easily add co-authors to their commits. The co-author names are populated from the suggestions list, minimizing the chances of user input errors. The co-authors are added using the Co-authored-by metadata format recognized by GitHub and GitLab.
2023-09-05Move diff context size from UserConfig to AppStateStefan Haller
2023-09-04Don't pass ignoreWhitespace to git commandsStefan Haller
Now that AppState is available via common.Common, they can take it from there.
2023-09-04Add AppState to common.CommonStefan Haller
2023-09-04Add support for external diff commands (e.g. difftastic)Stefan Haller
2023-09-04Add explicit --no-ext-diff arg to CommitCommands.ShowCmdObjStefan Haller
We do this for ShowFileDiffCmdObj and WorktreeFileDiffCmdObj too, so why not here.
2023-08-29Add option RefToShowDivergenceFrom to GetCommitsOptionsStefan Haller
Not used yet.
2023-08-29Don't return commits from setCommitMergedStatusesStefan Haller
Since the slice stores pointers to objects, and we're only modifying the objects but not the slice itself, there's no need to return it and assign it back. This will allow us to call the function for subslices of commits. Also, move the condition that checks for an empty string inside the function; we're going to call it from more than one place, so this makes it easier.
2023-08-21Add key binding for switching from the commit message panel to an editorStefan Haller
This is useful for when you begin to type the message in lazygit's commit panel, and then realize that you'd rather use your editor's more powerful editing capabilities. Pressing <c-o> will take you right there.
2023-08-19Fix testCristian Betivu
2023-08-19Add unit testCristian Betivu
2023-08-19Fix arg order to assertsCristian Betivu
2023-08-19Clean before convertion?Cristian Betivu
2023-08-19Stylistic changesCristian Betivu
2023-08-19Clean pathCristian Betivu
2023-08-19Improve error messageCristian Betivu
2023-08-19Fix yellow/red coloring while rebasingStefan Haller
It determines the yellow/red status by getting the merge-base between the current branch and its upstream; while we're rebasing, the current branch is HEAD, so it tried to get the merge-base between HEAD and HEAD{u}, which doesn't work. Fix this by passing the name of the checked-out branch separately.
2023-08-19Fix the blue sha color of todo commits while rebasingStefan Haller
This broke with 5d8a85f7e78.
2023-08-10Allow deleting remote tags/branches from local tag/branch views (#2738)Federico
2023-08-09use 'suspend' instead of 'editInTerminal' internallyJesse Duffield
'suspend' is a more appropriate name, especially now that you can choose not to suspend despite still being in a terminal
2023-08-09Honour editInTerminal value when opening a worktree folderJesse Duffield
There was no good reason not to do this in the first place.
2023-08-07Fix seg-fault when opening submodule in nested folderJesse Duffield
2023-08-07Support bare worktrees where worktree does not have its own .git fileJesse Duffield
This was on oversight on my part: I assumed that the --work-tree arg was always intended for use with linked worktrees which have a .git file pointing back to the repo. I'm honestly confused now: seems like there are three kinds of worktrees: * the main worktree of a non-bare repo * a linked worktree (with its own gitdir in the repo's worktrees/ dir) * a random folder which you specify as a worktree with the --work-tree arg I'm pretty sure the --work-tree arg is only intended to be used with this third kind or workree
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-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