Comments (7)
This is the most serious issue of the entire Git GUI! And I'm sure that it also happens under different circumstances (maybe after a Rescan when some other operations have been done in parallel, but I can't deliberately reproduce it). We need some form of commit message history, even for the scenarios when you screw up the Undo & Redo at a wrong moment. And obviously, even if you ignore power outages & Windows stability, one of the reasons why this is a must have is the frequency of Git GUI (wish.exe) freezing up.
from git-gui.
Presumably we want to add confirmation/auto-save of message text before deleting/clearing message text.
I think it would make more sense to use two separate backup files for "amended" and "new" messages, and clear respective backup when commit is done. Works intuitively and no need to confirm anything.
from git-gui.
Most user-friendly solution would be to keep old commit message in temporary file or just stored in memory in variable, and put it back into editor if user switches back from amend mode.
Less user-friendly but still OK is to show a confirmation dialog if "Amend Last Commit" is clicked and there is a text to be destroyed
from git-gui.
Some additional information which might be useful to someone trying to implement this (based on some brief code spelunking):
- While running, it appears a backup of the current text of the commit message UI control is stored in
.git/GITGUI_BCK
. - The above backup file seems to be created via a procedure named
backup_commit_buffer
:Lines 4122 to 4151 in df4f9e2
- The name of the commit message UI control appears to be
ui_comm
also referred to as$ui_comm
. - It appears that the current commit message text is also stored in
.git/GITGUI_MSG
if it is non-empty when the program exits. - See also:
Lines 4100 to 4120 in df4f9e2
Lines 3924 to 3949 in df4f9e2
Lines 3475 to 3506 in df4f9e2
Lines 3448 to 3466 in df4f9e2
Lines 2719 to 2723 in df4f9e2
Lines 1474 to 1486 in df4f9e2
Lines 1574 to 1594 in df4f9e2
Lines 2305 to 2339 in df4f9e2
- (Clears message text.)
Lines 69 to 73 in df4f9e2
- (Clears message text.)
Lines 121 to 123 in df4f9e2
- Presumably we want to add confirmation/auto-save of message text before deleting/clearing message text.
- In the interim, it might be a sufficient workaround to disable the "amend" etc button when the commit message text area isn't empty?
Hope these are some useful pointers for someone. :)
from git-gui.
GITGUI_BCK was introduced in 4578c5c, commit message contains details how GITGUI_BCK and GITGUI_MSG files are used
from git-gui.
I think it would make more sense to use two separate backup files for "amended" and "new" messages, and clear respective backup when commit is done. Works intuitively and no need to confirm anything.
Actually, it's not that simple, as "amended" message becomes irrelevant after HEAD moves. I see two possible ways to handle this situation:
- Don't backup "amended" message at all, so editing in "amend" mode always starts from original message. It's simpler to implement and is easy to understand, though may cause a loss of work if non-trivial edits were done in "amend" mode.
- Do backup "amended" message, but save corresponding HEAD hash alongside, drop it if current HEAD is different.
from git-gui.
git citool --amend
doesn't restore message from GITGUI_MSG, so I guess doing #1 would not be a step back in functionality.
from git-gui.
Related Issues (20)
- "Stage Hunk/Line For Commit" grayed out when having a custom diff
- Does not respect core.hooksPath HOT 3
- Does not respect push.default HOT 5
- "Official" Dark Mode for Git GUI HOT 22
- git-gui doesn't cleanup commit message (strip comments and blank lines) like git-commit HOT 2
- Wrong character encoding in push window
- Prevent TrojanSourceInjection in gitk HOT 3
- hooks are ignored in git worktrees other than the main worktree HOT 1
- Not working - black window HOT 1
- Can the "push" button optionally be removed/disabled/hidden ? HOT 9
- 'git gui' doesn't work in pair with 'git submodule foreach'
- How to make it into a proper mac app? HOT 2
- git-gui crash under macos 13 beta HOT 2
- Compress dialog popping up every time the repo is opened HOT 4
- On the Windows context menu the Target is empty
- Xlib error on console
- Please make diff colors configurable
- there used to be a way to find out keyboard shortcuts. HOT 1
- prepare-commit-msg hook fails because the commit message file does not exist
- Explore Working Copy can't find explorer.exe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-gui.