Commit graph

42 commits

Author SHA1 Message Date
leo
f72f1894c3
feature: supports to enable --ignore-cr-at-eol in diff by default
Signed-off-by: leo <longshuang@msn.cn>
2025-04-23 15:34:21 +08:00
leo
9a6c671a96
refactor: --ignore-cr-at-eol is not necessary when --ignore-all-space is enabled
Signed-off-by: leo <longshuang@msn.cn>
2025-04-22 16:50:46 +08:00
qiufengshe
9f18cbca5b
minimize temporary strings for better performance (#1224)
* minimize temporary strings for better performance

* minimize temporary strings for better performance

(cherry picked from commit c9e6a8d4c2d7b5fe03ee13af0a79c5334c23b1c0)
2025-04-22 10:23:20 +08:00
leo
db46de0261
enhance: append character U+26D4 to line when \ No newline at end of file is found in git diff output (#1197)
Signed-off-by: leo <longshuang@msn.cn>
2025-04-16 11:41:40 +08:00
leo
03216fc31e
code_style: run dotnet format and re-order codes
Signed-off-by: leo <longshuang@msn.cn>
2025-04-15 16:30:50 +08:00
leo
be3f418680
fix: no diff content shows with new files (#1193)
Signed-off-by: leo <longshuang@msn.cn>
2025-04-15 11:03:34 +08:00
leo
e89dbd8f43
code_review: PR #1177
- use `Command.ReadToEnd` instead of `Command.Exec` to avoid git trims line endings.
- use `StringBuilder.Append('\n')` instead of `StringBuilder.AppendLine()` to restore original line endings (we split the original diff output by `\n` not `\r')
- there's no need to show file content (the `StreamReader.ReadLine()` will trim line endings)

Signed-off-by: leo <longshuang@msn.cn>
2025-04-14 16:06:52 +08:00
Massimo
81820e7034
refactor: improve diff handling for EOL changes and enhance text diff… (#1177)
* refactor: improve diff handling for EOL changes and enhance text diff display

- Updated `Diff.cs` to streamline whitespace handling in diff arguments.
- Enhanced `DiffContext.cs` to check for EOL changes when old and new hashes differ, creating a text diff if necessary.
- Added support for showing end-of-line symbols in `TextDiffView.axaml.cs` options.

* localization: update translations to include EOF handling in ignore whitespace messages

- Modified the ignore whitespace text in multiple language files to specify that EOF changes are also ignored.
- Ensured consistency across all localization files for the patch application feature.

* revert: Typo in DiffResult comment

* revert: update diff arguments to ignore CR at EOL in whitespace handling (like before changes)

* revert: update translations to remove EOF references in Text.Apply.IgnoreWS and fixed typo in Text.Diff.IgnoreWhitespace (EOF => EOL)

---------

Co-authored-by: mpagani <massimo.pagani@unitec-group.com>
2025-04-14 15:18:45 +08:00
GadflyFang
7f8372f6b5
enhance: Handle file mode changes for new/deleted file (#1040) 2025-03-03 10:38:58 +08:00
leo
15d3ad355d
code_review: PR #703
* change the name of this feature to `Enable Block-Navigation`
* change the icon of the toggle button used to enable this feature
* use a new class `BlockNavigation` to hold all the data about this feature
* create `BlockNavigation` data only when it is enabled

Signed-off-by: leo <longshuang@msn.cn>
2024-12-08 21:02:30 +08:00
Göran W
655d71b0bc
Add navigation and highlighting of change-blocks in Text Diff (#616, #717) (#703)
* Corrected misspelled local variable nextHigh(t)light

* Implemented change-block navigation

* Modified behavior of the Prev/Next Change buttons in DiffView toolbar.
* Well-defined change-blocks are pre-calculated and can be navigated between.
* Current change-block is highlighted in the Diff panel(s).
* Prev/next at start/end of range (re-)scrolls to first/last change-block
(I.e when unset, or already at first/last change-block, or at the only one.)
* Current change-block is unset in RefreshContent().

* Added safeguards for edge cases

* Added indicator of current/total change-blocks in DiffView toolbar

* Added new Icon and String (en-US) for Highlighted Diff Navigation

* Added Preference and ToggleButton for diff navigation style
2024-12-08 17:50:33 +08:00
leo
58eeeab67b
enhance: set core.autocrlf to false when run git diff to get detail changes of selected file (#761) 2024-11-28 19:36:23 +08:00
leo
cd137e222c
feature: enable --no-ext-diff for git diff command
Signed-off-by: leo <longshuang@msn.cn>
2024-11-16 09:26:13 +08:00
leo
050b1d1188
enhance: supports issue link in keywords (#678)
Signed-off-by: leo <longshuang@msn.cn>
2024-11-11 12:16:29 +08:00
leo
dcf5093406
enhance: avoid that diff view refresh more than one times
Signed-off-by: leo <longshuang@msn.cn>
2024-11-04 18:21:07 +08:00
leo
3da52208ba
enhance: force enable --patch option 2024-10-17 19:20:14 +08:00
leo
d2a005c532
feature: add a button in diff view to ignore all whitespace changes (--ignore-all-space) 2024-09-30 11:34:09 +08:00
leo
ec6fe25e87
code_style: run dotnet format 2024-07-31 16:26:58 +08:00
leo
40d5a7c7f3
code_style: run dotnet format to apply rules 2024-07-23 13:58:57 +08:00
leo
b7e0e38de3
feature: stage/unstage hunk (#265) 2024-07-17 16:56:16 +08:00
leo
1040bbe4d2 feature: add buttons to increase/decrease visible lines in text diff view (#145) 2024-05-27 10:29:15 +08:00
leo
ab26bb83e9 refactor: re-design toolbar of Views.DiffView 2024-04-14 12:27:09 +08:00
leo
7b5534a267 code_style: run dotnet format to apply rules defined in .editorconfig 2024-04-13 19:24:45 +08:00
Gadfly
a249eed1ac
feat: show git file mode change if exist 2024-04-12 21:38:36 +08:00
leo
96d4150d26 project: reorganize the structure of the project.
* remove dotnet-tool.json because the project does not rely on any dotnet tools.
* remove Directory.Build.props because the solution has only one project.
* move src/SourceGit to src. It's not needed to put all sources into a subfolder of src since there's only one project.
2024-04-02 20:00:33 +08:00
Enner Pérez
a1a14f8858 Project Location 2024-03-20 02:38:28 -05:00
leo
18aaa0a143 style: add .editorconfig for code formatting. see issu #25 2024-03-18 09:37:06 +08:00
Enner Pérez
c0a079de41 Source Generated Regex 2024-03-16 04:09:27 -05:00
leo
cd2ecb109a enhance: diff with LFS filtered files 2024-03-14 10:55:25 +08:00
leo
59b7fd8c61 optimize: better supports for LFS object 2024-03-07 17:04:57 +08:00
leo
671e46f8b3 feature<TextDiffView>: supports line staging/unstaging in working copy diff view 2024-02-28 14:55:11 +08:00
leo
2a62596999 refactor<*>: rewrite all with AvaloniaUI 2024-02-06 15:08:37 +08:00
Jai
663f3237c0 Merge pull request !19 from Jai/fix/copy-content-order
* optimix<Diff>: performance optimization
* fix<DiffViewer>: incorrect order when copying file contents
2021-08-11 11:16:00 +00:00
leo
2cf7192ec4 cleanup<*>: run vs code cleanup to format codestyle and remove unused references 2021-08-05 15:54:00 +08:00
leo
d259d67fd5 optimize<Diff>: simplify DiffPlex algorithm 2021-07-29 20:42:44 +08:00
leo
44873cf088 fix<Diff>: fix compile error on .NET 4.8 2021-07-29 17:09:07 +08:00
leo
ef8488de51 optimize<Diff>: use custom chunker instead of CharacterDiff 2021-07-29 16:47:30 +08:00
leo
789e3cf6a2 optimize<Diff>: limit number of character diff; ignore empty changes 2021-07-28 15:26:41 +08:00
leo
18f35449e5 optimize<Diff>: show 4 context lines on diff 2021-07-28 15:04:00 +08:00
leo
92de6f2b79 feature<Diff>: highlights differences for modified lines (both added and removed) 2021-07-28 15:02:13 +08:00
leo
fe3a36348e fix<Diff>: fix crash when diff line is empty 2021-05-27 15:35:45 +08:00
leo
30ab8ae954 refactor<*>: rewrite all codes... 2021-04-29 20:05:55 +08:00