Commit graph

4460 commits

Author SHA1 Message Date
Jesse Duffield e2cef55f94 Fix filtering logic in worktrees view 2023-07-29 17:36:17 +10:00
Jesse Duffield 500c0eafb9 Support creating worktrees from refs 2023-07-29 17:36:17 +10:00
Jesse Duffield e0c8a56db5 Fix wording 2023-07-29 17:36:17 +10:00
Jesse Duffield 002e4eedf5 Log when directory is changed 2023-07-29 17:36:17 +10:00
Jesse Duffield a991525391 Handle deleting branch attached to worktree 2023-07-29 17:36:17 +10:00
Jesse Duffield 7be3658533 Update wording 2023-07-29 17:36:17 +10:00
Jesse Duffield fd854fb7f7 Don't touch repo stack when switching worktrees
We shouldn't touch this cos we're doing a lateral move
2023-07-29 17:36:17 +10:00
Jesse Duffield 64711dfc2f Move status panel presentation logic into presentation package 2023-07-29 17:36:17 +10:00
Jesse Duffield 0776ae41d3 Land in the same panel when switching to a worktree 2023-07-29 17:36:17 +10:00
Jesse Duffield ad017f3bb8 Move current worktree to top of list 2023-07-29 17:36:17 +10:00
Jesse Duffield 9eb9ce88b3 Prompt to switch to worktree when branch is checked out by other worktree 2023-07-29 17:36:17 +10:00
Jesse Duffield 7af9715a1b Use git lingo 2023-07-29 17:36:17 +10:00
Jesse Duffield dbd32f63dd Improve name handling 2023-07-29 17:36:17 +10:00
Jesse Duffield d7aca1bcbd Use sentence case 2023-07-29 17:36:17 +10:00
Jesse Duffield 72c856ac13 Refactor 2023-07-29 17:36:17 +10:00
Jesse Duffield 038de926b3 Update worktree model 2023-07-29 17:36:17 +10:00
Jesse Duffield 4c471dff83 Alert when attempting to enter the current worktree 2023-07-29 17:36:17 +10:00
Jesse Duffield c1ea17b66f Remove comment 2023-07-29 17:36:17 +10:00
Joel Baranick b22f936522 Address PR comments 2023-07-29 17:36:17 +10:00
Joel Baranick 53e408f156 Basic support for adding a worktree 2023-07-29 17:36:17 +10:00
Joel Baranick 46bb9bb60b Put all worktree i18n strings together
Use tabwriter to align worktree panel contents
2023-07-29 17:36:17 +10:00
Joel Baranick b10670ba44 Improve worktree panel 2023-07-29 17:36:17 +10:00
Joel Baranick f13f85de8e Style missing worktree as red and display better error when trying to switch to them
Use a broken link icon for missing worktrees
2023-07-29 17:36:17 +10:00
Joel Baranick 141011aaae Hide worktrees in the worktree panel if they point at a non-existing filesystem location.
Remove unneeded check when filtering out branches from non-current worktrees from the branch panel.
Add link icon for linked worktrees
2023-07-29 17:36:17 +10:00
Joel Baranick 4a2c54e5d8 Update status to differentiate the main vs linked worktrees 2023-07-29 17:36:17 +10:00
Joel Baranick 2f156b3438 Support for deleting a worktree 2023-07-29 17:36:17 +10:00
Joel Baranick eded08bacf Initial addition of support for worktrees 2023-07-29 17:36:17 +10:00
README-bot 1db1fee03a Updated README.md 2023-07-29 02:39:15 +00:00
Jesse Duffield 2f0116170d
Faster refresh (#2841) 2023-07-29 12:39:00 +10:00
Jesse Duffield 429225da80 Support random order of command execution in unit tests
Now that we run code concurrently in our loaders, we need to handle that in our tests.
We could enforce a deterministic ordering by mocking waitgroup or something like that,
but I think it's fine to let our tests handle some randomness given that prod itself
will have that randomness.

I've removed the patch test file because it was clunky, not providing much value, and
it would have been hard to refactor to the new pattern
2023-07-29 12:36:17 +10:00
Jesse Duffield 39b77c0fca Have staging refresh wait for files to refresh first 2023-07-29 10:20:15 +10:00
Jesse Duffield 63e5790410 Speed up refresh using concurrency and wait groups
Previously our synchronous refreshes took far longer because nothing
was happening concurrently. We now run refresh functions concurrently
and use a wait group to ensure they're all done before returning
2023-07-29 10:04:11 +10:00
Jesse Duffield 272e021c08 Refactor reflog commit loader
No functional changes
2023-07-29 10:04:11 +10:00
Jesse Duffield 862ebd25cb Speed up remote loader
We're:
* using concurrency with wait groups
* avoiding regex
* processing lines of input as they come rather than storing everything in one string
* avoiding an inner loop by creating a mapping of remote names to branches
2023-07-29 10:04:11 +10:00
Jesse Duffield 5d8a85f7e7 Use wait groups to speed up commit loading
The speedup is most noticeable on first load, when we haven't yet fetched out main branches.
I saw a speedup from 105ms to 60ms. On subsequent loads the gain is more modest;
54ms to 40ms
2023-07-29 10:04:11 +10:00
Jesse Duffield 5f30ccfbc3 Log duration of post-refresh-update call
Notably, the reflog view is taking ages here because it's got a
few thousand lines to write to the view.

In future we should only populate the view's viewport.
2023-07-29 09:39:22 +10:00
Jesse Duffield 71cab4fadc Log duration of commands
This will help us diagnose performance issues
2023-07-29 09:39:22 +10:00
Jesse Duffield 09ce430240 Log duration of refresh 2023-07-29 09:39:10 +10:00
Stefan Haller 6be9109aaa
Show error when trying to open patch menu with an empty patch (#2829) 2023-07-26 14:34:58 +02:00
Stefan Haller 67a7293e79 Show error when trying to open patch menu with an empty patch 2023-07-26 14:27:18 +02:00
Jesse Duffield decb055df9
Fix issue where using null to un-map a keybinding was ignored (#2832) 2023-07-26 20:26:51 +10:00
hatredholder 75674d819c bring back yaml library fork 2023-07-26 12:50:39 +03:00
README-bot 35c430c8c9 Updated README.md 2023-07-24 11:15:05 +00:00
Jesse Duffield 94426de533
Fix infinite wait on push/pull on windows (#2821) 2023-07-24 21:14:51 +10:00
Jesse Duffield c4e27bf96c Revert "Fix flakey pull_merge_conflict test"
This reverts commit 90613056ce, or the part that removed
a goroutine at least.

Reverting because this has caused an infinite wait for push/pull on windows.
We'll need to find out why that happens separately
2023-07-24 21:12:03 +10:00
Jesse Duffield 57bb1aa698
Support typing special characters like '[' on non-english keyboards (#2818) 2023-07-24 10:47:15 +10:00
Jesse Duffield 02270e9ccd
README.md: Add Gentoo installation documentation (#2811) 2023-07-24 09:48:51 +10:00
Fabio Coatti 1199c18b53 README.md: Add Gentoo installation documentation 2023-07-23 16:43:26 +02:00
Arnaud MASSERANN 4f807eeb19 Could not type special characters on non-english keyboards
On german/french/spanish keyboards, typing [ requires modifier
keys like AltGr, so the `mod==0` condition is wrong.

Fixes #2573

ch != 0 is useless because IsPrint is implemented this way:
	if uint32(r) <= MaxLatin1 {
		return properties[uint8(r)]&128 != 0
	}
with properties[0] set to 1 (so, bit 7 not set)
-> 0 is not printable.
2023-07-23 14:33:50 +02:00
Stefan Haller 7c44b76477
Prompt for commit message when moving a custom patch to a new commit (#2800) 2023-07-23 14:00:41 +02:00