Skip to content

Add new command "Move commits to new branch" #3876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 21, 2025

Conversation

stefanhaller
Copy link
Collaborator

@stefanhaller stefanhaller commented Aug 30, 2024

  • PR Description

Add a new command "Move commits to new branch" (bound to N by default), which is useful if you have just started some new work, you already made some commits, and then you realize that you forgot to create a new branch first, accidentally making those commits on main or whichever other feature branch you happened to be on.

If you made those commits on main, you are prompted for a branch name for the new branch, and then it creates the new branch right there and hard-resets main to where it was. If you made them on another feature branch though, you are first given the choice whether you want to create the new branch from main, or keep it stacked on that other feature branch. Then it prompts you for the name and proceeds as above.

Inspired by Magit's magit-branch-spinoff command.

The conditions under which the command is available are rather restrictive: the current branch must have an upstream, it must not be behind its upstream, but it must be ahead of it (otherwise there wouldn't be any commits to move, and you might as well just create a new branch normally).

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@stefanhaller stefanhaller added the enhancement New feature or request label Aug 30, 2024
@stefanhaller stefanhaller force-pushed the move-commits-to-new-branch branch from aaef833 to 67a61e4 Compare August 30, 2024 13:32
GetDisabledReason: self.canMoveCommitsToNewBranch,
Description: self.c.Tr.MoveCommitsToNewBranch,
Tooltip: self.c.Tr.MoveCommitsToNewBranchTooltip,
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't totally sure in which views to make the command available. We could consider making it global, because it doesn't depend on the selection at all. However, I found it important that the command shows up next to New Branch in the keybindings panel, so I decided to make it available in local branches and in BasicCommitsController (see code comment there).

Copy link

codacy-production bot commented Aug 30, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 05ae0801 85.71%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (05ae080) Report Missing Report Missing Report Missing
Head commit (67a61e4) 49902 42730 85.63%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3876) 175 150 85.71%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. One thing that would be good is if we could change the prompt or add a description in a secondary panel so that we're being clear about what we're about to do: right now there's no way to know whether you've pressed 'n' or 'N' after pressing the key, because the two prompts are identical.

@stefanhaller
Copy link
Collaborator Author

Code LGTM. One thing that would be good is if we could change the prompt or add a description in a secondary panel so that we're being clear about what we're about to do: right now there's no way to know whether you've pressed 'n' or 'N' after pressing the key, because the two prompts are identical.

I thought about this, or rather about an extra confirmation panel that comes before ("are you sure you want to..."). After all, a hard reset is involved, and this feels like a confirmation is in order. But then I realized that there's really no potential for losing data with the current approach, so I left it out. I can look into changing the prompt text though.

However, while testing it more I noticed that this only really works in the expected way when you start on master. If you start on an unrelated feature branch, it will create the new branch as a stacked branch on top of that one, which might sometimes be what you want if you are into stacked branches, but most of the time it's probably not. You want to create the new branch off of master most of the time.

If we want to achieve this, it has a few consequences:

  • we can provide the command only in the branches panel, and the selection becomes important. The new branch will be created off of the selected branch. (Probably a good thing because that makes it more similar to n.)
  • the simple approach of creating the new branch and hard resetting the other one is not enough. We do actually need to cherry-pick the commits to bring them over (except in the stacked branches example, so we need to check if the new branch contains the commits already).
  • this means we can now get conflicts, both when cherry-picking and when popping the auto-stash. Neither could happen with the current approach.

Very keen to hear your thoughts on this @jesseduffield

@jesseduffield
Copy link
Owner

we can provide the command only in the branches panel, and the selection becomes important. The new branch will be created off of the selected branch. (Probably a good thing because that makes it more similar to n.)

I actually don't think that's a good thing: the purpose is to move the commits from the checked out branch to a new branch. The selection shouldn't matter.

However, while testing it more I noticed that this only really works in the expected way when you start on master. If you start on an unrelated feature branch, it will create the new branch as a stacked branch on top of that one, which might sometimes be what you want if you are into stacked branches, but most of the time it's probably not. You want to create the new branch off of master most of the time.

