1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
Commit Graph

493 Commits

Author SHA1 Message Date
Stefan Haller
51a558040d Fix the title and text (and variable names) of the Discard Changes prompt
The title was saying "Unstage lines", which was just wrong. The text said
"Delete lines", which can be seen as a bit misleading; we are only discarding
the changes to the selected lines, not deleting the lines themselves.

For consistency, rename the config variable skipUnstageLineWarning accordingly.
2023-06-26 08:15:35 +02:00
Stefan Haller
1f42c8a387 Allow discarding changes only from local commits
We use CommitFilesController also for the files of commits that we show
elsewhere, e.g. for branch commits, tags, or stashes. It doesn't make sense to
discard changes from those (for stashes it might be possible to implement it
somehow, but that would be a new feature), so we disallow it unless we are in
the local commits panel.
2023-06-07 12:48:56 +02:00
Stefan Haller
5c55ce6555 Better prompt for discarding old file changes
Lazygit knows what kind of file change this is, so there doesn't have to be any
"if" in the prompt text.
2023-06-07 12:47:03 +02:00
Stefan Haller
1f801b91e4 Disallow discarding file changes while a directory is selected
Discarding changes to an entire directory doesn't quite work correctly in all
cases; for example, if the current commit added files to the directory (but the
directory existed before) then those files won't be removed.

It might be possible to fix the command so that these cases always work for
directories, but I don't think it's worth the effort (you can always use a
custom patch for that), so let's display an error for now.
2023-06-07 12:47:03 +02:00
Stefan Haller
16dceb813b Show menu instead of prompt when there are conflicts in a rebase or merge
This solves the issue that previously you could too easily abort a rebase
accidentally by hitting escape.
2023-06-01 10:51:48 +02:00
Tzeng Yuxio
5d8af7bbd8
Add Traditional Chinese support 2023-05-30 12:58:11 +08:00
Jesse Duffield
d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00
Jesse Duffield
3eed997161 Update cheatsheet
Now that we're using the angle-bracket syntax everywhere for consistency, we need to escape
the angle brackets in the markdown of the cheatsheets.
2023-05-21 11:31:29 +10:00
Stefan Haller
401610c0ef Remove the toast when toggling "ignore whitespace"
Now that we visualize the state, the toast is no longer needed.
2023-05-20 12:58:32 +10:00
Stefan Haller
64b2685c2d Visualize the "ignore whitespace" state in the subtitle of the diff view 2023-05-20 12:58:32 +10:00
Stefan Haller
7d4bfb6621 Don't toggle "ignore whitespace" in the staging and patch building panels
The option doesn't have any affect in these views, so we don't need to toggle it
here. But the problem was the HandleFocus call at the end: this would activate
the wrong view, so we need to avoid it here.

Show an error if the user tries to turn the option on, to let them know that it
doesn't work here.
2023-05-20 12:58:32 +10:00
Sean
9d68b287db Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 13:19:53 +10:00
Jesse Duffield
509e3efa70 lots more refactoring 2023-04-30 13:19:53 +10:00
Jesse Duffield
8f1f712841 use lowercase text for menu items (as we're still yet to standardise on 'Sentence case') 2023-04-15 17:29:31 +10:00
AzraelSec
a3fdf91714 feat: allow to perform a rebase with breaking before the first commit 2023-04-15 17:26:08 +10:00
Stefan Haller
d675eb6507 Don't allow changing the type of certain rebase todos
We already show "merge" todo entries when starting an interactive rebase with
--rebase-merges outside of lazygit. Changing the type of a merge entry to "pick"
or "edit" doesn't make sense and shouldn't be allowed. Earlier in this branch we
have started to show "update-ref" entries, these can't be changed either (they
can be moved, though).

You might argue that it should be possible to change them to "drop", but in the
case of "update-ref" this doesn't make sense either, because "drop" needs a Sha
and we don't have one here. Also, you would then be able to later change it back
to "pick", so we would have to remember that this isn't allowed for this
particular drop entry; that's messy, so just disallow all editing.
2023-04-15 08:36:03 +02:00
Stefan Haller
227b0b781c Show update-ref commands in rebase todo list
This is useful when working with stacked branches, because you can now move
"pick" entries across an update-ref command and you can tell exactly which
branch the commit will end up in.

