Bug 489253 - Undo from Git history
Summary: Undo from Git history
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Waqar Ahmed
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-26 18:39 UTC by Rene Horn
Modified: 2024-07-31 10:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rene Horn 2024-06-26 18:39:41 UTC
I think it would be useful if the Undo function could be used to undo the changes from the last Git commit to the file that's currently open on the current branch, or provide an interface to clearly see what changes were made in the last commit.
Comment 1 Lassi Väätämöinen 2024-06-26 19:08:02 UTC
>Undo function could be used to undo the changes from the last Git commit to the file that's currently open on the current branch

You can open the file using "Open at HEAD" to see what the unchanged file looks like. Then you could save it as the file you have been modifying. 

https://kate-editor.org/post/2023/2023-02-01-using-kate-git-support/
Comment 2 Bug Janitor Service 2024-07-26 18:31:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1547
Comment 3 Waqar Ahmed 2024-07-26 18:32:44 UTC
One way to see the last commit would be to use the "Open Commit..." action (search for it in the command bar or access via the hamburger menu in git toolview). 

However currently there is no way to see the last commit quickly. I will make some changes to the dialog to allow this.
Comment 4 Waqar Ahmed 2024-07-26 19:39:39 UTC
Git commit 2feefe9b87e88aa528c6cc8ad10988a4469edef2 by Waqar Ahmed.
Committed on 26/07/2024 at 19:39.
Pushed by waqar into branch 'master'.

Improve open commit dialog

The old one sucked and was too small. This one is a bit bigger and
allows you to show the last commit using a button

M  +34   -5    addons/project/gitwidget.cpp

https://invent.kde.org/utilities/kate/-/commit/2feefe9b87e88aa528c6cc8ad10988a4469edef2
Comment 5 Waqar Ahmed 2024-07-26 19:39:47 UTC
Git commit cd40b5f43ec4a2621c2f52e4fe469af5cdb3373b by Waqar Ahmed.
Committed on 26/07/2024 at 19:39.
Pushed by waqar into branch 'master'.

Allow "HEAD" when opening commit

M  +1    -1    apps/lib/commitfilesview.cpp

https://invent.kde.org/utilities/kate/-/commit/cd40b5f43ec4a2621c2f52e4fe469af5cdb3373b
Comment 6 Waqar Ahmed 2024-07-31 10:22:09 UTC
Git commit d5885e36a64948747eb4034b113affb4f8b28275 by Waqar Ahmed.
Committed on 31/07/2024 at 10:21.
Pushed by waqar into branch 'release/24.08'.

Allow "HEAD" when opening commit
(cherry picked from commit cd40b5f43ec4a2621c2f52e4fe469af5cdb3373b)

M  +1    -1    apps/lib/commitfilesview.cpp

https://invent.kde.org/utilities/kate/-/commit/d5885e36a64948747eb4034b113affb4f8b28275