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

3991 Commits

Author SHA1 Message Date
Stefan Haller
b24955063c Allow rewording the head commit during interactive rebase 2023-04-01 08:16:15 +02:00
Stefan Haller
605bc026a1 Set promptToReturnFromSubprocess to false for integration tests
There is no way how we could confirm the prompt in an integration test.
2023-04-01 08:16:15 +02:00
Stefan Haller
c6930e0538 Cleanup: use commit.isTODO() consistently
It seems cleaner than checking the Status for "rebasing".
2023-04-01 08:16:15 +02:00
Jesse Duffield
3a59aba46d
Merge pull request #2521 from jesseduffield/fix-reflog-text-colour 2023-03-26 17:10:31 +11:00
Jesse Duffield
213ae8dd07 fix reflog text colour by defaulting every view to the same foreground colour 2023-03-26 15:24:09 +11:00
Jesse Duffield
4780953cef
Merge pull request #2377 from shinhs0506/clear-staging-after-commit 2023-03-24 19:13:00 +11:00
README-bot
11bc8b87fa Updated README.md 2023-03-24 07:55:25 +00:00
Jesse Duffield
3bfbc9d255
Merge pull request #2518 from jesseduffield/remove-old-integration-test-stuff 2023-03-24 18:55:06 +11:00
Jesse Duffield
8121a0cc74 remove old integration test recording code 2023-03-24 18:42:11 +11:00
Stefan Haller
b7c61aa883 Push initial context instead of just putting it in the context array
This makes sure activateContext gets called on it.
2023-03-20 20:14:13 +11:00
Stefan Haller
40f6767cfc Avoid deactivating and activating when pushing the current context again
When calling PushContext, do nothing if the context to be pushed is already on
top of the stack. Avoids flicker in certain situations.
2023-03-20 20:14:13 +11:00
John Shin
776d8f4d2e refresh the staging panel on successful commit
apply formatting
2023-03-20 20:13:59 +11:00
Jesse Duffield
4b67a45a16
Merge pull request #2515 from stefanhaller/fix-deprecated-rand-seed 2023-03-20 20:12:25 +11:00
Jesse Duffield
a82d952f48
Merge pull request #2495 from jesseduffield/feature/remove-altreturn 2023-03-20 20:11:35 +11:00
Stefan Haller
549ce09f71 Fix deprecated rand.Seed 2023-03-19 10:00:19 +01:00
Jesse Duffield
cef804f27a
Merge pull request #2513 from jesseduffield/refactor-patch-handling 2023-03-19 16:53:02 +11:00
Jesse Duffield
60f902f026 rename patch manager to patch builder 2023-03-19 16:35:57 +11:00
Jesse Duffield
7ce3165afa specify view when assertion on line count fails 2023-03-19 16:30:39 +11:00
Jesse Duffield
c28e25524a bump gocui to fix race condition 2023-03-19 16:30:39 +11:00
Jesse Duffield
73c7dc9c5d refactor patch code 2023-03-19 16:30:39 +11:00
Jesse Duffield
b542579db3
Better escape code parsing (thanks to Ryooooooga) (#2514) 2023-03-19 15:41:47 +11:00
Jesse Duffield
e6274af015
appease golangci-lint (#2512) 2023-03-19 11:20:29 +11:00
README-bot
4f57bf22c9 Updated README.md 2023-03-19 00:09:11 +00:00
Luka Markušić
8dbd7d44ff
Fix checking for credentials performance (#2452)
Co-authored-by: Jesse Duffield <jessedduffield@gmail.com>
2023-03-19 11:08:54 +11:00
Stefan Haller
4b4dccfd7d
Fix "move patch into new commit" for partial hunk (#2507) 2023-03-18 18:17:47 +11:00
Shruti Chaturvedi
81ea3107ed
Uffizzi PR: Update Uffizzi Workflows (#2502) 2023-03-18 11:33:07 +11:00
Jens Kutilek
5c8bc790ff
Make arrows consistent (#2501) 2023-03-18 11:32:44 +11:00
yk-kd
b5d612e6d6
Add border config (#2344)
Co-authored-by: yk-kd <yosuke.komada@gmail.com>
2023-03-18 11:23:31 +11:00
README-bot
dea279920c Updated README.md 2023-03-17 23:26:33 +00:00
Jesse Duffield
5834440767
Merge pull request #2500 from Ryooooooga/fix-commit-loader 2023-03-18 10:26:15 +11:00
Ryooooooga
55fb3ef4e6
fix(commit_loader): fix log command 2023-03-16 20:13:23 +09:00
Luka Markušić
f314cb3763 Remove alternative confirmation and return keymappings 2023-03-09 10:32:00 +01:00
README-bot
516e963392 Updated README.md 2023-03-08 09:45:26 +00:00
Jesse Duffield
804a134aa5
Merge pull request #2471 from stefanhaller/improve-custom-patch-conflict-handling 2023-03-08 20:45:10 +11:00
Jesse Duffield
82fc6fb111
Merge pull request #2491 from TylerBarnes/patch-1 2023-03-08 10:26:06 +11:00
Jesse Duffield
0bda93d4c3 Add more unit tests 2023-03-08 09:19:23 +11:00
Tyler Barnes
6735bf4c89
Update Config.md 2023-03-07 11:54:47 -08:00
Stefan Haller
4bd1322941 Rename WillBeAppliedReverse to Reverse
This is the only "reverse"-related option that is left, so use a less clumsy
name for it.
2023-03-07 13:40:07 +01:00
Stefan Haller
45cf993982 Remove the PatchOptions.Reverse option
All callers pass false now (except for the tests, which we simply remove), so we
don't need the option any more.
2023-03-07 13:39:45 +01:00
Stefan Haller
e4659145e8 Use WillBeAppliedReverse (and git apply --reverse) in the staging panel too
It's simpler to have only one way of reversing a patch.
2023-03-07 13:38:19 +01:00
Stefan Haller
bf6e9a1bd3 Reenable failing test 2023-03-07 09:49:34 +01:00
Stefan Haller
a68cd6af9c Concatenate patches to apply them all at once
This fixes the problem that patching would stop at the first file that has a
conflict. We always want to patch all files.

Also, it's faster for large patches, and the code is a little bit simpler too.
2023-03-07 09:49:34 +01:00
Stefan Haller
4ca012dbfb Add test for reverse-applying a patch that conflicts
The patch contains changes to two files; the first one conflicts, the second
doesn't. Note how it only applies changes to the first file at this point in the
branch; we'll fix this in the next commit.

This test would fail on master for multiple reasons.
2023-03-07 09:49:34 +01:00
Stefan Haller
6bd1c1d068 Remove parameters that are no longer needed
All callers in this file now use reverseOnGenerate=false and
keepOriginalHeader=true, so hard-code that in the call to ModifiedPatchForLines
and get rid of the parameters.
2023-03-07 09:49:34 +01:00
Stefan Haller
5d692e8961 Remove the keepOriginalHeader retry loop
The loop is pointless for two reasons:
- git apply --3way has this fallback built in already. If it can't do a
  three-way merge, it will fall back to applying the patch normally.
- However, the only situation where it does this is when it can't do a 3-way
  merge at all because it can't find the necessary ancestor blob. This can only
  happen if you transfer a patch between different repos that don't have the
  same blobs available; we are applying the patch to the same repo that is was
  just generated from, so a 3-way merge is always possible. (Now that we fixed
  the bug in the previous commit, that is.)

But the retry loop is not only pointless, it was actually harmful, because when
a 3-way patch fails with a conflict, git will put conflict markers in the
patched file and then exit with a non-zero exit status. So the retry loop would
try to patch the already patched file again, and this almost certainly fails,
but with a cryptic error message such as "error: main.go: does not exist in
index".
2023-03-07 09:49:34 +01:00
Stefan Haller
9cc33c479b Use forward patches and --reverse flag for partial patches too
There's no reason to have two different ways of applying patches for whole-file
patches and partial patches; use --reverse for both. Not only does this simplify
the code a bit, but it fixes an actual problem: when reverseOnGenerate and
keepOriginalHeader are both true, the generated patch header is broken (the two
blobs in the line `index 6d1959b..6dc5f84 100644` are swapped). Git fails to do
a proper three-way merge in that case, as it expects the first of the two blobs
to be the common ancestor.

It would be possible to fix this by extending ModifiedPatchForLines to swap the
two blobs in this case; but this would prevent us from concatenating all patches
and apply them in one go, which we are going to do later in the branch.
2023-03-07 09:49:34 +01:00
Stefan Haller
c79e360584 Add patch option WillBeAppliedReverse
It's not used yet, but covered with tests already.
2023-03-07 09:49:34 +01:00
Stefan Haller
f76cc27956 Bundle the reverse and keepOriginalHeader flags into a PatchOptions struct
We are going to add one more flag in the next commit.

Note that we are not using the struct inside patch_manager.go; we keep passing
the individual flags there. The reason for this will become more obvious later
in this branch.
2023-03-07 09:49:34 +01:00
Stefan Haller
5a50bfd179 Fix opening the current test file from the integration test gui 2023-03-07 09:49:34 +01:00
Jesse Duffield
c36333af3d
Merge pull request #2433 from Ryooooooga/subcommits-limit 2023-03-06 18:22:57 +11:00