It's also useful to spot situations where the --update-refs option didn't work
as desired. For example, if you duplicate a branch and want to rebase only one
of the branches but not the other (maybe for testing); if you have
rebase.updateRefs=true in your git config, then rebasing one branch will move
the other branch along. To solve this we'll have to introduce a way to delete
the update-ref entry (maybe by hitting backspace?); this is out of scope for
this PR, so for now users will have to type "git rebase --edit-todo" into the
custom command prompt to sort this out.

We will also have to prevent users from trying to turn update-ref commands into
other commands like "pick" or "drop"; we'll do this later in this branch.
2023-04-15 08:36:03 +02:00
Stefan Haller
046b0d9daa Show warning about deprecated edit configs
We print this to the terminal after lazygit quits rather than showing it in a
panel at startup, so as to not annoy people too much. Hopefully it will still be
prominent enough this way.
2023-04-13 13:14:00 +02:00
Stefan Haller
c757063264 Better error message when trying to edit or move a non-todo commit during rebase
Previously we would have tried to do the rebase, resulting in a long and
somewhat cryptic error message from git; now we check ourselves and show a less
intimidating message.
2023-04-01 08:16:15 +02:00
Jesse Duffield
38c7030b0f mention path in tooltips 2023-02-20 19:28:45 +11:00
Luka Markušić
31b8524fe6 Add tooltips for discarding 2023-02-20 19:28:45 +11:00
Jesse Duffield
e1c376ef54
Merge pull request #2453 from stefanhaller/allow-rebasing-to-first-commit 2023-02-20 19:21:37 +11:00
Jesse Duffield
082d342bf8 add tag tests 2023-02-20 19:01:08 +11:00
Stefan Haller
a349e886ce Allow interactive rebasing all the way down to the first commit
Pass --root instead of a sha when we want to rebase down to the initial commit.
2023-02-20 07:40:05 +01:00
Stefan Haller
dd61c49a15 Better error message for trying to squash or fixup the first commit
It's not so much the total number of commits that matters here, it's just
whether we are on the first one. (This includes the other condition.)

This allows us to get rid of the condition in rebase.go.
2023-02-20 07:40:04 +01:00
Stefan Haller
bb856ad7c6 Bump minimum required git version to 2.20
We need this because the next commit is going to make use of the "break"
interactive rebase instruction, which was added in 2.20.
2023-02-19 10:20:14 +01:00
Jesse Duffield
368d6437b8
Merge pull request #2373 from phanithinks/clipboard_patch_option_2357 2023-01-31 17:02:46 +11:00
Ryooooooga
069af50f50
chore(i18n): remove unused texts 2023-01-24 21:24:46 +09:00
Phanindra kumar Paladi
f6f82091bc Added copy to clipboard option to the patch options 2023-01-17 09:07:07 +05:30
Jesse Duffield
af5b3be286 integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
Jesse Duffield
5679efe174
Merge pull request #2239 from bdach/u2f-key-prompts
close https://github.com/jesseduffield/lazygit/issues/2230
2022-12-20 21:44:29 +11:00
navazjm
3a1921cab0 updated rebase confirmation message 2022-12-16 17:36:37 -06:00
Bartłomiej Dach
1a1f042f49 Add credential prompts for U2F-backed SSH keys
The 8.2 release of OpenSSH added support for FIDO/U2F hardware
authenticators, which manifests in being able to create new types of SSH
key, named `ecdsa-sk` nad `ed25519-sk`. This is relevant to lazygit,
as those SSH keys can be used to authorise git operations over SSH, as
well as signing git commits. Actual code changes are required for
correct support, as the authentication process for these types of keys
is different than the process for types supported previously.

When an operation requiring credentials is initialised with a U2F
authenticator-backed key, the first prompt is:

	Enter PIN for ${key_type} key ${path_to_key}:

at which point the user is supposed to enter a numeric (and secret) PIN,
specific to the particular FIDO/U2F authenticator using which the SSH
keypair was generated. Upon entering the correct key, the user is
supposed to physically interact with the authenticator to confirm
presence. Sometimes this is accompanied by the following text prompt:

	Confirm user presence for key ${key_type} ${key_fingerprint}

This second prompt does not always occur and it is presumed that the
user will know to perform this step even if not prompted specifically.
At this stage some authenticator devices may also begin to blink a LED
to indicate that they're waiting for input.