I'm fine if we just only allow this command from the main branch

@stefanhaller
Copy link
Collaborator Author

we can provide the command only in the branches panel, and the selection becomes important. The new branch will be created off of the selected branch. (Probably a good thing because that makes it more similar to n.)

I actually don't think that's a good thing: the purpose is to move the commits from the checked out branch to a new branch. The selection shouldn't matter.

Hm, ok. That means we wouldn't provide the option of creating a new branch stacked on the current one. Maybe that's fine as it should be rather rare, but I do remember that I was in this situation once or twice.

What we need to do then is to create the new branch off of the current branch's base branch.

I'm fine if we just only allow this command from the main branch

This restriction would make it almost useless for me. I almost never have main checked out, so I don't accidentally make commits there; I'm much more likely to run into the problem while I'm on an unrelated feature branch.

@stefanhaller stefanhaller mentioned this pull request Sep 6, 2024
@jesseduffield
Copy link
Owner

I see. For whatever reason I seem to only get into this state from the master branch.

If we need to handle the case where this happens on a feature branch, then it seems to me that we'd need to specify two things: the commits we want to move, and the branch we want to use as the new base (defaulting to master). So I'm thinking we could make it that the keybinding is only present from the commits panel (after you've selected the commits to move) and the branch is specified via an input prompt. Or as you say, we could just programmatically work out the base branch; I'm fine with that too.

Then we would:

  1. copy the commit hashes
  2. checkout a new branch off of the specified base
  3. cherry-pick the commits
  4. hard reset the original branch to remove the commits (which we can do without checking it out, see here)

If there are conflicts with the cherry-pick, we could just skip the fourth step and leave that as an exercise for the user.

What do you think of that?

@stefanhaller
Copy link
Collaborator Author

Hm, I'm not sure. What you propose would only work if the selected range is at the end of the branch. Otherwise we'd have to drop the commits from the branch, which is not a simple reset, so there's potential for conflicts both at the source and the destination.

I'm not sure we need this much flexibility though; I think I'd be fine with restricting it to moving the unpushed commits. If you have the need to move an arbitrary commit range (whether at the end of the branch or in the middle), you still have to do that manually, like today.

So I'm still in favor of offering the command only in the branches panel; you select the target branch, and it works on the unpushed commits of the current branch. If you're on a branch that doesn't have an upstream (yet), the command is disabled.

My feeling is that this will cover most real-world cases, but of course that's hard to tell without using it for a while and seeing how much it helps.

@jesseduffield
Copy link
Owner

Okay that works for me.

@jesseduffield
Copy link
Owner

@stefanhaller are you waiting on my re-review for this PR or were there more changes to push?

@stefanhaller
Copy link
Collaborator Author

No, I was planning to implement the behavior that I proposed above, but didn't get around to it yet. Setting to draft in the meantime to make that clearer.

@stefanhaller stefanhaller marked this pull request as draft September 28, 2024 06:31
@jesseduffield
Copy link
Owner

No worries

@ar1a
Copy link

ar1a commented Mar 2, 2025

@stefanhaller hey! i'm really interested in this feature, it's one of the main things i miss from magit.

is there any chance you can take another look? i'd even be happy to pay a bounty for this

no stress if not, i can always reinstall emacs just for this command :p

@stefanhaller
Copy link
Collaborator Author

@ar1a I down-prioritized this a bit because I don't need it very often myself. I can't promise when I find the time to take this up again.

I'd be curious what you think about the discussion above. I'm having a hard time working out what magit's behavior is just from the description of its magit-branch-spinoff command (not a magit user myself).

@stefanhaller
Copy link
Collaborator Author

Oh, and I'm surprised that you'd rather switch to magit just for that command, instead of using the next best workaround inside of lazygit, which is to select the commits you made on the wrong branch, type shift-C to copy them, reset the current branch (using g h), create the new branch off of wherever you want it to start, and pressing shift-V to paste your commits there. I find this reasonably easy, to the point that I'd rather use this manual, explicit way of doing it than to use a command which I'm not totally sure will behave exactly the way I want it to.

@ar1a
Copy link

ar1a commented Mar 2, 2025

I didn't know about that workflow! It turns out I was still on lazygit ~0.40, which didn't have branch selection iirc. It definitely saves me the hassle of re setting up magit.

Oh, and I'm surprised that you'd rather switch to magit just for that command

to be fair, magit is really good.


if you haven't found it yet, here's magit's source code for this: https://github.com/magit/magit/blob/28d272ce0bcecc2e312d22ed15a48ad4cea564eb/lisp/magit-branch.el#L459-L531

I'm not sure we need this much flexibility though; I think I'd be fine with restricting it to moving the unpushed commits. If you have the need to move an arbitrary commit range (whether at the end of the branch or in the middle), you still have to do that manually, like today.

I agree with this, the behaviour I would expect from magit is a sort of "dumb" solution: Just base it off of the current branch you're on, don't go all the way back to main. If the user wants to do a multi-branch spinoff they will probably need to do it manually via the copying commits strategy as described in previous comments.


I think this feature is definitely still worth implementing. Having an easily pressed key when you fuck up and start working on the wrong branch is much easier to deal with than remembering the key sequence here #3876 (comment)

(in fact, i think the next few times I need this I would have to come back to this thread to remind myself)

@stefanhaller
Copy link
Collaborator Author

if you haven't found it yet, here's magit's source code for this: https://github.com/magit/magit/blob/28d272ce0bcecc2e312d22ed15a48ad4cea564eb/lisp/magit-branch.el#L459-L531

Thanks, but I speak very little lisp, so this is of limited usefulness to me...

the behaviour I would expect from magit is a sort of "dumb" solution: Just base it off of the current branch you're on, don't go all the way back to main

Doesn't that mean that you will always get a stack of branches when you are starting on another feature branch? This may occasionally be what I want, but most of the time it's not, so I'd then have to manually rebase the branch onto main, away from that other feature branch. While that's easy using lazygit's shift-B feature, it's still cumbersome.

I'm wondering if we should prompt the user whether they want to stay on the other feature branch, or move off of it onto main.

@stefanhaller
Copy link
Collaborator Author

I'm wondering if we should prompt the user whether they want to stay on the other feature branch, or move off of it onto main.

Ok, re-reading the discussion above I realize that I earlier suggested to select the target branch in the branches panel; that would make this prompt unnecessary. However, I actually no longer think this suggestion makes sense, for a number of reasons:

  • If I want to select master, I first need to make sure it's up to date. For me, since I never use master locally it is usually behind its upstream, so I first have to fast-forward it. While that's easy (f) it can take a bit of time, and it's annoying to have to do that. The prompt suggested above doesn't have this problem. (Incidentally, the same problem exists for just creating a new branch off of master; I sometimes wish we had a command for creating a branch off of origin/master.)
  • Selecting any other branch besides master or the one that you are currently on doesn't seem to make any sense to me, so this flexibility is unnecessary.

So I would now suggest to offer the command in branches view or commits view, as in the original version, and the selection doesn't matter; then, if the checked out branch is master, just do the simple thing, and if it is some other branch, show the prompt whether we should stay there and create a stack (in which case we do the simple thing here as well), or if we should move to master, in which case we need to do the slightly more complicated cherry-pick approach.

Hope this makes sense; I'll see if I can find some time to prototype this.

@ar1a
Copy link

ar1a commented Mar 3, 2025

Thanks, but I speak very little lisp, so this is of limited usefulness to me...

understandable 😅, it definitely seems indecipherable at a glance. especially since emacs lisp has its own functions for a lot of things, you sort of just need to be using emacs to understand it

So I would now suggest to offer the command in branches view or commits view, as in the original version, and the selection doesn't matter; then, if the checked out branch is master, just do the simple thing, and if it is some other branch, show the prompt whether we should stay there and create a stack (in which case we do the simple thing here as well), or if we should move to master, in which case we need to do the slightly more complicated cherry-pick approach.

i like this! i think this makes a lot of sense and really fits with lazygits design

@stefanhaller stefanhaller force-pushed the move-commits-to-new-branch branch from 67a61e4 to 41d5b48 Compare April 2, 2025 18:13
Copy link

codacy-production bot commented Apr 2, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for bd1e34b1 90.72%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bd1e34b) Report Missing Report Missing Report Missing
Head commit (f65166a) 55871 48476 86.76%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3876) 345 313 90.72%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@stefanhaller
Copy link
Collaborator Author

