3 ms·
Nice idea! The only non intuitive thing might be, that calling e.g. 'git undo' twice doesn't undo the last two changes, but the first undos the last change and
by dan00 10y ago
Nice idea!
The only non intuitive thing might be, that calling e.g. 'git undo' twice doesn't undo the last two changes, but the
first undos the last change and the second one undos the undo.
- m_mueller 10y agoCould it be improved to have undo filter out its own reflog entries and instead have a 'redo' to undo those?
- dan00 10y agoI don't think that 'git undo' can tell with certainty which entries in the reflog are from it. It would be a crude heuristic that's going to break.
- m_mueller 10y agoIs there maybe a way to annotate the commit message of HEAD without influencing the reflog?
- dan00 10y agoYou can't change the commit message of a commit without changing the commit, which in most cases is a bad idea, if you don't know pretty much exactly what your doing. Replacing one heuristic with another won't make this a stable operation. A lot of people had already the idea to encode relevant information inside of documentation and it was always a bad idea in the long run.
- m_mueller 10y agoI get that, I just wondered whether it's technically possible (with supported git operations, not hacking down at FS / byte level).
- Dylan16807 10y agoIf you want to undo without reflog entries, just snip the most recent line off the reflog. If you want to put annotations on commits, use tags with message bodies. So yes, there are ways to accomplish what you want.
- kasabali 10y agowell, there is git-notes(1), but I'm not sure how it can be used as a journal for reflog operations.