To facilitate lazygit's interoperability with these types of keys, add
support for the first PIN prompt, which allows "fetch", "pull", and
"push" git operations to complete.
2022-11-30 13:34:32 +11:00
Andrew Hynes
a47e72892a
Merge branch 'master' into stash-untracked-changes 2022-11-01 16:08:34 -02:30
Ryooooooga
11316b7a48
feat: add rename stash 2022-10-16 09:12:42 +09:00
Andrew Hynes
8c46a0110d
Merge branch 'master' into stash-untracked-changes 2022-10-06 22:59:06 -02:30
Jesse Duffield
74acb3e86a add integration tests for cherry picking 2022-09-16 22:15:16 -07:00
Andrew Hynes
7ddb80a13e feat: add stash option to include untracked changes 2022-09-15 21:48:48 -02:30
nullishamy
21a4522a51
Merge branch 'master' into feat/detect-bare-repo 2022-08-15 14:00:34 +01:00
Jesse Duffield
4aea005f26
Merge pull request #2098 from Ryooooooga/feature/not-a-repository-quit 2022-08-14 17:37:07 +10:00
Luka Markušić
0ff5b74d80 IgnoreOrExclude should be a menu 2022-08-11 14:23:02 +02:00
Ryooooooga
8b371ada73
feat(config): add notARepository: quit 2022-08-08 18:11:58 +09:00
nullishamy
a91d977f89
Merge branch 'master' into feat/detect-bare-repo 2022-08-06 14:08:59 +01:00
Jesse Duffield
524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
nullishamy
b9b2f58bc8
Format, bug fixes 2022-08-01 17:41:20 +01:00
nullishamy
2866827ca8
Apply suggestions from code review 2022-08-01 17:05:16 +01:00
Jesse Duffield
5f4c29d7b5
Merge pull request #2005 from mark2185/feature/recent-repos-path
Show active branch for recent repo
2022-07-31 19:30:30 +10:00
Luka Markušić
44de380c2b Add i18n for unknown branch 2022-07-31 08:57:57 +02:00
sportshead
f2880ecb46 Add empty output message and refreshing to showOutput 2022-07-31 12:04:40 +08:00
Jesse Duffield
c087dca60a
Merge pull request #2027 from jesseduffield/gozes-jesse
Attempt at fixing CI
2022-07-05 19:37:09 +10:00
Juan Sanchez Montalvo
11d766053e Allow adding a file to the .git/info/exclude file 2022-07-05 19:33:44 +10:00
Luka Markušić
f1efa02640 Ask for initial branch name 2022-06-30 13:53:58 +02:00
Jesse Duffield
9591cc381a support setting the author of a commit
update copy
2022-06-09 19:12:20 +10:00
Shin-JaeHeon
b6b1f5dc37 improve korean translation 2022-06-07 23:46:32 +09:00
Shin-JaeHeon
d2a873cb40 improve korean translation 2022-06-07 23:36:24 +09:00
Shin-JaeHeon
d533427173 Korean translation 2022-06-07 23:31:56 +09:00
Jesse Duffield
8fd9dea641
Merge pull request #1936 from Ryooooooga/feature/tab-i18n 2022-05-18 22:24:45 +10:00
Jesse Duffield
499d51ecf6
Merge pull request #1931 from mark2185/fix-non-existant-recent-repo 2022-05-18 22:22:28 +10:00
Ryooooooga
5275161a88
chore(i18n): localize panel titles 2022-05-18 20:55:42 +09:00
Ryooooooga
9693afd671
fix: fix lint error 2022-05-18 20:34:35 +09:00
Luka Markušić
1de5ca3511 Don't panic when there are no valid git repos 2022-05-17 07:28:52 +02:00
Luka Markušić
241d182da7 Make tooltip i18n-able 2022-05-15 12:16:20 +02:00
Luka Markušić
ca191159f5 Discard staged changes only 2022-05-08 14:24:28 +02:00
Jesse Duffield
20db9fc939 update copy 2022-05-08 13:29:57 +10:00
Jens Pfeifle
7c573a5bea Add command to reset the commit author from the commits panel. 2022-05-08 13:29:56 +10:00
Jesse Duffield
f257740ea7 add tooltip view for showing menu item descriptions 2022-05-08 13:24:36 +10:00
Ryooooooga
d458e78d95
feat: add ability to edit hunk 2022-05-06 21:53:00 +09:00
Jesse Duffield
0940e0182b
Merge pull request #1870 from mark2185/feature/stash-unstaged 2022-05-06 20:17:33 +10:00
Jesse Duffield
f7fae0b82e
Merge pull request #1869 from mark2185/feature/unset-upstream 2022-05-06 20:14:13 +10:00
Ryooooooga
cda359fbc9
feat(i18n): japanese translation 2022-05-05 18:42:27 +09:00
Jesse Duffield
4dd09ee0d5 allow copying commit author to clipboard 2022-05-01 14:14:29 +10:00
Jesse Duffield
dfb293c985 better upstream changes presentation 2022-04-18 11:03:28 +10:00
Luka Markušić
1ae2dc9941 The four horsemen of stashing 2022-04-14 21:45:55 +02:00
Luka Markušić
f83308c8df Add option to (un)set upstream for a local branch 2022-04-11 14:04:06 +02:00
Luka Markušić
6f7038c827 Add option to stash only unstaged files 2022-04-10 09:35:59 +02:00
Moritz Haase
f2fb6453a1 pkg/gui: Show notification popup when update was successful
Show a proper notification popup once an update has been installed successfully
so the user knows we're done (so far a popup is only shown if an error occurred).
The popup also reminds him to restart lazygit for the changes to take effect.
2022-03-28 09:13:34 +11:00
Moritz Haase
b7079634ee i18n: Make user-facing strings in the updater translatable
Convert a number of static (english) user-facing string in the updater code to
translatable ones.
2022-03-28 09:13:34 +11:00
Jesse Duffield
860d1e0145 fix copy for merge confirmation 2022-03-27 18:16:16 +11:00
Jesse Duffield
f0a4dcfdc3 refactor menu context 2022-03-27 18:16:16 +11:00
Jesse Duffield
51baa8c17d update cheatsheet 2022-03-26 18:00:46 +11:00
Jesse Duffield
ad7703df65 show namesake for child views 2022-03-26 18:00:46 +11:00
Jesse Duffield
13b90ac37f support viewing commits of reflog entry and show better view title 2022-03-26 18:00:46 +11:00
Jesse Duffield
45dab51214 add basic commits controller for handling actions that apply to all commit contexts 2022-03-26 17:22:42 +11:00
Luka Markušić
540edb0bf4 Add copy commit attributes option 2022-03-26 17:22:42 +11:00
Crystal-RainSlide
bbaa651943 Update chinese.go 2022-03-26 13:38:22 +11:00
Jesse Duffield
dde30fa104 add gone branches status 2022-03-24 17:50:25 +11:00
Jesse Duffield
f113ff21bf add confirmation before performing undo or redo action 2022-03-24 09:45:27 +11:00
Jesse Duffield
12ecd665c8 safe reword 2022-03-23 23:43:21 +11:00
Jesse Duffield
cc5d13c833 allow adding whole diff to patch
this was causing a panic

