1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 17:02:18 +03:00

37 Commits

Author SHA1 Message Date
Stefan Haller
b0ab6529c1 Escape special characters when git-ignoring files 2025-04-13 18:25:24 +10:00
Stefan Haller
ebb576feac Provide conflict resolution dialogs for non-textual conflicts 2025-04-09 10:27:57 +02:00
Stefan Haller
2dfc3491bd Rename Name to Path in File and CommitFile
Name was very confusing and misleading.
2025-03-20 12:31:34 +01:00
Stefan Haller
cf27399571 Revert "Skip post-checkout hook when discarding changes"
This reverts commit 964278255b8a0a460b74e459938057002d12390e.
2025-03-20 11:41:15 +01:00
Partho Kunda
7a1b63182d Commit only tracked files in tracked only filter view 2025-03-17 19:51:27 +01:00
Stefan Haller
964278255b Skip post-checkout hook when discarding changes
Some people have post-checkout hooks that take a lot of time, which makes
discarding changes slow. You can argue that a post-checkout hook should only run
when you switch branches, so it doesnt't have to run when checking out single
files or directories. You can also argue that lazygit might have implemented
discarding changes by taking the current patch and applying it in reverse, which
wouldn't have run a post-checkout hook either.

So disable them for all cases where we use git checkout with a path; this
includes checking out a file from the commit files view.
2025-02-25 11:39:27 +01:00
Stefan Haller
f98b57aa5e Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent
access.
2024-08-18 10:24:52 +02:00
Stefan Haller
75a95865ff Use filepath instead of path for file path operations
In practice, using path seems to work too, since Windows seems to be capable of
dealing with a path like C:/x/y instead of C:\x\y; but it's cleaner to do this
properly.
2024-08-18 10:24:52 +02:00
István Donkó
b9107d5fc8 Support setting the similarity threshold for detecting renames 2024-07-13 14:24:26 +10:00
knowmost
0677a58e9f chore: fix some comments and typos
Signed-off-by: knowmost <knowmost@outlook.com>
2024-04-28 09:44:59 +02:00
pikomonde
84333eebc3 renaming variable to CommitHash 2024-04-12 08:33:47 +02:00
Stefan Haller
93251db67e Fix the "Add to .git/info/exclude" command in submodules or worktrees 2024-03-28 13:11:08 +01:00
Stefan Haller
3b723282cb Show all submodules recursively 2024-03-07 20:16:28 +01:00
Stefan Haller
d329c92554 Set diff.noprefix=false for all other diff commands too
This fixes problems with being able to stage things in a custom patch correctly.
2024-02-18 15:22:43 +01:00
Jesse Duffield
269ef7f250 Support range select for staging/discarding files
As part of this, you must now press enter on a merge conflict file
to focus the merge view; you can no longer press space and if you do
it will raise an error.
2024-01-25 11:34:59 +11:00
John Whitley
3d9f1e02e5 Refactor repo_paths.go to use git rev-parse
This changes GetRepoPaths() to pull information from `git rev-parse`
instead of effectively reimplementing git's logic for pathfinding. This
change fixes issues with bare repos, esp. versioned homedir use cases,
by aligning lazygit's path handling to what git itself does.

This change also enables lazygit to run from arbitrary subdirectories of
a repository, including correct handling of symlinks, including "deep"
symlinks into a repo, worktree, a repo's submodules, etc.

Integration tests are now resilient against unintended side effects from
the host's environment variables. Of necessity, $PATH and $TERM are the
only env vars allowed through now.
2024-01-24 08:40:01 +01:00
Stefan Haller
c1cb95db6f Remove unused function 2024-01-09 14:24:14 +01:00
Stefan Haller
7774fe0ab3 Move diff context size from UserConfig to AppState 2023-09-05 13:55:30 +02:00
Stefan Haller
1dac4158e9 Don't pass ignoreWhitespace to git commands
Now that AppState is available via common.Common, they can take it from there.
2023-09-04 17:50:49 +02:00
Stefan Haller
6266e19623 Add support for external diff commands (e.g. difftastic) 2023-09-04 16:52:30 +02:00
Jesse Duffield
fb0931e1a1 Fix discard logic
Missed a spot a couple PR's ago. We had an integration test which caught this but which was skipped due
to index.lock file issues. The test was also broken for other reasons due to it not having been running
for a while, so I've fixed that up too.
2023-05-23 20:23:08 +10:00
Jesse Duffield
63dc07fded Construct arg vector manually rather than parse string
By constructing an arg vector manually, we no longer need to quote arguments

Mandate that args must be passed when building a command

Now you need to provide an args array when building a command.
There are a handful of places where we need to deal with a string,
such as with user-defined custom commands, and for those we now require
that at the callsite they use str.ToArgv to do that. I don't want
to provide a method out of the box for it because I want to discourage its
use.

For some reason we were invoking a command through a shell when amending a
commit, and I don't believe we needed to do that as there was nothing user-
supplied about the command. So I've switched to using a regular command out-
side the shell there
2023-05-23 19:49:19 +10:00
Jesse Duffield
ee11046d35 Refactor interface for ApplyPatch 2023-05-20 20:54:39 +10:00
Jesse Duffield
25f8b0337e Add convenience builder for git commands 2023-05-20 20:54:24 +10:00
stk
5bb6198219 Allow ignoring whitespace in diff in commits panel 2023-02-07 12:14:29 +01:00
sudoburt
3e73dacce3 Merge loaders package into git_commands package 2022-11-14 18:11:45 +11:00
Jesse Duffield
e8b97c9fe2 fix could-not-access error 2022-11-11 12:30:14 +11:00
Juan Sanchez Montalvo
11d766053e Allow adding a file to the .git/info/exclude file 2022-07-05 19:33:44 +10:00
Ryooooooga
d458e78d95
feat: add ability to edit hunk 2022-05-06 21:53:00 +09:00
Ryooooooga
53257db99d fix: fix diff of renamed files 2022-04-06 08:26:13 +10:00
Ryooooooga
86c259623c feat: fix permission problem of temp dirs 2022-04-02 08:48:38 +11:00
Jesse Duffield
bf4f06ab4e more generics 2022-03-24 20:14:41 +11:00
Jesse Duffield
c8cc18920f improve merge conflict flow 2022-01-26 14:50:47 +11:00
Jesse Duffield
5b7dd9e43c properly resolve cyclic dependency 2022-01-22 10:48:51 +11:00
Jesse Duffield
3e80a9e886 refactor to group up more commonly used git command stuff 2022-01-18 22:01:09 +11:00
Jesse Duffield
ccf90466fa fix test 2022-01-09 14:09:53 +11:00
Jesse Duffield
c9a0cc6b30 refactor 2022-01-09 14:09:53 +11:00