I pushed a new version that implements the proposal from my last comment. Would be good to get some thorough testing on this!

@stefanhaller stefanhaller marked this pull request as ready for review April 2, 2025 18:20
@stefanhaller stefanhaller force-pushed the move-commits-to-new-branch branch 2 times, most recently from 191844c to 3ca4b83 Compare April 10, 2025 09:55
@stefanhaller stefanhaller force-pushed the move-commits-to-new-branch branch from 3ca4b83 to cae6319 Compare April 16, 2025 15:57
@jesseduffield
Copy link
Owner

Testing this out locally and I get the error due to the current branch (which happens to be the main branch) being behind the upstream. @stefanhaller what is that error defending against? I would very much like to just ignore that edge case and have lazygit allow me to move the commits

@stefanhaller
Copy link
Collaborator Author

Testing this out locally and I get the error due to the current branch (which happens to be the main branch) being behind the upstream. @stefanhaller what is that error defending against? I would very much like to just ignore that edge case and have lazygit allow me to move the commits

Ok, this requires a bit of a longer explanation. For main branches it would indeed be nice to support this case, and I have seen this myself and found it annoying. However, it would be quite a bit of work to support this case, because we would no longer be able to share the code between main branches and stacked feature branches. In both cases we currently hard-reset the current branch to its upstream; this would have to change, we would have to hard-reset to the merge base of the branch and its upstream. And for feature branches we don't want to support that case, because if you have ↓3↑3, there's no way to tell whether a coworker pushed 3 commits, and you pushed 3 unrelated commits (in which case you could totally move those 3 commits to another branch and reset to the merge base), or whether you reworded a commit, in which case you don't want to hard-reset the current branch to anything. (This latter case can't happen for main branches, because you typically don't rebase them.)

