summaryrefslogtreecommitdiffstats
path: root/pkg/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-10-08Add inline status for pushing tags and deleting remote tagsStefan Haller
2023-10-08Add inline status for pushing/pulling/fast-forwarding branchesStefan Haller
When pulling/pushing/fast-forwarding a branch, show this state in the branches list for that branch for as long as the operation takes, to make it easier to see when it's done (without having to stare at the status bar in the lower left). This will hopefully help with making these operations feel more predictable, now that we no longer show a loader panel for them.
2023-10-04Remove redundant `len` checkEng Zer Jun
From the Go specification [1]: "3. If the map is nil, the number of iterations is 0." `len` returns 0 if the map is nil [2]. Therefore, checking `len(v) > 0` before a loop is unnecessary. [1]: https://go.dev/ref/spec#For_range [2]: https://pkg.go.dev/builtin#len Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
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 "Show divergence from upstream" entry to Upstream menu in branches panelStefan Haller
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-28Allow adding a port to webDomain part of services config (#2908)Jesse Duffield
2023-08-21Allow port in webDomain for services config valuesRaido Oras
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-15Stop cycling hunks when reaching the endStefan Haller
Previously, when pressing right-arrow when the cursor is already in the last hunk, it would jump back to the beginning of that hunk. This can be confusing if the hunk is long, maybe the start of the hunk is already scrolled off the top of the window, and then pressing right-arrow actually scrolls *backwards*, which is counter-intuitive. It's better to do nothing in this case. Same for left-arrow when the cursor is already in the first hunk, although here the problem is not so severe (unless diff context was increased by a huge amount, and the start of the first hunk is scrolled off the bottom of the window).
2023-08-10Allow deleting remote tags/branches from local tag/branch views (#2738)Federico
2023-08-10Support editing files in existing neovim instance (#2916)Jesse Duffield
2023-08-10Fix bug in LineNumberOfLineStefan Haller
This fixes a regression that was introduced in 73c7dc9c5d00.
2023-08-10Add test case for LineNumberOfLine()Stefan Haller
There's a bug in LineNumberOfLine, but the existing test coverage doesn't catch it, as the only test case for this was one where oldStart and newStart were the same for all hunks. Add a test case where newStart is different for one of the hunks; this demonstrates a bug, where all expected results from index 12 on are off by one.
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-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.