add integration test for toggling all commit files
2022-03-23 23:36:58 +11:00
Jesse Duffield
46e9946854 refactor credential handling 2022-03-17 19:13:40 +11:00
Jesse Duffield
a643957f89 include stash in commitish controller 2022-03-17 19:13:40 +11:00
Jesse Duffield
a2318d75b5 fix some things 2022-03-17 19:13:40 +11:00
Jesse Duffield
1dd7307fde start moving commit panel handlers into controller
more

and more

move rebase commit refreshing into existing abstraction

and more

and more

WIP

and more

handling clicks

properly fix merge conflicts

update cheatsheet

lots more preparation to start moving things into controllers

WIP

better typing

expand on remotes controller

moving more code into controllers
2022-03-17 19:13:40 +11:00
Jesse Duffield
a90b6efded start refactoring gui 2022-03-17 19:13:40 +11:00
Akash Soedamah
7e6b43d13b Just spotted some small typos in NL translation
I'm learning the LazyGit keybindings right now
2022-03-16 19:46:11 +11:00
Blair Noctis
471fe313d8
fix & polish Chinese intro message
- Fix first sentence of 3), #1756
- Use 你 instead of 您 to pose a closer feel, as fellow programmers
- Polish a little so it feels more natural
2022-02-02 18:59:15 +08:00
Jesse Duffield
1b09674ce8 simplify submodule remove 2022-01-29 00:17:32 +11:00
Jesse Duffield
c8cc18920f improve merge conflict flow 2022-01-26 14:50:47 +11:00
glendsoza
0c6bdac2f7 Changes as per review 2022-01-26 09:04:12 +11:00
glendsoza
257e222f8d ISSUE 1706: Ask confirmation before reverting a commit 2022-01-26 09:04:12 +11:00