I decided not to invest the work to support this case because with the "auto-forward main branches" PR it will happen a lot less often.

@stefanhaller stefanhaller force-pushed the move-commits-to-new-branch branch from cae6319 to 2392957 Compare April 20, 2025 14:27
Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll keep an eye on the limitation of restricting branches which have commits to pull from the upstream: I suspect the only resolution to that will be just allowing a selection of the commits directly, but we'll see how we go with the upcoming auto-fetch feature.

@stefanhaller stefanhaller enabled auto-merge April 21, 2025 16:07
…ergeAndRebaseHelper

It's the same, really, except that GetCheckedOutRef() does a check if any
branches exist and returns nil if not. Since we are accessing the returned
branch unconditionally without checking for nil, it seems this check is not
needed here. (The functions we are touching here are called from handlers that
are guarded with itemSelected or singleItemSelected, so we know that at least
one branch exists.)

The goal is to get rid of the dependency to refsHelper.
We want to make MergeAndRebaseHelper a dependency of RefsHelper instead.
The long story: I want to call this function from RefsHelper; however, I can't
make WorkingTreeHelper a field of RefsHelper because RefsHelper is already a
field in WorkingTreeHelper, so that would be a circular dependency.

The shorter story: there's really little reason to have to instantiate a helper
object in order to call a simple function like this. Long term I would like to
get to a state where a lot more of these helper functions are free-standing, and
you pass in the data they need.

While at it, simplify the implementation of AnyStagedFiles and AnyTrackedFiles
to one-liners.
@stefanhaller stefanhaller force-pushed the move-commits-to-new-branch branch from 2392957 to f65166a Compare April 21, 2025 16:13
@stefanhaller stefanhaller merged commit aa68885 into master Apr 21, 2025
14 checks passed
@stefanhaller stefanhaller deleted the move-commits-to-new-branch branch April 21, 2025 16:14
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 10, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.48.0` -> `v0.50.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary>

### [`v0.50.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.50.0)

[Compare Source](jesseduffield/lazygit@v0.49.0...v0.50.0)

<!-- Release notes generated using configuration in .github/release.yml at v0.50.0 -->

#### What's Changed

##### Enhancements 🔥

-   Continue/abort a conflicted cherry-pick or revert by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4441
-   Show todo items for pending cherry-picks and reverts by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4442
-   Use "git cherry-pick" for implementing copy/paste of commits by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4443
-   Allow reverting a range of commits by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4444
-   Section headers for rebase todos and actual commits by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4463
-   Focus the main view by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4429
-   Auto-forward main branches after fetching by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4493
-   Add new command "Move commits to new branch" by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#3876
-   Strip the '+' and '-' characters when copying parts of a diff to the clipboard by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4519
-   Reduce memory consumption of graph (pipe sets) by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4498

##### Fixes 🔧

-   Fix truncation of branches when scrolling branches panel to the left by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4483
-   Fix nvim-remote commands for fish shell by [@&#8203;SavingFrame](https://github.com/SavingFrame) in jesseduffield/lazygit#4506
-   Disallow creating custom patches when the diff context size is 0 by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4522
-   Remove double space between rebase todo and author columns by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4520

##### Maintenance ⚙️

-   Allow closing issues via github actions by [@&#8203;jesseduffield](https://github.com/jesseduffield) in jesseduffield/lazygit#4515

##### Docs 📖

-   Add Debian installation instructions alongside Ubuntu by [@&#8203;jmkim](https://github.com/jmkim) in jesseduffield/lazygit#4501
-   fix wording of random tip by [@&#8203;dawedawe](https://github.com/dawedawe) in jesseduffield/lazygit#4488

#### New Contributors

-   [@&#8203;jmkim](https://github.com/jmkim) made their first contribution in jesseduffield/lazygit#4501
-   [@&#8203;SavingFrame](https://github.com/SavingFrame) made their first contribution in jesseduffield/lazygit#4506
-   [@&#8203;dawedawe](https://github.com/dawedawe) made their first contribution in jesseduffield/lazygit#4488

**Full Changelog**: jesseduffield/lazygit@v0.49.0...v0.50.0

### [`v0.49.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.49.0)

[Compare Source](jesseduffield/lazygit@v0.48.0...v0.49.0)

<!-- Release notes generated using configuration in .github/release.yml at v0.49.0 -->

#### What's Changed

##### Enhancements 🔥

-   Support fish when running shell command by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4350
-   Add acme editor preset by [@&#8203;rakoo](https://github.com/rakoo) in jesseduffield/lazygit#4360
-   Support home and end as alternatives to '<' and '>' by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4396
-   Drop the git config cache when getting focus by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4376
-   Add a "Content of selected file" entry to the copy menu for commit files by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4341
-   Add root node in file tree by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4346
-   \[FEAT] Add Recursive Bulk Initialize and Update for Submodules by [@&#8203;cesarandr](https://github.com/cesarandr) in jesseduffield/lazygit#4259
-   Commit without pre-commit hooks action is independent on prefix by [@&#8203;kschweiger](https://github.com/kschweiger) in jesseduffield/lazygit#4374
-   Let users define custom icons and color for files on the config file by [@&#8203;hasecilu](https://github.com/hasecilu) in jesseduffield/lazygit#4395
-   Add "Absolute path" item to the file view's copy menu by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4410
-   Allow range drop stashes by [@&#8203;gaogao-qwq](https://github.com/gaogao-qwq) in jesseduffield/lazygit#4451
-   More navigation keybindings for confirmation panel by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4404
-   Resolve non-inline merge conflicts by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4431
-   Add `runCommand` function to Go template syntax + add support for templates in git `branchPrefix` setting by [@&#8203;ruudk](https://github.com/ruudk) in jesseduffield/lazygit#4438
-   Show "(hooks disabled)" in title bar of commit message editor by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4467
-   Add a command to select all commits of the current branch by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4448

##### Fixes 🔧

-   Use a waiting status for rewording a non-head commit by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4343
-   Fix layout of options view for non-english languages by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4359
-   Fix changing language while lazygit is running by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4361
-   URL encode gitlab brackets to make consistent with branch names by [@&#8203;ChrisMcD1](https://github.com/ChrisMcD1) in jesseduffield/lazygit#4336
-   Fix commitPrefix setting with empty pattern by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4381
-   Commit only tracked files in tracked filter view by [@&#8203;parthokunda](https://github.com/parthokunda) in jesseduffield/lazygit#4386
-   Revert [#&#8203;4313](jesseduffield/lazygit#4313) (Skip post-checkout hook when discarding changes) by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4407
-   Enhance support for GPG signed tags by [@&#8203;ChrisMcD1](https://github.com/ChrisMcD1) in jesseduffield/lazygit#4394
-   Fix checking out a file from a range selection of commits by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4423
-   Fix discarding submodule changes in nested folders by [@&#8203;brandondong](https://github.com/brandondong) in jesseduffield/lazygit#4317
-   Better support for shell aliases by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4385
-   Fix hyperlinks in last line of confirmation popups by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4454
-   Fix wrong main view content after pressing `e` in a stack of branches by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4450
-   fix: update vscode color to logo color by [@&#8203;PeterCardenas](https://github.com/PeterCardenas) in jesseduffield/lazygit#4459
-   Fix crash with drag selecting and staging by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4480
-   Escape special characters in filenames when git-ignoring files by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4475

##### Maintenance ⚙️

-   Fix linter warnings by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4352
-   Fix release schedule again by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4364
-   Update to go 1.24 by [@&#8203;radsaq](https://github.com/radsaq) in jesseduffield/lazygit#4377
-   Add an integration test for a config with a negative refspec by [@&#8203;radsaq](https://github.com/radsaq) in jesseduffield/lazygit#4382
-   Specify a go release minor version by [@&#8203;radsaq](https://github.com/radsaq) in jesseduffield/lazygit#4393
-   Fix flaky integration test by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4432
-   Some code cleanup by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4449
-   Bump the minimum required git version to 2.22 by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4439
-   Bump go-git, and get rid of github.com/imdario/mergo by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4460
-   Skip date check when release worfklow is manually invoked by [@&#8203;jesseduffield](https://github.com/jesseduffield) in jesseduffield/lazygit#4484

##### Docs 📖

-   Include empty arrays and maps in config docs by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4413
-   Filter out deprecated user config fields from generated Config.md by [@&#8203;karimkhaleel](https://github.com/karimkhaleel) in jesseduffield/lazygit#4416
-   Corrected interactive rebase keybind example in README.md by [@&#8203;NewtonChutney](https://github.com/NewtonChutney) in jesseduffield/lazygit#4426
-   Update kidpix link in README to active url by [@&#8203;ChrisMcD1](https://github.com/ChrisMcD1) in jesseduffield/lazygit#4425

##### I18n 🌎

-   Update translation files from Crowdin by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4473

#### New Contributors

-   [@&#8203;rakoo](https://github.com/rakoo) made their first contribution in jesseduffield/lazygit#4360
-   [@&#8203;radsaq](https://github.com/radsaq) made their first contribution in jesseduffield/lazygit#4377
-   [@&#8203;cesarandr](https://github.com/cesarandr) made their first contribution in jesseduffield/lazygit#4259
-   [@&#8203;kschweiger](https://github.com/kschweiger) made their first contribution in jesseduffield/lazygit#4374
-   [@&#8203;NewtonChutney](https://github.com/NewtonChutney) made their first contribution in jesseduffield/lazygit#4426
-   [@&#8203;gaogao-qwq](https://github.com/gaogao-qwq) made their first contribution in jesseduffield/lazygit#4451
-   [@&#8203;ruudk](https://github.com/ruudk) made their first contribution in jesseduffield/lazygit#4438

**Full Changelog**: jesseduffield/lazygit@v0.48.0...v0.49.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4yIiwidXBkYXRlZEluVmVyIjoiNDAuMTEuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants